diff --git a/_inc/blocks/editor-beta.asset.php b/_inc/blocks/editor-beta.asset.php index 38f3e3eb39..f979f9e47a 100644 --- a/_inc/blocks/editor-beta.asset.php +++ b/_inc/blocks/editor-beta.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'ec63998e4948ba4d20e2'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'a4c5bca92f5f6e80ff0d'); diff --git a/_inc/blocks/editor-beta.js b/_inc/blocks/editor-beta.js index 3f1e45833b..a67f0b62e9 100644 --- a/_inc/blocks/editor-beta.js +++ b/_inc/blocks/editor-beta.js @@ -4,9 +4,9 @@ _n("This post will be shared to %d connection.","This post will be shared to %d _n("%d character remaining","%d characters remaining",o,"jetpack"),o)})}},62578:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(55609),a=n(65736),s=n(61074),o=n(6163),i=n(65235),l=n.n(i),c=n(25162),u=n.n(c),d=n(82283);const __=a.__,p=({children:e,type:t="default",actions:n=[],onDismiss:a})=>{const i=l()(d.Z.notice,d.Z[`notice--${t}`]);return React.createElement("div",{className:i},React.createElement("div",{className:d.Z.content}," ",e," "),a&&React.createElement("button",{className:d.Z.dismiss,onClick:a},React.createElement(r.VisuallyHidden,null,__("Dismiss notice","jetpack")),React.createElement(s.Z,{icon:o.Z})),n&&n.length>0&&React.createElement("div",{className:d.Z.actions},n.map((e=>e))))};p.propTypes={children:u().node.isRequired,type:u().oneOf(["default","highlight","warning","error"]),actions:u().arrayOf(u().element),onDismiss:u().func};const m=p},8714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(55609),a=n(9818),s=n(12238),o=n(69307),i=n(65736),l=n(14085),c=n(86419),u=n(37568),d=n(49021),p=n(95788),m=n(3176),h=n(91474),g=n(23761);const __=i.__,f=({prePublish:e,children:t})=>{const{refresh:n,hasConnections:i,hasEnabledConnections:f}=(0,u.Z)(),b=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),{isPublicizeEnabled:v,hidePublicizeFeature:k,togglePublicizeFeature:y}=(0,l.Z)();(0,c.M1)((function(){f&&n()}),[f,n]);const w=e?o.Fragment:r.PanelBody,E=e?{}:{title:__("Share this post","jetpack"),className:g.Z.panel};return React.createElement(w,E,t,!k&&React.createElement(o.Fragment,null,!b&&React.createElement(r.ToggleControl,{label:v?__("Share when publishing","jetpack"):__("Sharing is disabled","jetpack",0),onChange:y,checked:v,disabled:!i}),React.createElement(d.Z,null),React.createElement(p.Z,null),React.createElement(h.o,null)),b&&React.createElement(m.u,null))}},91750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(88275),a=n(13419),s=n(9818),o=n(72067),i=n(12238),l=n(65736),c=n(37548),u=n(34607),d=n(45078);const __=l.__;function p(){const{isCurrentPostPublished:e}=(0,s.useSelect)((e=>e(i.store)),[]);return e()?React.createElement(o.PluginPostPublishPanel,{initialOpen:!0,title:__("Manual sharing","jetpack"),id:"publicize-manual-sharing",icon:React.createElement(a.Pm,null)},React.createElement(r.ZP,null,React.createElement(c.T,{className:d.Z.description,variant:"body-small"}),React.createElement(u.n,null))):null}},52403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(6895),a=n(13419),s=n(86989),o=n.n(s),i=n(72067),l=n(69307),c=n(14085),u=n(86419),d=n(37568),p=n(19649);const m=()=>{const[e,t]=(0,l.useState)((0,a.Pb)()?.social?.reviewRequestDismissed??!0),[n,s]=(0,l.useState)(!1),{hasEnabledConnections:m}=(0,d.Z)(),{isPublicizeEnabled:h,isPostAlreadyShared:g}=(0,c.Z)();(0,u.e3)((()=>{s(!g&&h&&m)}),[g,m,h]);const f=(0,l.useCallback)((()=>{const e=(0,a.Pb)()?.social?.dismissReviewRequestPath??null;o()({path:e,method:"POST",data:{dismissed:!0}}).catch((e=>{throw e})),t(!0)}),[]);return e||!n?null:React.createElement(i.PluginPostPublishPanel,{id:"publicize-title"},React.createElement(p.Z,{href:(0,r.Z)("jetpack-social-plugin-reviews"),onClose:f}))}},77106:(e,t,n)=>{"use strict";n(9818),n(23177)},19649:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(88275),a=n(90526),s=n(13419),o=n(65736),i=n(99196),l=n(2097);const __=o.__,c=({href:e,onClose:t})=>{const{recordEvent:n}=(0,s.z$)({pageViewEventName:"social_plugin_review_prompt",pageViewNamespace:"jetpack",pageViewSuffix:"view"}),c=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_new_review_click")}),[n]),u=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_dismiss_click"),t()}),[n,t]);return React.createElement(r.ZP,null,React.createElement("div",{className:l.Z.prompt},React.createElement("h2",{className:l.Z.header},/* translators: %s is the celebration emoji */ /* translators: %s is the celebration emoji */ (0,o.sprintf)(__("Presto! %s","jetpack"),String.fromCodePoint(127881))),React.createElement("p",null,__("Just like that, Jetpack Social has shared your post to your connected social accounts.","jetpack")),React.createElement("p",null,__("Please leave a review to let others know how easy getting your posts on social media can be!","jetpack")),React.createElement("div",{className:l.Z.buttons},React.createElement(a.Z,{onClick:c,isExternalLink:!0,href:e,className:l.Z.button},__("Leave a Review","jetpack")),React.createElement(a.Z,{onClick:u,variant:"link",className:l.Z.button},__("Dismiss","jetpack")))))}},69709:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(65736),a=n(14085),s=n(78619);const __=r.__;function o(){const{connectionsAdminUrl:e}=(0,a.Z)();return React.createElement("a",{className:s.Z["settings-link"],href:e,target:"_blank",rel:"noreferrer",title:__("Connect an account","jetpack")},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",fill:"#F6F7F7"}),React.createElement("path",{d:"M19 13.3333H14.6667V9H13.3333V13.3333H9V14.6667H13.3333V19H14.6667V14.6667H19V13.3333Z",fill:"black"}),React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",stroke:"#A7AAAD",strokeWidth:"0.75",strokeDasharray:"2 2"})))}},2817:(e,t,n)=>{"use strict";n.d(t,{o:()=>a});var r=n(65736);const __=r.__,a=[{label:__("X","jetpack"),networkName:"x",url:"https://x.com/intent/tweet?text={{text}}&url={{url}}"},{label:__("WhatsApp","jetpack"),networkName:"whatsapp",url:"https://api.whatsapp.com/send?text={{text}}"},{label:__("Facebook","jetpack"),networkName:"facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"}]},22917:(e,t,n)=>{"use strict";n(34607)},34607:(e,t,n)=>{"use strict";n.d(t,{n:()=>g});var r=n(3396),a=n(90526),s=n(45106),o=n(14203),i=n(13419),l=n(69307),c=n(65736),u=n(65235),d=n.n(u),p=n(2817),m=n(30664),h=n(38730);const __=c.__;function g({buttonStyle:e="icon",buttonVariant:t}){const n=(0,h.S)(),{recordEvent:u}=(0,i.z$)(),g=(0,l.useCallback)((()=>{u("jetpack_social_share_button_clicked",{network:"clipboard"})}),[u]),f=(0,l.useCallback)((()=>n("{{text}}\n{{url}}",!1)),[n]),b=(0,l.useCallback)((function(e,t){return function(n){n.preventDefault(),u("jetpack_social_share_button_clicked",t),window.open(e,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}}),[u]);return React.createElement("div",{className:d()(m.Z["share-buttons"],{[m.Z.vertical]:e.includes("text")})},p.o.map((({label:o,networkName:i,url:l})=>{const u=n(l),d="icon"===e?React.createElement(r.av,{serviceName:i}):null,p=(0,c.sprintf)(/* translators: %s is the name of a social network, e.g. Twitter. */ __("Share on %s","jetpack"),o);return React.createElement("div",{className:m.Z.container,key:i},React.createElement(a.Z,{icon:d,variant:t,"aria-label":p,href:u,target:"_blank",rel:"noopener noreferrer",onClick:b(u,{network:i}),className:"icon"===e?m.Z[i]:"has-text"},"icon"===e?null:React.createElement(React.Fragment,null,"icon-text"===e&&React.createElement(r.av,{className:m.Z[i],serviceName:i}),React.createElement(s.ZP,{className:m.Z.label,component:"span"},p))))})),React.createElement("div",{className:m.Z.container},React.createElement(o.Z,{buttonStyle:e,onCopy:g,textToCopy:f,className:"icon"===e?m.Z.clipboard:" has-text",variant:t},"icon"===e?null:React.createElement(s.ZP,{className:m.Z.label,component:"span"},__("Copy to clipboard","jetpack")))))}},38730:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(9818),a=n(69307),s=n(71806);function o(){const{shareMessage:e}=(0,s.R)(),{message:t,link:n}=(0,r.useSelect)((t=>{const n=t("core/editor").getEditedPostAttribute;return{link:n("link"),message:e||n("meta")?.jetpack_seo_html_title||n("title")}}),[e]);return(0,a.useCallback)(((e,r=!0)=>{let a=t,s=n;return e.includes("{{url}}")||(a=a+"\n\n"+s,s=""),r&&(a=encodeURIComponent(a),s=encodeURIComponent(s)),e.replace("{{text}}",a).replace("{{url}}",s)}),[n,t])}},32637:(e,t,n)=>{"use strict";n.d(t,{r:()=>d});var r=n(43521),a=n(69307),s=n(65736),o=n(65235),i=n.n(o),l=n(73640);const __=s.__,_x=s._x,c={error:"var(--jp-red-50)",warning:"var(--jp-yellow-20)",default:"var(--jp-green)"},u={error:"var(--jp-red-50)",warning:"var(--jp-yellow-20)",default:"var(--jp-green-5)"},d=({usedCount:e,scheduledCount:t,remainingCount:n,className:s,noticeType:o="default",legendCaption:d})=>{const p=(0,a.useMemo)((()=>{const r=__("scheduled","jetpack"),a=__("used or scheduled","jetpack");return[("default"===o||0===t)&&{count:e,backgroundColor:c[o],label:__("used","jetpack")},t>0&&{count:"default"===o?t:t+e,backgroundColor:u[o],label:"default"===o?r:a},{count:n,backgroundColor:"var(--jp-gray-off)",label:_x("left","Referring to the quantity remaning, not the direction - left/right.","jetpack")}].filter(Boolean)}),[e,o,t,n]);return React.createElement("div",{className:i()(l.Z.wrapper,s)},React.createElement(r.Z,{totalCount:e+t+n,items:p,className:l.Z["bar-wrapper"],tableCaption:d,legendTitle:d,recordTypeLabel:__("Share type","jetpack"),recordCountLabel:__("Usage","jetpack")}))}},91474:(e,t,n)=>{"use strict";n.d(t,{o:()=>h});var r=n(55609),a=n(9818),s=n(12238),o=n(69307),i=n(65736),l=n(53961),c=n(14085),u=n(45579),d=n(37568);const __=i.__;function p(e=__("Unable to share the Post","jetpack")){const{createErrorNotice:t}=(0,a.dispatch)(l.store);t(e,{id:"publicize-post-share-message"})}function m(){const{hasEnabledConnections:e}=(0,d.Z)(),{isPublicizeEnabled:t}=(0,c.Z)(),{isFetching:n,isError:i,isSuccess:m,doPublicize:h}=(0,u.Z)(),g=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]);(0,o.useEffect)((()=>{if(!n)return i?p():void(m&&function(){const{createSuccessNotice:e}=(0,a.dispatch)(l.store);e(__("Post shared","jetpack"),{id:"publicize-post-share-message",type:"snackbar"})}())}),[n,i,m]);const f=!t||!e||!g||n,b=(0,o.useCallback)((()=>{if(!g)return p(__("You must publish your post before you can share it.","jetpack"));(0,a.dispatch)(l.store).removeNotice("publicize-post-share-message"),h()}),[h,g]);return React.createElement(r.Button,{variant:"secondary",onClick:b,disabled:f,isBusy:n},__("Share post","jetpack"))}function h(){const{isRePublicizeUpgradableViaUpsell:e}=(0,c.Z)();return(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[])?e?null:React.createElement(r.PanelRow,null,React.createElement(m,null)):null}},54005:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(55609),a=n(69307),s=n(65736),o=n(75263),i=n(9888),l=n(81469);const __=s.__,c=({prePublish:e=!1})=>{const t=e?a.Fragment:r.PanelBody,n=e?{}:{title:__("Social Image Generator","jetpack")},{isEnabled:s,setIsEnabled:c}=(0,o.Z)(),[u,d]=(0,a.useState)(!1),p=(0,a.useCallback)((()=>d(!0)),[]),m=(0,a.useCallback)((()=>d(!1)),[]);return React.createElement(t,n,u&&React.createElement(l.Z,{onClose:m}),React.createElement(r.ToggleControl,{label:__("Enable Social Image","jetpack"),help:s?"":__("Social Image is disabled for this post.","jetpack"),checked:s,onChange:c}),s&&React.createElement(React.Fragment,null,React.createElement("hr",null),React.createElement(i.ZP,null),React.createElement("hr",null),React.createElement(r.Button,{variant:"secondary",onClick:p,label:__("Open the Social Image Generator settings","jetpack")},__("Settings","jetpack"))))}},81469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(75263),l=n(98811),c=n(9888),u=n(88649),d=n(39356),p=n(40088);const __=o.__,m=["image/jpeg","image/png"],h=__("Choose Image","jetpack"),g=({onClose:e})=>{const{customText:t,imageType:n,imageId:o,template:g,updateSettings:f}=(0,i.Z)(),[b,v]=(0,s.useState)(o),[k,y]=(0,s.useState)(n||"featured"),[w,E]=(0,s.useState)(t),[_,C]=(0,s.useState)(g),[x]=(0,l.Z)(b),j=(0,s.useCallback)((()=>{f({template:_,image_type:k,custom_text:w||"",..."custom"===k&&{image_id:b}}),e()}),[f,_,k,b,w,e]),S=(0,s.useCallback)((e=>{v(e?.id)}),[v]);return React.createElement(r.ZP,{targetDom:document.body},React.createElement(a.Modal,{onRequestClose:e},React.createElement(c.ZP,{className:p.Z.preview,imageId:b,customText:w,imageType:k,template:_}),React.createElement(a.SelectControl,{label:__("Image Type","jetpack"),value:k||"featured",options:[{label:__("Featured Image","jetpack"),value:"featured"},{label:__("Custom Image","jetpack"),value:"custom"},{label:__("No Image","jetpack"),value:"none"}],onChange:y}),"custom"===k&&React.createElement(u.Z,{buttonLabel:h,subTitle:__("Add a custom image","jetpack"),mediaId:b,mediaDetails:x,onChange:S,allowedMediaTypes:m,wrapperClassName:p.Z.mediaPicker}),React.createElement(a.TextControl,{className:p.Z.customText,value:w||"",onChange:E,label:__("Custom Header","jetpack"),help:__("By default the post title is used for the image. You can use this field to set your own text.","jetpack")}),React.createElement(a.BaseControl,{label:__("Templates","jetpack"),className:p.Z.templateControl},React.createElement(d.Z,{value:_,onTemplateSelected:C})),React.createElement(a.Button,{onClick:e,variant:"tertiary"},__("Cancel","jetpack")),React.createElement(a.Button,{onClick:j,variant:"primary"},__("Save","jetpack"))))}},79631:(e,t,n)=>{"use strict";n(9818),n(69307),n(65736),n(99196),n(23177),n(8350)},8350:(e,t,n)=>{"use strict";n(55609),n(69307),n(65736),n(39356),n(15214)},39356:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(69307),a=n(65736),s=n(65235),o=n.n(s),i=n(47320),l=n(57227);const __=a.__,c=({value:e=null,onTemplateSelected:t=null})=>{const n=(0,r.useCallback)((e=>{const n=e.target.id;t?.(n)}),[t]);return React.createElement("div",{className:i.Z.templates},l.Z.map((t=>React.createElement("button",{onClick:n,id:t.name,key:t.name,className:o()(i.Z.template,{[i.Z["template--active"]]:t.name===e})},React.createElement("img",{src:t.image,alt:t.label}),React.createElement("span",{className:"screen-reader-text"},/* translators: %s is the name of the template */ /* translators: %s is the name of the template */ -(0,a.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(30253),a=n(91948),s=n(5353);const o=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},76848:(e,t,n)=>{"use strict";n(9818),n(69307),n(99196),n(23177)},53513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(88219),l=n(89696);const __=o.__,c=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d({disabled:e=!1}){const{shouldUploadAttachedMedia:t,updateShouldUploadAttachedMedia:n}=(0,i.Z)(),o=(0,s.useCallback)((e=>{n(e)}),[n]),d=e?a.Disabled:s.Fragment,p=e?{className:l.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(d,p,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:t,onChange:o,label:__("Share as a social post","jetpack"),help:e?c:u})))}},63855:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(13477),o=n(9818),i=n(48751),l=n(23177);const c=(0,o.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,i.Z)(),{title:n,excerpt:r,content:c}=e,u=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n}=e(l.Eg).getConnectionProfileDetails(l.uJ);return{displayName:t,avatarUrl:n}}));return React.createElement(s.S,a()({},e,{type:"article",user:u,customText:t||r||c||n}))}))},83704:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(82674),a=n.n(r),s=n(17915),o=n(9818),i=n(22629),l=n(99196),c=n.n(l);const u=function(e){const t=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,i.decodeEntities)(t("root","site").title)}));return c().createElement(s.X,a()({},e,{siteTitle:t}))}},4124:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(4049),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,image:n,media:s}=e,{username:c,profileImage:u}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.M$))),{message:d}=(0,i.Z)(),p=d||t;return o().createElement(r.V,{image:n,media:s,name:c,profileImage:u,caption:p})}},27725:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(93453),a=n(9818),s=n(65736),o=n(99196),i=n.n(o),l=n(48751),c=n(23177);const __=s.__;function u(e){const{title:t,url:n,image:s,media:o}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(c.Eg).getConnectionProfileDetails(c.qk))),{message:p}=(0,l.Z)(),m=`${p||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:s,name:u,profileImage:d,title:t,description:m,url:n,media:o})}},28586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(82674),a=n.n(r),s=n(60312),o=n(9818),i=n(22629),l=n(71806),c=n(48751),u=n(23177);const d=e=>{const{message:t}=(0,c.Z)(),{content:n,siteName:r}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,i.decodeEntities)(n().title)}})),{shouldUploadAttachedMedia:d}=(0,l.R)(),p=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n,username:r}=e(u.Eg).getConnectionProfileDetails(u.cs);return{displayName:t,avatarUrl:n,address:r}})),m=e.media?.[0],h=m?.type.startsWith("image/")?m.url:null;return React.createElement(s.I,a()({},e,{siteName:r,user:p,description:n,customText:t,customImage:h,isSocialPost:d}))}},8454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(55609),a=n(65736),s=n(39517),o=n(41809),i=n(9279);const __=a.__,l=function({onClose:e,initialTabName:t}){const n=(0,o.P)(),{image:a,media:l,title:c,description:u,url:d}=(0,i.u)();return React.createElement(r.Modal,{onRequestClose:e,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:e,icon:s.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:n,initialTabName:t},(e=>React.createElement("div",null,React.createElement(e.preview,{title:c,description:u,url:d,image:a,media:l})))))}},18553:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(93122),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,url:n,image:s,media:c}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.Cd))),{message:p}=(0,i.Z)(),m=`${p||t} ${c.length?n:""}`.trim();return o().createElement(r.m,{image:s,name:u,profileImage:d,title:t,description:m,url:n,media:c})}},74140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(55609),a=n(65736),s=n(41809);const __=a.__,_x=a._x,o=({openModal:e})=>{const t=(0,s.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},t.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:e,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(1044),o=n(9818),i=n(48751),l=n(23177);const c=e=>{const{content:t,author:n}=(0,o.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{message:r}=(0,i.Z)(),c=(0,o.useSelect)((e=>{const{displayName:t,profileImage:r}=e(l.Eg).getConnectionProfileDetails(l.Bb);return{displayName:t||n,avatarUrl:r}}),[n]);return React.createElement(s.b,a()({},e,{user:c,description:t,customText:r}))}},24766:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(835),a=n(9818),s=n(99196),o=n.n(s),i=n(71806),l=n(23177);const c=function({title:e,description:t,image:n,url:s,media:c}){const{shareMessage:u}=(0,i.R)(),d=(0,a.useSelect)((r=>{const{displayName:a,profileImage:o,username:i}=r(l.Eg).getConnectionProfileDetails(l.wV);return[{name:a,profileImage:o,screenName:i,text:u+(c.length?` ${s}`:""),cardType:n?"summary_large_image":"summary",title:e,description:t,image:n,media:c,url:s}]}),[e,n,t,c,s,u]);return o().createElement(r.c,{tweets:d,hidePostPreview:!0})}},41809:(e,t,n)=>{"use strict";n.d(t,{P:()=>k});var r=n(82674),a=n.n(r),s=n(3396),o=n(65736),i=n(99196),l=n.n(i),c=n(23177),u=n(42032),d=n(63855),p=n(83704),m=n(4124),h=n(27725),g=n(28586),f=n(18553),b=n(94714),v=n(24766);const __=o.__;function k(){const e=(0,u.getSupportedAdditionalConnections)(),t=e.includes(c.M$),n=e.includes(c.cs),r=e.includes(c.Cd);return(0,i.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"google"},e)),name:"google",preview:p.Z},{title:__("X","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"x"},e)),name:"x",preview:v.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:d.Z},t?{title:__("Instagram","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:m.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:h.y},r?{title:__("Nextdoor","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"nextdoor"},e)),name:"nextdoor",preview:f.T}:null,{title:__("Tumblr","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"tumblr-alt"},e)),name:"tumblr",preview:b.Z},n?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:g.Z}:null].filter(Boolean)),[t,n,r])}},9279:(e,t,n)=>{"use strict";n.d(t,{u:()=>l});var r=n(9818),a=n(65736),s=n(71806),o=n(90785),i=n(25399);const __=a.__;function l(){const{attachedMedia:e,imageGeneratorSettings:t,shouldUploadAttachedMedia:n}=(0,s.R)();return(0,r.useSelect)((r=>{const{getMedia:a}=r("core"),{getEditedPostAttribute:s,getEditedPostContent:l}=r("core/editor"),c=s("featured_media");let u=c?(0,i.i)(a(c)):"";const d=t.enabled?(0,o.t)(t.token):"";if(d)u=d;else if(e?.[0]?.id){const[t]=e;!!t.id&&a(t.id)?.mime_type?.startsWith("image/")&&t.url&&(u=t.url)}if(!u){const e=(0,i.T)(l());e&&(u=e)}const p=[];if(n)if(d)p.push({type:"image/jpeg",url:d,alt:""});else{const t=e=>{const t=a(e);return t?{type:t.mime_type,url:(0,i.i)(t),alt:t.alt_text}:null};for(const{id:n}of e){const e=t(n);e&&p.push(e)}if(0===p.length&&c){const e=t(c);e&&p.push(e)}}return{title:s("meta")?.jetpack_seo_html_title||s("title"),description:s("meta")?.advanced_seo_description||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:s("link"),image:u,media:p,initialTabName:null}}),[n,e,t])}},25399:(e,t,n)=>{"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}function a(e){const t=(new DOMParser).parseFromString(e,"text/html"),n=Array.from(t.querySelectorAll("img")),r=n[0]?.src;return r??null}n.d(t,{T:()=>a,i:()=>r})},13858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(69307),a=n(87728);const s=({sourceUrl:e,mime:t,duration:n})=>{const[s,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(0),c=(0,r.useRef)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{c.current?.load()}),[e]);const p=(0,r.useCallback)((()=>{c.current.pause(),c.current.currentTime=0,clearInterval(u.current),clearTimeout(d.current),l(0),o(!1)}),[]),m=(0,r.useCallback)((()=>{d.current=setTimeout((()=>{s||(c.current.play(),o(!0),u.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[s]),h=()=>{const e=n-i,t=Math.floor(e/60),r=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${r}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:m,onMouseLeave:p},React.createElement("video",{ref:c,onEnded:p,muted:!0},React.createElement("source",{src:e,type:t})),React.createElement(h,null))}},88219:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(71806);function a(){const{attachedMedia:e,shouldUploadAttachedMedia:t,updateJetpackSocialOptions:n}=(0,r.R)();return{attachedMedia:e,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>n("attached_media",e),updateShouldUploadAttachedMedia:e=>n("should_upload_attached_media",e)}}},75323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(13419),a=n(86989),s=n.n(a),o=n(69307);const i={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},l=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function c(){const[e,t]=(0,o.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,o.useCallback)(((e,n=-1)=>{const r=l(n);t((t=>({...t,[e]:r}))),s()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_dismissed_notices:{[e]:r}}})}),[]),a=(0,o.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,o.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:i})),[e,a,n])}},39118:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(12238);const s=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9818),a=n(12238),s=n(69307),o=n(71806);const i=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function l(){const{imageGeneratorSettings:e,jetpackSocialOptions:t,updateJetpackSocialOptions:n}=(0,o.R)(),{isPostPublished:l}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),c=(0,s.useCallback)(((t,r)=>{const a={...e,[t]:r};n("image_generator_settings",a)}),[e,n]),u=(0,s.useCallback)((t=>{const r={...e,...t};n("image_generator_settings",r)}),[e,n]);return{...i(t.image_generator_settings,l),setIsEnabled:e=>c("enabled",e),setToken:e=>c("token",e),updateSettings:u}}},98811:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307);const s=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(!n.full)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.medium||n.large,a={width:r.width,height:r.height,sourceUrl:r.source_url};return{mediaData:{width:n.full.width,height:n.full.height,sourceUrl:n.full.source_url},metaData:t,previewData:a}};function o(e=null){const[t,n]=(0,a.useState)([{}]),o=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),i=(0,a.useCallback)((async()=>{try{const e=await s(o);n([e??{}])}catch{n([{}])}}),[o]);return(0,a.useEffect)((()=>{i()}),[i]),t}},46791:(e,t,n)=>{"use strict";n.d(t,{Wv:()=>l,ZP:()=>d,rs:()=>s});var r=n(69307),a=n(1795);const s="NO_MEDIA_ERROR",o="FILE_SIZE_ERROR",i="DIMENSION_ERROR";function l(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(l(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},u=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?s:null;if(!c.requiresMedia&&!r)return null;const{mime:u,fileSize:d}=e;if(!u||!c.allowedMediaTypes.includes(u.toLowerCase()))return"FILE_TYPE_ERROR";if(!t?.width||!t?.height)return i;const p=d?d/Math.pow(1e3,2):null;return l(u)?((e,t,n,r,s)=>{const{minSize:l=0,maxSize:c=a.zc,minLength:u=0,maxLength:d=a.zc,maxWidth:p=a.zc,aspectRatio:m=a.ay.video.aspectRatio}=s;if(!e||e>c||ed)return"VIDEO_LENGTH_TOO_LONG_ERROR";const h=n/r;return hm.max||n>p?i:null})(p,e.length,t.width,t.height,c.video):((e,t,n,r)=>{const{maxSize:s=a.zc,minWidth:l=0,maxWidth:c=a.zc,aspectRatio:u=a.ay.image.aspectRatio}=r,d=t/n;return du.max||t>c||ts?o:null})(p,t.width,t.height,c.image)},d=(e,t,{isSocialImageGeneratorEnabledForPost:n,shouldUploadAttachedMedia:a})=>{const s=(0,r.useRef)({});return(0,r.useMemo)((()=>{const r=n?{}:e.reduce(((e,{connection_id:n,service_name:r})=>{const s=u(t.metaData,t.mediaData,r,a);return s&&(e[n]=s),e}),{});return JSON.stringify(r)!==JSON.stringify(s.current)&&(s.current=r),{validationErrors:s.current,isConvertible:c(t.metaData)}}),[n,e,t.metaData,t.mediaData,a])}},1795:(e,t,n)=>{"use strict";n.d(t,{$8:()=>g,ay:()=>h,bD:()=>f,uo:()=>b,zc:()=>m});const r="video/mp4",a="video/mov",s="video/videopress",o=["image/jpeg","image/jpg","image/png"],i=o.concat(["image/gif","image/bmp"]),l=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],c=o.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),u=["video/webm","video/quicktime","video/ogg"],d=o.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),p=[a,"video/avi","video/mpg","video/mpeg","video/m4v"],m=1e5,h={requiresMedia:!1,allowedMediaTypes:o.concat([r,s,a]),image:{maxSize:4,minWidth:0,maxWidth:m,aspectRatio:{min:0,max:m}},video:{minLength:0,minSize:0,maxSize:m,maxLength:m,maxWidth:m,aspectRatio:{min:0,max:m}}},g={twitter:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:i.concat([s,...l]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:o.concat([r,a,s]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,s],image:{maxSize:8,minWidth:320,maxWidth:1440,aspectRatio:{min:.8,max:1.91}},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat([...u,r,s]),image:{maxSize:10},video:{maxSize:40}},nextdoor:{allowedMediaTypes:d.concat([...p,r,s]),image:{maxSize:10},video:{maxSize:500}}},f=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],b=[...new Set([...o,...i,...c,...l,...u,...f])]},71806:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(9818),a=n(12238),s=n(69307),o=n(42032);function i(){const{editPost:e}=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>{const t=e(a.store).getEditedPostAttribute("meta")||{},n=t.jetpack_publicize_feature_enabled??!0,r=t.jetpack_social_options||{};return{isPublicizeEnabled:n,jetpackSocialOptions:r,attachedMedia:r.attached_media||[],imageGeneratorSettings:r.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,o.getShareMessageMaxLength)()),shouldUploadAttachedMedia:r.should_upload_attached_media??!1}}),[]),n=(0,s.useCallback)(((t,n)=>{e({meta:{[t]:n}})}),[e]),i=(0,s.useCallback)((()=>{n("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,n]),l=(0,s.useCallback)(((e,r)=>{n("jetpack_social_options",{...t.jetpackSocialOptions,[e]:r})}),[t.jetpackSocialOptions,n]);return(0,s.useMemo)((()=>({...t,togglePublicizeFeature:i,updateJetpackSocialOptions:l,updateMeta:n})),[t,i,l,n])}},14085:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(13419),a=n(9818),s=n(12238),o=n(71806);const i="republicize";function l(){const e=(0,r.Pb)()?.social?.sharesData??{},t=e.is_share_limit_enabled,n=(0,r.OZ)(i)?.available||t,l=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),c=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",{isPublicizeEnabled:u,togglePublicizeFeature:d,isPostAlreadyShared:p}=(0,o.R)(),m=(0,r.X1)(i)&&!n,h=l?n:u,g=l&&m,f=l&&!n,b=!!(0,r.Pb)()?.social?.hasPaidPlan,v=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,k=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:u,isPublicizeEnabled:h,togglePublicizeFeature:d,isPublicizeDisabledBySitePlan:g,isRePublicizeFeatureAvailable:n,isRePublicizeUpgradableViaUpsell:m,hidePublicizeFeature:f,isShareLimitEnabled:t,isPostAlreadyShared:p,numberOfSharesRemaining:e.shares_remaining,shouldShowAdvancedPlanNudge:e.show_advanced_plan_upgrade_nudge,hasPaidPlan:b,isEnhancedPublishingEnabled:v,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:c+(0,r.lQ)(),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:k,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9818),a=n(69307),s=n(22552),o=n(23177);function i(){const e=(0,s.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(o.Eg).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},96672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(94333),a=n(69307),s=n(22552),o=n(37568);function i(){const e=(0,a.useRef)(!1),t=(0,s.Z)(),{refresh:n}=(0,o.Z)(),i=(0,r.useDebounce)(n,2e3);return()=>{t||(e.current=!0,i.cancel()),t&&e.current&&(i(),e.current=!1)}}},86419:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,e3:()=>l});var r=n(94333),a=n(9818),s=n(12238),o=n(69307);function i(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{i&&!n&&e()}),[n,i,e,t])}function l(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{!i&&n&&e()}),[n,i,e,t])}},34431:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(9818),a=n(65736),s=n(23177);const __=a.__,_n=a._n;function o({scheduledCountAdjustment:e=0,usedCountAdjustment:t=0}={}){return(0,r.useSelect)((n=>{const r=n(s.h),o=r.getShareLimit(),i=r.getScheduledSharesCount()+e,l=r.getSharesUsedCount()+t,c=l+i,u=r.numberOfSharesRemaining(),d=function(e){const t=Number.isFinite(e)?(0,a.sprintf)( +(0,a.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(30253),a=n(91948),s=n(5353);const o=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},76848:(e,t,n)=>{"use strict";n(9818),n(69307),n(99196),n(23177)},53513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(88219),l=n(89696);const __=o.__,c=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d({disabled:e=!1}){const{shouldUploadAttachedMedia:t,updateShouldUploadAttachedMedia:n}=(0,i.Z)(),o=(0,s.useCallback)((e=>{n(e)}),[n]),d=e?a.Disabled:s.Fragment,p=e?{className:l.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(d,p,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:t,onChange:o,label:__("Share as a social post","jetpack"),help:e?c:u})))}},63855:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(13477),o=n(9818),i=n(48751),l=n(23177);const c=(0,o.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,i.Z)(),{title:n,excerpt:r,content:c}=e,u=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n}=e(l.Eg).getConnectionProfileDetails(l.uJ);return{displayName:t,avatarUrl:n}}));return React.createElement(s.S,a()({},e,{type:"article",user:u,customText:t||r||c||n}))}))},83704:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(82674),a=n.n(r),s=n(17915),o=n(9818),i=n(22629),l=n(99196),c=n.n(l);const u=function(e){const t=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,i.decodeEntities)(t("root","site").title)}));return c().createElement(s.X,a()({},e,{siteTitle:t}))}},4124:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(4049),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,image:n,media:s}=e,{username:c,profileImage:u}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.M$))),{message:d}=(0,i.Z)(),p=d||t;return o().createElement(r.V,{image:n,media:s,name:c,profileImage:u,caption:p})}},27725:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(93453),a=n(9818),s=n(65736),o=n(99196),i=n.n(o),l=n(48751),c=n(23177);const __=s.__;function u(e){const{title:t,url:n,image:s,media:o}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(c.Eg).getConnectionProfileDetails(c.qk))),{message:p}=(0,l.Z)(),m=`${p||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:s,name:u,profileImage:d,title:t,description:m,url:n,media:o})}},28586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(82674),a=n.n(r),s=n(60312),o=n(9818),i=n(22629),l=n(71806),c=n(48751),u=n(23177);const d=e=>{const{message:t}=(0,c.Z)(),{content:n,siteName:r}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,i.decodeEntities)(n().title)}})),{shouldUploadAttachedMedia:d}=(0,l.R)(),p=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n,username:r}=e(u.Eg).getConnectionProfileDetails(u.cs);return{displayName:t,avatarUrl:n,address:r}})),m=e.media?.[0],h=m?.type.startsWith("image/")?m.url:null;return React.createElement(s.I,a()({},e,{siteName:r,user:p,description:n,customText:t,customImage:h,isSocialPost:d}))}},8454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(55609),a=n(65736),s=n(39517),o=n(41809),i=n(9279);const __=a.__,l=function({onClose:e,initialTabName:t}){const n=(0,o.P)(),{image:a,media:l,title:c,description:u,url:d}=(0,i.u)();return React.createElement(r.Modal,{onRequestClose:e,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:e,icon:s.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:n,initialTabName:t},(e=>React.createElement("div",null,React.createElement(e.preview,{title:c,description:u,url:d,image:a,media:l})))))}},18553:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(93122),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,url:n,image:s,media:c}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.Cd))),{message:p}=(0,i.Z)(),m=`${p||t} ${c.length?n:""}`.trim();return o().createElement(r.m,{image:s,name:u,profileImage:d,title:t,description:m,url:n,media:c})}},74140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(55609),a=n(65736),s=n(41809);const __=a.__,_x=a._x,o=({openModal:e})=>{const t=(0,s.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},t.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:e,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(1044),o=n(9818),i=n(48751),l=n(23177);const c=e=>{const{content:t,author:n}=(0,o.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{message:r}=(0,i.Z)(),c=(0,o.useSelect)((e=>{const{displayName:t,profileImage:r}=e(l.Eg).getConnectionProfileDetails(l.Bb);return{displayName:t||n,avatarUrl:r}}),[n]);return React.createElement(s.b,a()({},e,{user:c,description:t,customText:r}))}},24766:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(835),a=n(9818),s=n(99196),o=n.n(s),i=n(71806),l=n(23177);const c=function({title:e,description:t,image:n,url:s,media:c}){const{shareMessage:u}=(0,i.R)(),d=(0,a.useSelect)((r=>{const{displayName:a,profileImage:o,username:i}=r(l.Eg).getConnectionProfileDetails(l.wV);return[{name:a,profileImage:o,screenName:i,text:u+(c.length?` ${s}`:""),cardType:n?"summary_large_image":"summary",title:e,description:t,image:n,media:c,url:s}]}),[e,n,t,c,s,u]);return o().createElement(r.c,{tweets:d,hidePostPreview:!0})}},41809:(e,t,n)=>{"use strict";n.d(t,{P:()=>k});var r=n(82674),a=n.n(r),s=n(3396),o=n(65736),i=n(99196),l=n.n(i),c=n(23177),u=n(42032),d=n(63855),p=n(83704),m=n(4124),h=n(27725),g=n(28586),f=n(18553),b=n(94714),v=n(24766);const __=o.__;function k(){const e=(0,u.getSupportedAdditionalConnections)(),t=e.includes(c.M$),n=e.includes(c.cs),r=e.includes(c.Cd);return(0,i.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"google"},e)),name:"google",preview:p.Z},{title:__("X","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"x"},e)),name:"x",preview:v.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:d.Z},t?{title:__("Instagram","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:m.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:h.y},r?{title:__("Nextdoor","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"nextdoor"},e)),name:"nextdoor",preview:f.T}:null,{title:__("Tumblr","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"tumblr-alt"},e)),name:"tumblr",preview:b.Z},n?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:g.Z}:null].filter(Boolean)),[t,n,r])}},9279:(e,t,n)=>{"use strict";n.d(t,{u:()=>l});var r=n(9818),a=n(65736),s=n(71806),o=n(90785),i=n(25399);const __=a.__;function l(){const{attachedMedia:e,imageGeneratorSettings:t,shouldUploadAttachedMedia:n}=(0,s.R)();return(0,r.useSelect)((r=>{const{getMedia:a}=r("core"),{getEditedPostAttribute:s,getEditedPostContent:l}=r("core/editor"),c=s("featured_media");let u=c?(0,i.i)(a(c)):"";const d=t.enabled?(0,o.t)(t.token):"";if(d)u=d;else if(e?.[0]?.id){const[t]=e;!!t.id&&a(t.id)?.mime_type?.startsWith("image/")&&t.url&&(u=t.url)}if(!u){const e=(0,i.T)(l());e&&(u=e)}const p=[];if(n)if(d)p.push({type:"image/jpeg",url:d,alt:""});else{const t=e=>{const t=a(e);return t?{type:t.mime_type,url:(0,i.i)(t),alt:t.alt_text}:null};for(const{id:n}of e){const e=t(n);e&&p.push(e)}if(0===p.length&&c){const e=t(c);e&&p.push(e)}}return{title:s("meta")?.jetpack_seo_html_title||s("title"),description:s("meta")?.advanced_seo_description||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:s("link"),image:u,media:p,initialTabName:null}}),[n,e,t])}},25399:(e,t,n)=>{"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}function a(e){const t=(new DOMParser).parseFromString(e,"text/html"),n=Array.from(t.querySelectorAll("img")),r=n[0]?.src;return r??null}n.d(t,{T:()=>a,i:()=>r})},13858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(69307),a=n(87728);const s=({sourceUrl:e,mime:t,duration:n})=>{const[s,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(0),c=(0,r.useRef)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{c.current?.load()}),[e]);const p=(0,r.useCallback)((()=>{c.current.pause(),c.current.currentTime=0,clearInterval(u.current),clearTimeout(d.current),l(0),o(!1)}),[]),m=(0,r.useCallback)((()=>{d.current=setTimeout((()=>{s||(c.current.play(),o(!0),u.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[s]),h=()=>{const e=n-i,t=Math.floor(e/60),r=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${r}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:m,onMouseLeave:p},React.createElement("video",{ref:c,onEnded:p,muted:!0},React.createElement("source",{src:e,type:t})),React.createElement(h,null))}},88219:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(71806);function a(){const{attachedMedia:e,shouldUploadAttachedMedia:t,updateJetpackSocialOptions:n}=(0,r.R)();return{attachedMedia:e,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>n("attached_media",e),updateShouldUploadAttachedMedia:e=>n("should_upload_attached_media",e)}}},75323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(13419),a=n(86989),s=n.n(a),o=n(69307);const i={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},l=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function c(){const[e,t]=(0,o.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,o.useCallback)(((e,n=-1)=>{const r=l(n);t((t=>({...t,[e]:r}))),s()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_dismissed_notices:{[e]:r}}})}),[]),a=(0,o.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,o.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:i})),[e,a,n])}},39118:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(12238);const s=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9818),a=n(12238),s=n(69307),o=n(71806);const i=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function l(){const{imageGeneratorSettings:e,jetpackSocialOptions:t,updateJetpackSocialOptions:n}=(0,o.R)(),{isPostPublished:l}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),c=(0,s.useCallback)(((t,r)=>{const a={...e,[t]:r};n("image_generator_settings",a)}),[e,n]),u=(0,s.useCallback)((t=>{const r={...e,...t};n("image_generator_settings",r)}),[e,n]);return{...i(t.image_generator_settings,l),setIsEnabled:e=>c("enabled",e),setToken:e=>c("token",e),updateSettings:u}}},98811:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307);const s=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(!n.full)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.medium||n.large,a={width:r.width,height:r.height,sourceUrl:r.source_url};return{mediaData:{width:n.full.width,height:n.full.height,sourceUrl:n.full.source_url},metaData:t,previewData:a}};function o(e=null){const[t,n]=(0,a.useState)([{}]),o=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),i=(0,a.useCallback)((async()=>{try{const e=await s(o);n([e??{}])}catch{n([{}])}}),[o]);return(0,a.useEffect)((()=>{i()}),[i]),t}},46791:(e,t,n)=>{"use strict";n.d(t,{Wv:()=>l,ZP:()=>d,rs:()=>s});var r=n(69307),a=n(1795);const s="NO_MEDIA_ERROR",o="FILE_SIZE_ERROR",i="DIMENSION_ERROR";function l(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(l(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},u=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?s:null;if(!c.requiresMedia&&!r)return null;const{mime:u,fileSize:d}=e;if(!u||!c.allowedMediaTypes.includes(u.toLowerCase()))return"FILE_TYPE_ERROR";if(!t?.width||!t?.height)return i;const p=d?d/Math.pow(1e3,2):null;return l(u)?((e,t,n,r,s)=>{const{minSize:l=0,maxSize:c=a.zc,minLength:u=0,maxLength:d=a.zc,maxWidth:p=a.zc,aspectRatio:m=a.ay.video.aspectRatio}=s;if(!e||e>c||ed)return"VIDEO_LENGTH_TOO_LONG_ERROR";const h=n/r;return hm.max||n>p?i:null})(p,e.length,t.width,t.height,c.video):((e,t,n,r)=>{const{maxSize:s=a.zc,minWidth:l=0,maxWidth:c=a.zc,aspectRatio:u=a.ay.image.aspectRatio}=r,d=t/n;return du.max||t>c||ts?o:null})(p,t.width,t.height,c.image)},d=(e,t,{isSocialImageGeneratorEnabledForPost:n,shouldUploadAttachedMedia:a})=>{const s=(0,r.useRef)({});return(0,r.useMemo)((()=>{const r=n?{}:e.reduce(((e,{connection_id:n,service_name:r})=>{const s=u(t.metaData,t.mediaData,r,a);return s&&(e[n]=s),e}),{});return JSON.stringify(r)!==JSON.stringify(s.current)&&(s.current=r),{validationErrors:s.current,isConvertible:c(t.metaData)}}),[n,e,t.metaData,t.mediaData,a])}},1795:(e,t,n)=>{"use strict";n.d(t,{$8:()=>g,ay:()=>h,bD:()=>f,uo:()=>b,zc:()=>m});const r="video/mp4",a="video/mov",s="video/videopress",o=["image/jpeg","image/jpg","image/png"],i=o.concat(["image/gif","image/bmp"]),l=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],c=o.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),u=["video/webm","video/quicktime","video/ogg"],d=o.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),p=[a,"video/avi","video/mpg","video/mpeg","video/m4v"],m=1e5,h={requiresMedia:!1,allowedMediaTypes:o.concat([r,s,a]),image:{maxSize:4,minWidth:0,maxWidth:m,aspectRatio:{min:0,max:m}},video:{minLength:0,minSize:0,maxSize:m,maxLength:m,maxWidth:m,aspectRatio:{min:0,max:m}}},g={twitter:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:i.concat([s,...l]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:o.concat([r,a,s]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,s],image:{maxSize:8,minWidth:320,maxWidth:1440,aspectRatio:{min:.8,max:1.91}},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat([...u,r,s]),image:{maxSize:10},video:{maxSize:40}},nextdoor:{allowedMediaTypes:d.concat([...p,r,s]),image:{maxSize:10},video:{maxSize:500}}},f=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],b=[...new Set([...o,...i,...c,...l,...u,...f])]},71806:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(9818),a=n(12238),s=n(69307),o=n(42032);function i(){const{editPost:e}=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>{const t=e(a.store).getEditedPostAttribute("meta")||{},n=t.jetpack_publicize_feature_enabled??!0,r=t.jetpack_social_options||{};return{isPublicizeEnabled:n,jetpackSocialOptions:r,attachedMedia:r.attached_media||[],imageGeneratorSettings:r.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,o.getShareMessageMaxLength)()),shouldUploadAttachedMedia:r.should_upload_attached_media??!1}}),[]),n=(0,s.useCallback)(((t,n)=>{e({meta:{[t]:n}})}),[e]),i=(0,s.useCallback)((()=>{n("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,n]),l=(0,s.useCallback)(((e,r)=>{n("jetpack_social_options",{...t.jetpackSocialOptions,[e]:r})}),[t.jetpackSocialOptions,n]);return(0,s.useMemo)((()=>({...t,togglePublicizeFeature:i,updateJetpackSocialOptions:l,updateMeta:n})),[t,i,l,n])}},14085:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(13419),a=n(9818),s=n(12238),o=n(71806);const i="republicize";function l(){const e=(0,r.Pb)()?.social?.sharesData??{},t=(0,r.Pb)()?.wpcomBlogId,n=e.is_share_limit_enabled,l=(0,r.OZ)(i)?.available||n,c=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),u=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",{isPublicizeEnabled:d,togglePublicizeFeature:p,isPostAlreadyShared:m}=(0,o.R)(),h=(0,r.X1)(i)&&!l,g=c?l:d,f=c&&h,b=c&&!l,v=!!(0,r.Pb)()?.social?.hasPaidPlan,k=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,y=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:d,isPublicizeEnabled:g,togglePublicizeFeature:p,isPublicizeDisabledBySitePlan:f,isRePublicizeFeatureAvailable:l,isRePublicizeUpgradableViaUpsell:h,hidePublicizeFeature:b,isShareLimitEnabled:n,isPostAlreadyShared:m,numberOfSharesRemaining:e.shares_remaining,shouldShowAdvancedPlanNudge:e.show_advanced_plan_upgrade_nudge,hasPaidPlan:v,isEnhancedPublishingEnabled:k,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:u+(t??(0,r.lQ)()),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:y,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9818),a=n(69307),s=n(22552),o=n(23177);function i(){const e=(0,s.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(o.Eg).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},96672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(94333),a=n(69307),s=n(22552),o=n(37568);function i(){const e=(0,a.useRef)(!1),t=(0,s.Z)(),{refresh:n}=(0,o.Z)(),i=(0,r.useDebounce)(n,2e3);return()=>{t||(e.current=!0,i.cancel()),t&&e.current&&(i(),e.current=!1)}}},86419:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,e3:()=>l});var r=n(94333),a=n(9818),s=n(12238),o=n(69307);function i(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{i&&!n&&e()}),[n,i,e,t])}function l(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{!i&&n&&e()}),[n,i,e,t])}},34431:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(9818),a=n(65736),s=n(23177);const __=a.__,_n=a._n;function o({scheduledCountAdjustment:e=0,usedCountAdjustment:t=0}={}){return(0,r.useSelect)((n=>{const r=n(s.h),o=r.getShareLimit(),i=r.getScheduledSharesCount()+e,l=r.getSharesUsedCount()+t,c=l+i,u=r.numberOfSharesRemaining(),d=function(e){const t=Number.isFinite(e)?(0,a.sprintf)( // translators: %d: The number of shares to social media remaining -_n("You have %d auto-share remaining.","You have %d auto-shares remaining.",e,"jetpack"),e):"";return{default:"",exceeded:__("You have reached your auto-share limit. Scheduled posts will not be shared until shares become available.","jetpack"),full:__("You have reached your auto-share limit.","jetpack"),approaching:t}}(u);let p="default",m="none",h=d.default;return c>o?(p="error",m="exceeded",h=d.exceeded):c===o?(m="full",p="error",h=d.full):c>=.9*o?(m="approaching",p="error",h=d.approaching):c>=.8*o&&(m="approaching",p="warning",h=d.approaching),{status:m,noticeType:p,message:h,usedCount:l,scheduledCount:i,remainingCount:u}}),[e,t])}},45579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(9818),i=n(12238),l=n(69307),c=n(65736),u=n(37568),d=n(48751);const __=c.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||a;const[c,m]=(0,l.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,l.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!c.isFetching)return m({...r,isFetching:!0}),s()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then(((e={})=>{const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,c.isFetching,h]);return{...c,doPublicize:g}}},37568:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(23177);function s(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)(a.h);return{...(0,r.useSelect)((e=>{const t=e(a.h),n=t.getConnections(),r=t.getEnabledConnections(),s=t.getDisabledConnections().map((e=>e.id));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:r.length>0,skippedConnections:s,enabledConnections:r}}),[]),toggleById:t,refresh:e}}},48751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(42032),a=n(71806);function s(){const{updateMeta:e,shareMessage:t}=(0,a.R)();return{message:t,maxLength:(0,r.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(9818),a=n(12238),s=n(23177),o=n(86419);function i(){const{mergeConnections:e}=(0,r.useDispatch)(s.h),{didPostSaveRequestSucceed:t,isCurrentPostPublished:n,getEditedPostAttribute:i}=(0,r.useSelect)((e=>e(a.store)),[]);(0,o.M1)((()=>{if(t()&&n()){const t=i("jetpack_publicize_connections");t?.length&&e(t)}}),[t,n,i])}},21052:(e,t,n)=>{"use strict";n.d(t,{Au:()=>l,Wh:()=>c,ZP:()=>u,hi:()=>i,wO:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_AUTO_CONVERSION_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateAutoConversionSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Fl)(e);const t=yield(0,s.wi)();return yield c(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,r.select)(a.Eg).getAutoConversionSettings();return yield c(t),!1}finally{yield l()}},setAutoConversionSettings:c,refreshAutoConversionSettings:function*(){try{yield i();const e=yield(0,s.wi)();return yield c(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield l()}}}},23013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeConnections:()=>u,refreshConnectionTestResults:()=>d,setConnections:()=>l,syncConnectionsToPostMeta:()=>p,toggleConnection:()=>c,toggleConnectionById:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(12238),i=n(74442);function l(e){return{type:i.b,connections:e}}function c(e){return{type:i.L,connectionId:e}}function u(e){return function({dispatch:t,select:n}){const r=n.getConnections(),a=[],s={done:!1,enabled:Boolean(n.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...s,...r.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};a.push(e)}t(l(a))}}function d(e=!1){return async function({dispatch:t}){try{const n=(0,r.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(u(await s()({path:n}))),e&&t(p())}catch(e){}}}function p(){return function({registry:e,select:t}){const n=t.getConnections();return e.dispatch(o.store).editPost({jetpack_publicize_connections:n})}}function m(e,t=!0){return function({dispatch:n}){n(c(e)),t&&n(p())}}},74442:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,b:()=>r});const r="SET_CONNECTIONS",a="TOGGLE_CONNECTION"},54725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(21052),a=n(23013),s=n(371),o=n(72438),i=n(4462);const l={...s.ZP,...i.ZP,...r.ZP,...o.Z,...a}},371:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>l,dz:()=>o,ff:()=>i});var r=n(9818),a=n(23177),s=n(4957);const o="SET_JETPACK_SETTINGS";function i(e){return{type:o,options:e}}const l={updateJetpackSettings:function*(e){try{yield i({is_updating:!0}),yield i(e),yield(0,s.RF)(e);const t=yield(0,s.es)();return yield i(t),!0}catch(e){const t=(0,r.select)(a.Eg).getJetpackSettings();return yield i(t),!1}finally{yield i({is_updating:!1})}},setJetpackSettings:i}},72438:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4957),a=n(21052),s=n(4462);const o={refreshJetpackSocialSettings:function*(){try{yield(0,a.hi)(),yield(0,s.ds)();const e=yield(0,r.mu)();return yield(0,a.Wh)(e.jetpack_social_autoconvert_images),yield(0,s.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,a.Au)(),yield(0,s.Gr)()}}}},4462:(e,t,n)=>{"use strict";n.d(t,{Gr:()=>l,ZP:()=>u,ch:()=>c,ds:()=>i,kg:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateSocialImageGeneratorSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Ux)(e);const t=yield(0,s.oB)();return yield c(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,r.select)(a.Eg).getSocialImageGeneratorSettings();return yield c(t),!1}finally{yield l()}},setSocialImageGeneratorSettings:c,refreshSocialImageGeneratorSettings:function*(){try{yield i();const e=yield(0,s.oB)();return yield c(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield l()}}}},4957:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>k,es:()=>p,mu:()=>b,oB:()=>h,wi:()=>f});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_SETTINGS",o="UPDATE_JETPACK_SETTINGS",i="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",p=()=>({type:s}),m=e=>({type:o,settings:e}),h=()=>({type:i}),g=e=>({type:l,settings:e}),f=()=>({type:c}),b=()=>({type:d}),v=e=>({type:u,settings:e}),k={[s]:function(){return a()({path:"/jetpack/v4/social/settings"})},[o]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[i]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[l]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[c]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[u]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>f,Cd:()=>g,Eg:()=>c,M$:()=>p,cs:()=>h,h:()=>v,qk:()=>m,uJ:()=>d,wV:()=>b});var r=n(9818),a=n(54725),s=n(4957),o=n(45272),i=n(15781),l=n(22987);const c="jetpack-social-plugin",u={reducer:o.Z,actions:a.Z,selectors:l.Z,resolvers:i.ZP,controls:s.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",p="instagram-business",m="linkedin",h="mastodon",g="nextdoor",f="tumblr",b="twitter",v=(0,r.createReduxStore)(c,u);(0,r.register)(v)},20750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(21052);const a=(e={},t)=>t.type===r.wO?{...e,...t.options}:e},71837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(74442);const a=(e={},t)=>{switch(t.type){case r.b:return{...e,connections:t.connections};case r.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9818),a=n(20750),s=n(71837),o=n(80697),i=n(35652),l=n(28696),c=n(54489);const u=(0,r.combineReducers)({sharesData:i.Z,siteData:l.Z,connectionData:s.Z,jetpackSettings:o.Z,socialImageGeneratorSettings:c.Z,autoConversionSettings:a.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(371);const a=(e={},t)=>t.type===r.dz?{...e,...t.options}:e},35652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},28696:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},54489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4462);const a=(e={},t)=>t.type===r.kg?{...e,...t.options}:e},15781:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>c});var r=n(12238),a=n(21052),s=n(23013),o=n(371),i=n(4462),l=n(4957);const c={getJetpackSettings:function*(){try{const e=yield(0,l.es)();if(e)return(0,o.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,l.oB)();if(e)return(0,i.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,l.wi)();if(e)return(0,a.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const n=t.select(r.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,s.setConnections)(n||[]))}}}},68113:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,n)=>{"use strict";function r(e){return e.connectionData?.connections??[]}function a(e){return e.connectionData?.adminUrl??null}function s(e){return r(e).length>0}function o(e){return r(e).filter((e=>!1===e.test_success))}function i(e){return r(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function l(e){return r(e).filter((e=>e.enabled))}function c(e){return r(e).filter((e=>!e.enabled))}function u(e,t,{forceDefaults:n=!1}={}){let a="",s="",o="";if(!n){const n=r(e).find((({service_name:e})=>t===e));if(n){const{display_name:e,profile_display_name:r,profile_picture:i}=n;a="twitter"===t?r:e,o="twitter"===t?e:n.username,s=i}}return{displayName:a,profileImage:s,username:o}}n.r(t),n.d(t,{getConnectionProfileDetails:()=>u,getConnections:()=>r,getConnectionsAdminUrl:()=>a,getDisabledConnections:()=>c,getEnabledConnections:()=>l,getFailedConnections:()=>o,getMustReauthConnections:()=>i,hasConnections:()=>s})},22987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(68113),a=n(43354),s=n(82836),o=n(31473),i=n(85675),l=n(45073);const c={...i.Z,...a,...s.Z,...o,...l.Z,...r.Z}},82836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScheduledSharesCount:()=>l,getShareLimit:()=>o,getSharedPostsCount:()=>u,getSharesUsedCount:()=>i,getTotalSharesCount:()=>c,isShareLimitEnabled:()=>a,numberOfSharesRemaining:()=>p,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>s});var r=n(82836);function a(e){return e.sharesData?.is_share_limit_enabled??!1}function s(e){return!r.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&a(e)}function o(e){return e.sharesData?.share_limit??30}function i(e){return e.sharesData?.publicized_count??0}function l(e){return e.sharesData?.to_be_publicized_count??0}function c(e){const t=i(e)+l(e);return Math.max(t,0)}function u(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function p(e,t={}){if(!s(e))return 1/0;const{includeScheduled:n}={includeScheduled:!0,...t},r=i(e),a=o(e),c=n?l(e):0;return Math.max(a-r-c,0)}},85675:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=255;function a(){return r}},12677:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(13419);function a(){return(0,r.Pb)()?.social?.supportedAdditionalConnections||[]}},42032:(e,t,n)=>{"use strict";n.d(t,{getShareMessageMaxLength:()=>r.A,getSupportedAdditionalConnections:()=>a.h});var r=n(5463),a=n(12677),s=n(581);n.o(s,"useSyncPostDataToStore")&&n.d(t,{useSyncPostDataToStore:function(){return s.useSyncPostDataToStore}})},581:()=>{},13419:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>u.Z,FK:()=>c.FK,HD:()=>c.HD,M6:()=>s.M6,OZ:()=>o.Z,Pb:()=>r.Z,Pm:()=>m.Z,Qq:()=>c.Qq,Rl:()=>c.Rl,T:()=>l.Z,Ug:()=>s.Ug,Wp:()=>s.Wp,X1:()=>c.X1,_D:()=>c._D,aQ:()=>s.aQ,dM:()=>h.d,el:()=>p.Z,lQ:()=>a.Z,lt:()=>h.l,m3:()=>c.m3,o_:()=>i.Z,og:()=>g.Z,z$:()=>d.Z});var r=n(50148),a=n(35004),s=n(99505),o=n(48052),i=n(76714),l=n(80354),c=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959),g=n(19499);n(39058)},6342:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78868),a=n(99196),s=n.n(a);const o=()=>s().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:(e,t,n)=>{"use strict";n.d(t,{d:()=>s,l:()=>o});var r=n(69307),a=n(12953);function s(e){const t={};let n="span",a=e.icon;const s=document.createElement("div");s.innerHTML=e.icon;const o=s.querySelector("svg");return o&&(n="svg",a=o.innerHTML,Array.from(o.attributes).forEach((({nodeName:e,nodeValue:n})=>t[e]=n))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function o(e){return{src:s(e),foreground:(0,a.Z)()}}},12953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(99505);const a="#069e08";function s(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},19499:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){const e=(0,r.Z)();return e?.blocks_variation??"production"}},50148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:(e,t,n)=>{"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:()=>r})},61053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(6975),a=n(31294),s=n(69307);const{tracks:o}=r.Z,{recordEvent:i}=o,l=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:l={}}={})=>{const[c,u]=(0,s.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,s.useCallback)((async(e,t={})=>{d&&g&&h&&i(e,t)}),[d,g,h]);return(0,s.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,s.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(c||(b(r,l),u(!0)))}),[c,t,e,n,p,l,b]),{recordEvent:b,tracks:o}}},11380:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307),s=n(39058);const o=e=>{const{isModuleActive:t,isChangingStatus:n,isLoadingModules:o}=(0,r.useSelect)((t=>{const n=t(s.p);return{isModuleActive:n.isModuleActive(e),isChangingStatus:n.isModuleUpdating(e),isLoadingModules:n.areModulesLoading(e)}}),[s.p]),{updateJetpackModuleStatus:i}=(0,r.useDispatch)(s.p),l=(0,a.useCallback)((t=>i({name:e,active:t})),[e,i]);return(0,a.useMemo)((()=>({isLoadingModules:o,isChangingStatus:n,isModuleActive:t,changeStatus:l})),[o,n,t,l])}},68586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},44166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>d});var r=n(9818),a=n(99505),s=n(82162),o=n(39058);const i="SET_JETPACK_MODULES",l="SET_MODULE_UPDATING";function c(e){return d({isLoading:e})}function u(e,t){return{type:l,name:e,isUpdating:t}}function d(e){return{type:i,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,s.zL)(e);const t=yield(0,s.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,a.Wp)())return!0;try{yield c(!0);const e=yield(0,s.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield c(!1)}}}},82162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>i,ZP:()=>c,zL:()=>l});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_MODULES",o="UPDATE_JETPACK_MODULE_STATUS",i=()=>({type:s}),l=e=>({type:o,settings:e}),c={[s]:function(){return a()({path:"/jetpack/v4/module/all",method:"GET"})},[o]:function({settings:e}){return a()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(9818),a=n(44166),s=n(82162),o=n(42469),i=n(55133),l=n(43524);const c="jetpack-modules",u=(0,r.createReduxStore)(c,{reducer:o.Z,actions:a.ZP,controls:s.ZP,resolvers:i.Z,selectors:l.Z});(0,r.register)(u);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,r.dispatch)(c).setJetpackModules({data:{...d}})},42469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r={isLoading:!1,isUpdating:{},data:{}},a=(e=r,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(44166),a=n(82162);const s={getJetpackModules:function*(){try{const e=yield(0,a.Bs)();if(e)return(0,r.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(99505);const a={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,r.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,n)=>{"use strict";n.d(t,{FK:()=>g,HD:()=>f,Qq:()=>u,Rl:()=>m,X1:()=>d,_D:()=>p,m3:()=>b});var r=n(65736),a=n(96483),s=n(92819),o=n(50148),i=n(48052),l=n(35004),c=n(99505);const __=r.__;function u({planSlug:e,plan:t,postId:n,postType:r}){const o=(0,s.startsWith)(e,"jetpack_")?e:(0,s.get)(t,["path_slug"]),i=(void 0===r?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(r)?"":"edit";return(0,c.Wp)()?(0,a.addQueryArgs)("/"+(0,s.compact)([e,r,(0,l.Z)(),n]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:n,plan_upgraded:1})})();return(0,c.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:i,customerType:"business"}):o&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${o}`,{redirect_to:i})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,i.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,i.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,s.get)((0,o.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,s.map)(h,"name").includes(e),b=e=>(0,s.head)((0,s.filter)(h,(({name:t})=>t===e)))},76714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(98817),a=n(48052);function s(e,t){const{available:n,unavailableReason:s}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:(e,t,n)=>{"use strict";n.d(t,{M6:()=>i,Ug:()=>o,Wp:()=>s,aQ:()=>l});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===a()}function o(){return"atomic"===a()}function i(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function l(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(82674),a=n.n(r),s=n(94333);const o=e=>(0,s.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},83059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>S});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(586),p=n(3639),m=n(92710),h=n(58532),g=n(51128),f=n.n(g),b=(n(99196),n(49259)),v=n(63634),k=n(854),y=n(6747),w=n(81612),E=n(27298);const __=u.__,_=f()("jetpack-ai-assistant:dropdown"),C=[{name:__("Correct spelling and grammar","jetpack"),key:"correct-spelling",aiSuggestion:v.Hd,icon:d.Z},{name:__("Simplify","jetpack"),key:"simplify",aiSuggestion:v.hI,icon:p.Z},{name:__("Summarize","jetpack"),key:"summarize",aiSuggestion:v.Lq,icon:m.Z},{name:__("Expand","jetpack"),key:"make-longer",aiSuggestion:v.TV,icon:h.Z}];function x(e){return e.filter((e=>null!=e)).map((e=>(0,o.getBlockContent)(e))).join("\n\n")}function j({onClose:e,blockType:t}){const[n,o]=(0,c.useState)(!1),{getSelectedBlockClientIds:u,getBlocksByClientId:d}=(0,l.useSelect)("core/block-editor"),{removeBlocks:p,replaceBlock:m}=(0,l.useDispatch)("core/block-editor");(0,c.useEffect)((()=>{const e=u(),t=x(d(e)),n=(0,k.t$)(t);return o(!n.length)}),[d,u]);const{tracks:h}=(0,s.z$)(),g=(n,r={})=>{const a=u(),s=d(a),o=x(s);e(),_("requestSuggestion",n,r),h.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:n,block_type:t});const[i]=s,[l,...c]=a,g={...i?.attributes||{},content:o},f=(0,y.b)(t,g),v={clientId:l,type:n,options:{...r,contentType:"generated",fromExtension:!0}};localStorage.setItem((0,b.$M)(f.clientId),JSON.stringify(v)),m(l,f),p(c)};return(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"jetpack-ai-assistant__info"},__("Add content to activate the tools below","jetpack")),(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(i.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:()=>{const e=u(),n=d(e),r=x(n),[a,...s]=e,[o]=n,i={...o?.attributes||{},content:r};m(a,(0,y.b)(t,i)),p(s),h.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:t})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),C.map((e=>(0,r.createElement)(i.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{g(e.aiSuggestion,{})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(E.IP,{onChange:e=>{g(v.Lg,{tone:e})},disabled:n}),(0,r.createElement)(w.xK,{onChange:e=>{g(v.Nw,{language:e})},disabled:n})))}function S({blockType:e}){const{tracks:t}=(0,s.z$)();return(0,r.createElement)(i.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{className:"jetpack-ai-assistant__button",showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,label:__("AI Assistant","jetpack"),icon:a.u_}),onToggle:n=>{n&&t.recordEvent("jetpack_ai_assistant_extension_toolbar_menu_show",{block_type:e})},renderContent:({onClose:t})=>(0,r.createElement)(j,{onClose:t,blockType:e})})}},3180:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},87445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(6895),s=n(55609),o=n(65736);const __=o.__;const i=function(){const e=(0,a.Z)("jetpack-ai-feedback");return(0,r.createElement)("div",{className:"jetpack-ai-feedback-control"},(0,r.createElement)(s.BaseControl,{label:__("Feedback","jetpack")},(0,r.createElement)("p",null,__("Your feedback is valuable in our commitment to refine and improve this feature.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:e},__("Share your feedback","jetpack"))))}},81612:(e,t,n)=>{"use strict";n.d(t,{QA:()=>h,ZP:()=>f,xK:()=>b});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(61074),l=n(46936),c=n(43618);n(99196);const __=o.__,u=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],d=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,p=__("Translate","jetpack"),m=d?.split("-")[0]||"en",h=(d?.split("-"),{en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),g=({value:e,onChange:t})=>{const n=[...u.filter((e=>e!==m))];return u.includes(m)&&n.unshift(m),(0,r.createElement)(s.MenuGroup,{label:__("Select language","jetpack")},n.map((n=>(0,r.createElement)(s.MenuItem,{key:`key-${n}`,onClick:()=>t(n+" ("+h[n].label+")"),isSelected:e===n},h[n].label))))};function f({value:e=m,label:t=p,onChange:n,disabled:o=!1}){const{tracks:l}=(0,a.z$)();return o?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(i.Z,{icon:c.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:c.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"i18n"})}},(()=>(0,r.createElement)(g,{value:e,onChange:n})))}function b({value:e=m,label:t=p,onChange:n,disabled:a=!1}){return(0,r.createElement)(s.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:t,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},t),(0,r.createElement)(i.Z,{icon:l.Z})),disabled:a}},(({onClose:t})=>(0,r.createElement)(g,{onChange:e=>{n(e),t()},value:e})))}},50297:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(51806),a=n(55609),s=n(65736);const __=s.__,o=({image:e,inModal:t=!1,saveImage:n,setImageModal:s})=>(0,r.createElement)(a.Flex,{direction:"column"},t&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>s(e)})),!t&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))))))},24404:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,l="make-longer",c="makeLonger",u="make-shorter",d="makeShorter",p="summarize",m="summarize",h=[{name:__("Summarize","jetpack"),key:p,aiSuggestion:m},{name:__("Make longer","jetpack"),key:l,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:u,aiSuggestion:d}];function g({key:e,label:t=__("Improve","jetpack"),exclude:n=[],onChange:o,disabled:l=!1}){const{tracks:c}=(0,a.z$)();return l?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(s.Icon,{icon:i.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:i.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&c.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"improve"})}},(()=>{const a=h.filter((e=>!n.includes(e.key)));return(0,r.createElement)(s.MenuGroup,{label:t},a.map((t=>(0,r.createElement)(s.MenuItem,{key:`key-${t.key}`,onClick:()=>o(t.aiSuggestion,{contentType:"generated"}),isSelected:e===t.key},t.name))))}))}},85642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840),l=n(58532),c=n(586),u=n(3639),d=n(92710),p=n(32677);n(99196);const __=o.__,m=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}],h=[{label:__("Say it differently…","jetpack"),description:{original:"Rewrite it in a way that ",translated:__("Rewrite it in a way that ","jetpack")}},{label:__("Add…","jetpack"),description:{original:"Add more details about ",translated:__("Add more details about ","jetpack")}},{label:__("Remove…","jetpack"),description:{original:"Remove unnecessary details about ",translated:__("Remove unnecessary details about ","jetpack")}}];function g({hasContentBefore:e,hasContent:t,hasPostTitle:n,contentIsLoaded:o,onPromptSelect:g,onSuggestionSelect:f}){const b=__("Write with AI…","jetpack"),{tracks:v}=(0,a.z$)();return(0,r.createElement)(s.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:b,text:b,onToggle:e=>{e&&v.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"write-with-ai"})}},(({onClose:a})=>o?(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},h.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))):(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(s.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(s.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>f("continue")},__("Continue writing","jetpack")),(0,r.createElement)(s.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>f("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(s.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>f("simplify")},__("Simplify","jetpack"))),t&&(0,r.createElement)(s.MenuGroup,{label:__("Based on entire content…","jetpack")},t&&(0,r.createElement)(s.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>f("summarize")},__("Summarize","jetpack")),t&&(0,r.createElement)(s.MenuItem,{icon:p.Z,iconPosition:"left",onClick:()=>f("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},n&&(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>f("titleSummary")},__("Summary based on title","jetpack")),m.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))))))}},27298:(e,t,n)=>{"use strict";n.d(t,{IP:()=>m,Nj:()=>u,ZP:()=>h,bu:()=>d});var r=n(51806),a=n(42290),s=n(13419),o=n(55609),i=n(65736),l=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},p=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${d[n].emoji} ${d[n].label}`))));function m({label:e=__("Change tone","jetpack"),value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.Z})),disabled:s}},(({onClose:e})=>(0,r.createElement)(p,{value:t,onChange:t=>{n(t),e()}})))}function h({value:e=u,onChange:t,disabled:n=!1}){const i=__("Change tone","jetpack"),{tracks:l}=(0,s.z$)();return n?(0,r.createElement)(o.Tooltip,{text:i},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.v_}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:i,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(p,{value:e,onChange:t})))}},4965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(52175),s=n(55609),o=n(65736),i=n(79201),l=n(48381),c=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=o.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:o,handleImageRequest:h,handleTryAgain:g,showRetry:f,contentBefore:b,hasPostTitle:v,wholeContent:k,setUserPrompt:y,recordEvent:w,isGeneratingTitle:E})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,!f&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(p.ZP,{hasContentBefore:!!b?.length,hasContent:!!k?.length,hasPostTitle:v,contentIsLoaded:e,onPromptSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),y(e.translated)},onSuggestionSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Lg}),t(c.Lg,{tone:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(u.ZP,{value:"en",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Nw}),t(c.Nw,{language:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(d.ZP,{onChange:t,exclude:E?["summarize"]:[],disabled:!e}))),(f||g)&&(0,r.createElement)(s.ToolbarGroup,null,!f&&e&&g&&(0,r.createElement)(s.ToolbarButton,{onClick:g},__("Try Again","jetpack")),f&&e&&(0,r.createElement)(s.ToolbarButton,{icon:i.Z,onClick:o},__("Accept","jetpack")),f&&(0,r.createElement)(s.ToolbarButton,{icon:l.Z,onClick:n},__("Retry","jetpack"))),false))},5246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r=n(51806),a=n(6895),s=n(13419),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(99196),d=n(26546),p=n(23795),m=n(63206),h=n(18135),g=n(71449);const __=i.__,f=c()("jetpack-ai-assistant:upgrade-prompt"),b=e=>{const{upgradeType:t}=(0,h.Z)();return"vip"===t?(0,r.createElement)(d.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(({placement:e=null})=>{const{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:l}=(0,m.Z)(),c=(0,g.d)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y,usagePeriod:w}=(0,h.Z)(),E=(0,p.U_)(k)===p.dt?w?.requestsCount:y,{tracks:_}=(0,s.z$)(),C=(0,u.useCallback)((t=>{f("upgrade",e),_.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:E,placement:e}),n(t)}),[n,k,E,_,e]),x=(0,u.useCallback)((()=>{f("contact us",e),_.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[_,e]);if(!c)return(0,r.createElement)(d.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null});if(v){if(!b){const e=(0,a.Z)("jetpack-ai-tiers-more-requests-contact");return(0,r.createElement)(d.p,{buttonText:__("Contact Us","jetpack"),description:__("You have reached the request limit for your current plan.","jetpack"),className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:x})}return(0,r.createElement)(d.p,{buttonText:(0,i.sprintf)(/* Translators: number of requests */ +_n("You have %d auto-share remaining.","You have %d auto-shares remaining.",e,"jetpack"),e):"";return{default:"",exceeded:__("You have reached your auto-share limit. Scheduled posts will not be shared until shares become available.","jetpack"),full:__("You have reached your auto-share limit.","jetpack"),approaching:t}}(u);let p="default",m="none",h=d.default;return c>o?(p="error",m="exceeded",h=d.exceeded):c===o?(m="full",p="error",h=d.full):c>=.9*o?(m="approaching",p="error",h=d.approaching):c>=.8*o&&(m="approaching",p="warning",h=d.approaching),{status:m,noticeType:p,message:h,usedCount:l,scheduledCount:i,remainingCount:u}}),[e,t])}},45579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(9818),i=n(12238),l=n(69307),c=n(65736),u=n(37568),d=n(48751);const __=c.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||a;const[c,m]=(0,l.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,l.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!c.isFetching)return m({...r,isFetching:!0}),s()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then(((e={})=>{const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,c.isFetching,h]);return{...c,doPublicize:g}}},37568:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(23177);function s(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)(a.h);return{...(0,r.useSelect)((e=>{const t=e(a.h),n=t.getConnections(),r=t.getEnabledConnections(),s=t.getDisabledConnections().map((e=>e.id));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:r.length>0,skippedConnections:s,enabledConnections:r}}),[]),toggleById:t,refresh:e}}},48751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(42032),a=n(71806);function s(){const{updateMeta:e,shareMessage:t}=(0,a.R)();return{message:t,maxLength:(0,r.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(9818),a=n(12238),s=n(23177),o=n(86419);function i(){const{mergeConnections:e}=(0,r.useDispatch)(s.h),{didPostSaveRequestSucceed:t,isCurrentPostPublished:n,getEditedPostAttribute:i}=(0,r.useSelect)((e=>e(a.store)),[]);(0,o.M1)((()=>{if(t()&&n()){const t=i("jetpack_publicize_connections");t?.length&&e(t)}}),[t,n,i])}},21052:(e,t,n)=>{"use strict";n.d(t,{Au:()=>l,Wh:()=>c,ZP:()=>u,hi:()=>i,wO:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_AUTO_CONVERSION_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateAutoConversionSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Fl)(e);const t=yield(0,s.wi)();return yield c(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,r.select)(a.Eg).getAutoConversionSettings();return yield c(t),!1}finally{yield l()}},setAutoConversionSettings:c,refreshAutoConversionSettings:function*(){try{yield i();const e=yield(0,s.wi)();return yield c(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield l()}}}},23013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeConnections:()=>u,refreshConnectionTestResults:()=>d,setConnections:()=>l,syncConnectionsToPostMeta:()=>p,toggleConnection:()=>c,toggleConnectionById:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(12238),i=n(74442);function l(e){return{type:i.b,connections:e}}function c(e){return{type:i.L,connectionId:e}}function u(e){return function({dispatch:t,select:n}){const r=n.getConnections(),a=[],s={done:!1,enabled:Boolean(n.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...s,...r.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};a.push(e)}t(l(a))}}function d(e=!1){return async function({dispatch:t}){try{const n=(0,r.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(u(await s()({path:n}))),e&&t(p())}catch(e){}}}function p(){return function({registry:e,select:t}){const n=t.getConnections();return e.dispatch(o.store).editPost({jetpack_publicize_connections:n})}}function m(e,t=!0){return function({dispatch:n}){n(c(e)),t&&n(p())}}},74442:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,b:()=>r});const r="SET_CONNECTIONS",a="TOGGLE_CONNECTION"},54725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(21052),a=n(23013),s=n(371),o=n(72438),i=n(4462);const l={...s.ZP,...i.ZP,...r.ZP,...o.Z,...a}},371:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>l,dz:()=>o,ff:()=>i});var r=n(9818),a=n(23177),s=n(4957);const o="SET_JETPACK_SETTINGS";function i(e){return{type:o,options:e}}const l={updateJetpackSettings:function*(e){try{yield i({is_updating:!0}),yield i(e),yield(0,s.RF)(e);const t=yield(0,s.es)();return yield i(t),!0}catch(e){const t=(0,r.select)(a.Eg).getJetpackSettings();return yield i(t),!1}finally{yield i({is_updating:!1})}},setJetpackSettings:i}},72438:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4957),a=n(21052),s=n(4462);const o={refreshJetpackSocialSettings:function*(){try{yield(0,a.hi)(),yield(0,s.ds)();const e=yield(0,r.mu)();return yield(0,a.Wh)(e.jetpack_social_autoconvert_images),yield(0,s.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,a.Au)(),yield(0,s.Gr)()}}}},4462:(e,t,n)=>{"use strict";n.d(t,{Gr:()=>l,ZP:()=>u,ch:()=>c,ds:()=>i,kg:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateSocialImageGeneratorSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Ux)(e);const t=yield(0,s.oB)();return yield c(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,r.select)(a.Eg).getSocialImageGeneratorSettings();return yield c(t),!1}finally{yield l()}},setSocialImageGeneratorSettings:c,refreshSocialImageGeneratorSettings:function*(){try{yield i();const e=yield(0,s.oB)();return yield c(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield l()}}}},4957:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>k,es:()=>p,mu:()=>b,oB:()=>h,wi:()=>f});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_SETTINGS",o="UPDATE_JETPACK_SETTINGS",i="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",p=()=>({type:s}),m=e=>({type:o,settings:e}),h=()=>({type:i}),g=e=>({type:l,settings:e}),f=()=>({type:c}),b=()=>({type:d}),v=e=>({type:u,settings:e}),k={[s]:function(){return a()({path:"/jetpack/v4/social/settings"})},[o]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[i]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[l]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[c]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[u]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>f,Cd:()=>g,Eg:()=>c,M$:()=>p,cs:()=>h,h:()=>v,qk:()=>m,uJ:()=>d,wV:()=>b});var r=n(9818),a=n(54725),s=n(4957),o=n(45272),i=n(15781),l=n(22987);const c="jetpack-social-plugin",u={reducer:o.Z,actions:a.Z,selectors:l.Z,resolvers:i.ZP,controls:s.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",p="instagram-business",m="linkedin",h="mastodon",g="nextdoor",f="tumblr",b="twitter",v=(0,r.createReduxStore)(c,u);(0,r.register)(v)},20750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(21052);const a=(e={},t)=>t.type===r.wO?{...e,...t.options}:e},71837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(74442);const a=(e={},t)=>{switch(t.type){case r.b:return{...e,connections:t.connections};case r.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9818),a=n(20750),s=n(71837),o=n(80697),i=n(35652),l=n(28696),c=n(54489);const u=(0,r.combineReducers)({sharesData:i.Z,siteData:l.Z,connectionData:s.Z,jetpackSettings:o.Z,socialImageGeneratorSettings:c.Z,autoConversionSettings:a.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(371);const a=(e={},t)=>t.type===r.dz?{...e,...t.options}:e},35652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},28696:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},54489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4462);const a=(e={},t)=>t.type===r.kg?{...e,...t.options}:e},15781:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>c});var r=n(12238),a=n(21052),s=n(23013),o=n(371),i=n(4462),l=n(4957);const c={getJetpackSettings:function*(){try{const e=yield(0,l.es)();if(e)return(0,o.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,l.oB)();if(e)return(0,i.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,l.wi)();if(e)return(0,a.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const n=t.select(r.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,s.setConnections)(n||[]))}}}},68113:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,n)=>{"use strict";function r(e){return e.connectionData?.connections??[]}function a(e){return e.connectionData?.adminUrl??null}function s(e){return r(e).length>0}function o(e){return r(e).filter((e=>!1===e.test_success))}function i(e){return r(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function l(e){return r(e).filter((e=>e.enabled))}function c(e){return r(e).filter((e=>!e.enabled))}function u(e,t,{forceDefaults:n=!1}={}){let a="",s="",o="";if(!n){const n=r(e).find((({service_name:e})=>t===e));if(n){const{display_name:e,profile_display_name:r,profile_picture:i}=n;a="twitter"===t?r:e,o="twitter"===t?e:n.username,s=i}}return{displayName:a,profileImage:s,username:o}}n.r(t),n.d(t,{getConnectionProfileDetails:()=>u,getConnections:()=>r,getConnectionsAdminUrl:()=>a,getDisabledConnections:()=>c,getEnabledConnections:()=>l,getFailedConnections:()=>o,getMustReauthConnections:()=>i,hasConnections:()=>s})},22987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(68113),a=n(43354),s=n(82836),o=n(31473),i=n(85675),l=n(45073);const c={...i.Z,...a,...s.Z,...o,...l.Z,...r.Z}},82836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScheduledSharesCount:()=>l,getShareLimit:()=>o,getSharedPostsCount:()=>u,getSharesUsedCount:()=>i,getTotalSharesCount:()=>c,isShareLimitEnabled:()=>a,numberOfSharesRemaining:()=>p,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>s});var r=n(82836);function a(e){return e.sharesData?.is_share_limit_enabled??!1}function s(e){return!r.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&a(e)}function o(e){return e.sharesData?.share_limit??30}function i(e){return e.sharesData?.publicized_count??0}function l(e){return e.sharesData?.to_be_publicized_count??0}function c(e){const t=i(e)+l(e);return Math.max(t,0)}function u(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function p(e,t={}){if(!s(e))return 1/0;const{includeScheduled:n}={includeScheduled:!0,...t},r=i(e),a=o(e),c=n?l(e):0;return Math.max(a-r-c,0)}},85675:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getBlogID:e=>e.siteData?.blogID??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=255;function a(){return r}},12677:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(13419);function a(){return(0,r.Pb)()?.social?.supportedAdditionalConnections||[]}},42032:(e,t,n)=>{"use strict";n.d(t,{getShareMessageMaxLength:()=>r.A,getSupportedAdditionalConnections:()=>a.h});var r=n(5463),a=n(12677),s=n(581);n.o(s,"useSyncPostDataToStore")&&n.d(t,{useSyncPostDataToStore:function(){return s.useSyncPostDataToStore}})},581:()=>{},13419:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>u.Z,FK:()=>c.FK,HD:()=>c.HD,M6:()=>s.M6,OZ:()=>o.Z,Pb:()=>r.Z,Pm:()=>m.Z,Qq:()=>c.Qq,Rl:()=>c.Rl,T:()=>l.Z,Ug:()=>s.Ug,Wp:()=>s.Wp,X1:()=>c.X1,_D:()=>c._D,aQ:()=>s.aQ,dM:()=>h.d,el:()=>p.Z,lQ:()=>a.Z,lt:()=>h.l,m3:()=>c.m3,o_:()=>i.Z,og:()=>g.Z,z$:()=>d.Z});var r=n(50148),a=n(35004),s=n(99505),o=n(48052),i=n(76714),l=n(80354),c=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959),g=n(19499);n(39058)},6342:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78868),a=n(99196),s=n.n(a);const o=()=>s().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:(e,t,n)=>{"use strict";n.d(t,{d:()=>s,l:()=>o});var r=n(69307),a=n(12953);function s(e){const t={};let n="span",a=e.icon;const s=document.createElement("div");s.innerHTML=e.icon;const o=s.querySelector("svg");return o&&(n="svg",a=o.innerHTML,Array.from(o.attributes).forEach((({nodeName:e,nodeValue:n})=>t[e]=n))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function o(e){return{src:s(e),foreground:(0,a.Z)()}}},12953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(99505);const a="#069e08";function s(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},19499:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){const e=(0,r.Z)();return e?.blocks_variation??"production"}},50148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:(e,t,n)=>{"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:()=>r})},61053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(6975),a=n(31294),s=n(69307);const{tracks:o}=r.Z,{recordEvent:i}=o,l=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:l={}}={})=>{const[c,u]=(0,s.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,s.useCallback)((async(e,t={})=>{d&&g&&h&&i(e,t)}),[d,g,h]);return(0,s.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,s.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(c||(b(r,l),u(!0)))}),[c,t,e,n,p,l,b]),{recordEvent:b,tracks:o}}},11380:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307),s=n(39058);const o=e=>{const{isModuleActive:t,isChangingStatus:n,isLoadingModules:o}=(0,r.useSelect)((t=>{const n=t(s.p);return{isModuleActive:n.isModuleActive(e),isChangingStatus:n.isModuleUpdating(e),isLoadingModules:n.areModulesLoading(e)}}),[s.p]),{updateJetpackModuleStatus:i}=(0,r.useDispatch)(s.p),l=(0,a.useCallback)((t=>i({name:e,active:t})),[e,i]);return(0,a.useMemo)((()=>({isLoadingModules:o,isChangingStatus:n,isModuleActive:t,changeStatus:l})),[o,n,t,l])}},68586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},44166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>d});var r=n(9818),a=n(99505),s=n(82162),o=n(39058);const i="SET_JETPACK_MODULES",l="SET_MODULE_UPDATING";function c(e){return d({isLoading:e})}function u(e,t){return{type:l,name:e,isUpdating:t}}function d(e){return{type:i,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,s.zL)(e);const t=yield(0,s.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,a.Wp)())return!0;try{yield c(!0);const e=yield(0,s.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield c(!1)}}}},82162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>i,ZP:()=>c,zL:()=>l});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_MODULES",o="UPDATE_JETPACK_MODULE_STATUS",i=()=>({type:s}),l=e=>({type:o,settings:e}),c={[s]:function(){return a()({path:"/jetpack/v4/module/all",method:"GET"})},[o]:function({settings:e}){return a()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(9818),a=n(44166),s=n(82162),o=n(42469),i=n(55133),l=n(43524);const c="jetpack-modules",u=(0,r.createReduxStore)(c,{reducer:o.Z,actions:a.ZP,controls:s.ZP,resolvers:i.Z,selectors:l.Z});(0,r.register)(u);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,r.dispatch)(c).setJetpackModules({data:{...d}})},42469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r={isLoading:!1,isUpdating:{},data:{}},a=(e=r,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(44166),a=n(82162);const s={getJetpackModules:function*(){try{const e=yield(0,a.Bs)();if(e)return(0,r.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(99505);const a={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,r.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,n)=>{"use strict";n.d(t,{FK:()=>g,HD:()=>f,Qq:()=>u,Rl:()=>m,X1:()=>d,_D:()=>p,m3:()=>b});var r=n(65736),a=n(96483),s=n(92819),o=n(50148),i=n(48052),l=n(35004),c=n(99505);const __=r.__;function u({planSlug:e,plan:t,postId:n,postType:r}){const o=(0,s.startsWith)(e,"jetpack_")?e:(0,s.get)(t,["path_slug"]),i=(void 0===r?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(r)?"":"edit";return(0,c.Wp)()?(0,a.addQueryArgs)("/"+(0,s.compact)([e,r,(0,l.Z)(),n]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:n,plan_upgraded:1})})();return(0,c.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:i,customerType:"business"}):o&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${o}`,{redirect_to:i})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,i.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,i.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,s.get)((0,o.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,s.map)(h,"name").includes(e),b=e=>(0,s.head)((0,s.filter)(h,(({name:t})=>t===e)))},76714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(98817),a=n(48052);function s(e,t){const{available:n,unavailableReason:s}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:(e,t,n)=>{"use strict";n.d(t,{M6:()=>i,Ug:()=>o,Wp:()=>s,aQ:()=>l});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===a()}function o(){return"atomic"===a()}function i(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function l(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(82674),a=n.n(r),s=n(94333);const o=e=>(0,s.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},83059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>S});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(586),p=n(3639),m=n(92710),h=n(58532),g=n(51128),f=n.n(g),b=(n(99196),n(49259)),v=n(63634),k=n(854),y=n(6747),w=n(81612),E=n(27298);const __=u.__,_=f()("jetpack-ai-assistant:dropdown"),C=[{name:__("Correct spelling and grammar","jetpack"),key:"correct-spelling",aiSuggestion:v.Hd,icon:d.Z},{name:__("Simplify","jetpack"),key:"simplify",aiSuggestion:v.hI,icon:p.Z},{name:__("Summarize","jetpack"),key:"summarize",aiSuggestion:v.Lq,icon:m.Z},{name:__("Expand","jetpack"),key:"make-longer",aiSuggestion:v.TV,icon:h.Z}];function x(e){return e.filter((e=>null!=e)).map((e=>(0,o.getBlockContent)(e))).join("\n\n")}function j({onClose:e,blockType:t}){const[n,o]=(0,c.useState)(!1),{getSelectedBlockClientIds:u,getBlocksByClientId:d}=(0,l.useSelect)("core/block-editor"),{removeBlocks:p,replaceBlock:m}=(0,l.useDispatch)("core/block-editor");(0,c.useEffect)((()=>{const e=u(),t=x(d(e)),n=(0,k.t$)(t);return o(!n.length)}),[d,u]);const{tracks:h}=(0,s.z$)(),g=(n,r={})=>{const a=u(),s=d(a),o=x(s);e(),_("requestSuggestion",n,r),h.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:n,block_type:t});const[i]=s,[l,...c]=a,g={...i?.attributes||{},content:o},f=(0,y.b)(t,g),v={clientId:l,type:n,options:{...r,contentType:"generated",fromExtension:!0}};localStorage.setItem((0,b.$M)(f.clientId),JSON.stringify(v)),m(l,f),p(c)};return(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"jetpack-ai-assistant__info"},__("Add content to activate the tools below","jetpack")),(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(i.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:()=>{const e=u(),n=d(e),r=x(n),[a,...s]=e,[o]=n,i={...o?.attributes||{},content:r};m(a,(0,y.b)(t,i)),p(s),h.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:t})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),C.map((e=>(0,r.createElement)(i.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{g(e.aiSuggestion,{})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(E.IP,{onChange:e=>{g(v.Lg,{tone:e})},disabled:n}),(0,r.createElement)(w.xK,{onChange:e=>{g(v.Nw,{language:e})},disabled:n})))}function S({blockType:e}){const{tracks:t}=(0,s.z$)();return(0,r.createElement)(i.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{className:"jetpack-ai-assistant__button",showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,label:__("AI Assistant","jetpack"),icon:a.u_}),onToggle:n=>{n&&t.recordEvent("jetpack_ai_assistant_extension_toolbar_menu_show",{block_type:e})},renderContent:({onClose:t})=>(0,r.createElement)(j,{onClose:t,blockType:e})})}},3180:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},87445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(6895),s=n(55609),o=n(65736);const __=o.__;const i=function(){const e=(0,a.Z)("jetpack-ai-feedback");return(0,r.createElement)("div",{className:"jetpack-ai-feedback-control"},(0,r.createElement)(s.BaseControl,{label:__("Feedback","jetpack")},(0,r.createElement)("p",null,__("Your feedback is valuable in our commitment to refine and improve this feature.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:e},__("Share your feedback","jetpack"))))}},81612:(e,t,n)=>{"use strict";n.d(t,{QA:()=>h,ZP:()=>f,xK:()=>b});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(61074),l=n(46936),c=n(43618);n(99196);const __=o.__,u=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],d=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,p=__("Translate","jetpack"),m=d?.split("-")[0]||"en",h=(d?.split("-"),{en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),g=({value:e,onChange:t})=>{const n=[...u.filter((e=>e!==m))];return u.includes(m)&&n.unshift(m),(0,r.createElement)(s.MenuGroup,{label:__("Select language","jetpack")},n.map((n=>(0,r.createElement)(s.MenuItem,{key:`key-${n}`,onClick:()=>t(n+" ("+h[n].label+")"),isSelected:e===n},h[n].label))))};function f({value:e=m,label:t=p,onChange:n,disabled:o=!1}){const{tracks:l}=(0,a.z$)();return o?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(i.Z,{icon:c.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:c.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"i18n"})}},(()=>(0,r.createElement)(g,{value:e,onChange:n})))}function b({value:e=m,label:t=p,onChange:n,disabled:a=!1}){return(0,r.createElement)(s.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:t,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},t),(0,r.createElement)(i.Z,{icon:l.Z})),disabled:a}},(({onClose:t})=>(0,r.createElement)(g,{onChange:e=>{n(e),t()},value:e})))}},50297:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(51806),a=n(55609),s=n(65736);const __=s.__,o=({image:e,inModal:t=!1,saveImage:n,setImageModal:s})=>(0,r.createElement)(a.Flex,{direction:"column"},t&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>s(e)})),!t&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))))))},24404:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,l="make-longer",c="makeLonger",u="make-shorter",d="makeShorter",p="summarize",m="summarize",h=[{name:__("Summarize","jetpack"),key:p,aiSuggestion:m},{name:__("Make longer","jetpack"),key:l,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:u,aiSuggestion:d}];function g({key:e,label:t=__("Improve","jetpack"),exclude:n=[],onChange:o,disabled:l=!1}){const{tracks:c}=(0,a.z$)();return l?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(s.Icon,{icon:i.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:i.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&c.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"improve"})}},(()=>{const a=h.filter((e=>!n.includes(e.key)));return(0,r.createElement)(s.MenuGroup,{label:t},a.map((t=>(0,r.createElement)(s.MenuItem,{key:`key-${t.key}`,onClick:()=>o(t.aiSuggestion,{contentType:"generated"}),isSelected:e===t.key},t.name))))}))}},85642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840),l=n(58532),c=n(586),u=n(3639),d=n(92710),p=n(32677);n(99196);const __=o.__,m=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}],h=[{label:__("Say it differently…","jetpack"),description:{original:"Rewrite it in a way that ",translated:__("Rewrite it in a way that ","jetpack")}},{label:__("Add…","jetpack"),description:{original:"Add more details about ",translated:__("Add more details about ","jetpack")}},{label:__("Remove…","jetpack"),description:{original:"Remove unnecessary details about ",translated:__("Remove unnecessary details about ","jetpack")}}];function g({hasContentBefore:e,hasContent:t,hasPostTitle:n,contentIsLoaded:o,onPromptSelect:g,onSuggestionSelect:f}){const b=__("Write with AI…","jetpack"),{tracks:v}=(0,a.z$)();return(0,r.createElement)(s.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:b,text:b,onToggle:e=>{e&&v.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"write-with-ai"})}},(({onClose:a})=>o?(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},h.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))):(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(s.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(s.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>f("continue")},__("Continue writing","jetpack")),(0,r.createElement)(s.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>f("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(s.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>f("simplify")},__("Simplify","jetpack"))),t&&(0,r.createElement)(s.MenuGroup,{label:__("Based on entire content…","jetpack")},t&&(0,r.createElement)(s.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>f("summarize")},__("Summarize","jetpack")),t&&(0,r.createElement)(s.MenuItem,{icon:p.Z,iconPosition:"left",onClick:()=>f("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},n&&(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>f("titleSummary")},__("Summary based on title","jetpack")),m.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))))))}},27298:(e,t,n)=>{"use strict";n.d(t,{IP:()=>m,Nj:()=>u,ZP:()=>h,bu:()=>d});var r=n(51806),a=n(42290),s=n(13419),o=n(55609),i=n(65736),l=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},p=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${d[n].emoji} ${d[n].label}`))));function m({label:e=__("Change tone","jetpack"),value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.Z})),disabled:s}},(({onClose:e})=>(0,r.createElement)(p,{value:t,onChange:t=>{n(t),e()}})))}function h({value:e=u,onChange:t,disabled:n=!1}){const i=__("Change tone","jetpack"),{tracks:l}=(0,s.z$)();return n?(0,r.createElement)(o.Tooltip,{text:i},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.v_}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:i,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(p,{value:e,onChange:t})))}},4965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(52175),s=n(55609),o=n(65736),i=n(79201),l=n(48381),c=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=o.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:o,handleImageRequest:h,handleTryAgain:g,showRetry:f,contentBefore:b,hasPostTitle:v,wholeContent:k,setUserPrompt:y,recordEvent:w,isGeneratingTitle:E})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,!f&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(p.ZP,{hasContentBefore:!!b?.length,hasContent:!!k?.length,hasPostTitle:v,contentIsLoaded:e,onPromptSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),y(e.translated)},onSuggestionSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Lg}),t(c.Lg,{tone:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(u.ZP,{value:"en",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Nw}),t(c.Nw,{language:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(d.ZP,{onChange:t,exclude:E?["summarize"]:[],disabled:!e}))),(f||g)&&(0,r.createElement)(s.ToolbarGroup,null,!f&&e&&g&&(0,r.createElement)(s.ToolbarButton,{onClick:g},__("Try Again","jetpack")),f&&e&&(0,r.createElement)(s.ToolbarButton,{icon:i.Z,onClick:o},__("Accept","jetpack")),f&&(0,r.createElement)(s.ToolbarButton,{icon:l.Z,onClick:n},__("Retry","jetpack"))),false))},5246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r=n(51806),a=n(6895),s=n(13419),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(99196),d=n(26546),p=n(23795),m=n(63206),h=n(18135),g=n(71449);const __=i.__,f=c()("jetpack-ai-assistant:upgrade-prompt"),b=e=>{const{upgradeType:t}=(0,h.Z)();return"vip"===t?(0,r.createElement)(d.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(({placement:e=null})=>{const{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:l}=(0,m.Z)(),c=(0,g.d)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y,usagePeriod:w}=(0,h.Z)(),E=(0,p.U_)(k)===p.dt?w?.requestsCount:y,{tracks:_}=(0,s.z$)(),C=(0,u.useCallback)((t=>{f("upgrade",e),_.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:E,placement:e}),n(t)}),[n,k,E,_,e]),x=(0,u.useCallback)((()=>{f("contact us",e),_.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[_,e]);if(!c)return(0,r.createElement)(d.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null});if(v){if(!b){const e=(0,a.Z)("jetpack-ai-tiers-more-requests-contact");return(0,r.createElement)(d.p,{buttonText:__("Contact Us","jetpack"),description:__("You have reached the request limit for your current plan.","jetpack"),className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:x})}return(0,r.createElement)(d.p,{buttonText:(0,i.sprintf)(/* Translators: number of requests */ __("Upgrade to %d requests","jetpack"),b.limit),checkoutUrl:t,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)((0,i.sprintf)(/* Translators: number of requests */ __("You have reached the requests limit for your current plan. Upgrade now to increase your requests limit to %d.","jetpack"),b.limit),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:C,isRedirecting:l,visible:!0,align:"center",title:null,context:null})}return(0,r.createElement)(d.p,{buttonText:"Upgrade",checkoutUrl:t,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Upgrade now to keep using it.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:n,isRedirecting:l,visible:!0,align:null,title:null,context:null})})(e)}},45624:(e,t,n)=>{"use strict";n.d(t,{Z:()=>B});var r=n(82674),a=n.n(r),s=n(51806),o=n(42290),i=n(13419),l=n(52175),c=n(4981),u=n(55609),d=n(94333),p=n(9818),m=n(69307),h=n(65736),g=n(65235),f=n.n(g),b=n(10185),v=n.n(b),k=n(99196),y=n(84102),w=n(80013),E=n(3180),_=n(87445),C=n(50297),x=n(4965),j=n(5246),S=n(49259),P=n(18135),N=n(60751),L=n(71449),T=n(3687),A=n(63634);const __=h.__,M=new(v())({breaks:!0}),R="post"===window?.Jetpack_Editor_Initial_State?.screenBase,Z=window?.Jetpack_Editor_Initial_State?.["ai-assistant"]?.["is-playground-visible"];function B({attributes:e,setAttributes:t,clientId:n,isSelected:r}){const[h,g]=(0,m.useState)({}),[b,v]=(0,m.useState)(!1),[B,I]=(0,m.useState)([]),[z,D]=(0,m.useState)(null),[F,O]=(0,m.useState)(null),{tracks:U}=(0,i.z$)(),H=(0,p.useSelect)((e=>e("core/editor").getCurrentPostId())),{getBlock:V}=(0,p.useSelect)("core/block-editor"),q=(0,k.useRef)(null),G=(0,k.useRef)(null),{replaceBlocks:$,replaceBlock:W,removeBlock:J}=(0,p.useDispatch)("core/block-editor"),{editPost:K}=(0,p.useDispatch)("core/editor"),{mediaUpload:Y}=(0,p.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return{mediaUpload:t().mediaUpload}}),[]),{isOverLimit:X,requireUpgrade:Q,increaseRequestsCount:ee}=(0,P.Z)(),te=()=>{setTimeout((()=>{q.current?.focus?.()}),100)},ne=()=>{setTimeout((()=>{G.current?.focus?.()}),100)},re=(0,d.useViewportMatch)("medium","<"),{isLoadingCategories:ae,isLoadingCompletion:se,wasCompletionJustRequested:oe,getSuggestionFromOpenAI:ie,stopSuggestion:le,showRetry:ce,contentBefore:ue,postTitle:de,retryRequest:pe,wholeContent:me,requestingState:he}=(0,N.Z)({onSuggestionDone:(0,m.useCallback)((()=>{te(),ee()}),[ee]),onUnclearPrompt:(0,m.useCallback)((()=>{ne(),ee()}),[ee]),onModeration:te,attributes:e,clientId:n,content:e.content,setError:g,tracks:U,userPrompt:e.userPrompt,requireUpgrade:Q,requestingState:e.requestingState}),ge=(0,L.b)(),fe=(0,S.$M)(n);(0,k.useEffect)((()=>{if(!fe)return;const e=JSON.parse(localStorage.getItem(fe));if(!e)return;const{type:t,options:n}=e;localStorage.removeItem(fe),ie(t,n)}),[fe,ie]),(0,k.useEffect)((()=>{h&&O(!1)}),[h]);const be=(0,k.useRef)(e?.content);(0,k.useEffect)((()=>{if(!e?.useGutenbergSyntax)return;if(!be?.current?.length)return;const t=V(n);if(t?.innerBlocks?.length)return;const r=(0,c.parse)(be.current);r?.length&&$(n,r)}),[be,n,$,V,e?.useGutenbergSyntax]),(0,k.useEffect)((()=>{["init","done"].includes(he)&&t({requestingState:he})}),[he,t]);const ve=async t=>{if(b)return;v(!0),g({});const r=await fetch(t),a=await r.blob(),s=new File([a],"jetpack_ai_image.png",{type:"image/png"});Y({filesList:[s],onFileChange:([t])=>{t.id&&W(n,(0,c.createBlock)("core/image",{url:t.url,caption:e.requestedPrompt,alt:e.requestedPrompt}))},allowedTypes:["image"],onError:e=>{console.error(e),v(!1)}}),U.recordEvent("jetpack_ai_dalle_generation_upload",{post_id:H})},ke=e?.useGutenbergSyntax,ye=se||ae,we=!!e.content,Ee="generateTitle"===e.promptType,_e=__("Accept","jetpack"),Ce=__("Accept title","jetpack"),xe=Ee?Ce:_e,je=(...e)=>{ie(...e),ne()},Se=async()=>{let t=[];if(ke)t=V(n),t=t?.innerBlocks||[];else{const n=M.render(e.content||"").replace(/
  • \s+

    /g,"

  • ").replace(/<\/p>\s+<\/li>/g,"
  • ");t=(0,c.rawHandler)({HTML:n})}await $(n,t);const r=(e=>{let t=null;return e.forEach((e=>{const n=document.querySelector(`.wp-block[data-block="${e.clientId}"]`);if(!n)return;"true"===n.contentEditable&&(t=n);const r=n.querySelectorAll("[contenteditable=true]");t=r.length?r[r.length-1]:t})),t})(t);r&&(e=>{const t=window.getSelection();t.selectAllChildren(e),t.collapseToEnd(),e.focus()})(r)},Pe=()=>{Se(),U.recordEvent("jetpack_ai_assistant_block_accept",{feature:"ai-assistant"})},Ne=()=>{R?(K({title:e.content?e.content.trim():""}),J(n),U.recordEvent("jetpack_ai_assistant_block_accept",{feature:"ai-assistant"})):Pe()},Le=()=>{le(),te(),U.recordEvent("jetpack_ai_assistant_block_stop",{feature:"ai-assistant"})},[Te,Ae]=(0,m.useState)(!1),Me=()=>{Ae(!Te)},Re=(0,l.useBlockProps)({ref:G,className:f()({"is-waiting-response":oe})}),Ze=(0,l.useInnerBlocksProps)(Re),Be=__("Ask Jetpack AI…","jetpack"),Ie=__("Write about… Make a table for…","jetpack"),ze=(0,s.createElement)(s.Fragment,null,X&&r&&(0,s.createElement)(j.Z,{placement:"ai-assistant-block"}),!ge&&(0,s.createElement)(E.Z,null));return(0,s.createElement)(u.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{esc:()=>{["requesting","suggesting"].includes(he)&&Le()}}},(0,s.createElement)("div",Re,h?.message&&!F&&"error_quota_exceeded"!==h?.code&&(0,s.createElement)(u.Notice,{status:h.status,isDismissible:!1,className:"jetpack-ai-assistant__error"},h.message),we&&!ke&&(0,s.createElement)("div",{className:"jetpack-ai-assistant__content"},(0,s.createElement)(m.RawHTML,null,M.render(e.content))),we&&ke&&(0,s.createElement)("div",a()({className:"jetpack-ai-assistant__content is-layout-building-mode"},Ze)),(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(u.PanelBody,{initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(y.Z,{placement:w.I}))),(0,s.createElement)(u.PanelBody,{initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(_.Z,null)))),Z&&(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(u.PanelBody,{title:__("AI Playground","jetpack"),initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(u.ToggleControl,{label:__("Gutenberg Syntax","jetpack"),onChange:e=>t({useGutenbergSyntax:e}),checked:e.useGutenbergSyntax})),(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(u.ToggleControl,{label:__("GPT-4","jetpack"),onChange:e=>t({useGpt4:e}),checked:e.useGpt4})),(0,s.createElement)(u.PanelRow,null,Te&&(0,s.createElement)(u.Modal,{title:__("Custom System Prompt","jetpack"),onRequestClose:Me},(0,s.createElement)(u.TextareaControl,{rows:20,label:__("Set up the custom system prompt ","jetpack"),onChange:e=>t({customSystemPrompt:e}),className:"jetpack-ai-assistant__custom-prompt",value:e.customSystemPrompt||(0,A.t4)({useGutenbergSyntax:e.useGutenbergSyntax,useGpt4:e.useGpt4})?.content}),(0,s.createElement)("div",{className:"jetpack-ai-assistant__custom-prompt__footer"},(0,s.createElement)(u.Button,{onClick:()=>t({customSystemPrompt:""}),variant:"secondary"},__("Restore the prompt","jetpack")),(0,s.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Close","jetpack")))),(0,s.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Set system custom prompt","jetpack"))))),!ye&&ge&&!Q&&(0,s.createElement)(x.Z,{isWaitingState:ye,contentIsLoaded:we,getSuggestionFromOpenAI:ie,retryRequest:pe,handleAcceptContent:Pe,handleAcceptTitle:Ne,handleGetSuggestion:je,handleImageRequest:()=>{I([]),g({}),(0,T.b)(""===e.userPrompt.trim()?__("What would you like to see?","jetpack"):e.userPrompt,t,v,I,g,H),U.recordEvent("jetpack_ai_dalle_generation",{post_id:H})},handleTryAgain:null,showRetry:ce,contentBefore:ue,hasPostTitle:!!de?.length,wholeContent:me,promptType:e.promptType,setUserPrompt:e=>{if(!q?.current)return;q.current.focus(),t({userPrompt:e})},recordEvent:U.recordEvent,isGeneratingTitle:Ee}),(0,s.createElement)(o.tK,{ref:q,disabled:Q||!ge,value:e.userPrompt,placeholder:e?.content?Be:Ie,onChange:e=>{O(!0),t({userPrompt:e})},onSend:()=>{je("userPrompt"),U.recordEvent("jetpack_ai_assistant_block_generate",{feature:"ai-assistant"})},onStop:Le,onAccept:()=>{Ee?Ne():Pe()},onDiscard:()=>{const r=e?.content===V(n).attributes?.content;t({content:e?.originalContent,promptType:void 0,messages:e?.originalMessages}),Se(),r?U.recordEvent("jetpack_ai_assistant_block_dismiss"):U.recordEvent("jetpack_ai_assistant_block_discard",{feature:"ai-assistant"})},state:he,isTransparent:Q||!ge,showButtonLabels:!re,showAccept:"init"!==he&&we&&!ye,acceptLabel:xe,showGuideLine:we,showRemove:e?.content?.length>0,bannerComponent:ze}),!b&&B.length>0&&(0,s.createElement)(u.Flex,{direction:"column",style:{width:"100%"}},(0,s.createElement)(u.FlexBlock,{style:{textAlign:"center",margin:"12px",fontStyle:"italic",width:"100%"}},e.requestedPrompt),(0,s.createElement)(u.FlexBlock,{style:{fontSize:"20px",lineHeight:"38px"}},__("Please choose your image","jetpack")),(0,s.createElement)(u.Flex,{direction:"row",wrap:!0},B.map((e=>(0,s.createElement)(C.Z,{setImageModal:D,saveImage:ve,image:e,key:e}))))),!b&&z&&(0,s.createElement)(u.Modal,{onRequestClose:()=>D(null)},(0,s.createElement)(C.Z,{saveImage:ve,setImageModal:D,image:z,inModal:!0}))))}},27559:(e,t,n)=>{"use strict";var r=n(31985),a=n(23536),s=n(45624),o=n(6747);n(81765),n(54765),n(94662);(0,r.S)(a,{edit:s.Z,save:()=>null,transforms:o.Z})},54765:(e,t,n)=>{"use strict";n.d(t,{J7:()=>u,NP:()=>l});var r=n(4981),a=n(9818),s=n(92694),o=n(23536),i=n(71449);const l=["core/paragraph","core/heading","core/list"],c=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-support"];function u(){if(!(0,r.getBlockType)(o.name))return!1;if(!c)return!1;if(!(0,i.b)())return!1;const{errorCode:e}=(0,a.select)("wordpress-com/plans")?.getAiAssistantFeature?.()||{};if(e)return!1;const{getHiddenBlockTypes:t}=(0,a.select)("core/edit-post")||{};return!(t?.()||[]).includes(o.name)}(0,s.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return l.includes(t)&&u()?{...e,supports:{...e.supports,"jetpack/ai":{assistant:!0}}}:e}),100)},49259:(e,t,n)=>{"use strict";n.d(t,{$M:()=>i,ZP:()=>l});var r=n(51806),a=n(52175),s=n(94333),o=(n(99196),n(83059));function i(e){return`ai-assistant-block-${e}`}const l=(0,s.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(o.ZP,{blockType:n})))}),"withAIAssistant")},79191:(e,t,n)=>{"use strict";n.d(t,{Z:()=>C});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(94333),c=n(9818),u=n(69307),d=n(65736),p=n(53961),m=n(65235),h=n.n(m),g=(n(99196),n(3180)),f=n(5246),b=n(18135),v=n(71449),k=n(63634),y=n(79817),w=n(44110);const __=d.__,E={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480};function _(e){if(!e?.length)return"";const t=(0,c.select)("core/block-editor").getBlock(e);if(!t)return"";const{innerBlocks:n}=t;return n?.length?n.reduce(((e,t)=>e+(0,o.serialize)(t)+"\n\n"),""):""}function C({clientId:e,className:t=""}){const n=(0,u.useRef)(null),o=(0,u.useRef)(null),{tracks:d}=(0,s.z$)(),m=(0,v.b)(),{inputValue:C,setInputValue:x,isVisible:j,assistantAnchor:S}=(0,u.useContext)(y.D),{dequeueAiAssistantFeatureAyncRequest:P}=(0,c.useDispatch)("wordpress-com/plans"),N=()=>{setTimeout((()=>{o.current?.focus?.()}),100)},{requestSuggestion:L,requestingState:T,stopSuggestion:A,requestingError:M}=(0,a.X_)({onDone:N}),{requireUpgrade:R}=(0,b.Z)(),Z=M?.code===a.$L||R,B="requesting"===T||"suggesting"===T,I="suggesting"===T||"done"===T,z=__("Ask Jetpack AI to create your form","jetpack"),D=__("Creating your form. Please wait a few moments.","jetpack"),{removeNotice:F}=(0,c.useDispatch)(p.store),O=(0,u.useCallback)((()=>{if(!C?.length)return;F(w.uu);const t=(0,k.r1)(k.Re,{request:C,content:_(e)});P(),L(t,{feature:"jetpack-form-ai-extension"}),d.recordEvent("jetpack_ai_assistant_block_generate",{feature:"jetpack-form-ai-extension"}),n?.current?.focus()}),[e,P,C,F,L,d]),U=(0,u.useCallback)((()=>{A(),N(),d.recordEvent("jetpack_ai_assistant_block_stop",{feature:"jetpack-form-ai-extension"})}),[A,d]),H=(0,l.useViewportMatch)("medium","<"),V=H&&S,q=(0,u.useRef)(null),G=(0,u.useRef)(H),[$,W]=(0,u.useState)(H);if((0,u.useEffect)((()=>{const e=n?.current;if(e)return q?.current||(q.current=new ResizeObserver((e=>{if(!j)return;if(V)return;const t=e[0].contentRect.width{q?.current?.disconnect()}}),[V,j]),(0,u.useEffect)((()=>{j&&d.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:"jetpack/contact-form"})}),[j,d]),(0,u.useEffect)((()=>{const e=setTimeout((()=>{j&&o?.current&&o.current.focus()}),300);return function(){clearTimeout(e)}}),[]),!j)return null;const J=(0,r.createElement)("div",{className:"jetpack-ai-assistant__bar-wrapper"},(0,r.createElement)(i.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{esc:()=>{["requesting","suggesting"].includes(T)&&U()}}},(0,r.createElement)("div",{ref:n,className:h()("jetpack-ai-assistant__bar",{[t]:t,"is-fixed":V,"is-mobile-mode":$}),tabIndex:-1},Z&&(0,r.createElement)(f.Z,{placement:"jetpack-form-block"}),!m&&(0,r.createElement)(g.Z,null),(0,r.createElement)(a.tK,{ref:o,disabled:Z||!m,value:C,placeholder:B?D:z,onChange:x,onSend:O,onStop:U,state:T,isTransparent:Z||!m,showButtonLabels:!$,showGuideLine:I}))));return V?(0,u.createPortal)(J,S):J}},81732:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(51806),a=n(42290),s=n(55609),o=n(94333),i=n(69307),l=n(65736),c=n(99196),u=n(79817),d=n(44110);const __=l.__,p="jetpack-ai-assistant-bar__slot";function m({jetpackFormClientId:e}){const{isVisible:t,toggle:n,setAnchor:l,assistantAnchor:m}=(0,i.useContext)(u.D),{requestingState:h}=(0,a.X_)(),g=(0,i.useRef)(null),f=(0,o.useViewportMatch)("medium","<");(0,c.useEffect)((()=>{if(!g.current)return;const e=g.current.closest(".block-editor-block-contextual-toolbar");if(!e)return;let t=e.parentElement?.querySelector(`.${p}`);if(t)return e.after(t),l(t);t=document.createElement("div"),t.setAttribute("role","toolbar"),t.setAttribute("aria-label",__("AI Assistant","jetpack")),t.setAttribute("aria-orientation","horizontal"),t.className=p;const n=e.offsetHeight;t.style.top=`${n}px`,e.after(t),l(t)}),[l]),(0,c.useEffect)((()=>{f||m?.remove()}),[f,m]);const b=(0,i.useCallback)((()=>{if(!e)return n();(0,d.Vl)(e,n)}),[e,n]),v="requesting"===h||"suggesting"===h;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{"mod+/":n}}),(0,r.createElement)(s.ToolbarButton,{ref:g,showTooltip:!0,onClick:b,"aria-haspopup":"true","aria-expanded":t,label:__("Ask AI Assistant","jetpack"),icon:a.u_,disabled:v}))}},59090:(e,t,n)=>{"use strict";n.d(t,{aE:()=>r,nB:()=>a});const r=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-form-support"]?.available,a=["jetpack/field-name","jetpack/field-email","jetpack/field-text","jetpack/field-textarea","jetpack/field-checkbox","jetpack/field-date","jetpack/field-telephone","jetpack/field-url","jetpack/field-checkbox-multiple","jetpack/field-radio","jetpack/field-select","jetpack/field-consent","jetpack/button"]},94662:(e,t,n)=>{"use strict";n.d(t,{G:()=>f});var r=n(51806),a=n(42290),s=n(13419),o=n(52175),i=n(4981),l=n(94333),c=n(9818),u=n(69307),d=n(92694),p=(n(99196),n(79191)),m=n(81732),h=n(59090),g=n(44110);function f(e,{checkChildrenBlocks:t=!1,clientId:n}={clientId:""}){const r=(0,i.getBlockType)("jetpack/ai-assistant"),{isModuleActive:a}=(0,s.el)("contact-form");if(!a)return!1;if(!r)return!1;if("string"!=typeof e)return!1;if(!h.aE)return!1;if(!n?.length)return!1;if(t){if(!h.nB.includes(e))return!1}else if("jetpack/contact-form"!==e)return!1;const{getHiddenBlockTypes:o}=(0,c.select)("core/edit-post")||{};return!(o?.()||[]).includes(e)}const b=(0,l.createHigherOrderComponent)((e=>t=>{const n=f(t?.name,{clientId:t.clientId}),{increaseAiAssistantRequestsCount:s}=(0,c.useDispatch)("wordpress-com/plans"),{eventSource:i}=(0,a.X_)({onDone:(0,u.useCallback)((()=>{s()}),[s]),onError:(0,u.useCallback)((e=>{"error_network"!==e.code&&"error_quota_exceeded"!==e.code&&s()}),[s])}),l=(0,u.useCallback)((()=>{i&&i?.close()}),[i]);if((0,u.useEffect)((()=>()=>{"jetpack/contact-form"===t?.name&&l()}),[l,t?.name]),!n)return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(p.Z,{clientId:t.clientId}),(0,r.createElement)(o.BlockControls,{group:"block"},(0,r.createElement)(m.Z,null)))}),"jetpackFormEditWithAiComponents");(0,d.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return"jetpack/contact-form"!==t?e:{...e,edit:(0,a.oN)((0,g.ZP)(b(e.edit)))}}),100);const v=(0,l.createHigherOrderComponent)((e=>t=>{const n=(0,c.useSelect)((e=>{const n=e("core/block-editor"),{getBlockParentsByBlockName:r}=n;return r(t.clientId,"jetpack/contact-form")?.[0]}),[t.clientId]);if(!f(t?.name,{checkChildrenBlocks:!0,clientId:n}))return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(o.BlockControls,{group:"parent"},(0,r.createElement)(m.Z,{jetpackFormClientId:n})))}),"jetpackFormChildrenEditWithAiComponents");(0,d.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return h.nB.includes(t)?{...e,edit:v(e.edit)}:e}))},79817:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,v:()=>o});var r=n(51806),a=n(69307);const s=(0,a.createContext)({}),o=({value:e,children:t})=>(0,r.createElement)(s.Provider,{value:e,children:t})},44110:(e,t,n)=>{"use strict";n.d(t,{Vl:()=>b,ZP:()=>v,uu:()=>f});var r=n(51806),a=n(42290),s=n(4981),o=n(55609),i=n(94333),l=n(9818),c=n(69307),u=n(65736),d=n(53961),p=(n(99196),n(94662)),m=n(5863),h=n(56359),g=n(79817);const __=u.__,f="ai-assistant";function b(e,t){(0,l.dispatch)("core/block-editor").selectBlock(e).then(t)}const v=(0,i.createHigherOrderComponent)((e=>t=>{const{clientId:n,isSelected:i}=t,{replaceInnerBlocks:u}=(0,l.useDispatch)("core/block-editor"),v=(0,l.useSelect)((e=>e("core/editor")),[]),k=(0,l.useSelect)((e=>e("core/block-editor")),[]),y=v.getCurrentPostId(),w=k.getBlock(n),[E,_]=(0,c.useState)(""),C="jetpack/contact-form"===w?.name&&0===w?.innerBlocks?.length,[x,j]=(0,c.useState)(C),[S,P]=(0,c.useState)(!1),[N,L]=(0,c.useState)(null),T=(0,c.useRef)([]),A=(0,c.useCallback)((()=>{j(!0)}),[]),M=(0,c.useCallback)((()=>{j(!1)}),[]),R=(0,c.useCallback)((()=>{j(!x)}),[x]),Z=(0,c.useCallback)((e=>{L(e)}),[]),{createNotice:B}=(0,l.useDispatch)(d.store),I=(0,c.useCallback)((({severity:e,message:t,code:n})=>{n!==a.$L&&B(e,t,{isDismissible:!0,id:f})}),[B]);(0,c.useEffect)((()=>{i||M()}),[i,M]);const z=(0,c.useMemo)((()=>({inputValue:E,setInputValue:_,isVisible:x,show:A,hide:M,toggle:R,isFixed:S,setAssistantFixed:P,assistantAnchor:N,setAnchor:Z})),[E,x,A,M,R,S,N,Z]),D=(0,c.useCallback)(((e,t=!1)=>{const r=e.replace(//g,""),a=(0,h.J)(r),o=(0,s.parse)(a).filter((e=>e.isValid&&!["core/freeform","core/missing","core/html"].includes(e.name)));let i=!1;if(o.length0){const e=o[o.length-1],t=T.current[o.length-1];i=!(0,m.c)(e,t)}if(o.length>0&&(o.length!==T.current.length||i)&&(u(n,o),T.current=o),t){const e=o.filter((e=>"jetpack/button"===e.name));if(T.current=T.current||[],e.length>1){let t=0;T.current=T.current.filter((n=>"jetpack/button"!==n.name||(t++,t===e.length))),u(n,T.current)}else 0===e.length&&u(n,[...T.current,(0,s.createBlock)("jetpack/button",{label:__("Submit","jetpack"),element:"button",text:__("Submit","jetpack"),borderRadius:8,lock:{remove:!0}})]);T.current=[]}}),[n,u]);return(0,a.X_)({askQuestionOptions:{postId:y},onDone:e=>{D(e,!0),_("")},onSuggestion:D,onError:I}),(0,p.G)(t.name,{clientId:t.clientId})?(0,r.createElement)(g.v,{value:z},(0,r.createElement)(o.KeyboardShortcuts,{shortcuts:{"mod+/":()=>b(n,A)}},(0,r.createElement)(e,t))):(0,r.createElement)(e,t)}),"withUiHandlerDataProvider")},63206:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6895),a=n(13419),s=n(46867),o=n(18135);function i(){const{nextTier:e,tierPlansEnabled:t}=(0,o.Z)(),n=t?(0,r.Z)("jetpack-ai-yearly-tier-upgrade-nudge",{site:(0,a.lQ)(),path:`jetpack_ai_yearly:-q-${e?.limit}`,query:`redirect_to=${window.location.href}`}):(0,r.Z)("jetpack-ai-monthly-plan-ai-assistant-block-banner",{site:(0,a.lQ)()}),i=(0,a.Ug)()||(0,a.Wp)()?n:`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/add-jetpack-ai`,{autosaveAndRedirect:l,isRedirecting:c}=(0,s.Z)(i);return{checkoutUrl:i,autosaveAndRedirect:l,isRedirecting:c}}},18135:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9818);function a(){const{data:e,loading:t}=(0,r.useSelect)((e=>{const{getAiAssistantFeature:t,getIsRequestingAiAssistantFeature:n}=e("wordpress-com/plans");return{data:t(),loading:n()}}),[]),{fetchAiAssistantFeature:n,increaseAiAssistantRequestsCount:a}=(0,r.useDispatch)("wordpress-com/plans");return{...e,loading:t,error:null,refresh:n,increaseRequestsCount:a}}},42890:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6975),a=n(69307);const s=window?.Jetpack_Editor_Initial_State?.tracksUserData||null,o=parseInt(window?.Jetpack_Editor_Initial_State?.wpcomBlogId)||0,i=()=>((0,a.useEffect)((()=>{s&&r.Z.initialize(s?.userid,s?.username,o?{blog_id:o}:{})}),[]),r.Z)},60751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(42290),a=n(4981),s=n(9818),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(27298),d=n(63634),p=n(854);const __=i.__,m=c()("jetpack-ai-assistant:event"),h=c()("jetpack-ai-assistant:prompt"),g=({attributes:e,clientId:t,content:n,setError:i,tracks:l,userPrompt:c,onSuggestionDone:g,onUnclearPrompt:f,onModeration:b,requireUpgrade:v,requestingState:k})=>{const[y,w]=(0,o.useState)(!1),[E,_]=(0,o.useState)(!1),[C,x]=(0,o.useState)(!1),[j,S]=(0,o.useState)(!1),[P,N]=(0,o.useState)(""),{updateBlockAttributes:L}=(0,s.useDispatch)("core/block-editor"),{dequeueAiAssistantFeatureAyncRequest:T,setAiAssistantFeatureRequireUpgrade:A}=(0,s.useDispatch)("wordpress-com/plans"),[M,R]=(0,o.useState)(k||"init"),Z=(0,o.useRef)(),B=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("title")));let I=!1;const z=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("categories")))||[],D=(0,s.useSelect)((e=>z.map((t=>{const n=e("core").getEntityRecord("taxonomy","category",t);if(n)return n;I=!0})).filter(Boolean)),[z]),F=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("tags")),[])||[],O=(0,s.useSelect)((e=>F.map((t=>{const n=e("core").getEntityRecord("taxonomy","post_tag",t);if(n)return n;I=!0})).filter(Boolean)),[F]);(0,o.useEffect)((()=>(w(I),()=>{Z?.current&&(m("Cleaning things up..."),Z?.current?.close())})),[I,Z]);const U=(0,s.useSelect)((e=>e("core/editor").getCurrentPostId())),H=(D.filter((e=>1!==e.id)).map((({name:e})=>e)).join(", "),O.map((({name:e})=>e)).join(", "),async(o,g={})=>{T();const k=g?.functions?.reduce(((e,{name:t,implementation:n})=>({...e,[t]:n})),{});if(v)return R("error"),_(!1),x(!1),S(!1),void i({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"});if(g={retryRequest:!1,tone:u.Nj,...g},E)return;S(!1),i({});let y=P;l.recordEvent("jetpack_ai_chat_completion",{post_id:U});const w=[...e.messages]??[];let C={};if(g.retryRequest)C=y[y.length-1];else{const r=e?.isLayoutBuldingModeEnable?(0,p.WN)(t):(0,p.xN)();y=(0,d.Iq)({generatedContent:n,allPostContent:r,postContentAbove:(0,p.h7)(t),currentPostTitle:B,options:g,userPrompt:c,type:o,isGeneratingTitle:"generateTitle"===e.promptType,useGutenbergSyntax:!!e?.useGutenbergSyntax,customSystemPrompt:e?.customSystemPrompt}),C=y.pop(),y=[...y,...w],y.push(C),N(y),"generateTitle"!==e.promptType&&L(t,{promptType:o})}try{_(!0),x(!0),y.forEach((({role:e,content:t},n)=>h("(%s/%s) %o\n%s",n+1,y.length,`[${e}]`,t))),R("requesting"),Z.current=await(0,r.jt)(y,{postId:U,requireUpgrade:v,feature:e?.useGpt4?"ai-assistant-experimental":"ai-assistant",functions:g?.functions}),R("suggesting")}catch(e){e.message?i({message:e.message,code:e?.code||"unknown",status:"error"}):i({message:__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack"),code:"unknown",status:"error"}),S(!0),_(!1),x(!1)}const j=async t=>{const{detail:n}=t,a={role:"assistant",content:null,function_call:n},s=await(k[n.name]?.(JSON.parse(n.arguments))),o={role:"function",name:n?.name,content:JSON.stringify(s)};y=[...y,a,o],Z?.current?.removeEventListener("function_done",j),Z?.current?.removeEventListener("done",M),Z?.current?.removeEventListener("error_unclear_prompt",I),Z?.current?.removeEventListener("error_network",D),Z?.current?.removeEventListener("error_context_too_large",z),Z?.current?.removeEventListener("error_service_unavailable",F),Z?.current?.removeEventListener("error_quota_exceeded",O),Z?.current?.removeEventListener("error_moderation",H),Z?.current?.removeEventListener("suggestion",q),Z.current=await(0,r.jt)(y,{postId:U,requireUpgrade:v,feature:e?.useGpt4?"ai-assistant-experimental":null,functions:g.functions}),Z?.current?.addEventListener("function_done",j),Z?.current?.addEventListener("done",M),Z?.current?.addEventListener("error_unclear_prompt",I),Z?.current?.addEventListener("error_network",D),Z?.current?.addEventListener("error_context_too_large",z),Z?.current?.addEventListener("error_service_unavailable",F),Z?.current?.addEventListener("error_quota_exceeded",O),Z?.current?.addEventListener("error_moderation",H),Z?.current?.addEventListener("suggestion",q)},M=n=>{const{detail:r}=n;R("done");const o=r.replaceAll(d._W,""),i={role:"assistant",content:o};w.push(C,i),h("Add %o\n%s",`[${C.role}]`,C.content),h("Add %o\n%s",`[${i.role}]`,i.content),w.length>20&&w.splice(0,w.length-20),V();const l=e?.useGutenbergSyntax;if(L(t,{content:o,messages:w}),!l)return;const{replaceInnerBlocks:c}=(0,s.dispatch)("core/block-editor"),u=(0,a.parse)(r).filter((e=>e.isValid));c(t,u)},I=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),i({code:"error_unclear_prompt",message:__("Your request was unclear. Mind trying again?","jetpack"),status:"info"}),f?.()},z=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),S(!1),i({code:"error_context_too_large",message:__("The content is too large to be processed all at once. Please try to shorten it or divide it into smaller parts.","jetpack"),status:"info"})},D=({detail:r})=>{R("error");const{name:a,message:s}=r;"TypeError"===a&&"Failed to fetch"===s&&(w.splice(0,8),L(t,{messages:w}),y=(0,d.Iq)({generatedContent:n,allPostContent:(0,p.xN)(),postContentAbove:(0,p.h7)(t),currentPostTitle:B,options:g,userPrompt:c,type:o,isGeneratingTitle:"generateTitle"===e.promptType,useGutenbergSyntax:!!e?.useGutenbergSyntax,customSystemPrompt:e?.customSystemPrompt}),N([...y,...w,C])),Z?.current?.close(),_(!1),x(!1),S(!0),i({code:"error_network",message:__("It was not possible to process your request. Mind trying again?","jetpack"),status:"info"})},F=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),S(!0),i({code:"error_service_unavailable",message:__("Jetpack AI services are currently unavailable. Sorry for the inconvenience.","jetpack"),status:"info"})},O=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),S(!1),A(!0),i({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"})},H=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),S(!1),i({code:"error_moderation",message:__("This request has been flagged by our moderation system. Please try to rephrase it and try again.","jetpack"),status:"info"}),b?.()},q=e=>{x(!1),m("(suggestion)",e?.detail),L(t,{content:e?.detail?.replaceAll(d._W,"")})};return Z?.current?.addEventListener("function_done",j),Z?.current?.addEventListener("done",M),Z?.current?.addEventListener("error_unclear_prompt",I),Z?.current?.addEventListener("error_network",D),Z?.current?.addEventListener("error_context_too_large",z),Z?.current?.addEventListener("error_service_unavailable",F),Z?.current?.addEventListener("error_quota_exceeded",O),Z?.current?.addEventListener("error_moderation",H),Z?.current?.addEventListener("suggestion",q),Z?.current});function V(){Z?.current&&(Z?.current?.close(),_(!1),x(!1),g?.(),R("done"))}return{isLoadingCategories:y,isLoadingCompletion:E,wasCompletionJustRequested:C,setIsLoadingCategories:w,setShowRetry:S,showRetry:j,postTitle:B,contentBefore:(0,p.h7)(t),wholeContent:(0,p.xN)(),requestingState:M,getSuggestionFromOpenAI:H,stopSuggestion:V,retryRequest:()=>H("",{retryRequest:!0})}}},71449:(e,t,n)=>{"use strict";n.d(t,{b:()=>u,d:()=>d});var r=n(13419),a=n(51128),s=n.n(a);const o=window?.JP_CONNECTION_INITIAL_STATE,i=s()("jetpack-ai-assistant:connection");let l=!1;const c=e=>{l||(i(e),l=!0)};function u(){return(0,r.Wp)()?(c("Simple site connected ✅"),!0):(0,r.Ug)()?(c("Atomic site connected ✅"),!0):o?.connectionStatus?.isUserConnected?(c("Jetpack user is connected ✅"),!0):(c("User is not connected ❌"),!1)}function d(){if((0,r.Wp)())return!0;return!1==!(o?.userConnectionData?.currentUser?.permissions??{}).manage_options}},3687:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(86989),a=n.n(r),s=n(65736);const __=s.__;function o(e,t,n,r,s,o){n(!0),s(null),t({requestedPrompt:e}),a()({path:"/wpcom/v2/jetpack-ai/images/generations",method:"POST",data:{prompt:e,post_id:o}}).then((e=>{n(!1);const t=e.data.map((e=>"data:image/png;base64,"+e.b64_json));r(t)})).catch((e=>{e.message?s(e.message):s(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),n(!1)}))}},57832:(e,t,n)=>{"use strict";n.d(t,{v_:()=>i,x1:()=>l});var r=n(63634);const a="title",s="content",o=null;function i(e,t){return{role:"jetpack-ai",context:{type:"ai-assistant-initial-prompt",for:u(e),...t?.length?{custom_system_prompt:t}:{}}}}function l({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:a,options:s,type:o,userPrompt:i,isGeneratingTitle:l}){const u=[],d="generated"===s?.contentType;let p=null;switch(o){case r.qA:p=a;break;case r.sz:case r.hI:case r.Hd:p=n;break;case r.jf:p=t;break;case r.TV:case r.DR:p=e;break;case r.Lg:case r.Lq:case r.Nw:p=d?e:t;break;case r.Gh:p=e||t}const m=function(e,t){return!e&&t?.length>0?{role:"jetpack-ai",context:{type:"ai-assistant-relevant-content",content:t}}:null}(o===r.Gh?!!e?.length:d,p);return m&&u.push(m),u.push({role:"jetpack-ai",context:c({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:a,options:s,type:o,userPrompt:i,isGeneratingTitle:l})}),u}function c({options:e,type:t,userPrompt:n,isGeneratingTitle:i}){const l=function(e,t,n){return e?a:!t||n?s:o}(i,"generated"===e?.contentType,e?.fromExtension||!1);return{type:u(t),...l?{subject:l}:{},...t===r.Lg&&e?.tone?{tone:e.tone}:{},...t===r.Nw&&e?.language?{language:e.language}:{},...t===r.Gh&&n?{request:n}:{}}}function u(e){return{[r.qA]:"ai-assistant-summary-by-title",[r.sz]:"ai-assistant-continue-writing",[r.hI]:"ai-assistant-simplify",[r.Hd]:"ai-assistant-correct-spelling",[r.jf]:"ai-assistant-generate-title",[r.TV]:"ai-assistant-make-longer",[r.DR]:"ai-assistant-make-shorter",[r.Lg]:"ai-assistant-change-tone",[r.Lq]:"ai-assistant-summarize",[r.Nw]:"ai-assistant-change-language",[r.Gh]:"ai-assistant-user-prompt"}[e]}},63634:(e,t,n)=>{"use strict";n.d(t,{DR:()=>p,Gh:()=>f,Hd:()=>c,Iq:()=>T,Lg:()=>m,Lq:()=>h,Nw:()=>g,Re:()=>b,SV:()=>v,TV:()=>d,_W:()=>y,hI:()=>l,jf:()=>u,qA:()=>o,r1:()=>A,sz:()=>i,t4:()=>w});var r=n(51128),a=n.n(r),s=n(57832);const o="titleSummary",i="continue",l="simplify",c="correctSpelling",u="generateTitle",d="makeLonger",p="makeShorter",m="changeTone",h="summarize",g="changeLanguage",f="userPrompt",b="jetpackFormCustomPrompt",v=!0,k=a()("jetpack-ai-assistant:prompt"),y="````";function w({context:e="You are an advanced polyglot ghostwriter. Your task is to generate and modify content based on user requests. This functionality is integrated into the Jetpack product developed by Automattic. Users interact with you through a Gutenberg block, you are inside the WordPress editor",rules:t,useGutenbergSyntax:n=!1,useMarkdown:r=!0,customSystemPrompt:a=null}){let s="";t?.length&&(s=t.map((e=>`- ${e}.`)).join("\n")+"\n");let o=`${e}. Strictly follow these rules:\n\n${s}${r?"- Format your responses in Markdown syntax, ready to be published.":""}\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`;return n&&(o=`${e}. Strictly follow these rules:\n\t\n${s}- Format your responses in Gutenberg HTML format including HTML comments for WordPress blocks. All responses must be valid Gutenberg HTML.\n- Use only WordPress core blocks\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`),a&&(o=a),{role:"system",content:o}}function E(e){return`${y}${e.replaceAll(y,"")}${y}`}function _({content:e,role:t="user"}){return[{role:t,content:`Repeat the text delimited with ${y}, without the delimiter, correcting any spelling and grammar mistakes directly in the text without providing feedback about the corrections, keeping the language of the text: ${E(e)}`}]}function C({content:e,role:t="user"}){return[{role:t,content:`Simplify the text delimited with ${y}, using words and phrases that are easier to understand and keeping the language of the text: ${E(e)}`}]}function x({content:e,role:t="user"}){return[{role:t,content:`Summarize the text delimited with ${y}, keeping the language of the text: ${E(e)}`}]}function j({content:e,role:t="user"}){return[{role:t,content:`Expand the text delimited with ${y} to about double its size, keeping the language of the text: ${E(e)}`}]}function S({content:e,language:t,role:n="user"}){return[{role:n,content:`Translate the text delimited with ${y} to ${t}, preserving the same core meaning and tone: ${E(e)}`}]}function P({content:e,tone:t,role:n="user"}){return[{role:n,content:`Rewrite the text delimited with ${y}, with a ${t} tone, keeping the language of the text: ${E(e)}`}]}function N({content:e,request:t}){if(!t)throw new Error("You must provide a custom prompt for the Jetpack Form Custom Prompt");return[{role:"jetpack-ai",context:{type:"form-ai-extension",content:e,request:t}}]}const L=({rules:e=[],request:t=null,relevantContent:n=null,isContentGenerated:r=!1,isGeneratingTitle:a=!1,useGutenbergSyntax:s=!1,customSystemPrompt:o=null})=>{if(!t&&!n)throw new Error("You must provide either a request or content");const i=[w({rules:e,useGutenbergSyntax:s,customSystemPrompt:o})];if(null!=n&&n?.length){const e=n.replaceAll(y,"");r||i.push({role:"user",content:`The specific relevant content for this request, if necessary, delimited with ${y} characters: ${y}${e}${y}`})}const l={role:"user",content:t};return a&&(l.content+=" Only output a title, do not generate body content."),i.push(l),i.forEach((e=>{k(`Role: ${e?.role}.\nMessage: ${e?.content}\n---`)})),i};function T({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:r,options:a,type:b,userPrompt:k,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E}){if(v){return[(0,s.v_)(b,E),...(0,s.x1)({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:r,options:a,type:b,userPrompt:k,isGeneratingTitle:y})]}const _="generated"===a?.contentType,C=function(e,t=!1,n){const r="generated"===n?.contentType;let a="the title";t||(a=r?"your last answer":"the content");const s=`. Do not switch to any language other than the language of ${a} in your response`;switch(e){case o:return{request:`Write a short piece for a blog post based on ${a}, keeping the same language`};case i:return{request:`Continue writing from ${a}${s}.`,rules:r?[]:["Only output the continuation of the content, without repeating it"]};case l:return{request:`Simplify ${a}${s}.`,rules:["Use words and phrases that are easier to understand for non-technical people","Use as much of the original language as possible"]};case c:return{request:`Repeat ${a}, correcting any spelling and grammar mistakes, and do not add new content${s}.`};case u:return{request:"Generate a new title for this blog post and only output the title.",rules:["Only output the raw title, without any prefix or quotes"]};case d:return{request:`Make ${a} longer${s}.`};case p:return{request:`Make ${a} shorter${s}.`};case m:return{request:`Rewrite ${a} with ${/^[aeiou]/i.test(n.tone)?"an":"a"} ${n.tone} tone${s}.`};case h:return{request:`Summarize ${a}${s}.`};case g:return{request:`Translate ${a} to the following language: ${n.language}.`};default:return null}}(b,y,a);if(b!==f){let a;switch(b){case o:a=r;break;case i:case l:case c:a=n;break;case u:a=t;break;case d:case p:a=e;break;case m:case h:case g:a=_?e:t}return L({...C,relevantContent:a,isContentGenerated:_,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E})}return L({request:k,relevantContent:e||t,isContentGenerated:!!e?.length,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E})}function A(e,t){k("Addressing prompt type: %o %o",e,t);const{prevMessages:n=[]}=t,r={role:"system",content:"You are an advanced polyglot ghostwriter. Your task is to help the user create and modify content based on their requests.\nWriting rules:\n- Execute the request without any acknowledgment or explanation to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n"},a=[...n];switch(a.push(r),e){case c:return[...a,..._(t)];case l:return[...a,...C(t)];case h:return[...a,...x(t)];case d:return[...a,...j(t)];case g:return[...a,...S(t)];case m:return[...a,...P(t)];case b:return[...n,...N(t)];default:throw new Error(`Unknown prompt type: ${e}`)}}},74359:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r=new(n(92213).Z)({emDelimiter:"_",headingStyle:"atx"});r.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}});const a=r},854:(e,t,n)=>{"use strict";n.d(t,{WN:()=>l,h7:()=>o,t$:()=>c,xN:()=>i});var r=n(4981),a=n(9818),s=n(74359);function o(e){if(!e)return"";const t=(0,a.select)("core/block-editor"),n=t.getBlockIndex(e),o=t.getBlocks().slice(0,n)??[];return o?.length?s.Z.turndown((0,r.serialize)(o)):""}function i(){const e=(0,a.select)("core/block-editor").getBlocks();return e?.length?s.Z.turndown((0,r.serialize)(e)):""}function l(e){const t=(0,a.select)("core/block-editor").getBlock(e);return t?.innerBlocks?.length?t.innerBlocks.filter((e=>null!=e)).map((e=>(0,r.getBlockContent)(e.clientId))).join("\n\n"):""}function c(e){if(!e?.replace(/\s+/,"").length)return"";const t=document.createElement("div");t.innerHTML=e;const{textContent:n,innerText:r}=t;return n&&!n.replace(/\s+/,"").length||r&&!r.replace(/\s+/,"").length?"":t.textContent||t.innerText||""}},5863:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});const r=e=>{delete e.clientId;for(const t of e.innerBlocks??[])r(t);return e},a=e=>r((e=>JSON.parse(JSON.stringify(e)))(e));function s(e,t){const n=a(e),r=a(t);return JSON.stringify(n)===JSON.stringify(r)}},56359:(e,t,n)=>{"use strict";function r(e){const t=document.createElement("div");return t.innerHTML=e,t.innerHTML}n.d(t,{J:()=>r})},81765:(e,t,n)=>{"use strict";var r=n(4981),a=n(92694),s=n(54765),o=n(49259);(0,a.addFilter)("blocks.registerBlockType","jetpack/handle-jetpack-ai-supports",(function(e){const t=(0,r.getBlockSupport)(e,"jetpack/ai");return t&&t?.assistant&&(0,s.J7)()?{...e,edit:(0,o.ZP)(e.edit)}:e}),100)},6747:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u,b:()=>c});var r=n(4981),a=n(23536),s=n(54765),o=n(63634),i=n(74359);const l=[];function c(e,t){const{content:n,...s}=t;let l=n;"core/heading"===e&&t?.level&&(l=l.replace(/<(\/?)h\d([^>]*)>/g,`<$1h${t.level}$2>`));const c=i.Z.turndown(l),u=[];return o.SV?u.push({role:"jetpack-ai",context:{type:"ai-assistant-relevant-content",content:c}}):(u.push({role:"user",content:"Tell me some content for this block, please."}),u.push({role:"assistant",content:c})),(0,r.createBlock)(a.name,{...s,content:c,originalContent:c,messages:u,originalMessages:u})}for(const e of s.NP)l.push({type:"block",blocks:[e],isMatch:()=>(0,s.J7)(),transform:(t,n)=>{const a=(0,r.getSaveContent)(e,t,n);return c(e,{...t,content:a})}});const u={from:l}},98825:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);if(window?.Jetpack_Editor_Initial_State?.jetpack?.is_current_user_connected)return null;return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},56352:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{let e=window?.Jetpack_Editor_Initial_State?.adminUrl||"";e=e.replace(/wp-admin\/\?frame-nonce=[a-z0-9]+/,"wp-admin/");const t=`${e}admin.php?page=jetpack-search`,{autosaveAndRedirect:n,isRedirecting:a}=(0,o.Z)(t);if(window?.Jetpack_AIChatBlock?.jetpackSettings?.instant_search_enabled)return null;return(0,r.createElement)(s.p,{buttonText:__("Enable Jetpack Search","jetpack"),checkoutUrl:t,className:"jetpack-ai-connect-banner",description:__("You need to enable Jetpack Search so that Jetpack AI can index your site.","jetpack"),goToCheckoutPage:e=>{n(e)},isRedirecting:a,visible:!0,align:null,title:null,context:null})}},23719:(e,t,n)=>{"use strict";n.d(t,{V:()=>l});var r=n(51806),a=n(52175),s=n(55609),o=n(37798),i=n(65736);const __=i.__;function l({setAttributes:e,placeholder:t,showCopy:n,showFeedback:i,showSources:l}){const[c,u]=(0,o.useEntityProp)("root","site","jetpack_search_ai_prompt_override");return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,r.createElement)(s.BaseControl,{label:__("Placeholder Text","jetpack"),className:"jetpack-ai-chat__ask-button-text"},(0,r.createElement)(s.TextControl,{placeholder:__("Ask a question about this site.","jetpack"),onChange:t=>e({placeholder:t}),value:t})))),(0,r.createElement)(a.InspectorAdvancedControls,null,(0,r.createElement)(s.BaseControl,{label:__("Additional instructions","jetpack"),help:__("Give Jetpack AI additional instructions for answer length, format, and tone.","jetpack")},(0,r.createElement)(s.TextareaControl,{value:c,onChange:u})),(0,r.createElement)(s.ToggleControl,{label:__("Show copy answer button.","jetpack"),help:__("Allow users to easily copy the answer.","jetpack"),checked:n,onChange:t=>e({showCopy:t})}),(0,r.createElement)(s.ToggleControl,{label:__("Show rating button.","jetpack"),help:__("Allow users to rate the answer and give feedback.","jetpack"),checked:i,onChange:t=>e({showFeedback:t})}),(0,r.createElement)(s.ToggleControl,{label:__("Show list of sources.","jetpack"),help:__("Show used sources at the bottom of the answer.","jetpack"),checked:l,onChange:t=>e({showSources:t})})))}},74021:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(51806),a=n(42290),s=n(52175),o=n(55609),i=n(9818),l=n(98825),c=n(56352),u=n(23719);function d({attributes:e,setAttributes:t,clientId:n}){const d=(0,s.useBlockProps)(),p=(0,i.useSelect)((e=>e("core/block-editor").isBlockSelected(n)),[n]);return(0,r.createElement)("div",d,(0,r.createElement)(l.Z,null),(0,r.createElement)(c.Z,null),(0,r.createElement)("div",{className:"jetpack-ai-chat-question-wrapper"},(0,r.createElement)(o.TextControl,{className:"jetpack-ai-chat-question-input",placeholder:e.placeholder,disabled:!0}),(0,r.createElement)(s.RichText,{className:"wp-block-button__link jetpack-ai-chat-question-button",onChange:e=>t({askButtonLabel:e}),value:e.askButtonLabel,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),p&&(0,r.createElement)(a.Eo,null),(0,r.createElement)(s.InspectorControls,null,(0,r.createElement)(u.V,{askButtonLabel:e.askButtonLabel,placeholder:e.placeholder,setAttributes:t,showCopy:e.showCopy,showFeedback:e.showFeedback,showSources:e.showSources})))}},86116:(e,t,n)=>{"use strict";var r=n(31985),a=n(21540),s=n(74021),o=n(148);(0,r.S)(a,{edit:s.Z,save:o.Z})},148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(51806),a=n(52175);function s({attributes:e}){const t=a.useBlockProps.save({"data-ask-button-label":e.askButtonLabel});return(0,r.createElement)("div",t)}},77567:(e,t,n)=>{"use strict";n.d(t,{K:()=>r});const r=["A digital Illustration of the a purely mechanical television, 4k, detailed, fantasy vivid colors","3D render of a floating futuristic castle in a clear sky, digital art","Hedgehog smelling a flower | clear blue sky | intricate artwork by Beatrix Potter | cottagecore aesthetic | 8K | highly detailed | wide angle |","Hyper realistic photo of a high end futuristic single-level house where walls are made of windows, light coming through the window, mid century modern style, cinematic lighting","Pink ape Astronaut in space holding a claymate in a photorealistic style, digital art","Studio photography set of high detail irregular marble stones with gold lines stacked in impossible balance, perfect composition, cinematic light photo studio, beige color scheme, indirect lighting, 8k, elegant and luxury style","Ultrawide, highway, with golden ratio style, 4K , sides are prairies, light is Golden hour, sky with red Clouds, ultrarealistic, CinémaScope, ultra wide format, ratio 16/9, 1/1000 sec, maximum resolution, Sharp details","A photo of cat flying out to space as an astronaut, digital art","A hyper realistic rilakkuma enjoying an icecream in the snow","A lush tropical forest with a waterfall.","A majestic snowy mountain peak.","A beautiful sunset over a beach.","A serene lake surrounded by trees.","A picturesque countryside with rolling hills.","A colorful hot air balloon in the sky.","A peaceful Zen garden.","A grand castle on a hill.","A lively street market in a bustling city.","A delightful flower garden in full bloom.","A cozy cabin in the woods.","A vibrant coral reef teeming with sea life.","A classic European city with cobblestone streets.","A stunning waterfall cascading into a crystal clear pool.","A secluded cabin on the edge of a lake.","A beautiful desert landscape with sand dunes.","A majestic elephant in its natural habitat.","A charming countryside village with thatched roof cottages.","A dreamy castle floating on a cloud.","A whimsical tree house in a forest.","A vibrant city skyline at night.","A picturesque vineyard with rows of grapevines.","A peaceful Japanese garden with a koi pond.","A charming lighthouse on a rocky coastline.","A beautiful waterfall surrounded by greenery.","A dreamy castle with a moat and drawbridge.","A colorful hot air balloon festival.","A beautiful garden with a fountain and sculptures.","A picturesque countryside with a windmill.","A stunning mountain landscape with a rainbow."]},84295:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(13419),s=n(86989),o=n.n(s),i=n(52175),l=n(4981),c=n(55609),u=n(9818),d=n(69307),p=n(65736),m=n(77567);const __=p.__;function h({attributes:e,setAttributes:t,clientId:n}){const[s,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)([]),[f,b]=(0,d.useState)(null),[v,k]=(0,d.useState)(""),{replaceBlock:y}=(0,u.useDispatch)(i.store),[w,E]=(0,d.useState)(null),[_]=(0,d.useState)((C=m.K)[Math.floor(Math.random()*C.length)]);var C;const x=__("Retry","jetpack"),j=__("Submit","jetpack"),S=w?x:j,{tracks:P}=(0,a.z$)(),{mediaUpload:N}=(0,u.useSelect)((e=>{const{getSettings:t}=e(i.store);return{mediaUpload:t().mediaUpload}}),[]),L=(0,u.useSelect)((e=>e("core/editor").getCurrentPostId())),T=({image:e,inModal:t=!1})=>(0,r.createElement)(c.Flex,{direction:"column"},t&&(0,r.createElement)(c.FlexItem,{style:{"text-align":"center"}},(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>A(e)},__("Use this image","jetpack"))),(0,r.createElement)(c.FlexBlock,null,(0,r.createElement)("img",{className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>b(e)})),!t&&(0,r.createElement)(c.FlexBlock,null,(0,r.createElement)(c.Flex,{direction:"column",style:{"align-items":"center"}},(0,r.createElement)(c.FlexItem,null,(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>A(e)},__("Use this image","jetpack")))))),A=async t=>{if(s)return;p(!0),E(null);const r=await fetch(t),a=await r.blob(),o=new File([a],"jetpack_ai_image.png",{type:"image/png"});N({filesList:[o],onFileChange:([t])=>{t.id&&y(n,(0,l.createBlock)("core/image",{url:t.url,caption:e.requestedPrompt,alt:e.requestedPrompt}))},allowedTypes:["image"],onError:e=>{console.error(e),p(!1)}}),P.recordEvent("jetpack_ai_dalle_generation_upload",{post_id:L})};return(0,r.createElement)("div",(0,i.useBlockProps)(),(0,r.createElement)(c.Placeholder,{label:__("AI Image","jetpack"),notices:w&&[(0,r.createElement)("div",null,w)]},!s&&0===h.length&&(0,r.createElement)(c.Flex,{expanded:!0},(0,r.createElement)(c.FlexBlock,null,(0,r.createElement)(c.TextareaControl,{label:__("What would you like to see?","jetpack"),placeholder:_,allowedFormats:[],onChange:k,rows:6}),(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>{p(!1),g([]),E(null),function(e,t,n,r,a,s){n(!0),a(null),t({requestedPrompt:e}),o()({path:"/wpcom/v2/jetpack-ai/images/generations",method:"POST",data:{prompt:e,post_id:s}}).then((e=>{n(!1);const t=e.data.map((e=>"data:image/png;base64,"+e.b64_json));r(t)})).catch((e=>{e.message?a(e.message):a(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),n(!1)}))}(""===v.trim()?_:v,t,p,g,E,L),P.recordEvent("jetpack_ai_dalle_generation",{post_id:L})}},S))),!s&&h.length>0&&(0,r.createElement)(c.Flex,{direction:"column",style:{width:"100%"}},(0,r.createElement)(c.FlexBlock,{style:{textAlign:"center",margin:"12px",fontStyle:"italic",width:"100%"}},e.requestedPrompt),(0,r.createElement)(c.FlexBlock,{style:{fontSize:"20px",lineHeight:"38px"}},__("Please choose your image","jetpack")),(0,r.createElement)(c.Flex,{direction:"row",wrap:!0},h.map((e=>(0,r.createElement)(T,{image:e}))))),!s&&f&&(0,r.createElement)(c.Modal,{onRequestClose:()=>b(null)},(0,r.createElement)(T,{image:f,inModal:!0})),e.content&&(0,r.createElement)("div",{className:"content"},e.content),s&&(0,r.createElement)(c.FlexBlock,{style:{padding:"10px",textAlign:"center"}},(0,r.createElement)(c.Spinner,{style:{height:"calc(4px * 20)",width:"calc(4px * 20)"}}))))}},6454:(e,t,n)=>{"use strict";var r=n(31985),a=n(41107),s=n(84295);(0,r.S)(a,{edit:s.Z,save:()=>""})},55410:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(86989),o=n.n(s),i=n(52175),l=n(55609),c=n(9818),u=n(69307),d=n(65736),p=n(59958);const __=d.__,m=(e="",t=[],n="",r="")=>{const a=t.filter((function(e){return e&&e.attributes&&e.attributes.content})).map((function(e){return e.attributes.content.replaceAll("
    ","\n")})).join("\n").slice(-1024);if(!(e||a||n||r))return!1;let s="";return s=e?(0,d.sprintf)(/** translators: This will be the beginning of a prompt that will be sent to OpenAI based on the post title. */ __("Please help me write a short piece of a blog post titled '%1$s'","jetpack"),e):__("Please help me write a short piece of a blog post","jetpack"),n&&( diff --git a/_inc/blocks/editor-experimental.asset.php b/_inc/blocks/editor-experimental.asset.php index 0de8dc1897..1834bf8e9c 100644 --- a/_inc/blocks/editor-experimental.asset.php +++ b/_inc/blocks/editor-experimental.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '162bf27545f0a9062fad'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '77f959dd51d857cf2c7e'); diff --git a/_inc/blocks/editor-experimental.js b/_inc/blocks/editor-experimental.js index a071a53d45..e26626a39c 100644 --- a/_inc/blocks/editor-experimental.js +++ b/_inc/blocks/editor-experimental.js @@ -4,9 +4,9 @@ _n("This post will be shared to %d connection.","This post will be shared to %d _n("%d character remaining","%d characters remaining",o,"jetpack"),o)})}},62578:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(55609),a=n(65736),s=n(61074),o=n(6163),i=n(65235),l=n.n(i),c=n(25162),u=n.n(c),d=n(82283);const __=a.__,p=({children:e,type:t="default",actions:n=[],onDismiss:a})=>{const i=l()(d.Z.notice,d.Z[`notice--${t}`]);return React.createElement("div",{className:i},React.createElement("div",{className:d.Z.content}," ",e," "),a&&React.createElement("button",{className:d.Z.dismiss,onClick:a},React.createElement(r.VisuallyHidden,null,__("Dismiss notice","jetpack")),React.createElement(s.Z,{icon:o.Z})),n&&n.length>0&&React.createElement("div",{className:d.Z.actions},n.map((e=>e))))};p.propTypes={children:u().node.isRequired,type:u().oneOf(["default","highlight","warning","error"]),actions:u().arrayOf(u().element),onDismiss:u().func};const m=p},8714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(55609),a=n(9818),s=n(12238),o=n(69307),i=n(65736),l=n(14085),c=n(86419),u=n(37568),d=n(49021),p=n(95788),m=n(3176),h=n(91474),g=n(23761);const __=i.__,f=({prePublish:e,children:t})=>{const{refresh:n,hasConnections:i,hasEnabledConnections:f}=(0,u.Z)(),b=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),{isPublicizeEnabled:v,hidePublicizeFeature:k,togglePublicizeFeature:y}=(0,l.Z)();(0,c.M1)((function(){f&&n()}),[f,n]);const w=e?o.Fragment:r.PanelBody,E=e?{}:{title:__("Share this post","jetpack"),className:g.Z.panel};return React.createElement(w,E,t,!k&&React.createElement(o.Fragment,null,!b&&React.createElement(r.ToggleControl,{label:v?__("Share when publishing","jetpack"):__("Sharing is disabled","jetpack",0),onChange:y,checked:v,disabled:!i}),React.createElement(d.Z,null),React.createElement(p.Z,null),React.createElement(h.o,null)),b&&React.createElement(m.u,null))}},91750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(88275),a=n(13419),s=n(9818),o=n(72067),i=n(12238),l=n(65736),c=n(37548),u=n(34607),d=n(45078);const __=l.__;function p(){const{isCurrentPostPublished:e}=(0,s.useSelect)((e=>e(i.store)),[]);return e()?React.createElement(o.PluginPostPublishPanel,{initialOpen:!0,title:__("Manual sharing","jetpack"),id:"publicize-manual-sharing",icon:React.createElement(a.Pm,null)},React.createElement(r.ZP,null,React.createElement(c.T,{className:d.Z.description,variant:"body-small"}),React.createElement(u.n,null))):null}},52403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(6895),a=n(13419),s=n(86989),o=n.n(s),i=n(72067),l=n(69307),c=n(14085),u=n(86419),d=n(37568),p=n(19649);const m=()=>{const[e,t]=(0,l.useState)((0,a.Pb)()?.social?.reviewRequestDismissed??!0),[n,s]=(0,l.useState)(!1),{hasEnabledConnections:m}=(0,d.Z)(),{isPublicizeEnabled:h,isPostAlreadyShared:g}=(0,c.Z)();(0,u.e3)((()=>{s(!g&&h&&m)}),[g,m,h]);const f=(0,l.useCallback)((()=>{const e=(0,a.Pb)()?.social?.dismissReviewRequestPath??null;o()({path:e,method:"POST",data:{dismissed:!0}}).catch((e=>{throw e})),t(!0)}),[]);return e||!n?null:React.createElement(i.PluginPostPublishPanel,{id:"publicize-title"},React.createElement(p.Z,{href:(0,r.Z)("jetpack-social-plugin-reviews"),onClose:f}))}},77106:(e,t,n)=>{"use strict";n(9818),n(23177)},19649:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(88275),a=n(90526),s=n(13419),o=n(65736),i=n(99196),l=n(2097);const __=o.__,c=({href:e,onClose:t})=>{const{recordEvent:n}=(0,s.z$)({pageViewEventName:"social_plugin_review_prompt",pageViewNamespace:"jetpack",pageViewSuffix:"view"}),c=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_new_review_click")}),[n]),u=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_dismiss_click"),t()}),[n,t]);return React.createElement(r.ZP,null,React.createElement("div",{className:l.Z.prompt},React.createElement("h2",{className:l.Z.header},/* translators: %s is the celebration emoji */ /* translators: %s is the celebration emoji */ (0,o.sprintf)(__("Presto! %s","jetpack"),String.fromCodePoint(127881))),React.createElement("p",null,__("Just like that, Jetpack Social has shared your post to your connected social accounts.","jetpack")),React.createElement("p",null,__("Please leave a review to let others know how easy getting your posts on social media can be!","jetpack")),React.createElement("div",{className:l.Z.buttons},React.createElement(a.Z,{onClick:c,isExternalLink:!0,href:e,className:l.Z.button},__("Leave a Review","jetpack")),React.createElement(a.Z,{onClick:u,variant:"link",className:l.Z.button},__("Dismiss","jetpack")))))}},69709:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(65736),a=n(14085),s=n(78619);const __=r.__;function o(){const{connectionsAdminUrl:e}=(0,a.Z)();return React.createElement("a",{className:s.Z["settings-link"],href:e,target:"_blank",rel:"noreferrer",title:__("Connect an account","jetpack")},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",fill:"#F6F7F7"}),React.createElement("path",{d:"M19 13.3333H14.6667V9H13.3333V13.3333H9V14.6667H13.3333V19H14.6667V14.6667H19V13.3333Z",fill:"black"}),React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",stroke:"#A7AAAD",strokeWidth:"0.75",strokeDasharray:"2 2"})))}},2817:(e,t,n)=>{"use strict";n.d(t,{o:()=>a});var r=n(65736);const __=r.__,a=[{label:__("X","jetpack"),networkName:"x",url:"https://x.com/intent/tweet?text={{text}}&url={{url}}"},{label:__("WhatsApp","jetpack"),networkName:"whatsapp",url:"https://api.whatsapp.com/send?text={{text}}"},{label:__("Facebook","jetpack"),networkName:"facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"}]},22917:(e,t,n)=>{"use strict";n(34607)},34607:(e,t,n)=>{"use strict";n.d(t,{n:()=>g});var r=n(3396),a=n(90526),s=n(45106),o=n(14203),i=n(13419),l=n(69307),c=n(65736),u=n(65235),d=n.n(u),p=n(2817),m=n(30664),h=n(38730);const __=c.__;function g({buttonStyle:e="icon",buttonVariant:t}){const n=(0,h.S)(),{recordEvent:u}=(0,i.z$)(),g=(0,l.useCallback)((()=>{u("jetpack_social_share_button_clicked",{network:"clipboard"})}),[u]),f=(0,l.useCallback)((()=>n("{{text}}\n{{url}}",!1)),[n]),b=(0,l.useCallback)((function(e,t){return function(n){n.preventDefault(),u("jetpack_social_share_button_clicked",t),window.open(e,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}}),[u]);return React.createElement("div",{className:d()(m.Z["share-buttons"],{[m.Z.vertical]:e.includes("text")})},p.o.map((({label:o,networkName:i,url:l})=>{const u=n(l),d="icon"===e?React.createElement(r.av,{serviceName:i}):null,p=(0,c.sprintf)(/* translators: %s is the name of a social network, e.g. Twitter. */ __("Share on %s","jetpack"),o);return React.createElement("div",{className:m.Z.container,key:i},React.createElement(a.Z,{icon:d,variant:t,"aria-label":p,href:u,target:"_blank",rel:"noopener noreferrer",onClick:b(u,{network:i}),className:"icon"===e?m.Z[i]:"has-text"},"icon"===e?null:React.createElement(React.Fragment,null,"icon-text"===e&&React.createElement(r.av,{className:m.Z[i],serviceName:i}),React.createElement(s.ZP,{className:m.Z.label,component:"span"},p))))})),React.createElement("div",{className:m.Z.container},React.createElement(o.Z,{buttonStyle:e,onCopy:g,textToCopy:f,className:"icon"===e?m.Z.clipboard:" has-text",variant:t},"icon"===e?null:React.createElement(s.ZP,{className:m.Z.label,component:"span"},__("Copy to clipboard","jetpack")))))}},38730:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(9818),a=n(69307),s=n(71806);function o(){const{shareMessage:e}=(0,s.R)(),{message:t,link:n}=(0,r.useSelect)((t=>{const n=t("core/editor").getEditedPostAttribute;return{link:n("link"),message:e||n("meta")?.jetpack_seo_html_title||n("title")}}),[e]);return(0,a.useCallback)(((e,r=!0)=>{let a=t,s=n;return e.includes("{{url}}")||(a=a+"\n\n"+s,s=""),r&&(a=encodeURIComponent(a),s=encodeURIComponent(s)),e.replace("{{text}}",a).replace("{{url}}",s)}),[n,t])}},32637:(e,t,n)=>{"use strict";n.d(t,{r:()=>d});var r=n(43521),a=n(69307),s=n(65736),o=n(65235),i=n.n(o),l=n(73640);const __=s.__,_x=s._x,c={error:"var(--jp-red-50)",warning:"var(--jp-yellow-20)",default:"var(--jp-green)"},u={error:"var(--jp-red-50)",warning:"var(--jp-yellow-20)",default:"var(--jp-green-5)"},d=({usedCount:e,scheduledCount:t,remainingCount:n,className:s,noticeType:o="default",legendCaption:d})=>{const p=(0,a.useMemo)((()=>{const r=__("scheduled","jetpack"),a=__("used or scheduled","jetpack");return[("default"===o||0===t)&&{count:e,backgroundColor:c[o],label:__("used","jetpack")},t>0&&{count:"default"===o?t:t+e,backgroundColor:u[o],label:"default"===o?r:a},{count:n,backgroundColor:"var(--jp-gray-off)",label:_x("left","Referring to the quantity remaning, not the direction - left/right.","jetpack")}].filter(Boolean)}),[e,o,t,n]);return React.createElement("div",{className:i()(l.Z.wrapper,s)},React.createElement(r.Z,{totalCount:e+t+n,items:p,className:l.Z["bar-wrapper"],tableCaption:d,legendTitle:d,recordTypeLabel:__("Share type","jetpack"),recordCountLabel:__("Usage","jetpack")}))}},91474:(e,t,n)=>{"use strict";n.d(t,{o:()=>h});var r=n(55609),a=n(9818),s=n(12238),o=n(69307),i=n(65736),l=n(53961),c=n(14085),u=n(45579),d=n(37568);const __=i.__;function p(e=__("Unable to share the Post","jetpack")){const{createErrorNotice:t}=(0,a.dispatch)(l.store);t(e,{id:"publicize-post-share-message"})}function m(){const{hasEnabledConnections:e}=(0,d.Z)(),{isPublicizeEnabled:t}=(0,c.Z)(),{isFetching:n,isError:i,isSuccess:m,doPublicize:h}=(0,u.Z)(),g=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]);(0,o.useEffect)((()=>{if(!n)return i?p():void(m&&function(){const{createSuccessNotice:e}=(0,a.dispatch)(l.store);e(__("Post shared","jetpack"),{id:"publicize-post-share-message",type:"snackbar"})}())}),[n,i,m]);const f=!t||!e||!g||n,b=(0,o.useCallback)((()=>{if(!g)return p(__("You must publish your post before you can share it.","jetpack"));(0,a.dispatch)(l.store).removeNotice("publicize-post-share-message"),h()}),[h,g]);return React.createElement(r.Button,{variant:"secondary",onClick:b,disabled:f,isBusy:n},__("Share post","jetpack"))}function h(){const{isRePublicizeUpgradableViaUpsell:e}=(0,c.Z)();return(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[])?e?null:React.createElement(r.PanelRow,null,React.createElement(m,null)):null}},54005:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(55609),a=n(69307),s=n(65736),o=n(75263),i=n(9888),l=n(81469);const __=s.__,c=({prePublish:e=!1})=>{const t=e?a.Fragment:r.PanelBody,n=e?{}:{title:__("Social Image Generator","jetpack")},{isEnabled:s,setIsEnabled:c}=(0,o.Z)(),[u,d]=(0,a.useState)(!1),p=(0,a.useCallback)((()=>d(!0)),[]),m=(0,a.useCallback)((()=>d(!1)),[]);return React.createElement(t,n,u&&React.createElement(l.Z,{onClose:m}),React.createElement(r.ToggleControl,{label:__("Enable Social Image","jetpack"),help:s?"":__("Social Image is disabled for this post.","jetpack"),checked:s,onChange:c}),s&&React.createElement(React.Fragment,null,React.createElement("hr",null),React.createElement(i.ZP,null),React.createElement("hr",null),React.createElement(r.Button,{variant:"secondary",onClick:p,label:__("Open the Social Image Generator settings","jetpack")},__("Settings","jetpack"))))}},81469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(75263),l=n(98811),c=n(9888),u=n(88649),d=n(39356),p=n(40088);const __=o.__,m=["image/jpeg","image/png"],h=__("Choose Image","jetpack"),g=({onClose:e})=>{const{customText:t,imageType:n,imageId:o,template:g,updateSettings:f}=(0,i.Z)(),[b,v]=(0,s.useState)(o),[k,y]=(0,s.useState)(n||"featured"),[w,E]=(0,s.useState)(t),[_,C]=(0,s.useState)(g),[x]=(0,l.Z)(b),S=(0,s.useCallback)((()=>{f({template:_,image_type:k,custom_text:w||"",..."custom"===k&&{image_id:b}}),e()}),[f,_,k,b,w,e]),j=(0,s.useCallback)((e=>{v(e?.id)}),[v]);return React.createElement(r.ZP,{targetDom:document.body},React.createElement(a.Modal,{onRequestClose:e},React.createElement(c.ZP,{className:p.Z.preview,imageId:b,customText:w,imageType:k,template:_}),React.createElement(a.SelectControl,{label:__("Image Type","jetpack"),value:k||"featured",options:[{label:__("Featured Image","jetpack"),value:"featured"},{label:__("Custom Image","jetpack"),value:"custom"},{label:__("No Image","jetpack"),value:"none"}],onChange:y}),"custom"===k&&React.createElement(u.Z,{buttonLabel:h,subTitle:__("Add a custom image","jetpack"),mediaId:b,mediaDetails:x,onChange:j,allowedMediaTypes:m,wrapperClassName:p.Z.mediaPicker}),React.createElement(a.TextControl,{className:p.Z.customText,value:w||"",onChange:E,label:__("Custom Header","jetpack"),help:__("By default the post title is used for the image. You can use this field to set your own text.","jetpack")}),React.createElement(a.BaseControl,{label:__("Templates","jetpack"),className:p.Z.templateControl},React.createElement(d.Z,{value:_,onTemplateSelected:C})),React.createElement(a.Button,{onClick:e,variant:"tertiary"},__("Cancel","jetpack")),React.createElement(a.Button,{onClick:S,variant:"primary"},__("Save","jetpack"))))}},79631:(e,t,n)=>{"use strict";n(9818),n(69307),n(65736),n(99196),n(23177),n(8350)},8350:(e,t,n)=>{"use strict";n(55609),n(69307),n(65736),n(39356),n(15214)},39356:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(69307),a=n(65736),s=n(65235),o=n.n(s),i=n(47320),l=n(57227);const __=a.__,c=({value:e=null,onTemplateSelected:t=null})=>{const n=(0,r.useCallback)((e=>{const n=e.target.id;t?.(n)}),[t]);return React.createElement("div",{className:i.Z.templates},l.Z.map((t=>React.createElement("button",{onClick:n,id:t.name,key:t.name,className:o()(i.Z.template,{[i.Z["template--active"]]:t.name===e})},React.createElement("img",{src:t.image,alt:t.label}),React.createElement("span",{className:"screen-reader-text"},/* translators: %s is the name of the template */ /* translators: %s is the name of the template */ -(0,a.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(30253),a=n(91948),s=n(5353);const o=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},76848:(e,t,n)=>{"use strict";n(9818),n(69307),n(99196),n(23177)},53513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(88219),l=n(89696);const __=o.__,c=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d({disabled:e=!1}){const{shouldUploadAttachedMedia:t,updateShouldUploadAttachedMedia:n}=(0,i.Z)(),o=(0,s.useCallback)((e=>{n(e)}),[n]),d=e?a.Disabled:s.Fragment,p=e?{className:l.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(d,p,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:t,onChange:o,label:__("Share as a social post","jetpack"),help:e?c:u})))}},63855:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(13477),o=n(9818),i=n(48751),l=n(23177);const c=(0,o.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,i.Z)(),{title:n,excerpt:r,content:c}=e,u=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n}=e(l.Eg).getConnectionProfileDetails(l.uJ);return{displayName:t,avatarUrl:n}}));return React.createElement(s.S,a()({},e,{type:"article",user:u,customText:t||r||c||n}))}))},83704:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(82674),a=n.n(r),s=n(17915),o=n(9818),i=n(22629),l=n(99196),c=n.n(l);const u=function(e){const t=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,i.decodeEntities)(t("root","site").title)}));return c().createElement(s.X,a()({},e,{siteTitle:t}))}},4124:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(4049),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,image:n,media:s}=e,{username:c,profileImage:u}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.M$))),{message:d}=(0,i.Z)(),p=d||t;return o().createElement(r.V,{image:n,media:s,name:c,profileImage:u,caption:p})}},27725:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(93453),a=n(9818),s=n(65736),o=n(99196),i=n.n(o),l=n(48751),c=n(23177);const __=s.__;function u(e){const{title:t,url:n,image:s,media:o}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(c.Eg).getConnectionProfileDetails(c.qk))),{message:p}=(0,l.Z)(),m=`${p||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:s,name:u,profileImage:d,title:t,description:m,url:n,media:o})}},28586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(82674),a=n.n(r),s=n(60312),o=n(9818),i=n(22629),l=n(71806),c=n(48751),u=n(23177);const d=e=>{const{message:t}=(0,c.Z)(),{content:n,siteName:r}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,i.decodeEntities)(n().title)}})),{shouldUploadAttachedMedia:d}=(0,l.R)(),p=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n,username:r}=e(u.Eg).getConnectionProfileDetails(u.cs);return{displayName:t,avatarUrl:n,address:r}})),m=e.media?.[0],h=m?.type.startsWith("image/")?m.url:null;return React.createElement(s.I,a()({},e,{siteName:r,user:p,description:n,customText:t,customImage:h,isSocialPost:d}))}},8454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(55609),a=n(65736),s=n(39517),o=n(41809),i=n(9279);const __=a.__,l=function({onClose:e,initialTabName:t}){const n=(0,o.P)(),{image:a,media:l,title:c,description:u,url:d}=(0,i.u)();return React.createElement(r.Modal,{onRequestClose:e,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:e,icon:s.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:n,initialTabName:t},(e=>React.createElement("div",null,React.createElement(e.preview,{title:c,description:u,url:d,image:a,media:l})))))}},18553:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(93122),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,url:n,image:s,media:c}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.Cd))),{message:p}=(0,i.Z)(),m=`${p||t} ${c.length?n:""}`.trim();return o().createElement(r.m,{image:s,name:u,profileImage:d,title:t,description:m,url:n,media:c})}},74140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(55609),a=n(65736),s=n(41809);const __=a.__,_x=a._x,o=({openModal:e})=>{const t=(0,s.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},t.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:e,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(1044),o=n(9818),i=n(48751),l=n(23177);const c=e=>{const{content:t,author:n}=(0,o.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{message:r}=(0,i.Z)(),c=(0,o.useSelect)((e=>{const{displayName:t,profileImage:r}=e(l.Eg).getConnectionProfileDetails(l.Bb);return{displayName:t||n,avatarUrl:r}}),[n]);return React.createElement(s.b,a()({},e,{user:c,description:t,customText:r}))}},24766:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(835),a=n(9818),s=n(99196),o=n.n(s),i=n(71806),l=n(23177);const c=function({title:e,description:t,image:n,url:s,media:c}){const{shareMessage:u}=(0,i.R)(),d=(0,a.useSelect)((r=>{const{displayName:a,profileImage:o,username:i}=r(l.Eg).getConnectionProfileDetails(l.wV);return[{name:a,profileImage:o,screenName:i,text:u+(c.length?` ${s}`:""),cardType:n?"summary_large_image":"summary",title:e,description:t,image:n,media:c,url:s}]}),[e,n,t,c,s,u]);return o().createElement(r.c,{tweets:d,hidePostPreview:!0})}},41809:(e,t,n)=>{"use strict";n.d(t,{P:()=>k});var r=n(82674),a=n.n(r),s=n(3396),o=n(65736),i=n(99196),l=n.n(i),c=n(23177),u=n(42032),d=n(63855),p=n(83704),m=n(4124),h=n(27725),g=n(28586),f=n(18553),b=n(94714),v=n(24766);const __=o.__;function k(){const e=(0,u.getSupportedAdditionalConnections)(),t=e.includes(c.M$),n=e.includes(c.cs),r=e.includes(c.Cd);return(0,i.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"google"},e)),name:"google",preview:p.Z},{title:__("X","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"x"},e)),name:"x",preview:v.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:d.Z},t?{title:__("Instagram","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:m.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:h.y},r?{title:__("Nextdoor","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"nextdoor"},e)),name:"nextdoor",preview:f.T}:null,{title:__("Tumblr","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"tumblr-alt"},e)),name:"tumblr",preview:b.Z},n?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:g.Z}:null].filter(Boolean)),[t,n,r])}},9279:(e,t,n)=>{"use strict";n.d(t,{u:()=>l});var r=n(9818),a=n(65736),s=n(71806),o=n(90785),i=n(25399);const __=a.__;function l(){const{attachedMedia:e,imageGeneratorSettings:t,shouldUploadAttachedMedia:n}=(0,s.R)();return(0,r.useSelect)((r=>{const{getMedia:a}=r("core"),{getEditedPostAttribute:s,getEditedPostContent:l}=r("core/editor"),c=s("featured_media");let u=c?(0,i.i)(a(c)):"";const d=t.enabled?(0,o.t)(t.token):"";if(d)u=d;else if(e?.[0]?.id){const[t]=e;!!t.id&&a(t.id)?.mime_type?.startsWith("image/")&&t.url&&(u=t.url)}if(!u){const e=(0,i.T)(l());e&&(u=e)}const p=[];if(n)if(d)p.push({type:"image/jpeg",url:d,alt:""});else{const t=e=>{const t=a(e);return t?{type:t.mime_type,url:(0,i.i)(t),alt:t.alt_text}:null};for(const{id:n}of e){const e=t(n);e&&p.push(e)}if(0===p.length&&c){const e=t(c);e&&p.push(e)}}return{title:s("meta")?.jetpack_seo_html_title||s("title"),description:s("meta")?.advanced_seo_description||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:s("link"),image:u,media:p,initialTabName:null}}),[n,e,t])}},25399:(e,t,n)=>{"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}function a(e){const t=(new DOMParser).parseFromString(e,"text/html"),n=Array.from(t.querySelectorAll("img")),r=n[0]?.src;return r??null}n.d(t,{T:()=>a,i:()=>r})},13858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(69307),a=n(87728);const s=({sourceUrl:e,mime:t,duration:n})=>{const[s,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(0),c=(0,r.useRef)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{c.current?.load()}),[e]);const p=(0,r.useCallback)((()=>{c.current.pause(),c.current.currentTime=0,clearInterval(u.current),clearTimeout(d.current),l(0),o(!1)}),[]),m=(0,r.useCallback)((()=>{d.current=setTimeout((()=>{s||(c.current.play(),o(!0),u.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[s]),h=()=>{const e=n-i,t=Math.floor(e/60),r=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${r}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:m,onMouseLeave:p},React.createElement("video",{ref:c,onEnded:p,muted:!0},React.createElement("source",{src:e,type:t})),React.createElement(h,null))}},88219:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(71806);function a(){const{attachedMedia:e,shouldUploadAttachedMedia:t,updateJetpackSocialOptions:n}=(0,r.R)();return{attachedMedia:e,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>n("attached_media",e),updateShouldUploadAttachedMedia:e=>n("should_upload_attached_media",e)}}},75323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(13419),a=n(86989),s=n.n(a),o=n(69307);const i={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},l=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function c(){const[e,t]=(0,o.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,o.useCallback)(((e,n=-1)=>{const r=l(n);t((t=>({...t,[e]:r}))),s()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_dismissed_notices:{[e]:r}}})}),[]),a=(0,o.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,o.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:i})),[e,a,n])}},39118:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(12238);const s=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9818),a=n(12238),s=n(69307),o=n(71806);const i=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function l(){const{imageGeneratorSettings:e,jetpackSocialOptions:t,updateJetpackSocialOptions:n}=(0,o.R)(),{isPostPublished:l}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),c=(0,s.useCallback)(((t,r)=>{const a={...e,[t]:r};n("image_generator_settings",a)}),[e,n]),u=(0,s.useCallback)((t=>{const r={...e,...t};n("image_generator_settings",r)}),[e,n]);return{...i(t.image_generator_settings,l),setIsEnabled:e=>c("enabled",e),setToken:e=>c("token",e),updateSettings:u}}},98811:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307);const s=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(!n.full)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.medium||n.large,a={width:r.width,height:r.height,sourceUrl:r.source_url};return{mediaData:{width:n.full.width,height:n.full.height,sourceUrl:n.full.source_url},metaData:t,previewData:a}};function o(e=null){const[t,n]=(0,a.useState)([{}]),o=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),i=(0,a.useCallback)((async()=>{try{const e=await s(o);n([e??{}])}catch{n([{}])}}),[o]);return(0,a.useEffect)((()=>{i()}),[i]),t}},46791:(e,t,n)=>{"use strict";n.d(t,{Wv:()=>l,ZP:()=>d,rs:()=>s});var r=n(69307),a=n(1795);const s="NO_MEDIA_ERROR",o="FILE_SIZE_ERROR",i="DIMENSION_ERROR";function l(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(l(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},u=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?s:null;if(!c.requiresMedia&&!r)return null;const{mime:u,fileSize:d}=e;if(!u||!c.allowedMediaTypes.includes(u.toLowerCase()))return"FILE_TYPE_ERROR";if(!t?.width||!t?.height)return i;const p=d?d/Math.pow(1e3,2):null;return l(u)?((e,t,n,r,s)=>{const{minSize:l=0,maxSize:c=a.zc,minLength:u=0,maxLength:d=a.zc,maxWidth:p=a.zc,aspectRatio:m=a.ay.video.aspectRatio}=s;if(!e||e>c||ed)return"VIDEO_LENGTH_TOO_LONG_ERROR";const h=n/r;return hm.max||n>p?i:null})(p,e.length,t.width,t.height,c.video):((e,t,n,r)=>{const{maxSize:s=a.zc,minWidth:l=0,maxWidth:c=a.zc,aspectRatio:u=a.ay.image.aspectRatio}=r,d=t/n;return du.max||t>c||ts?o:null})(p,t.width,t.height,c.image)},d=(e,t,{isSocialImageGeneratorEnabledForPost:n,shouldUploadAttachedMedia:a})=>{const s=(0,r.useRef)({});return(0,r.useMemo)((()=>{const r=n?{}:e.reduce(((e,{connection_id:n,service_name:r})=>{const s=u(t.metaData,t.mediaData,r,a);return s&&(e[n]=s),e}),{});return JSON.stringify(r)!==JSON.stringify(s.current)&&(s.current=r),{validationErrors:s.current,isConvertible:c(t.metaData)}}),[n,e,t.metaData,t.mediaData,a])}},1795:(e,t,n)=>{"use strict";n.d(t,{$8:()=>g,ay:()=>h,bD:()=>f,uo:()=>b,zc:()=>m});const r="video/mp4",a="video/mov",s="video/videopress",o=["image/jpeg","image/jpg","image/png"],i=o.concat(["image/gif","image/bmp"]),l=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],c=o.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),u=["video/webm","video/quicktime","video/ogg"],d=o.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),p=[a,"video/avi","video/mpg","video/mpeg","video/m4v"],m=1e5,h={requiresMedia:!1,allowedMediaTypes:o.concat([r,s,a]),image:{maxSize:4,minWidth:0,maxWidth:m,aspectRatio:{min:0,max:m}},video:{minLength:0,minSize:0,maxSize:m,maxLength:m,maxWidth:m,aspectRatio:{min:0,max:m}}},g={twitter:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:i.concat([s,...l]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:o.concat([r,a,s]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,s],image:{maxSize:8,minWidth:320,maxWidth:1440,aspectRatio:{min:.8,max:1.91}},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat([...u,r,s]),image:{maxSize:10},video:{maxSize:40}},nextdoor:{allowedMediaTypes:d.concat([...p,r,s]),image:{maxSize:10},video:{maxSize:500}}},f=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],b=[...new Set([...o,...i,...c,...l,...u,...f])]},71806:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(9818),a=n(12238),s=n(69307),o=n(42032);function i(){const{editPost:e}=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>{const t=e(a.store).getEditedPostAttribute("meta")||{},n=t.jetpack_publicize_feature_enabled??!0,r=t.jetpack_social_options||{};return{isPublicizeEnabled:n,jetpackSocialOptions:r,attachedMedia:r.attached_media||[],imageGeneratorSettings:r.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,o.getShareMessageMaxLength)()),shouldUploadAttachedMedia:r.should_upload_attached_media??!1}}),[]),n=(0,s.useCallback)(((t,n)=>{e({meta:{[t]:n}})}),[e]),i=(0,s.useCallback)((()=>{n("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,n]),l=(0,s.useCallback)(((e,r)=>{n("jetpack_social_options",{...t.jetpackSocialOptions,[e]:r})}),[t.jetpackSocialOptions,n]);return(0,s.useMemo)((()=>({...t,togglePublicizeFeature:i,updateJetpackSocialOptions:l,updateMeta:n})),[t,i,l,n])}},14085:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(13419),a=n(9818),s=n(12238),o=n(71806);const i="republicize";function l(){const e=(0,r.Pb)()?.social?.sharesData??{},t=e.is_share_limit_enabled,n=(0,r.OZ)(i)?.available||t,l=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),c=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",{isPublicizeEnabled:u,togglePublicizeFeature:d,isPostAlreadyShared:p}=(0,o.R)(),m=(0,r.X1)(i)&&!n,h=l?n:u,g=l&&m,f=l&&!n,b=!!(0,r.Pb)()?.social?.hasPaidPlan,v=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,k=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:u,isPublicizeEnabled:h,togglePublicizeFeature:d,isPublicizeDisabledBySitePlan:g,isRePublicizeFeatureAvailable:n,isRePublicizeUpgradableViaUpsell:m,hidePublicizeFeature:f,isShareLimitEnabled:t,isPostAlreadyShared:p,numberOfSharesRemaining:e.shares_remaining,shouldShowAdvancedPlanNudge:e.show_advanced_plan_upgrade_nudge,hasPaidPlan:b,isEnhancedPublishingEnabled:v,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:c+(0,r.lQ)(),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:k,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9818),a=n(69307),s=n(22552),o=n(23177);function i(){const e=(0,s.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(o.Eg).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},96672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(94333),a=n(69307),s=n(22552),o=n(37568);function i(){const e=(0,a.useRef)(!1),t=(0,s.Z)(),{refresh:n}=(0,o.Z)(),i=(0,r.useDebounce)(n,2e3);return()=>{t||(e.current=!0,i.cancel()),t&&e.current&&(i(),e.current=!1)}}},86419:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,e3:()=>l});var r=n(94333),a=n(9818),s=n(12238),o=n(69307);function i(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{i&&!n&&e()}),[n,i,e,t])}function l(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{!i&&n&&e()}),[n,i,e,t])}},34431:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(9818),a=n(65736),s=n(23177);const __=a.__,_n=a._n;function o({scheduledCountAdjustment:e=0,usedCountAdjustment:t=0}={}){return(0,r.useSelect)((n=>{const r=n(s.h),o=r.getShareLimit(),i=r.getScheduledSharesCount()+e,l=r.getSharesUsedCount()+t,c=l+i,u=r.numberOfSharesRemaining(),d=function(e){const t=Number.isFinite(e)?(0,a.sprintf)( +(0,a.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(30253),a=n(91948),s=n(5353);const o=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},76848:(e,t,n)=>{"use strict";n(9818),n(69307),n(99196),n(23177)},53513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(88219),l=n(89696);const __=o.__,c=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d({disabled:e=!1}){const{shouldUploadAttachedMedia:t,updateShouldUploadAttachedMedia:n}=(0,i.Z)(),o=(0,s.useCallback)((e=>{n(e)}),[n]),d=e?a.Disabled:s.Fragment,p=e?{className:l.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(d,p,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:t,onChange:o,label:__("Share as a social post","jetpack"),help:e?c:u})))}},63855:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(13477),o=n(9818),i=n(48751),l=n(23177);const c=(0,o.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,i.Z)(),{title:n,excerpt:r,content:c}=e,u=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n}=e(l.Eg).getConnectionProfileDetails(l.uJ);return{displayName:t,avatarUrl:n}}));return React.createElement(s.S,a()({},e,{type:"article",user:u,customText:t||r||c||n}))}))},83704:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(82674),a=n.n(r),s=n(17915),o=n(9818),i=n(22629),l=n(99196),c=n.n(l);const u=function(e){const t=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,i.decodeEntities)(t("root","site").title)}));return c().createElement(s.X,a()({},e,{siteTitle:t}))}},4124:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(4049),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,image:n,media:s}=e,{username:c,profileImage:u}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.M$))),{message:d}=(0,i.Z)(),p=d||t;return o().createElement(r.V,{image:n,media:s,name:c,profileImage:u,caption:p})}},27725:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(93453),a=n(9818),s=n(65736),o=n(99196),i=n.n(o),l=n(48751),c=n(23177);const __=s.__;function u(e){const{title:t,url:n,image:s,media:o}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(c.Eg).getConnectionProfileDetails(c.qk))),{message:p}=(0,l.Z)(),m=`${p||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:s,name:u,profileImage:d,title:t,description:m,url:n,media:o})}},28586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(82674),a=n.n(r),s=n(60312),o=n(9818),i=n(22629),l=n(71806),c=n(48751),u=n(23177);const d=e=>{const{message:t}=(0,c.Z)(),{content:n,siteName:r}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,i.decodeEntities)(n().title)}})),{shouldUploadAttachedMedia:d}=(0,l.R)(),p=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n,username:r}=e(u.Eg).getConnectionProfileDetails(u.cs);return{displayName:t,avatarUrl:n,address:r}})),m=e.media?.[0],h=m?.type.startsWith("image/")?m.url:null;return React.createElement(s.I,a()({},e,{siteName:r,user:p,description:n,customText:t,customImage:h,isSocialPost:d}))}},8454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(55609),a=n(65736),s=n(39517),o=n(41809),i=n(9279);const __=a.__,l=function({onClose:e,initialTabName:t}){const n=(0,o.P)(),{image:a,media:l,title:c,description:u,url:d}=(0,i.u)();return React.createElement(r.Modal,{onRequestClose:e,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:e,icon:s.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:n,initialTabName:t},(e=>React.createElement("div",null,React.createElement(e.preview,{title:c,description:u,url:d,image:a,media:l})))))}},18553:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(93122),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,url:n,image:s,media:c}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.Cd))),{message:p}=(0,i.Z)(),m=`${p||t} ${c.length?n:""}`.trim();return o().createElement(r.m,{image:s,name:u,profileImage:d,title:t,description:m,url:n,media:c})}},74140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(55609),a=n(65736),s=n(41809);const __=a.__,_x=a._x,o=({openModal:e})=>{const t=(0,s.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},t.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:e,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(1044),o=n(9818),i=n(48751),l=n(23177);const c=e=>{const{content:t,author:n}=(0,o.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{message:r}=(0,i.Z)(),c=(0,o.useSelect)((e=>{const{displayName:t,profileImage:r}=e(l.Eg).getConnectionProfileDetails(l.Bb);return{displayName:t||n,avatarUrl:r}}),[n]);return React.createElement(s.b,a()({},e,{user:c,description:t,customText:r}))}},24766:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(835),a=n(9818),s=n(99196),o=n.n(s),i=n(71806),l=n(23177);const c=function({title:e,description:t,image:n,url:s,media:c}){const{shareMessage:u}=(0,i.R)(),d=(0,a.useSelect)((r=>{const{displayName:a,profileImage:o,username:i}=r(l.Eg).getConnectionProfileDetails(l.wV);return[{name:a,profileImage:o,screenName:i,text:u+(c.length?` ${s}`:""),cardType:n?"summary_large_image":"summary",title:e,description:t,image:n,media:c,url:s}]}),[e,n,t,c,s,u]);return o().createElement(r.c,{tweets:d,hidePostPreview:!0})}},41809:(e,t,n)=>{"use strict";n.d(t,{P:()=>k});var r=n(82674),a=n.n(r),s=n(3396),o=n(65736),i=n(99196),l=n.n(i),c=n(23177),u=n(42032),d=n(63855),p=n(83704),m=n(4124),h=n(27725),g=n(28586),f=n(18553),b=n(94714),v=n(24766);const __=o.__;function k(){const e=(0,u.getSupportedAdditionalConnections)(),t=e.includes(c.M$),n=e.includes(c.cs),r=e.includes(c.Cd);return(0,i.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"google"},e)),name:"google",preview:p.Z},{title:__("X","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"x"},e)),name:"x",preview:v.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:d.Z},t?{title:__("Instagram","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:m.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:h.y},r?{title:__("Nextdoor","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"nextdoor"},e)),name:"nextdoor",preview:f.T}:null,{title:__("Tumblr","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"tumblr-alt"},e)),name:"tumblr",preview:b.Z},n?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:g.Z}:null].filter(Boolean)),[t,n,r])}},9279:(e,t,n)=>{"use strict";n.d(t,{u:()=>l});var r=n(9818),a=n(65736),s=n(71806),o=n(90785),i=n(25399);const __=a.__;function l(){const{attachedMedia:e,imageGeneratorSettings:t,shouldUploadAttachedMedia:n}=(0,s.R)();return(0,r.useSelect)((r=>{const{getMedia:a}=r("core"),{getEditedPostAttribute:s,getEditedPostContent:l}=r("core/editor"),c=s("featured_media");let u=c?(0,i.i)(a(c)):"";const d=t.enabled?(0,o.t)(t.token):"";if(d)u=d;else if(e?.[0]?.id){const[t]=e;!!t.id&&a(t.id)?.mime_type?.startsWith("image/")&&t.url&&(u=t.url)}if(!u){const e=(0,i.T)(l());e&&(u=e)}const p=[];if(n)if(d)p.push({type:"image/jpeg",url:d,alt:""});else{const t=e=>{const t=a(e);return t?{type:t.mime_type,url:(0,i.i)(t),alt:t.alt_text}:null};for(const{id:n}of e){const e=t(n);e&&p.push(e)}if(0===p.length&&c){const e=t(c);e&&p.push(e)}}return{title:s("meta")?.jetpack_seo_html_title||s("title"),description:s("meta")?.advanced_seo_description||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:s("link"),image:u,media:p,initialTabName:null}}),[n,e,t])}},25399:(e,t,n)=>{"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}function a(e){const t=(new DOMParser).parseFromString(e,"text/html"),n=Array.from(t.querySelectorAll("img")),r=n[0]?.src;return r??null}n.d(t,{T:()=>a,i:()=>r})},13858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(69307),a=n(87728);const s=({sourceUrl:e,mime:t,duration:n})=>{const[s,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(0),c=(0,r.useRef)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{c.current?.load()}),[e]);const p=(0,r.useCallback)((()=>{c.current.pause(),c.current.currentTime=0,clearInterval(u.current),clearTimeout(d.current),l(0),o(!1)}),[]),m=(0,r.useCallback)((()=>{d.current=setTimeout((()=>{s||(c.current.play(),o(!0),u.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[s]),h=()=>{const e=n-i,t=Math.floor(e/60),r=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${r}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:m,onMouseLeave:p},React.createElement("video",{ref:c,onEnded:p,muted:!0},React.createElement("source",{src:e,type:t})),React.createElement(h,null))}},88219:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(71806);function a(){const{attachedMedia:e,shouldUploadAttachedMedia:t,updateJetpackSocialOptions:n}=(0,r.R)();return{attachedMedia:e,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>n("attached_media",e),updateShouldUploadAttachedMedia:e=>n("should_upload_attached_media",e)}}},75323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(13419),a=n(86989),s=n.n(a),o=n(69307);const i={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},l=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function c(){const[e,t]=(0,o.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,o.useCallback)(((e,n=-1)=>{const r=l(n);t((t=>({...t,[e]:r}))),s()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_dismissed_notices:{[e]:r}}})}),[]),a=(0,o.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,o.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:i})),[e,a,n])}},39118:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(12238);const s=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9818),a=n(12238),s=n(69307),o=n(71806);const i=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function l(){const{imageGeneratorSettings:e,jetpackSocialOptions:t,updateJetpackSocialOptions:n}=(0,o.R)(),{isPostPublished:l}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),c=(0,s.useCallback)(((t,r)=>{const a={...e,[t]:r};n("image_generator_settings",a)}),[e,n]),u=(0,s.useCallback)((t=>{const r={...e,...t};n("image_generator_settings",r)}),[e,n]);return{...i(t.image_generator_settings,l),setIsEnabled:e=>c("enabled",e),setToken:e=>c("token",e),updateSettings:u}}},98811:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307);const s=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(!n.full)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.medium||n.large,a={width:r.width,height:r.height,sourceUrl:r.source_url};return{mediaData:{width:n.full.width,height:n.full.height,sourceUrl:n.full.source_url},metaData:t,previewData:a}};function o(e=null){const[t,n]=(0,a.useState)([{}]),o=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),i=(0,a.useCallback)((async()=>{try{const e=await s(o);n([e??{}])}catch{n([{}])}}),[o]);return(0,a.useEffect)((()=>{i()}),[i]),t}},46791:(e,t,n)=>{"use strict";n.d(t,{Wv:()=>l,ZP:()=>d,rs:()=>s});var r=n(69307),a=n(1795);const s="NO_MEDIA_ERROR",o="FILE_SIZE_ERROR",i="DIMENSION_ERROR";function l(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(l(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},u=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?s:null;if(!c.requiresMedia&&!r)return null;const{mime:u,fileSize:d}=e;if(!u||!c.allowedMediaTypes.includes(u.toLowerCase()))return"FILE_TYPE_ERROR";if(!t?.width||!t?.height)return i;const p=d?d/Math.pow(1e3,2):null;return l(u)?((e,t,n,r,s)=>{const{minSize:l=0,maxSize:c=a.zc,minLength:u=0,maxLength:d=a.zc,maxWidth:p=a.zc,aspectRatio:m=a.ay.video.aspectRatio}=s;if(!e||e>c||ed)return"VIDEO_LENGTH_TOO_LONG_ERROR";const h=n/r;return hm.max||n>p?i:null})(p,e.length,t.width,t.height,c.video):((e,t,n,r)=>{const{maxSize:s=a.zc,minWidth:l=0,maxWidth:c=a.zc,aspectRatio:u=a.ay.image.aspectRatio}=r,d=t/n;return du.max||t>c||ts?o:null})(p,t.width,t.height,c.image)},d=(e,t,{isSocialImageGeneratorEnabledForPost:n,shouldUploadAttachedMedia:a})=>{const s=(0,r.useRef)({});return(0,r.useMemo)((()=>{const r=n?{}:e.reduce(((e,{connection_id:n,service_name:r})=>{const s=u(t.metaData,t.mediaData,r,a);return s&&(e[n]=s),e}),{});return JSON.stringify(r)!==JSON.stringify(s.current)&&(s.current=r),{validationErrors:s.current,isConvertible:c(t.metaData)}}),[n,e,t.metaData,t.mediaData,a])}},1795:(e,t,n)=>{"use strict";n.d(t,{$8:()=>g,ay:()=>h,bD:()=>f,uo:()=>b,zc:()=>m});const r="video/mp4",a="video/mov",s="video/videopress",o=["image/jpeg","image/jpg","image/png"],i=o.concat(["image/gif","image/bmp"]),l=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],c=o.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),u=["video/webm","video/quicktime","video/ogg"],d=o.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),p=[a,"video/avi","video/mpg","video/mpeg","video/m4v"],m=1e5,h={requiresMedia:!1,allowedMediaTypes:o.concat([r,s,a]),image:{maxSize:4,minWidth:0,maxWidth:m,aspectRatio:{min:0,max:m}},video:{minLength:0,minSize:0,maxSize:m,maxLength:m,maxWidth:m,aspectRatio:{min:0,max:m}}},g={twitter:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:i.concat([s,...l]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:o.concat([r,a,s]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,s],image:{maxSize:8,minWidth:320,maxWidth:1440,aspectRatio:{min:.8,max:1.91}},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat([...u,r,s]),image:{maxSize:10},video:{maxSize:40}},nextdoor:{allowedMediaTypes:d.concat([...p,r,s]),image:{maxSize:10},video:{maxSize:500}}},f=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],b=[...new Set([...o,...i,...c,...l,...u,...f])]},71806:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(9818),a=n(12238),s=n(69307),o=n(42032);function i(){const{editPost:e}=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>{const t=e(a.store).getEditedPostAttribute("meta")||{},n=t.jetpack_publicize_feature_enabled??!0,r=t.jetpack_social_options||{};return{isPublicizeEnabled:n,jetpackSocialOptions:r,attachedMedia:r.attached_media||[],imageGeneratorSettings:r.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,o.getShareMessageMaxLength)()),shouldUploadAttachedMedia:r.should_upload_attached_media??!1}}),[]),n=(0,s.useCallback)(((t,n)=>{e({meta:{[t]:n}})}),[e]),i=(0,s.useCallback)((()=>{n("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,n]),l=(0,s.useCallback)(((e,r)=>{n("jetpack_social_options",{...t.jetpackSocialOptions,[e]:r})}),[t.jetpackSocialOptions,n]);return(0,s.useMemo)((()=>({...t,togglePublicizeFeature:i,updateJetpackSocialOptions:l,updateMeta:n})),[t,i,l,n])}},14085:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(13419),a=n(9818),s=n(12238),o=n(71806);const i="republicize";function l(){const e=(0,r.Pb)()?.social?.sharesData??{},t=(0,r.Pb)()?.wpcomBlogId,n=e.is_share_limit_enabled,l=(0,r.OZ)(i)?.available||n,c=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),u=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",{isPublicizeEnabled:d,togglePublicizeFeature:p,isPostAlreadyShared:m}=(0,o.R)(),h=(0,r.X1)(i)&&!l,g=c?l:d,f=c&&h,b=c&&!l,v=!!(0,r.Pb)()?.social?.hasPaidPlan,k=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,y=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:d,isPublicizeEnabled:g,togglePublicizeFeature:p,isPublicizeDisabledBySitePlan:f,isRePublicizeFeatureAvailable:l,isRePublicizeUpgradableViaUpsell:h,hidePublicizeFeature:b,isShareLimitEnabled:n,isPostAlreadyShared:m,numberOfSharesRemaining:e.shares_remaining,shouldShowAdvancedPlanNudge:e.show_advanced_plan_upgrade_nudge,hasPaidPlan:v,isEnhancedPublishingEnabled:k,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:u+(t??(0,r.lQ)()),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:y,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9818),a=n(69307),s=n(22552),o=n(23177);function i(){const e=(0,s.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(o.Eg).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},96672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(94333),a=n(69307),s=n(22552),o=n(37568);function i(){const e=(0,a.useRef)(!1),t=(0,s.Z)(),{refresh:n}=(0,o.Z)(),i=(0,r.useDebounce)(n,2e3);return()=>{t||(e.current=!0,i.cancel()),t&&e.current&&(i(),e.current=!1)}}},86419:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,e3:()=>l});var r=n(94333),a=n(9818),s=n(12238),o=n(69307);function i(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{i&&!n&&e()}),[n,i,e,t])}function l(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{!i&&n&&e()}),[n,i,e,t])}},34431:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(9818),a=n(65736),s=n(23177);const __=a.__,_n=a._n;function o({scheduledCountAdjustment:e=0,usedCountAdjustment:t=0}={}){return(0,r.useSelect)((n=>{const r=n(s.h),o=r.getShareLimit(),i=r.getScheduledSharesCount()+e,l=r.getSharesUsedCount()+t,c=l+i,u=r.numberOfSharesRemaining(),d=function(e){const t=Number.isFinite(e)?(0,a.sprintf)( // translators: %d: The number of shares to social media remaining -_n("You have %d auto-share remaining.","You have %d auto-shares remaining.",e,"jetpack"),e):"";return{default:"",exceeded:__("You have reached your auto-share limit. Scheduled posts will not be shared until shares become available.","jetpack"),full:__("You have reached your auto-share limit.","jetpack"),approaching:t}}(u);let p="default",m="none",h=d.default;return c>o?(p="error",m="exceeded",h=d.exceeded):c===o?(m="full",p="error",h=d.full):c>=.9*o?(m="approaching",p="error",h=d.approaching):c>=.8*o&&(m="approaching",p="warning",h=d.approaching),{status:m,noticeType:p,message:h,usedCount:l,scheduledCount:i,remainingCount:u}}),[e,t])}},45579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(9818),i=n(12238),l=n(69307),c=n(65736),u=n(37568),d=n(48751);const __=c.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||a;const[c,m]=(0,l.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,l.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!c.isFetching)return m({...r,isFetching:!0}),s()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then(((e={})=>{const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,c.isFetching,h]);return{...c,doPublicize:g}}},37568:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(23177);function s(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)(a.h);return{...(0,r.useSelect)((e=>{const t=e(a.h),n=t.getConnections(),r=t.getEnabledConnections(),s=t.getDisabledConnections().map((e=>e.id));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:r.length>0,skippedConnections:s,enabledConnections:r}}),[]),toggleById:t,refresh:e}}},48751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(42032),a=n(71806);function s(){const{updateMeta:e,shareMessage:t}=(0,a.R)();return{message:t,maxLength:(0,r.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(9818),a=n(12238),s=n(23177),o=n(86419);function i(){const{mergeConnections:e}=(0,r.useDispatch)(s.h),{didPostSaveRequestSucceed:t,isCurrentPostPublished:n,getEditedPostAttribute:i}=(0,r.useSelect)((e=>e(a.store)),[]);(0,o.M1)((()=>{if(t()&&n()){const t=i("jetpack_publicize_connections");t?.length&&e(t)}}),[t,n,i])}},21052:(e,t,n)=>{"use strict";n.d(t,{Au:()=>l,Wh:()=>c,ZP:()=>u,hi:()=>i,wO:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_AUTO_CONVERSION_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateAutoConversionSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Fl)(e);const t=yield(0,s.wi)();return yield c(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,r.select)(a.Eg).getAutoConversionSettings();return yield c(t),!1}finally{yield l()}},setAutoConversionSettings:c,refreshAutoConversionSettings:function*(){try{yield i();const e=yield(0,s.wi)();return yield c(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield l()}}}},23013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeConnections:()=>u,refreshConnectionTestResults:()=>d,setConnections:()=>l,syncConnectionsToPostMeta:()=>p,toggleConnection:()=>c,toggleConnectionById:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(12238),i=n(74442);function l(e){return{type:i.b,connections:e}}function c(e){return{type:i.L,connectionId:e}}function u(e){return function({dispatch:t,select:n}){const r=n.getConnections(),a=[],s={done:!1,enabled:Boolean(n.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...s,...r.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};a.push(e)}t(l(a))}}function d(e=!1){return async function({dispatch:t}){try{const n=(0,r.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(u(await s()({path:n}))),e&&t(p())}catch(e){}}}function p(){return function({registry:e,select:t}){const n=t.getConnections();return e.dispatch(o.store).editPost({jetpack_publicize_connections:n})}}function m(e,t=!0){return function({dispatch:n}){n(c(e)),t&&n(p())}}},74442:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,b:()=>r});const r="SET_CONNECTIONS",a="TOGGLE_CONNECTION"},54725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(21052),a=n(23013),s=n(371),o=n(72438),i=n(4462);const l={...s.ZP,...i.ZP,...r.ZP,...o.Z,...a}},371:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>l,dz:()=>o,ff:()=>i});var r=n(9818),a=n(23177),s=n(4957);const o="SET_JETPACK_SETTINGS";function i(e){return{type:o,options:e}}const l={updateJetpackSettings:function*(e){try{yield i({is_updating:!0}),yield i(e),yield(0,s.RF)(e);const t=yield(0,s.es)();return yield i(t),!0}catch(e){const t=(0,r.select)(a.Eg).getJetpackSettings();return yield i(t),!1}finally{yield i({is_updating:!1})}},setJetpackSettings:i}},72438:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4957),a=n(21052),s=n(4462);const o={refreshJetpackSocialSettings:function*(){try{yield(0,a.hi)(),yield(0,s.ds)();const e=yield(0,r.mu)();return yield(0,a.Wh)(e.jetpack_social_autoconvert_images),yield(0,s.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,a.Au)(),yield(0,s.Gr)()}}}},4462:(e,t,n)=>{"use strict";n.d(t,{Gr:()=>l,ZP:()=>u,ch:()=>c,ds:()=>i,kg:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateSocialImageGeneratorSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Ux)(e);const t=yield(0,s.oB)();return yield c(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,r.select)(a.Eg).getSocialImageGeneratorSettings();return yield c(t),!1}finally{yield l()}},setSocialImageGeneratorSettings:c,refreshSocialImageGeneratorSettings:function*(){try{yield i();const e=yield(0,s.oB)();return yield c(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield l()}}}},4957:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>k,es:()=>p,mu:()=>b,oB:()=>h,wi:()=>f});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_SETTINGS",o="UPDATE_JETPACK_SETTINGS",i="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",p=()=>({type:s}),m=e=>({type:o,settings:e}),h=()=>({type:i}),g=e=>({type:l,settings:e}),f=()=>({type:c}),b=()=>({type:d}),v=e=>({type:u,settings:e}),k={[s]:function(){return a()({path:"/jetpack/v4/social/settings"})},[o]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[i]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[l]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[c]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[u]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>f,Cd:()=>g,Eg:()=>c,M$:()=>p,cs:()=>h,h:()=>v,qk:()=>m,uJ:()=>d,wV:()=>b});var r=n(9818),a=n(54725),s=n(4957),o=n(45272),i=n(15781),l=n(22987);const c="jetpack-social-plugin",u={reducer:o.Z,actions:a.Z,selectors:l.Z,resolvers:i.ZP,controls:s.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",p="instagram-business",m="linkedin",h="mastodon",g="nextdoor",f="tumblr",b="twitter",v=(0,r.createReduxStore)(c,u);(0,r.register)(v)},20750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(21052);const a=(e={},t)=>t.type===r.wO?{...e,...t.options}:e},71837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(74442);const a=(e={},t)=>{switch(t.type){case r.b:return{...e,connections:t.connections};case r.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9818),a=n(20750),s=n(71837),o=n(80697),i=n(35652),l=n(28696),c=n(54489);const u=(0,r.combineReducers)({sharesData:i.Z,siteData:l.Z,connectionData:s.Z,jetpackSettings:o.Z,socialImageGeneratorSettings:c.Z,autoConversionSettings:a.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(371);const a=(e={},t)=>t.type===r.dz?{...e,...t.options}:e},35652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},28696:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},54489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4462);const a=(e={},t)=>t.type===r.kg?{...e,...t.options}:e},15781:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>c});var r=n(12238),a=n(21052),s=n(23013),o=n(371),i=n(4462),l=n(4957);const c={getJetpackSettings:function*(){try{const e=yield(0,l.es)();if(e)return(0,o.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,l.oB)();if(e)return(0,i.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,l.wi)();if(e)return(0,a.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const n=t.select(r.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,s.setConnections)(n||[]))}}}},68113:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,n)=>{"use strict";function r(e){return e.connectionData?.connections??[]}function a(e){return e.connectionData?.adminUrl??null}function s(e){return r(e).length>0}function o(e){return r(e).filter((e=>!1===e.test_success))}function i(e){return r(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function l(e){return r(e).filter((e=>e.enabled))}function c(e){return r(e).filter((e=>!e.enabled))}function u(e,t,{forceDefaults:n=!1}={}){let a="",s="",o="";if(!n){const n=r(e).find((({service_name:e})=>t===e));if(n){const{display_name:e,profile_display_name:r,profile_picture:i}=n;a="twitter"===t?r:e,o="twitter"===t?e:n.username,s=i}}return{displayName:a,profileImage:s,username:o}}n.r(t),n.d(t,{getConnectionProfileDetails:()=>u,getConnections:()=>r,getConnectionsAdminUrl:()=>a,getDisabledConnections:()=>c,getEnabledConnections:()=>l,getFailedConnections:()=>o,getMustReauthConnections:()=>i,hasConnections:()=>s})},22987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(68113),a=n(43354),s=n(82836),o=n(31473),i=n(85675),l=n(45073);const c={...i.Z,...a,...s.Z,...o,...l.Z,...r.Z}},82836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScheduledSharesCount:()=>l,getShareLimit:()=>o,getSharedPostsCount:()=>u,getSharesUsedCount:()=>i,getTotalSharesCount:()=>c,isShareLimitEnabled:()=>a,numberOfSharesRemaining:()=>p,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>s});var r=n(82836);function a(e){return e.sharesData?.is_share_limit_enabled??!1}function s(e){return!r.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&a(e)}function o(e){return e.sharesData?.share_limit??30}function i(e){return e.sharesData?.publicized_count??0}function l(e){return e.sharesData?.to_be_publicized_count??0}function c(e){const t=i(e)+l(e);return Math.max(t,0)}function u(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function p(e,t={}){if(!s(e))return 1/0;const{includeScheduled:n}={includeScheduled:!0,...t},r=i(e),a=o(e),c=n?l(e):0;return Math.max(a-r-c,0)}},85675:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=255;function a(){return r}},12677:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(13419);function a(){return(0,r.Pb)()?.social?.supportedAdditionalConnections||[]}},42032:(e,t,n)=>{"use strict";n.d(t,{getShareMessageMaxLength:()=>r.A,getSupportedAdditionalConnections:()=>a.h});var r=n(5463),a=n(12677),s=n(581);n.o(s,"useSyncPostDataToStore")&&n.d(t,{useSyncPostDataToStore:function(){return s.useSyncPostDataToStore}})},581:()=>{},13419:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>u.Z,FK:()=>c.FK,HD:()=>c.HD,M6:()=>s.M6,OZ:()=>o.Z,Pb:()=>r.Z,Pm:()=>m.Z,Qq:()=>c.Qq,Rl:()=>c.Rl,T:()=>l.Z,Ug:()=>s.Ug,Wp:()=>s.Wp,X1:()=>c.X1,_D:()=>c._D,aQ:()=>s.aQ,dM:()=>h.d,el:()=>p.Z,lQ:()=>a.Z,lt:()=>h.l,m3:()=>c.m3,o_:()=>i.Z,og:()=>g.Z,z$:()=>d.Z});var r=n(50148),a=n(35004),s=n(99505),o=n(48052),i=n(76714),l=n(80354),c=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959),g=n(19499);n(39058)},6342:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78868),a=n(99196),s=n.n(a);const o=()=>s().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:(e,t,n)=>{"use strict";n.d(t,{d:()=>s,l:()=>o});var r=n(69307),a=n(12953);function s(e){const t={};let n="span",a=e.icon;const s=document.createElement("div");s.innerHTML=e.icon;const o=s.querySelector("svg");return o&&(n="svg",a=o.innerHTML,Array.from(o.attributes).forEach((({nodeName:e,nodeValue:n})=>t[e]=n))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function o(e){return{src:s(e),foreground:(0,a.Z)()}}},12953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(99505);const a="#069e08";function s(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},19499:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){const e=(0,r.Z)();return e?.blocks_variation??"production"}},50148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:(e,t,n)=>{"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:()=>r})},61053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(6975),a=n(31294),s=n(69307);const{tracks:o}=r.Z,{recordEvent:i}=o,l=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:l={}}={})=>{const[c,u]=(0,s.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,s.useCallback)((async(e,t={})=>{d&&g&&h&&i(e,t)}),[d,g,h]);return(0,s.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,s.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(c||(b(r,l),u(!0)))}),[c,t,e,n,p,l,b]),{recordEvent:b,tracks:o}}},11380:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307),s=n(39058);const o=e=>{const{isModuleActive:t,isChangingStatus:n,isLoadingModules:o}=(0,r.useSelect)((t=>{const n=t(s.p);return{isModuleActive:n.isModuleActive(e),isChangingStatus:n.isModuleUpdating(e),isLoadingModules:n.areModulesLoading(e)}}),[s.p]),{updateJetpackModuleStatus:i}=(0,r.useDispatch)(s.p),l=(0,a.useCallback)((t=>i({name:e,active:t})),[e,i]);return(0,a.useMemo)((()=>({isLoadingModules:o,isChangingStatus:n,isModuleActive:t,changeStatus:l})),[o,n,t,l])}},68586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},44166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>d});var r=n(9818),a=n(99505),s=n(82162),o=n(39058);const i="SET_JETPACK_MODULES",l="SET_MODULE_UPDATING";function c(e){return d({isLoading:e})}function u(e,t){return{type:l,name:e,isUpdating:t}}function d(e){return{type:i,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,s.zL)(e);const t=yield(0,s.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,a.Wp)())return!0;try{yield c(!0);const e=yield(0,s.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield c(!1)}}}},82162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>i,ZP:()=>c,zL:()=>l});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_MODULES",o="UPDATE_JETPACK_MODULE_STATUS",i=()=>({type:s}),l=e=>({type:o,settings:e}),c={[s]:function(){return a()({path:"/jetpack/v4/module/all",method:"GET"})},[o]:function({settings:e}){return a()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(9818),a=n(44166),s=n(82162),o=n(42469),i=n(55133),l=n(43524);const c="jetpack-modules",u=(0,r.createReduxStore)(c,{reducer:o.Z,actions:a.ZP,controls:s.ZP,resolvers:i.Z,selectors:l.Z});(0,r.register)(u);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,r.dispatch)(c).setJetpackModules({data:{...d}})},42469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r={isLoading:!1,isUpdating:{},data:{}},a=(e=r,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(44166),a=n(82162);const s={getJetpackModules:function*(){try{const e=yield(0,a.Bs)();if(e)return(0,r.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(99505);const a={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,r.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,n)=>{"use strict";n.d(t,{FK:()=>g,HD:()=>f,Qq:()=>u,Rl:()=>m,X1:()=>d,_D:()=>p,m3:()=>b});var r=n(65736),a=n(96483),s=n(92819),o=n(50148),i=n(48052),l=n(35004),c=n(99505);const __=r.__;function u({planSlug:e,plan:t,postId:n,postType:r}){const o=(0,s.startsWith)(e,"jetpack_")?e:(0,s.get)(t,["path_slug"]),i=(void 0===r?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(r)?"":"edit";return(0,c.Wp)()?(0,a.addQueryArgs)("/"+(0,s.compact)([e,r,(0,l.Z)(),n]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:n,plan_upgraded:1})})();return(0,c.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:i,customerType:"business"}):o&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${o}`,{redirect_to:i})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,i.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,i.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,s.get)((0,o.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,s.map)(h,"name").includes(e),b=e=>(0,s.head)((0,s.filter)(h,(({name:t})=>t===e)))},76714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(98817),a=n(48052);function s(e,t){const{available:n,unavailableReason:s}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:(e,t,n)=>{"use strict";n.d(t,{M6:()=>i,Ug:()=>o,Wp:()=>s,aQ:()=>l});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===a()}function o(){return"atomic"===a()}function i(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function l(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(82674),a=n.n(r),s=n(94333);const o=e=>(0,s.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},83059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>j});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(586),p=n(3639),m=n(92710),h=n(58532),g=n(51128),f=n.n(g),b=(n(99196),n(49259)),v=n(63634),k=n(854),y=n(6747),w=n(81612),E=n(27298);const __=u.__,_=f()("jetpack-ai-assistant:dropdown"),C=[{name:__("Correct spelling and grammar","jetpack"),key:"correct-spelling",aiSuggestion:v.Hd,icon:d.Z},{name:__("Simplify","jetpack"),key:"simplify",aiSuggestion:v.hI,icon:p.Z},{name:__("Summarize","jetpack"),key:"summarize",aiSuggestion:v.Lq,icon:m.Z},{name:__("Expand","jetpack"),key:"make-longer",aiSuggestion:v.TV,icon:h.Z}];function x(e){return e.filter((e=>null!=e)).map((e=>(0,o.getBlockContent)(e))).join("\n\n")}function S({onClose:e,blockType:t}){const[n,o]=(0,c.useState)(!1),{getSelectedBlockClientIds:u,getBlocksByClientId:d}=(0,l.useSelect)("core/block-editor"),{removeBlocks:p,replaceBlock:m}=(0,l.useDispatch)("core/block-editor");(0,c.useEffect)((()=>{const e=u(),t=x(d(e)),n=(0,k.t$)(t);return o(!n.length)}),[d,u]);const{tracks:h}=(0,s.z$)(),g=(n,r={})=>{const a=u(),s=d(a),o=x(s);e(),_("requestSuggestion",n,r),h.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:n,block_type:t});const[i]=s,[l,...c]=a,g={...i?.attributes||{},content:o},f=(0,y.b)(t,g),v={clientId:l,type:n,options:{...r,contentType:"generated",fromExtension:!0}};localStorage.setItem((0,b.$M)(f.clientId),JSON.stringify(v)),m(l,f),p(c)};return(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"jetpack-ai-assistant__info"},__("Add content to activate the tools below","jetpack")),(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(i.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:()=>{const e=u(),n=d(e),r=x(n),[a,...s]=e,[o]=n,i={...o?.attributes||{},content:r};m(a,(0,y.b)(t,i)),p(s),h.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:t})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),C.map((e=>(0,r.createElement)(i.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{g(e.aiSuggestion,{})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(E.IP,{onChange:e=>{g(v.Lg,{tone:e})},disabled:n}),(0,r.createElement)(w.xK,{onChange:e=>{g(v.Nw,{language:e})},disabled:n})))}function j({blockType:e}){const{tracks:t}=(0,s.z$)();return(0,r.createElement)(i.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{className:"jetpack-ai-assistant__button",showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,label:__("AI Assistant","jetpack"),icon:a.u_}),onToggle:n=>{n&&t.recordEvent("jetpack_ai_assistant_extension_toolbar_menu_show",{block_type:e})},renderContent:({onClose:t})=>(0,r.createElement)(S,{onClose:t,blockType:e})})}},3180:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},87445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(6895),s=n(55609),o=n(65736);const __=o.__;const i=function(){const e=(0,a.Z)("jetpack-ai-feedback");return(0,r.createElement)("div",{className:"jetpack-ai-feedback-control"},(0,r.createElement)(s.BaseControl,{label:__("Feedback","jetpack")},(0,r.createElement)("p",null,__("Your feedback is valuable in our commitment to refine and improve this feature.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:e},__("Share your feedback","jetpack"))))}},81612:(e,t,n)=>{"use strict";n.d(t,{QA:()=>h,ZP:()=>f,xK:()=>b});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(61074),l=n(46936),c=n(43618);n(99196);const __=o.__,u=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],d=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,p=__("Translate","jetpack"),m=d?.split("-")[0]||"en",h=(d?.split("-"),{en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),g=({value:e,onChange:t})=>{const n=[...u.filter((e=>e!==m))];return u.includes(m)&&n.unshift(m),(0,r.createElement)(s.MenuGroup,{label:__("Select language","jetpack")},n.map((n=>(0,r.createElement)(s.MenuItem,{key:`key-${n}`,onClick:()=>t(n+" ("+h[n].label+")"),isSelected:e===n},h[n].label))))};function f({value:e=m,label:t=p,onChange:n,disabled:o=!1}){const{tracks:l}=(0,a.z$)();return o?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(i.Z,{icon:c.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:c.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"i18n"})}},(()=>(0,r.createElement)(g,{value:e,onChange:n})))}function b({value:e=m,label:t=p,onChange:n,disabled:a=!1}){return(0,r.createElement)(s.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:t,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},t),(0,r.createElement)(i.Z,{icon:l.Z})),disabled:a}},(({onClose:t})=>(0,r.createElement)(g,{onChange:e=>{n(e),t()},value:e})))}},50297:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(51806),a=n(55609),s=n(65736);const __=s.__,o=({image:e,inModal:t=!1,saveImage:n,setImageModal:s})=>(0,r.createElement)(a.Flex,{direction:"column"},t&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>s(e)})),!t&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))))))},24404:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,l="make-longer",c="makeLonger",u="make-shorter",d="makeShorter",p="summarize",m="summarize",h=[{name:__("Summarize","jetpack"),key:p,aiSuggestion:m},{name:__("Make longer","jetpack"),key:l,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:u,aiSuggestion:d}];function g({key:e,label:t=__("Improve","jetpack"),exclude:n=[],onChange:o,disabled:l=!1}){const{tracks:c}=(0,a.z$)();return l?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(s.Icon,{icon:i.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:i.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&c.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"improve"})}},(()=>{const a=h.filter((e=>!n.includes(e.key)));return(0,r.createElement)(s.MenuGroup,{label:t},a.map((t=>(0,r.createElement)(s.MenuItem,{key:`key-${t.key}`,onClick:()=>o(t.aiSuggestion,{contentType:"generated"}),isSelected:e===t.key},t.name))))}))}},85642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840),l=n(58532),c=n(586),u=n(3639),d=n(92710),p=n(32677);n(99196);const __=o.__,m=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}],h=[{label:__("Say it differently…","jetpack"),description:{original:"Rewrite it in a way that ",translated:__("Rewrite it in a way that ","jetpack")}},{label:__("Add…","jetpack"),description:{original:"Add more details about ",translated:__("Add more details about ","jetpack")}},{label:__("Remove…","jetpack"),description:{original:"Remove unnecessary details about ",translated:__("Remove unnecessary details about ","jetpack")}}];function g({hasContentBefore:e,hasContent:t,hasPostTitle:n,contentIsLoaded:o,onPromptSelect:g,onSuggestionSelect:f}){const b=__("Write with AI…","jetpack"),{tracks:v}=(0,a.z$)();return(0,r.createElement)(s.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:b,text:b,onToggle:e=>{e&&v.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"write-with-ai"})}},(({onClose:a})=>o?(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},h.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))):(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(s.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(s.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>f("continue")},__("Continue writing","jetpack")),(0,r.createElement)(s.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>f("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(s.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>f("simplify")},__("Simplify","jetpack"))),t&&(0,r.createElement)(s.MenuGroup,{label:__("Based on entire content…","jetpack")},t&&(0,r.createElement)(s.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>f("summarize")},__("Summarize","jetpack")),t&&(0,r.createElement)(s.MenuItem,{icon:p.Z,iconPosition:"left",onClick:()=>f("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},n&&(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>f("titleSummary")},__("Summary based on title","jetpack")),m.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))))))}},27298:(e,t,n)=>{"use strict";n.d(t,{IP:()=>m,Nj:()=>u,ZP:()=>h,bu:()=>d});var r=n(51806),a=n(42290),s=n(13419),o=n(55609),i=n(65736),l=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},p=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${d[n].emoji} ${d[n].label}`))));function m({label:e=__("Change tone","jetpack"),value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.Z})),disabled:s}},(({onClose:e})=>(0,r.createElement)(p,{value:t,onChange:t=>{n(t),e()}})))}function h({value:e=u,onChange:t,disabled:n=!1}){const i=__("Change tone","jetpack"),{tracks:l}=(0,s.z$)();return n?(0,r.createElement)(o.Tooltip,{text:i},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.v_}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:i,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(p,{value:e,onChange:t})))}},4965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(52175),s=n(55609),o=n(65736),i=n(79201),l=n(48381),c=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=o.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:o,handleImageRequest:h,handleTryAgain:g,showRetry:f,contentBefore:b,hasPostTitle:v,wholeContent:k,setUserPrompt:y,recordEvent:w,isGeneratingTitle:E})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,!f&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(p.ZP,{hasContentBefore:!!b?.length,hasContent:!!k?.length,hasPostTitle:v,contentIsLoaded:e,onPromptSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),y(e.translated)},onSuggestionSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Lg}),t(c.Lg,{tone:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(u.ZP,{value:"en",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Nw}),t(c.Nw,{language:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(d.ZP,{onChange:t,exclude:E?["summarize"]:[],disabled:!e}))),(f||g)&&(0,r.createElement)(s.ToolbarGroup,null,!f&&e&&g&&(0,r.createElement)(s.ToolbarButton,{onClick:g},__("Try Again","jetpack")),f&&e&&(0,r.createElement)(s.ToolbarButton,{icon:i.Z,onClick:o},__("Accept","jetpack")),f&&(0,r.createElement)(s.ToolbarButton,{icon:l.Z,onClick:n},__("Retry","jetpack"))),false))},5246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r=n(51806),a=n(6895),s=n(13419),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(99196),d=n(26546),p=n(23795),m=n(63206),h=n(18135),g=n(71449);const __=i.__,f=c()("jetpack-ai-assistant:upgrade-prompt"),b=e=>{const{upgradeType:t}=(0,h.Z)();return"vip"===t?(0,r.createElement)(d.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(({placement:e=null})=>{const{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:l}=(0,m.Z)(),c=(0,g.d)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y,usagePeriod:w}=(0,h.Z)(),E=(0,p.U_)(k)===p.dt?w?.requestsCount:y,{tracks:_}=(0,s.z$)(),C=(0,u.useCallback)((t=>{f("upgrade",e),_.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:E,placement:e}),n(t)}),[n,k,E,_,e]),x=(0,u.useCallback)((()=>{f("contact us",e),_.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[_,e]);if(!c)return(0,r.createElement)(d.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null});if(v){if(!b){const e=(0,a.Z)("jetpack-ai-tiers-more-requests-contact");return(0,r.createElement)(d.p,{buttonText:__("Contact Us","jetpack"),description:__("You have reached the request limit for your current plan.","jetpack"),className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:x})}return(0,r.createElement)(d.p,{buttonText:(0,i.sprintf)(/* Translators: number of requests */ +_n("You have %d auto-share remaining.","You have %d auto-shares remaining.",e,"jetpack"),e):"";return{default:"",exceeded:__("You have reached your auto-share limit. Scheduled posts will not be shared until shares become available.","jetpack"),full:__("You have reached your auto-share limit.","jetpack"),approaching:t}}(u);let p="default",m="none",h=d.default;return c>o?(p="error",m="exceeded",h=d.exceeded):c===o?(m="full",p="error",h=d.full):c>=.9*o?(m="approaching",p="error",h=d.approaching):c>=.8*o&&(m="approaching",p="warning",h=d.approaching),{status:m,noticeType:p,message:h,usedCount:l,scheduledCount:i,remainingCount:u}}),[e,t])}},45579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(9818),i=n(12238),l=n(69307),c=n(65736),u=n(37568),d=n(48751);const __=c.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||a;const[c,m]=(0,l.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,l.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!c.isFetching)return m({...r,isFetching:!0}),s()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then(((e={})=>{const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,c.isFetching,h]);return{...c,doPublicize:g}}},37568:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(23177);function s(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)(a.h);return{...(0,r.useSelect)((e=>{const t=e(a.h),n=t.getConnections(),r=t.getEnabledConnections(),s=t.getDisabledConnections().map((e=>e.id));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:r.length>0,skippedConnections:s,enabledConnections:r}}),[]),toggleById:t,refresh:e}}},48751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(42032),a=n(71806);function s(){const{updateMeta:e,shareMessage:t}=(0,a.R)();return{message:t,maxLength:(0,r.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(9818),a=n(12238),s=n(23177),o=n(86419);function i(){const{mergeConnections:e}=(0,r.useDispatch)(s.h),{didPostSaveRequestSucceed:t,isCurrentPostPublished:n,getEditedPostAttribute:i}=(0,r.useSelect)((e=>e(a.store)),[]);(0,o.M1)((()=>{if(t()&&n()){const t=i("jetpack_publicize_connections");t?.length&&e(t)}}),[t,n,i])}},21052:(e,t,n)=>{"use strict";n.d(t,{Au:()=>l,Wh:()=>c,ZP:()=>u,hi:()=>i,wO:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_AUTO_CONVERSION_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateAutoConversionSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Fl)(e);const t=yield(0,s.wi)();return yield c(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,r.select)(a.Eg).getAutoConversionSettings();return yield c(t),!1}finally{yield l()}},setAutoConversionSettings:c,refreshAutoConversionSettings:function*(){try{yield i();const e=yield(0,s.wi)();return yield c(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield l()}}}},23013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeConnections:()=>u,refreshConnectionTestResults:()=>d,setConnections:()=>l,syncConnectionsToPostMeta:()=>p,toggleConnection:()=>c,toggleConnectionById:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(12238),i=n(74442);function l(e){return{type:i.b,connections:e}}function c(e){return{type:i.L,connectionId:e}}function u(e){return function({dispatch:t,select:n}){const r=n.getConnections(),a=[],s={done:!1,enabled:Boolean(n.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...s,...r.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};a.push(e)}t(l(a))}}function d(e=!1){return async function({dispatch:t}){try{const n=(0,r.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(u(await s()({path:n}))),e&&t(p())}catch(e){}}}function p(){return function({registry:e,select:t}){const n=t.getConnections();return e.dispatch(o.store).editPost({jetpack_publicize_connections:n})}}function m(e,t=!0){return function({dispatch:n}){n(c(e)),t&&n(p())}}},74442:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,b:()=>r});const r="SET_CONNECTIONS",a="TOGGLE_CONNECTION"},54725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(21052),a=n(23013),s=n(371),o=n(72438),i=n(4462);const l={...s.ZP,...i.ZP,...r.ZP,...o.Z,...a}},371:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>l,dz:()=>o,ff:()=>i});var r=n(9818),a=n(23177),s=n(4957);const o="SET_JETPACK_SETTINGS";function i(e){return{type:o,options:e}}const l={updateJetpackSettings:function*(e){try{yield i({is_updating:!0}),yield i(e),yield(0,s.RF)(e);const t=yield(0,s.es)();return yield i(t),!0}catch(e){const t=(0,r.select)(a.Eg).getJetpackSettings();return yield i(t),!1}finally{yield i({is_updating:!1})}},setJetpackSettings:i}},72438:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4957),a=n(21052),s=n(4462);const o={refreshJetpackSocialSettings:function*(){try{yield(0,a.hi)(),yield(0,s.ds)();const e=yield(0,r.mu)();return yield(0,a.Wh)(e.jetpack_social_autoconvert_images),yield(0,s.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,a.Au)(),yield(0,s.Gr)()}}}},4462:(e,t,n)=>{"use strict";n.d(t,{Gr:()=>l,ZP:()=>u,ch:()=>c,ds:()=>i,kg:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateSocialImageGeneratorSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Ux)(e);const t=yield(0,s.oB)();return yield c(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,r.select)(a.Eg).getSocialImageGeneratorSettings();return yield c(t),!1}finally{yield l()}},setSocialImageGeneratorSettings:c,refreshSocialImageGeneratorSettings:function*(){try{yield i();const e=yield(0,s.oB)();return yield c(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield l()}}}},4957:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>k,es:()=>p,mu:()=>b,oB:()=>h,wi:()=>f});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_SETTINGS",o="UPDATE_JETPACK_SETTINGS",i="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",p=()=>({type:s}),m=e=>({type:o,settings:e}),h=()=>({type:i}),g=e=>({type:l,settings:e}),f=()=>({type:c}),b=()=>({type:d}),v=e=>({type:u,settings:e}),k={[s]:function(){return a()({path:"/jetpack/v4/social/settings"})},[o]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[i]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[l]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[c]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[u]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>f,Cd:()=>g,Eg:()=>c,M$:()=>p,cs:()=>h,h:()=>v,qk:()=>m,uJ:()=>d,wV:()=>b});var r=n(9818),a=n(54725),s=n(4957),o=n(45272),i=n(15781),l=n(22987);const c="jetpack-social-plugin",u={reducer:o.Z,actions:a.Z,selectors:l.Z,resolvers:i.ZP,controls:s.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",p="instagram-business",m="linkedin",h="mastodon",g="nextdoor",f="tumblr",b="twitter",v=(0,r.createReduxStore)(c,u);(0,r.register)(v)},20750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(21052);const a=(e={},t)=>t.type===r.wO?{...e,...t.options}:e},71837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(74442);const a=(e={},t)=>{switch(t.type){case r.b:return{...e,connections:t.connections};case r.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9818),a=n(20750),s=n(71837),o=n(80697),i=n(35652),l=n(28696),c=n(54489);const u=(0,r.combineReducers)({sharesData:i.Z,siteData:l.Z,connectionData:s.Z,jetpackSettings:o.Z,socialImageGeneratorSettings:c.Z,autoConversionSettings:a.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(371);const a=(e={},t)=>t.type===r.dz?{...e,...t.options}:e},35652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},28696:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},54489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4462);const a=(e={},t)=>t.type===r.kg?{...e,...t.options}:e},15781:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>c});var r=n(12238),a=n(21052),s=n(23013),o=n(371),i=n(4462),l=n(4957);const c={getJetpackSettings:function*(){try{const e=yield(0,l.es)();if(e)return(0,o.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,l.oB)();if(e)return(0,i.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,l.wi)();if(e)return(0,a.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const n=t.select(r.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,s.setConnections)(n||[]))}}}},68113:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,n)=>{"use strict";function r(e){return e.connectionData?.connections??[]}function a(e){return e.connectionData?.adminUrl??null}function s(e){return r(e).length>0}function o(e){return r(e).filter((e=>!1===e.test_success))}function i(e){return r(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function l(e){return r(e).filter((e=>e.enabled))}function c(e){return r(e).filter((e=>!e.enabled))}function u(e,t,{forceDefaults:n=!1}={}){let a="",s="",o="";if(!n){const n=r(e).find((({service_name:e})=>t===e));if(n){const{display_name:e,profile_display_name:r,profile_picture:i}=n;a="twitter"===t?r:e,o="twitter"===t?e:n.username,s=i}}return{displayName:a,profileImage:s,username:o}}n.r(t),n.d(t,{getConnectionProfileDetails:()=>u,getConnections:()=>r,getConnectionsAdminUrl:()=>a,getDisabledConnections:()=>c,getEnabledConnections:()=>l,getFailedConnections:()=>o,getMustReauthConnections:()=>i,hasConnections:()=>s})},22987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(68113),a=n(43354),s=n(82836),o=n(31473),i=n(85675),l=n(45073);const c={...i.Z,...a,...s.Z,...o,...l.Z,...r.Z}},82836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScheduledSharesCount:()=>l,getShareLimit:()=>o,getSharedPostsCount:()=>u,getSharesUsedCount:()=>i,getTotalSharesCount:()=>c,isShareLimitEnabled:()=>a,numberOfSharesRemaining:()=>p,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>s});var r=n(82836);function a(e){return e.sharesData?.is_share_limit_enabled??!1}function s(e){return!r.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&a(e)}function o(e){return e.sharesData?.share_limit??30}function i(e){return e.sharesData?.publicized_count??0}function l(e){return e.sharesData?.to_be_publicized_count??0}function c(e){const t=i(e)+l(e);return Math.max(t,0)}function u(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function p(e,t={}){if(!s(e))return 1/0;const{includeScheduled:n}={includeScheduled:!0,...t},r=i(e),a=o(e),c=n?l(e):0;return Math.max(a-r-c,0)}},85675:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getBlogID:e=>e.siteData?.blogID??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=255;function a(){return r}},12677:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(13419);function a(){return(0,r.Pb)()?.social?.supportedAdditionalConnections||[]}},42032:(e,t,n)=>{"use strict";n.d(t,{getShareMessageMaxLength:()=>r.A,getSupportedAdditionalConnections:()=>a.h});var r=n(5463),a=n(12677),s=n(581);n.o(s,"useSyncPostDataToStore")&&n.d(t,{useSyncPostDataToStore:function(){return s.useSyncPostDataToStore}})},581:()=>{},13419:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>u.Z,FK:()=>c.FK,HD:()=>c.HD,M6:()=>s.M6,OZ:()=>o.Z,Pb:()=>r.Z,Pm:()=>m.Z,Qq:()=>c.Qq,Rl:()=>c.Rl,T:()=>l.Z,Ug:()=>s.Ug,Wp:()=>s.Wp,X1:()=>c.X1,_D:()=>c._D,aQ:()=>s.aQ,dM:()=>h.d,el:()=>p.Z,lQ:()=>a.Z,lt:()=>h.l,m3:()=>c.m3,o_:()=>i.Z,og:()=>g.Z,z$:()=>d.Z});var r=n(50148),a=n(35004),s=n(99505),o=n(48052),i=n(76714),l=n(80354),c=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959),g=n(19499);n(39058)},6342:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78868),a=n(99196),s=n.n(a);const o=()=>s().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:(e,t,n)=>{"use strict";n.d(t,{d:()=>s,l:()=>o});var r=n(69307),a=n(12953);function s(e){const t={};let n="span",a=e.icon;const s=document.createElement("div");s.innerHTML=e.icon;const o=s.querySelector("svg");return o&&(n="svg",a=o.innerHTML,Array.from(o.attributes).forEach((({nodeName:e,nodeValue:n})=>t[e]=n))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function o(e){return{src:s(e),foreground:(0,a.Z)()}}},12953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(99505);const a="#069e08";function s(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},19499:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){const e=(0,r.Z)();return e?.blocks_variation??"production"}},50148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:(e,t,n)=>{"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:()=>r})},61053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(6975),a=n(31294),s=n(69307);const{tracks:o}=r.Z,{recordEvent:i}=o,l=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:l={}}={})=>{const[c,u]=(0,s.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,s.useCallback)((async(e,t={})=>{d&&g&&h&&i(e,t)}),[d,g,h]);return(0,s.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,s.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(c||(b(r,l),u(!0)))}),[c,t,e,n,p,l,b]),{recordEvent:b,tracks:o}}},11380:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307),s=n(39058);const o=e=>{const{isModuleActive:t,isChangingStatus:n,isLoadingModules:o}=(0,r.useSelect)((t=>{const n=t(s.p);return{isModuleActive:n.isModuleActive(e),isChangingStatus:n.isModuleUpdating(e),isLoadingModules:n.areModulesLoading(e)}}),[s.p]),{updateJetpackModuleStatus:i}=(0,r.useDispatch)(s.p),l=(0,a.useCallback)((t=>i({name:e,active:t})),[e,i]);return(0,a.useMemo)((()=>({isLoadingModules:o,isChangingStatus:n,isModuleActive:t,changeStatus:l})),[o,n,t,l])}},68586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},44166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>d});var r=n(9818),a=n(99505),s=n(82162),o=n(39058);const i="SET_JETPACK_MODULES",l="SET_MODULE_UPDATING";function c(e){return d({isLoading:e})}function u(e,t){return{type:l,name:e,isUpdating:t}}function d(e){return{type:i,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,s.zL)(e);const t=yield(0,s.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,a.Wp)())return!0;try{yield c(!0);const e=yield(0,s.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield c(!1)}}}},82162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>i,ZP:()=>c,zL:()=>l});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_MODULES",o="UPDATE_JETPACK_MODULE_STATUS",i=()=>({type:s}),l=e=>({type:o,settings:e}),c={[s]:function(){return a()({path:"/jetpack/v4/module/all",method:"GET"})},[o]:function({settings:e}){return a()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(9818),a=n(44166),s=n(82162),o=n(42469),i=n(55133),l=n(43524);const c="jetpack-modules",u=(0,r.createReduxStore)(c,{reducer:o.Z,actions:a.ZP,controls:s.ZP,resolvers:i.Z,selectors:l.Z});(0,r.register)(u);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,r.dispatch)(c).setJetpackModules({data:{...d}})},42469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r={isLoading:!1,isUpdating:{},data:{}},a=(e=r,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(44166),a=n(82162);const s={getJetpackModules:function*(){try{const e=yield(0,a.Bs)();if(e)return(0,r.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(99505);const a={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,r.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,n)=>{"use strict";n.d(t,{FK:()=>g,HD:()=>f,Qq:()=>u,Rl:()=>m,X1:()=>d,_D:()=>p,m3:()=>b});var r=n(65736),a=n(96483),s=n(92819),o=n(50148),i=n(48052),l=n(35004),c=n(99505);const __=r.__;function u({planSlug:e,plan:t,postId:n,postType:r}){const o=(0,s.startsWith)(e,"jetpack_")?e:(0,s.get)(t,["path_slug"]),i=(void 0===r?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(r)?"":"edit";return(0,c.Wp)()?(0,a.addQueryArgs)("/"+(0,s.compact)([e,r,(0,l.Z)(),n]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:n,plan_upgraded:1})})();return(0,c.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:i,customerType:"business"}):o&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${o}`,{redirect_to:i})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,i.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,i.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,s.get)((0,o.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,s.map)(h,"name").includes(e),b=e=>(0,s.head)((0,s.filter)(h,(({name:t})=>t===e)))},76714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(98817),a=n(48052);function s(e,t){const{available:n,unavailableReason:s}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:(e,t,n)=>{"use strict";n.d(t,{M6:()=>i,Ug:()=>o,Wp:()=>s,aQ:()=>l});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===a()}function o(){return"atomic"===a()}function i(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function l(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(82674),a=n.n(r),s=n(94333);const o=e=>(0,s.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},83059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>j});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(586),p=n(3639),m=n(92710),h=n(58532),g=n(51128),f=n.n(g),b=(n(99196),n(49259)),v=n(63634),k=n(854),y=n(6747),w=n(81612),E=n(27298);const __=u.__,_=f()("jetpack-ai-assistant:dropdown"),C=[{name:__("Correct spelling and grammar","jetpack"),key:"correct-spelling",aiSuggestion:v.Hd,icon:d.Z},{name:__("Simplify","jetpack"),key:"simplify",aiSuggestion:v.hI,icon:p.Z},{name:__("Summarize","jetpack"),key:"summarize",aiSuggestion:v.Lq,icon:m.Z},{name:__("Expand","jetpack"),key:"make-longer",aiSuggestion:v.TV,icon:h.Z}];function x(e){return e.filter((e=>null!=e)).map((e=>(0,o.getBlockContent)(e))).join("\n\n")}function S({onClose:e,blockType:t}){const[n,o]=(0,c.useState)(!1),{getSelectedBlockClientIds:u,getBlocksByClientId:d}=(0,l.useSelect)("core/block-editor"),{removeBlocks:p,replaceBlock:m}=(0,l.useDispatch)("core/block-editor");(0,c.useEffect)((()=>{const e=u(),t=x(d(e)),n=(0,k.t$)(t);return o(!n.length)}),[d,u]);const{tracks:h}=(0,s.z$)(),g=(n,r={})=>{const a=u(),s=d(a),o=x(s);e(),_("requestSuggestion",n,r),h.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:n,block_type:t});const[i]=s,[l,...c]=a,g={...i?.attributes||{},content:o},f=(0,y.b)(t,g),v={clientId:l,type:n,options:{...r,contentType:"generated",fromExtension:!0}};localStorage.setItem((0,b.$M)(f.clientId),JSON.stringify(v)),m(l,f),p(c)};return(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"jetpack-ai-assistant__info"},__("Add content to activate the tools below","jetpack")),(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(i.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:()=>{const e=u(),n=d(e),r=x(n),[a,...s]=e,[o]=n,i={...o?.attributes||{},content:r};m(a,(0,y.b)(t,i)),p(s),h.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:t})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),C.map((e=>(0,r.createElement)(i.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{g(e.aiSuggestion,{})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(E.IP,{onChange:e=>{g(v.Lg,{tone:e})},disabled:n}),(0,r.createElement)(w.xK,{onChange:e=>{g(v.Nw,{language:e})},disabled:n})))}function j({blockType:e}){const{tracks:t}=(0,s.z$)();return(0,r.createElement)(i.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{className:"jetpack-ai-assistant__button",showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,label:__("AI Assistant","jetpack"),icon:a.u_}),onToggle:n=>{n&&t.recordEvent("jetpack_ai_assistant_extension_toolbar_menu_show",{block_type:e})},renderContent:({onClose:t})=>(0,r.createElement)(S,{onClose:t,blockType:e})})}},3180:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},87445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(6895),s=n(55609),o=n(65736);const __=o.__;const i=function(){const e=(0,a.Z)("jetpack-ai-feedback");return(0,r.createElement)("div",{className:"jetpack-ai-feedback-control"},(0,r.createElement)(s.BaseControl,{label:__("Feedback","jetpack")},(0,r.createElement)("p",null,__("Your feedback is valuable in our commitment to refine and improve this feature.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:e},__("Share your feedback","jetpack"))))}},81612:(e,t,n)=>{"use strict";n.d(t,{QA:()=>h,ZP:()=>f,xK:()=>b});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(61074),l=n(46936),c=n(43618);n(99196);const __=o.__,u=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],d=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,p=__("Translate","jetpack"),m=d?.split("-")[0]||"en",h=(d?.split("-"),{en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),g=({value:e,onChange:t})=>{const n=[...u.filter((e=>e!==m))];return u.includes(m)&&n.unshift(m),(0,r.createElement)(s.MenuGroup,{label:__("Select language","jetpack")},n.map((n=>(0,r.createElement)(s.MenuItem,{key:`key-${n}`,onClick:()=>t(n+" ("+h[n].label+")"),isSelected:e===n},h[n].label))))};function f({value:e=m,label:t=p,onChange:n,disabled:o=!1}){const{tracks:l}=(0,a.z$)();return o?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(i.Z,{icon:c.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:c.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"i18n"})}},(()=>(0,r.createElement)(g,{value:e,onChange:n})))}function b({value:e=m,label:t=p,onChange:n,disabled:a=!1}){return(0,r.createElement)(s.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:t,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},t),(0,r.createElement)(i.Z,{icon:l.Z})),disabled:a}},(({onClose:t})=>(0,r.createElement)(g,{onChange:e=>{n(e),t()},value:e})))}},50297:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(51806),a=n(55609),s=n(65736);const __=s.__,o=({image:e,inModal:t=!1,saveImage:n,setImageModal:s})=>(0,r.createElement)(a.Flex,{direction:"column"},t&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>s(e)})),!t&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))))))},24404:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,l="make-longer",c="makeLonger",u="make-shorter",d="makeShorter",p="summarize",m="summarize",h=[{name:__("Summarize","jetpack"),key:p,aiSuggestion:m},{name:__("Make longer","jetpack"),key:l,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:u,aiSuggestion:d}];function g({key:e,label:t=__("Improve","jetpack"),exclude:n=[],onChange:o,disabled:l=!1}){const{tracks:c}=(0,a.z$)();return l?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(s.Icon,{icon:i.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:i.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&c.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"improve"})}},(()=>{const a=h.filter((e=>!n.includes(e.key)));return(0,r.createElement)(s.MenuGroup,{label:t},a.map((t=>(0,r.createElement)(s.MenuItem,{key:`key-${t.key}`,onClick:()=>o(t.aiSuggestion,{contentType:"generated"}),isSelected:e===t.key},t.name))))}))}},85642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840),l=n(58532),c=n(586),u=n(3639),d=n(92710),p=n(32677);n(99196);const __=o.__,m=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}],h=[{label:__("Say it differently…","jetpack"),description:{original:"Rewrite it in a way that ",translated:__("Rewrite it in a way that ","jetpack")}},{label:__("Add…","jetpack"),description:{original:"Add more details about ",translated:__("Add more details about ","jetpack")}},{label:__("Remove…","jetpack"),description:{original:"Remove unnecessary details about ",translated:__("Remove unnecessary details about ","jetpack")}}];function g({hasContentBefore:e,hasContent:t,hasPostTitle:n,contentIsLoaded:o,onPromptSelect:g,onSuggestionSelect:f}){const b=__("Write with AI…","jetpack"),{tracks:v}=(0,a.z$)();return(0,r.createElement)(s.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:b,text:b,onToggle:e=>{e&&v.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"write-with-ai"})}},(({onClose:a})=>o?(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},h.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))):(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(s.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(s.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>f("continue")},__("Continue writing","jetpack")),(0,r.createElement)(s.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>f("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(s.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>f("simplify")},__("Simplify","jetpack"))),t&&(0,r.createElement)(s.MenuGroup,{label:__("Based on entire content…","jetpack")},t&&(0,r.createElement)(s.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>f("summarize")},__("Summarize","jetpack")),t&&(0,r.createElement)(s.MenuItem,{icon:p.Z,iconPosition:"left",onClick:()=>f("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},n&&(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>f("titleSummary")},__("Summary based on title","jetpack")),m.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))))))}},27298:(e,t,n)=>{"use strict";n.d(t,{IP:()=>m,Nj:()=>u,ZP:()=>h,bu:()=>d});var r=n(51806),a=n(42290),s=n(13419),o=n(55609),i=n(65736),l=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},p=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${d[n].emoji} ${d[n].label}`))));function m({label:e=__("Change tone","jetpack"),value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.Z})),disabled:s}},(({onClose:e})=>(0,r.createElement)(p,{value:t,onChange:t=>{n(t),e()}})))}function h({value:e=u,onChange:t,disabled:n=!1}){const i=__("Change tone","jetpack"),{tracks:l}=(0,s.z$)();return n?(0,r.createElement)(o.Tooltip,{text:i},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.v_}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:i,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(p,{value:e,onChange:t})))}},4965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(52175),s=n(55609),o=n(65736),i=n(79201),l=n(48381),c=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=o.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:o,handleImageRequest:h,handleTryAgain:g,showRetry:f,contentBefore:b,hasPostTitle:v,wholeContent:k,setUserPrompt:y,recordEvent:w,isGeneratingTitle:E})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,!f&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(p.ZP,{hasContentBefore:!!b?.length,hasContent:!!k?.length,hasPostTitle:v,contentIsLoaded:e,onPromptSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),y(e.translated)},onSuggestionSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Lg}),t(c.Lg,{tone:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(u.ZP,{value:"en",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Nw}),t(c.Nw,{language:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(d.ZP,{onChange:t,exclude:E?["summarize"]:[],disabled:!e}))),(f||g)&&(0,r.createElement)(s.ToolbarGroup,null,!f&&e&&g&&(0,r.createElement)(s.ToolbarButton,{onClick:g},__("Try Again","jetpack")),f&&e&&(0,r.createElement)(s.ToolbarButton,{icon:i.Z,onClick:o},__("Accept","jetpack")),f&&(0,r.createElement)(s.ToolbarButton,{icon:l.Z,onClick:n},__("Retry","jetpack"))),false))},5246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r=n(51806),a=n(6895),s=n(13419),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(99196),d=n(26546),p=n(23795),m=n(63206),h=n(18135),g=n(71449);const __=i.__,f=c()("jetpack-ai-assistant:upgrade-prompt"),b=e=>{const{upgradeType:t}=(0,h.Z)();return"vip"===t?(0,r.createElement)(d.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(({placement:e=null})=>{const{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:l}=(0,m.Z)(),c=(0,g.d)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y,usagePeriod:w}=(0,h.Z)(),E=(0,p.U_)(k)===p.dt?w?.requestsCount:y,{tracks:_}=(0,s.z$)(),C=(0,u.useCallback)((t=>{f("upgrade",e),_.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:E,placement:e}),n(t)}),[n,k,E,_,e]),x=(0,u.useCallback)((()=>{f("contact us",e),_.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[_,e]);if(!c)return(0,r.createElement)(d.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null});if(v){if(!b){const e=(0,a.Z)("jetpack-ai-tiers-more-requests-contact");return(0,r.createElement)(d.p,{buttonText:__("Contact Us","jetpack"),description:__("You have reached the request limit for your current plan.","jetpack"),className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:x})}return(0,r.createElement)(d.p,{buttonText:(0,i.sprintf)(/* Translators: number of requests */ __("Upgrade to %d requests","jetpack"),b.limit),checkoutUrl:t,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)((0,i.sprintf)(/* Translators: number of requests */ __("You have reached the requests limit for your current plan. Upgrade now to increase your requests limit to %d.","jetpack"),b.limit),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:C,isRedirecting:l,visible:!0,align:"center",title:null,context:null})}return(0,r.createElement)(d.p,{buttonText:"Upgrade",checkoutUrl:t,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Upgrade now to keep using it.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:n,isRedirecting:l,visible:!0,align:null,title:null,context:null})})(e)}},45624:(e,t,n)=>{"use strict";n.d(t,{Z:()=>I});var r=n(82674),a=n.n(r),s=n(51806),o=n(42290),i=n(13419),l=n(52175),c=n(4981),u=n(55609),d=n(94333),p=n(9818),m=n(69307),h=n(65736),g=n(65235),f=n.n(g),b=n(10185),v=n.n(b),k=n(99196),y=n(84102),w=n(80013),E=n(3180),_=n(87445),C=n(50297),x=n(4965),S=n(5246),j=n(49259),P=n(18135),N=n(60751),L=n(71449),T=n(3687),A=n(63634);const __=h.__,M=new(v())({breaks:!0}),R="post"===window?.Jetpack_Editor_Initial_State?.screenBase,Z=window?.Jetpack_Editor_Initial_State?.["ai-assistant"]?.["is-playground-visible"];function I({attributes:e,setAttributes:t,clientId:n,isSelected:r}){const[h,g]=(0,m.useState)({}),[b,v]=(0,m.useState)(!1),[I,B]=(0,m.useState)([]),[z,D]=(0,m.useState)(null),[F,O]=(0,m.useState)(null),{tracks:U}=(0,i.z$)(),H=(0,p.useSelect)((e=>e("core/editor").getCurrentPostId())),{getBlock:V}=(0,p.useSelect)("core/block-editor"),q=(0,k.useRef)(null),G=(0,k.useRef)(null),{replaceBlocks:$,replaceBlock:W,removeBlock:J}=(0,p.useDispatch)("core/block-editor"),{editPost:K}=(0,p.useDispatch)("core/editor"),{mediaUpload:Y}=(0,p.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return{mediaUpload:t().mediaUpload}}),[]),{isOverLimit:X,requireUpgrade:Q,increaseRequestsCount:ee}=(0,P.Z)(),te=()=>{setTimeout((()=>{q.current?.focus?.()}),100)},ne=()=>{setTimeout((()=>{G.current?.focus?.()}),100)},re=(0,d.useViewportMatch)("medium","<"),{isLoadingCategories:ae,isLoadingCompletion:se,wasCompletionJustRequested:oe,getSuggestionFromOpenAI:ie,stopSuggestion:le,showRetry:ce,contentBefore:ue,postTitle:de,retryRequest:pe,wholeContent:me,requestingState:he}=(0,N.Z)({onSuggestionDone:(0,m.useCallback)((()=>{te(),ee()}),[ee]),onUnclearPrompt:(0,m.useCallback)((()=>{ne(),ee()}),[ee]),onModeration:te,attributes:e,clientId:n,content:e.content,setError:g,tracks:U,userPrompt:e.userPrompt,requireUpgrade:Q,requestingState:e.requestingState}),ge=(0,L.b)(),fe=(0,j.$M)(n);(0,k.useEffect)((()=>{if(!fe)return;const e=JSON.parse(localStorage.getItem(fe));if(!e)return;const{type:t,options:n}=e;localStorage.removeItem(fe),ie(t,n)}),[fe,ie]),(0,k.useEffect)((()=>{h&&O(!1)}),[h]);const be=(0,k.useRef)(e?.content);(0,k.useEffect)((()=>{if(!e?.useGutenbergSyntax)return;if(!be?.current?.length)return;const t=V(n);if(t?.innerBlocks?.length)return;const r=(0,c.parse)(be.current);r?.length&&$(n,r)}),[be,n,$,V,e?.useGutenbergSyntax]),(0,k.useEffect)((()=>{["init","done"].includes(he)&&t({requestingState:he})}),[he,t]);const ve=async t=>{if(b)return;v(!0),g({});const r=await fetch(t),a=await r.blob(),s=new File([a],"jetpack_ai_image.png",{type:"image/png"});Y({filesList:[s],onFileChange:([t])=>{t.id&&W(n,(0,c.createBlock)("core/image",{url:t.url,caption:e.requestedPrompt,alt:e.requestedPrompt}))},allowedTypes:["image"],onError:e=>{console.error(e),v(!1)}}),U.recordEvent("jetpack_ai_dalle_generation_upload",{post_id:H})},ke=e?.useGutenbergSyntax,ye=se||ae,we=!!e.content,Ee="generateTitle"===e.promptType,_e=__("Accept","jetpack"),Ce=__("Accept title","jetpack"),xe=Ee?Ce:_e,Se=(...e)=>{ie(...e),ne()},je=async()=>{let t=[];if(ke)t=V(n),t=t?.innerBlocks||[];else{const n=M.render(e.content||"").replace(/
  • \s+

    /g,"

  • ").replace(/<\/p>\s+<\/li>/g,"
  • ");t=(0,c.rawHandler)({HTML:n})}await $(n,t);const r=(e=>{let t=null;return e.forEach((e=>{const n=document.querySelector(`.wp-block[data-block="${e.clientId}"]`);if(!n)return;"true"===n.contentEditable&&(t=n);const r=n.querySelectorAll("[contenteditable=true]");t=r.length?r[r.length-1]:t})),t})(t);r&&(e=>{const t=window.getSelection();t.selectAllChildren(e),t.collapseToEnd(),e.focus()})(r)},Pe=()=>{je(),U.recordEvent("jetpack_ai_assistant_block_accept",{feature:"ai-assistant"})},Ne=()=>{R?(K({title:e.content?e.content.trim():""}),J(n),U.recordEvent("jetpack_ai_assistant_block_accept",{feature:"ai-assistant"})):Pe()},Le=()=>{le(),te(),U.recordEvent("jetpack_ai_assistant_block_stop",{feature:"ai-assistant"})},[Te,Ae]=(0,m.useState)(!1),Me=()=>{Ae(!Te)},Re=(0,l.useBlockProps)({ref:G,className:f()({"is-waiting-response":oe})}),Ze=(0,l.useInnerBlocksProps)(Re),Ie=__("Ask Jetpack AI…","jetpack"),Be=__("Write about… Make a table for…","jetpack"),ze=(0,s.createElement)(s.Fragment,null,X&&r&&(0,s.createElement)(S.Z,{placement:"ai-assistant-block"}),!ge&&(0,s.createElement)(E.Z,null));return(0,s.createElement)(u.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{esc:()=>{["requesting","suggesting"].includes(he)&&Le()}}},(0,s.createElement)("div",Re,h?.message&&!F&&"error_quota_exceeded"!==h?.code&&(0,s.createElement)(u.Notice,{status:h.status,isDismissible:!1,className:"jetpack-ai-assistant__error"},h.message),we&&!ke&&(0,s.createElement)("div",{className:"jetpack-ai-assistant__content"},(0,s.createElement)(m.RawHTML,null,M.render(e.content))),we&&ke&&(0,s.createElement)("div",a()({className:"jetpack-ai-assistant__content is-layout-building-mode"},Ze)),(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(u.PanelBody,{initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(y.Z,{placement:w.I}))),(0,s.createElement)(u.PanelBody,{initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(_.Z,null)))),Z&&(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(u.PanelBody,{title:__("AI Playground","jetpack"),initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(u.ToggleControl,{label:__("Gutenberg Syntax","jetpack"),onChange:e=>t({useGutenbergSyntax:e}),checked:e.useGutenbergSyntax})),(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(u.ToggleControl,{label:__("GPT-4","jetpack"),onChange:e=>t({useGpt4:e}),checked:e.useGpt4})),(0,s.createElement)(u.PanelRow,null,Te&&(0,s.createElement)(u.Modal,{title:__("Custom System Prompt","jetpack"),onRequestClose:Me},(0,s.createElement)(u.TextareaControl,{rows:20,label:__("Set up the custom system prompt ","jetpack"),onChange:e=>t({customSystemPrompt:e}),className:"jetpack-ai-assistant__custom-prompt",value:e.customSystemPrompt||(0,A.t4)({useGutenbergSyntax:e.useGutenbergSyntax,useGpt4:e.useGpt4})?.content}),(0,s.createElement)("div",{className:"jetpack-ai-assistant__custom-prompt__footer"},(0,s.createElement)(u.Button,{onClick:()=>t({customSystemPrompt:""}),variant:"secondary"},__("Restore the prompt","jetpack")),(0,s.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Close","jetpack")))),(0,s.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Set system custom prompt","jetpack"))))),!ye&&ge&&!Q&&(0,s.createElement)(x.Z,{isWaitingState:ye,contentIsLoaded:we,getSuggestionFromOpenAI:ie,retryRequest:pe,handleAcceptContent:Pe,handleAcceptTitle:Ne,handleGetSuggestion:Se,handleImageRequest:()=>{B([]),g({}),(0,T.b)(""===e.userPrompt.trim()?__("What would you like to see?","jetpack"):e.userPrompt,t,v,B,g,H),U.recordEvent("jetpack_ai_dalle_generation",{post_id:H})},handleTryAgain:null,showRetry:ce,contentBefore:ue,hasPostTitle:!!de?.length,wholeContent:me,promptType:e.promptType,setUserPrompt:e=>{if(!q?.current)return;q.current.focus(),t({userPrompt:e})},recordEvent:U.recordEvent,isGeneratingTitle:Ee}),(0,s.createElement)(o.tK,{ref:q,disabled:Q||!ge,value:e.userPrompt,placeholder:e?.content?Ie:Be,onChange:e=>{O(!0),t({userPrompt:e})},onSend:()=>{Se("userPrompt"),U.recordEvent("jetpack_ai_assistant_block_generate",{feature:"ai-assistant"})},onStop:Le,onAccept:()=>{Ee?Ne():Pe()},onDiscard:()=>{const r=e?.content===V(n).attributes?.content;t({content:e?.originalContent,promptType:void 0,messages:e?.originalMessages}),je(),r?U.recordEvent("jetpack_ai_assistant_block_dismiss"):U.recordEvent("jetpack_ai_assistant_block_discard",{feature:"ai-assistant"})},state:he,isTransparent:Q||!ge,showButtonLabels:!re,showAccept:"init"!==he&&we&&!ye,acceptLabel:xe,showGuideLine:we,showRemove:e?.content?.length>0,bannerComponent:ze}),!b&&I.length>0&&(0,s.createElement)(u.Flex,{direction:"column",style:{width:"100%"}},(0,s.createElement)(u.FlexBlock,{style:{textAlign:"center",margin:"12px",fontStyle:"italic",width:"100%"}},e.requestedPrompt),(0,s.createElement)(u.FlexBlock,{style:{fontSize:"20px",lineHeight:"38px"}},__("Please choose your image","jetpack")),(0,s.createElement)(u.Flex,{direction:"row",wrap:!0},I.map((e=>(0,s.createElement)(C.Z,{setImageModal:D,saveImage:ve,image:e,key:e}))))),!b&&z&&(0,s.createElement)(u.Modal,{onRequestClose:()=>D(null)},(0,s.createElement)(C.Z,{saveImage:ve,setImageModal:D,image:z,inModal:!0}))))}},27559:(e,t,n)=>{"use strict";var r=n(31985),a=n(23536),s=n(45624),o=n(6747);n(81765),n(54765),n(94662);(0,r.S)(a,{edit:s.Z,save:()=>null,transforms:o.Z})},54765:(e,t,n)=>{"use strict";n.d(t,{J7:()=>u,NP:()=>l});var r=n(4981),a=n(9818),s=n(92694),o=n(23536),i=n(71449);const l=["core/paragraph","core/heading","core/list"],c=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-support"];function u(){if(!(0,r.getBlockType)(o.name))return!1;if(!c)return!1;if(!(0,i.b)())return!1;const{errorCode:e}=(0,a.select)("wordpress-com/plans")?.getAiAssistantFeature?.()||{};if(e)return!1;const{getHiddenBlockTypes:t}=(0,a.select)("core/edit-post")||{};return!(t?.()||[]).includes(o.name)}(0,s.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return l.includes(t)&&u()?{...e,supports:{...e.supports,"jetpack/ai":{assistant:!0}}}:e}),100)},49259:(e,t,n)=>{"use strict";n.d(t,{$M:()=>i,ZP:()=>l});var r=n(51806),a=n(52175),s=n(94333),o=(n(99196),n(83059));function i(e){return`ai-assistant-block-${e}`}const l=(0,s.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(o.ZP,{blockType:n})))}),"withAIAssistant")},79191:(e,t,n)=>{"use strict";n.d(t,{Z:()=>C});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(94333),c=n(9818),u=n(69307),d=n(65736),p=n(53961),m=n(65235),h=n.n(m),g=(n(99196),n(3180)),f=n(5246),b=n(18135),v=n(71449),k=n(63634),y=n(79817),w=n(44110);const __=d.__,E={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480};function _(e){if(!e?.length)return"";const t=(0,c.select)("core/block-editor").getBlock(e);if(!t)return"";const{innerBlocks:n}=t;return n?.length?n.reduce(((e,t)=>e+(0,o.serialize)(t)+"\n\n"),""):""}function C({clientId:e,className:t=""}){const n=(0,u.useRef)(null),o=(0,u.useRef)(null),{tracks:d}=(0,s.z$)(),m=(0,v.b)(),{inputValue:C,setInputValue:x,isVisible:S,assistantAnchor:j}=(0,u.useContext)(y.D),{dequeueAiAssistantFeatureAyncRequest:P}=(0,c.useDispatch)("wordpress-com/plans"),N=()=>{setTimeout((()=>{o.current?.focus?.()}),100)},{requestSuggestion:L,requestingState:T,stopSuggestion:A,requestingError:M}=(0,a.X_)({onDone:N}),{requireUpgrade:R}=(0,b.Z)(),Z=M?.code===a.$L||R,I="requesting"===T||"suggesting"===T,B="suggesting"===T||"done"===T,z=__("Ask Jetpack AI to create your form","jetpack"),D=__("Creating your form. Please wait a few moments.","jetpack"),{removeNotice:F}=(0,c.useDispatch)(p.store),O=(0,u.useCallback)((()=>{if(!C?.length)return;F(w.uu);const t=(0,k.r1)(k.Re,{request:C,content:_(e)});P(),L(t,{feature:"jetpack-form-ai-extension"}),d.recordEvent("jetpack_ai_assistant_block_generate",{feature:"jetpack-form-ai-extension"}),n?.current?.focus()}),[e,P,C,F,L,d]),U=(0,u.useCallback)((()=>{A(),N(),d.recordEvent("jetpack_ai_assistant_block_stop",{feature:"jetpack-form-ai-extension"})}),[A,d]),H=(0,l.useViewportMatch)("medium","<"),V=H&&j,q=(0,u.useRef)(null),G=(0,u.useRef)(H),[$,W]=(0,u.useState)(H);if((0,u.useEffect)((()=>{const e=n?.current;if(e)return q?.current||(q.current=new ResizeObserver((e=>{if(!S)return;if(V)return;const t=e[0].contentRect.width{q?.current?.disconnect()}}),[V,S]),(0,u.useEffect)((()=>{S&&d.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:"jetpack/contact-form"})}),[S,d]),(0,u.useEffect)((()=>{const e=setTimeout((()=>{S&&o?.current&&o.current.focus()}),300);return function(){clearTimeout(e)}}),[]),!S)return null;const J=(0,r.createElement)("div",{className:"jetpack-ai-assistant__bar-wrapper"},(0,r.createElement)(i.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{esc:()=>{["requesting","suggesting"].includes(T)&&U()}}},(0,r.createElement)("div",{ref:n,className:h()("jetpack-ai-assistant__bar",{[t]:t,"is-fixed":V,"is-mobile-mode":$}),tabIndex:-1},Z&&(0,r.createElement)(f.Z,{placement:"jetpack-form-block"}),!m&&(0,r.createElement)(g.Z,null),(0,r.createElement)(a.tK,{ref:o,disabled:Z||!m,value:C,placeholder:I?D:z,onChange:x,onSend:O,onStop:U,state:T,isTransparent:Z||!m,showButtonLabels:!$,showGuideLine:B}))));return V?(0,u.createPortal)(J,j):J}},81732:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(51806),a=n(42290),s=n(55609),o=n(94333),i=n(69307),l=n(65736),c=n(99196),u=n(79817),d=n(44110);const __=l.__,p="jetpack-ai-assistant-bar__slot";function m({jetpackFormClientId:e}){const{isVisible:t,toggle:n,setAnchor:l,assistantAnchor:m}=(0,i.useContext)(u.D),{requestingState:h}=(0,a.X_)(),g=(0,i.useRef)(null),f=(0,o.useViewportMatch)("medium","<");(0,c.useEffect)((()=>{if(!g.current)return;const e=g.current.closest(".block-editor-block-contextual-toolbar");if(!e)return;let t=e.parentElement?.querySelector(`.${p}`);if(t)return e.after(t),l(t);t=document.createElement("div"),t.setAttribute("role","toolbar"),t.setAttribute("aria-label",__("AI Assistant","jetpack")),t.setAttribute("aria-orientation","horizontal"),t.className=p;const n=e.offsetHeight;t.style.top=`${n}px`,e.after(t),l(t)}),[l]),(0,c.useEffect)((()=>{f||m?.remove()}),[f,m]);const b=(0,i.useCallback)((()=>{if(!e)return n();(0,d.Vl)(e,n)}),[e,n]),v="requesting"===h||"suggesting"===h;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{"mod+/":n}}),(0,r.createElement)(s.ToolbarButton,{ref:g,showTooltip:!0,onClick:b,"aria-haspopup":"true","aria-expanded":t,label:__("Ask AI Assistant","jetpack"),icon:a.u_,disabled:v}))}},59090:(e,t,n)=>{"use strict";n.d(t,{aE:()=>r,nB:()=>a});const r=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-form-support"]?.available,a=["jetpack/field-name","jetpack/field-email","jetpack/field-text","jetpack/field-textarea","jetpack/field-checkbox","jetpack/field-date","jetpack/field-telephone","jetpack/field-url","jetpack/field-checkbox-multiple","jetpack/field-radio","jetpack/field-select","jetpack/field-consent","jetpack/button"]},94662:(e,t,n)=>{"use strict";n.d(t,{G:()=>f});var r=n(51806),a=n(42290),s=n(13419),o=n(52175),i=n(4981),l=n(94333),c=n(9818),u=n(69307),d=n(92694),p=(n(99196),n(79191)),m=n(81732),h=n(59090),g=n(44110);function f(e,{checkChildrenBlocks:t=!1,clientId:n}={clientId:""}){const r=(0,i.getBlockType)("jetpack/ai-assistant"),{isModuleActive:a}=(0,s.el)("contact-form");if(!a)return!1;if(!r)return!1;if("string"!=typeof e)return!1;if(!h.aE)return!1;if(!n?.length)return!1;if(t){if(!h.nB.includes(e))return!1}else if("jetpack/contact-form"!==e)return!1;const{getHiddenBlockTypes:o}=(0,c.select)("core/edit-post")||{};return!(o?.()||[]).includes(e)}const b=(0,l.createHigherOrderComponent)((e=>t=>{const n=f(t?.name,{clientId:t.clientId}),{increaseAiAssistantRequestsCount:s}=(0,c.useDispatch)("wordpress-com/plans"),{eventSource:i}=(0,a.X_)({onDone:(0,u.useCallback)((()=>{s()}),[s]),onError:(0,u.useCallback)((e=>{"error_network"!==e.code&&"error_quota_exceeded"!==e.code&&s()}),[s])}),l=(0,u.useCallback)((()=>{i&&i?.close()}),[i]);if((0,u.useEffect)((()=>()=>{"jetpack/contact-form"===t?.name&&l()}),[l,t?.name]),!n)return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(p.Z,{clientId:t.clientId}),(0,r.createElement)(o.BlockControls,{group:"block"},(0,r.createElement)(m.Z,null)))}),"jetpackFormEditWithAiComponents");(0,d.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return"jetpack/contact-form"!==t?e:{...e,edit:(0,a.oN)((0,g.ZP)(b(e.edit)))}}),100);const v=(0,l.createHigherOrderComponent)((e=>t=>{const n=(0,c.useSelect)((e=>{const n=e("core/block-editor"),{getBlockParentsByBlockName:r}=n;return r(t.clientId,"jetpack/contact-form")?.[0]}),[t.clientId]);if(!f(t?.name,{checkChildrenBlocks:!0,clientId:n}))return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(o.BlockControls,{group:"parent"},(0,r.createElement)(m.Z,{jetpackFormClientId:n})))}),"jetpackFormChildrenEditWithAiComponents");(0,d.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return h.nB.includes(t)?{...e,edit:v(e.edit)}:e}))},79817:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,v:()=>o});var r=n(51806),a=n(69307);const s=(0,a.createContext)({}),o=({value:e,children:t})=>(0,r.createElement)(s.Provider,{value:e,children:t})},44110:(e,t,n)=>{"use strict";n.d(t,{Vl:()=>b,ZP:()=>v,uu:()=>f});var r=n(51806),a=n(42290),s=n(4981),o=n(55609),i=n(94333),l=n(9818),c=n(69307),u=n(65736),d=n(53961),p=(n(99196),n(94662)),m=n(5863),h=n(56359),g=n(79817);const __=u.__,f="ai-assistant";function b(e,t){(0,l.dispatch)("core/block-editor").selectBlock(e).then(t)}const v=(0,i.createHigherOrderComponent)((e=>t=>{const{clientId:n,isSelected:i}=t,{replaceInnerBlocks:u}=(0,l.useDispatch)("core/block-editor"),v=(0,l.useSelect)((e=>e("core/editor")),[]),k=(0,l.useSelect)((e=>e("core/block-editor")),[]),y=v.getCurrentPostId(),w=k.getBlock(n),[E,_]=(0,c.useState)(""),C="jetpack/contact-form"===w?.name&&0===w?.innerBlocks?.length,[x,S]=(0,c.useState)(C),[j,P]=(0,c.useState)(!1),[N,L]=(0,c.useState)(null),T=(0,c.useRef)([]),A=(0,c.useCallback)((()=>{S(!0)}),[]),M=(0,c.useCallback)((()=>{S(!1)}),[]),R=(0,c.useCallback)((()=>{S(!x)}),[x]),Z=(0,c.useCallback)((e=>{L(e)}),[]),{createNotice:I}=(0,l.useDispatch)(d.store),B=(0,c.useCallback)((({severity:e,message:t,code:n})=>{n!==a.$L&&I(e,t,{isDismissible:!0,id:f})}),[I]);(0,c.useEffect)((()=>{i||M()}),[i,M]);const z=(0,c.useMemo)((()=>({inputValue:E,setInputValue:_,isVisible:x,show:A,hide:M,toggle:R,isFixed:j,setAssistantFixed:P,assistantAnchor:N,setAnchor:Z})),[E,x,A,M,R,j,N,Z]),D=(0,c.useCallback)(((e,t=!1)=>{const r=e.replace(//g,""),a=(0,h.J)(r),o=(0,s.parse)(a).filter((e=>e.isValid&&!["core/freeform","core/missing","core/html"].includes(e.name)));let i=!1;if(o.length0){const e=o[o.length-1],t=T.current[o.length-1];i=!(0,m.c)(e,t)}if(o.length>0&&(o.length!==T.current.length||i)&&(u(n,o),T.current=o),t){const e=o.filter((e=>"jetpack/button"===e.name));if(T.current=T.current||[],e.length>1){let t=0;T.current=T.current.filter((n=>"jetpack/button"!==n.name||(t++,t===e.length))),u(n,T.current)}else 0===e.length&&u(n,[...T.current,(0,s.createBlock)("jetpack/button",{label:__("Submit","jetpack"),element:"button",text:__("Submit","jetpack"),borderRadius:8,lock:{remove:!0}})]);T.current=[]}}),[n,u]);return(0,a.X_)({askQuestionOptions:{postId:y},onDone:e=>{D(e,!0),_("")},onSuggestion:D,onError:B}),(0,p.G)(t.name,{clientId:t.clientId})?(0,r.createElement)(g.v,{value:z},(0,r.createElement)(o.KeyboardShortcuts,{shortcuts:{"mod+/":()=>b(n,A)}},(0,r.createElement)(e,t))):(0,r.createElement)(e,t)}),"withUiHandlerDataProvider")},63206:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6895),a=n(13419),s=n(46867),o=n(18135);function i(){const{nextTier:e,tierPlansEnabled:t}=(0,o.Z)(),n=t?(0,r.Z)("jetpack-ai-yearly-tier-upgrade-nudge",{site:(0,a.lQ)(),path:`jetpack_ai_yearly:-q-${e?.limit}`,query:`redirect_to=${window.location.href}`}):(0,r.Z)("jetpack-ai-monthly-plan-ai-assistant-block-banner",{site:(0,a.lQ)()}),i=(0,a.Ug)()||(0,a.Wp)()?n:`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/add-jetpack-ai`,{autosaveAndRedirect:l,isRedirecting:c}=(0,s.Z)(i);return{checkoutUrl:i,autosaveAndRedirect:l,isRedirecting:c}}},18135:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9818);function a(){const{data:e,loading:t}=(0,r.useSelect)((e=>{const{getAiAssistantFeature:t,getIsRequestingAiAssistantFeature:n}=e("wordpress-com/plans");return{data:t(),loading:n()}}),[]),{fetchAiAssistantFeature:n,increaseAiAssistantRequestsCount:a}=(0,r.useDispatch)("wordpress-com/plans");return{...e,loading:t,error:null,refresh:n,increaseRequestsCount:a}}},42890:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6975),a=n(69307);const s=window?.Jetpack_Editor_Initial_State?.tracksUserData||null,o=parseInt(window?.Jetpack_Editor_Initial_State?.wpcomBlogId)||0,i=()=>((0,a.useEffect)((()=>{s&&r.Z.initialize(s?.userid,s?.username,o?{blog_id:o}:{})}),[]),r.Z)},60751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(42290),a=n(4981),s=n(9818),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(27298),d=n(63634),p=n(854);const __=i.__,m=c()("jetpack-ai-assistant:event"),h=c()("jetpack-ai-assistant:prompt"),g=({attributes:e,clientId:t,content:n,setError:i,tracks:l,userPrompt:c,onSuggestionDone:g,onUnclearPrompt:f,onModeration:b,requireUpgrade:v,requestingState:k})=>{const[y,w]=(0,o.useState)(!1),[E,_]=(0,o.useState)(!1),[C,x]=(0,o.useState)(!1),[S,j]=(0,o.useState)(!1),[P,N]=(0,o.useState)(""),{updateBlockAttributes:L}=(0,s.useDispatch)("core/block-editor"),{dequeueAiAssistantFeatureAyncRequest:T,setAiAssistantFeatureRequireUpgrade:A}=(0,s.useDispatch)("wordpress-com/plans"),[M,R]=(0,o.useState)(k||"init"),Z=(0,o.useRef)(),I=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("title")));let B=!1;const z=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("categories")))||[],D=(0,s.useSelect)((e=>z.map((t=>{const n=e("core").getEntityRecord("taxonomy","category",t);if(n)return n;B=!0})).filter(Boolean)),[z]),F=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("tags")),[])||[],O=(0,s.useSelect)((e=>F.map((t=>{const n=e("core").getEntityRecord("taxonomy","post_tag",t);if(n)return n;B=!0})).filter(Boolean)),[F]);(0,o.useEffect)((()=>(w(B),()=>{Z?.current&&(m("Cleaning things up..."),Z?.current?.close())})),[B,Z]);const U=(0,s.useSelect)((e=>e("core/editor").getCurrentPostId())),H=(D.filter((e=>1!==e.id)).map((({name:e})=>e)).join(", "),O.map((({name:e})=>e)).join(", "),async(o,g={})=>{T();const k=g?.functions?.reduce(((e,{name:t,implementation:n})=>({...e,[t]:n})),{});if(v)return R("error"),_(!1),x(!1),j(!1),void i({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"});if(g={retryRequest:!1,tone:u.Nj,...g},E)return;j(!1),i({});let y=P;l.recordEvent("jetpack_ai_chat_completion",{post_id:U});const w=[...e.messages]??[];let C={};if(g.retryRequest)C=y[y.length-1];else{const r=e?.isLayoutBuldingModeEnable?(0,p.WN)(t):(0,p.xN)();y=(0,d.Iq)({generatedContent:n,allPostContent:r,postContentAbove:(0,p.h7)(t),currentPostTitle:I,options:g,userPrompt:c,type:o,isGeneratingTitle:"generateTitle"===e.promptType,useGutenbergSyntax:!!e?.useGutenbergSyntax,customSystemPrompt:e?.customSystemPrompt}),C=y.pop(),y=[...y,...w],y.push(C),N(y),"generateTitle"!==e.promptType&&L(t,{promptType:o})}try{_(!0),x(!0),y.forEach((({role:e,content:t},n)=>h("(%s/%s) %o\n%s",n+1,y.length,`[${e}]`,t))),R("requesting"),Z.current=await(0,r.jt)(y,{postId:U,requireUpgrade:v,feature:e?.useGpt4?"ai-assistant-experimental":"ai-assistant",functions:g?.functions}),R("suggesting")}catch(e){e.message?i({message:e.message,code:e?.code||"unknown",status:"error"}):i({message:__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack"),code:"unknown",status:"error"}),j(!0),_(!1),x(!1)}const S=async t=>{const{detail:n}=t,a={role:"assistant",content:null,function_call:n},s=await(k[n.name]?.(JSON.parse(n.arguments))),o={role:"function",name:n?.name,content:JSON.stringify(s)};y=[...y,a,o],Z?.current?.removeEventListener("function_done",S),Z?.current?.removeEventListener("done",M),Z?.current?.removeEventListener("error_unclear_prompt",B),Z?.current?.removeEventListener("error_network",D),Z?.current?.removeEventListener("error_context_too_large",z),Z?.current?.removeEventListener("error_service_unavailable",F),Z?.current?.removeEventListener("error_quota_exceeded",O),Z?.current?.removeEventListener("error_moderation",H),Z?.current?.removeEventListener("suggestion",q),Z.current=await(0,r.jt)(y,{postId:U,requireUpgrade:v,feature:e?.useGpt4?"ai-assistant-experimental":null,functions:g.functions}),Z?.current?.addEventListener("function_done",S),Z?.current?.addEventListener("done",M),Z?.current?.addEventListener("error_unclear_prompt",B),Z?.current?.addEventListener("error_network",D),Z?.current?.addEventListener("error_context_too_large",z),Z?.current?.addEventListener("error_service_unavailable",F),Z?.current?.addEventListener("error_quota_exceeded",O),Z?.current?.addEventListener("error_moderation",H),Z?.current?.addEventListener("suggestion",q)},M=n=>{const{detail:r}=n;R("done");const o=r.replaceAll(d._W,""),i={role:"assistant",content:o};w.push(C,i),h("Add %o\n%s",`[${C.role}]`,C.content),h("Add %o\n%s",`[${i.role}]`,i.content),w.length>20&&w.splice(0,w.length-20),V();const l=e?.useGutenbergSyntax;if(L(t,{content:o,messages:w}),!l)return;const{replaceInnerBlocks:c}=(0,s.dispatch)("core/block-editor"),u=(0,a.parse)(r).filter((e=>e.isValid));c(t,u)},B=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),i({code:"error_unclear_prompt",message:__("Your request was unclear. Mind trying again?","jetpack"),status:"info"}),f?.()},z=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!1),i({code:"error_context_too_large",message:__("The content is too large to be processed all at once. Please try to shorten it or divide it into smaller parts.","jetpack"),status:"info"})},D=({detail:r})=>{R("error");const{name:a,message:s}=r;"TypeError"===a&&"Failed to fetch"===s&&(w.splice(0,8),L(t,{messages:w}),y=(0,d.Iq)({generatedContent:n,allPostContent:(0,p.xN)(),postContentAbove:(0,p.h7)(t),currentPostTitle:I,options:g,userPrompt:c,type:o,isGeneratingTitle:"generateTitle"===e.promptType,useGutenbergSyntax:!!e?.useGutenbergSyntax,customSystemPrompt:e?.customSystemPrompt}),N([...y,...w,C])),Z?.current?.close(),_(!1),x(!1),j(!0),i({code:"error_network",message:__("It was not possible to process your request. Mind trying again?","jetpack"),status:"info"})},F=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!0),i({code:"error_service_unavailable",message:__("Jetpack AI services are currently unavailable. Sorry for the inconvenience.","jetpack"),status:"info"})},O=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!1),A(!0),i({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"})},H=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!1),i({code:"error_moderation",message:__("This request has been flagged by our moderation system. Please try to rephrase it and try again.","jetpack"),status:"info"}),b?.()},q=e=>{x(!1),m("(suggestion)",e?.detail),L(t,{content:e?.detail?.replaceAll(d._W,"")})};return Z?.current?.addEventListener("function_done",S),Z?.current?.addEventListener("done",M),Z?.current?.addEventListener("error_unclear_prompt",B),Z?.current?.addEventListener("error_network",D),Z?.current?.addEventListener("error_context_too_large",z),Z?.current?.addEventListener("error_service_unavailable",F),Z?.current?.addEventListener("error_quota_exceeded",O),Z?.current?.addEventListener("error_moderation",H),Z?.current?.addEventListener("suggestion",q),Z?.current});function V(){Z?.current&&(Z?.current?.close(),_(!1),x(!1),g?.(),R("done"))}return{isLoadingCategories:y,isLoadingCompletion:E,wasCompletionJustRequested:C,setIsLoadingCategories:w,setShowRetry:j,showRetry:S,postTitle:I,contentBefore:(0,p.h7)(t),wholeContent:(0,p.xN)(),requestingState:M,getSuggestionFromOpenAI:H,stopSuggestion:V,retryRequest:()=>H("",{retryRequest:!0})}}},71449:(e,t,n)=>{"use strict";n.d(t,{b:()=>u,d:()=>d});var r=n(13419),a=n(51128),s=n.n(a);const o=window?.JP_CONNECTION_INITIAL_STATE,i=s()("jetpack-ai-assistant:connection");let l=!1;const c=e=>{l||(i(e),l=!0)};function u(){return(0,r.Wp)()?(c("Simple site connected ✅"),!0):(0,r.Ug)()?(c("Atomic site connected ✅"),!0):o?.connectionStatus?.isUserConnected?(c("Jetpack user is connected ✅"),!0):(c("User is not connected ❌"),!1)}function d(){if((0,r.Wp)())return!0;return!1==!(o?.userConnectionData?.currentUser?.permissions??{}).manage_options}},3687:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(86989),a=n.n(r),s=n(65736);const __=s.__;function o(e,t,n,r,s,o){n(!0),s(null),t({requestedPrompt:e}),a()({path:"/wpcom/v2/jetpack-ai/images/generations",method:"POST",data:{prompt:e,post_id:o}}).then((e=>{n(!1);const t=e.data.map((e=>"data:image/png;base64,"+e.b64_json));r(t)})).catch((e=>{e.message?s(e.message):s(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),n(!1)}))}},57832:(e,t,n)=>{"use strict";n.d(t,{v_:()=>i,x1:()=>l});var r=n(63634);const a="title",s="content",o=null;function i(e,t){return{role:"jetpack-ai",context:{type:"ai-assistant-initial-prompt",for:u(e),...t?.length?{custom_system_prompt:t}:{}}}}function l({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:a,options:s,type:o,userPrompt:i,isGeneratingTitle:l}){const u=[],d="generated"===s?.contentType;let p=null;switch(o){case r.qA:p=a;break;case r.sz:case r.hI:case r.Hd:p=n;break;case r.jf:p=t;break;case r.TV:case r.DR:p=e;break;case r.Lg:case r.Lq:case r.Nw:p=d?e:t;break;case r.Gh:p=e||t}const m=function(e,t){return!e&&t?.length>0?{role:"jetpack-ai",context:{type:"ai-assistant-relevant-content",content:t}}:null}(o===r.Gh?!!e?.length:d,p);return m&&u.push(m),u.push({role:"jetpack-ai",context:c({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:a,options:s,type:o,userPrompt:i,isGeneratingTitle:l})}),u}function c({options:e,type:t,userPrompt:n,isGeneratingTitle:i}){const l=function(e,t,n){return e?a:!t||n?s:o}(i,"generated"===e?.contentType,e?.fromExtension||!1);return{type:u(t),...l?{subject:l}:{},...t===r.Lg&&e?.tone?{tone:e.tone}:{},...t===r.Nw&&e?.language?{language:e.language}:{},...t===r.Gh&&n?{request:n}:{}}}function u(e){return{[r.qA]:"ai-assistant-summary-by-title",[r.sz]:"ai-assistant-continue-writing",[r.hI]:"ai-assistant-simplify",[r.Hd]:"ai-assistant-correct-spelling",[r.jf]:"ai-assistant-generate-title",[r.TV]:"ai-assistant-make-longer",[r.DR]:"ai-assistant-make-shorter",[r.Lg]:"ai-assistant-change-tone",[r.Lq]:"ai-assistant-summarize",[r.Nw]:"ai-assistant-change-language",[r.Gh]:"ai-assistant-user-prompt"}[e]}},63634:(e,t,n)=>{"use strict";n.d(t,{DR:()=>p,Gh:()=>f,Hd:()=>c,Iq:()=>T,Lg:()=>m,Lq:()=>h,Nw:()=>g,Re:()=>b,SV:()=>v,TV:()=>d,_W:()=>y,hI:()=>l,jf:()=>u,qA:()=>o,r1:()=>A,sz:()=>i,t4:()=>w});var r=n(51128),a=n.n(r),s=n(57832);const o="titleSummary",i="continue",l="simplify",c="correctSpelling",u="generateTitle",d="makeLonger",p="makeShorter",m="changeTone",h="summarize",g="changeLanguage",f="userPrompt",b="jetpackFormCustomPrompt",v=!0,k=a()("jetpack-ai-assistant:prompt"),y="````";function w({context:e="You are an advanced polyglot ghostwriter. Your task is to generate and modify content based on user requests. This functionality is integrated into the Jetpack product developed by Automattic. Users interact with you through a Gutenberg block, you are inside the WordPress editor",rules:t,useGutenbergSyntax:n=!1,useMarkdown:r=!0,customSystemPrompt:a=null}){let s="";t?.length&&(s=t.map((e=>`- ${e}.`)).join("\n")+"\n");let o=`${e}. Strictly follow these rules:\n\n${s}${r?"- Format your responses in Markdown syntax, ready to be published.":""}\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`;return n&&(o=`${e}. Strictly follow these rules:\n\t\n${s}- Format your responses in Gutenberg HTML format including HTML comments for WordPress blocks. All responses must be valid Gutenberg HTML.\n- Use only WordPress core blocks\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`),a&&(o=a),{role:"system",content:o}}function E(e){return`${y}${e.replaceAll(y,"")}${y}`}function _({content:e,role:t="user"}){return[{role:t,content:`Repeat the text delimited with ${y}, without the delimiter, correcting any spelling and grammar mistakes directly in the text without providing feedback about the corrections, keeping the language of the text: ${E(e)}`}]}function C({content:e,role:t="user"}){return[{role:t,content:`Simplify the text delimited with ${y}, using words and phrases that are easier to understand and keeping the language of the text: ${E(e)}`}]}function x({content:e,role:t="user"}){return[{role:t,content:`Summarize the text delimited with ${y}, keeping the language of the text: ${E(e)}`}]}function S({content:e,role:t="user"}){return[{role:t,content:`Expand the text delimited with ${y} to about double its size, keeping the language of the text: ${E(e)}`}]}function j({content:e,language:t,role:n="user"}){return[{role:n,content:`Translate the text delimited with ${y} to ${t}, preserving the same core meaning and tone: ${E(e)}`}]}function P({content:e,tone:t,role:n="user"}){return[{role:n,content:`Rewrite the text delimited with ${y}, with a ${t} tone, keeping the language of the text: ${E(e)}`}]}function N({content:e,request:t}){if(!t)throw new Error("You must provide a custom prompt for the Jetpack Form Custom Prompt");return[{role:"jetpack-ai",context:{type:"form-ai-extension",content:e,request:t}}]}const L=({rules:e=[],request:t=null,relevantContent:n=null,isContentGenerated:r=!1,isGeneratingTitle:a=!1,useGutenbergSyntax:s=!1,customSystemPrompt:o=null})=>{if(!t&&!n)throw new Error("You must provide either a request or content");const i=[w({rules:e,useGutenbergSyntax:s,customSystemPrompt:o})];if(null!=n&&n?.length){const e=n.replaceAll(y,"");r||i.push({role:"user",content:`The specific relevant content for this request, if necessary, delimited with ${y} characters: ${y}${e}${y}`})}const l={role:"user",content:t};return a&&(l.content+=" Only output a title, do not generate body content."),i.push(l),i.forEach((e=>{k(`Role: ${e?.role}.\nMessage: ${e?.content}\n---`)})),i};function T({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:r,options:a,type:b,userPrompt:k,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E}){if(v){return[(0,s.v_)(b,E),...(0,s.x1)({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:r,options:a,type:b,userPrompt:k,isGeneratingTitle:y})]}const _="generated"===a?.contentType,C=function(e,t=!1,n){const r="generated"===n?.contentType;let a="the title";t||(a=r?"your last answer":"the content");const s=`. Do not switch to any language other than the language of ${a} in your response`;switch(e){case o:return{request:`Write a short piece for a blog post based on ${a}, keeping the same language`};case i:return{request:`Continue writing from ${a}${s}.`,rules:r?[]:["Only output the continuation of the content, without repeating it"]};case l:return{request:`Simplify ${a}${s}.`,rules:["Use words and phrases that are easier to understand for non-technical people","Use as much of the original language as possible"]};case c:return{request:`Repeat ${a}, correcting any spelling and grammar mistakes, and do not add new content${s}.`};case u:return{request:"Generate a new title for this blog post and only output the title.",rules:["Only output the raw title, without any prefix or quotes"]};case d:return{request:`Make ${a} longer${s}.`};case p:return{request:`Make ${a} shorter${s}.`};case m:return{request:`Rewrite ${a} with ${/^[aeiou]/i.test(n.tone)?"an":"a"} ${n.tone} tone${s}.`};case h:return{request:`Summarize ${a}${s}.`};case g:return{request:`Translate ${a} to the following language: ${n.language}.`};default:return null}}(b,y,a);if(b!==f){let a;switch(b){case o:a=r;break;case i:case l:case c:a=n;break;case u:a=t;break;case d:case p:a=e;break;case m:case h:case g:a=_?e:t}return L({...C,relevantContent:a,isContentGenerated:_,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E})}return L({request:k,relevantContent:e||t,isContentGenerated:!!e?.length,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E})}function A(e,t){k("Addressing prompt type: %o %o",e,t);const{prevMessages:n=[]}=t,r={role:"system",content:"You are an advanced polyglot ghostwriter. Your task is to help the user create and modify content based on their requests.\nWriting rules:\n- Execute the request without any acknowledgment or explanation to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n"},a=[...n];switch(a.push(r),e){case c:return[...a,..._(t)];case l:return[...a,...C(t)];case h:return[...a,...x(t)];case d:return[...a,...S(t)];case g:return[...a,...j(t)];case m:return[...a,...P(t)];case b:return[...n,...N(t)];default:throw new Error(`Unknown prompt type: ${e}`)}}},74359:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r=new(n(92213).Z)({emDelimiter:"_",headingStyle:"atx"});r.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}});const a=r},854:(e,t,n)=>{"use strict";n.d(t,{WN:()=>l,h7:()=>o,t$:()=>c,xN:()=>i});var r=n(4981),a=n(9818),s=n(74359);function o(e){if(!e)return"";const t=(0,a.select)("core/block-editor"),n=t.getBlockIndex(e),o=t.getBlocks().slice(0,n)??[];return o?.length?s.Z.turndown((0,r.serialize)(o)):""}function i(){const e=(0,a.select)("core/block-editor").getBlocks();return e?.length?s.Z.turndown((0,r.serialize)(e)):""}function l(e){const t=(0,a.select)("core/block-editor").getBlock(e);return t?.innerBlocks?.length?t.innerBlocks.filter((e=>null!=e)).map((e=>(0,r.getBlockContent)(e.clientId))).join("\n\n"):""}function c(e){if(!e?.replace(/\s+/,"").length)return"";const t=document.createElement("div");t.innerHTML=e;const{textContent:n,innerText:r}=t;return n&&!n.replace(/\s+/,"").length||r&&!r.replace(/\s+/,"").length?"":t.textContent||t.innerText||""}},5863:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});const r=e=>{delete e.clientId;for(const t of e.innerBlocks??[])r(t);return e},a=e=>r((e=>JSON.parse(JSON.stringify(e)))(e));function s(e,t){const n=a(e),r=a(t);return JSON.stringify(n)===JSON.stringify(r)}},56359:(e,t,n)=>{"use strict";function r(e){const t=document.createElement("div");return t.innerHTML=e,t.innerHTML}n.d(t,{J:()=>r})},81765:(e,t,n)=>{"use strict";var r=n(4981),a=n(92694),s=n(54765),o=n(49259);(0,a.addFilter)("blocks.registerBlockType","jetpack/handle-jetpack-ai-supports",(function(e){const t=(0,r.getBlockSupport)(e,"jetpack/ai");return t&&t?.assistant&&(0,s.J7)()?{...e,edit:(0,o.ZP)(e.edit)}:e}),100)},6747:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u,b:()=>c});var r=n(4981),a=n(23536),s=n(54765),o=n(63634),i=n(74359);const l=[];function c(e,t){const{content:n,...s}=t;let l=n;"core/heading"===e&&t?.level&&(l=l.replace(/<(\/?)h\d([^>]*)>/g,`<$1h${t.level}$2>`));const c=i.Z.turndown(l),u=[];return o.SV?u.push({role:"jetpack-ai",context:{type:"ai-assistant-relevant-content",content:c}}):(u.push({role:"user",content:"Tell me some content for this block, please."}),u.push({role:"assistant",content:c})),(0,r.createBlock)(a.name,{...s,content:c,originalContent:c,messages:u,originalMessages:u})}for(const e of s.NP)l.push({type:"block",blocks:[e],isMatch:()=>(0,s.J7)(),transform:(t,n)=>{const a=(0,r.getSaveContent)(e,t,n);return c(e,{...t,content:a})}});const u={from:l}},98825:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);if(window?.Jetpack_Editor_Initial_State?.jetpack?.is_current_user_connected)return null;return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},56352:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{let e=window?.Jetpack_Editor_Initial_State?.adminUrl||"";e=e.replace(/wp-admin\/\?frame-nonce=[a-z0-9]+/,"wp-admin/");const t=`${e}admin.php?page=jetpack-search`,{autosaveAndRedirect:n,isRedirecting:a}=(0,o.Z)(t);if(window?.Jetpack_AIChatBlock?.jetpackSettings?.instant_search_enabled)return null;return(0,r.createElement)(s.p,{buttonText:__("Enable Jetpack Search","jetpack"),checkoutUrl:t,className:"jetpack-ai-connect-banner",description:__("You need to enable Jetpack Search so that Jetpack AI can index your site.","jetpack"),goToCheckoutPage:e=>{n(e)},isRedirecting:a,visible:!0,align:null,title:null,context:null})}},23719:(e,t,n)=>{"use strict";n.d(t,{V:()=>l});var r=n(51806),a=n(52175),s=n(55609),o=n(37798),i=n(65736);const __=i.__;function l({setAttributes:e,placeholder:t,showCopy:n,showFeedback:i,showSources:l}){const[c,u]=(0,o.useEntityProp)("root","site","jetpack_search_ai_prompt_override");return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,r.createElement)(s.BaseControl,{label:__("Placeholder Text","jetpack"),className:"jetpack-ai-chat__ask-button-text"},(0,r.createElement)(s.TextControl,{placeholder:__("Ask a question about this site.","jetpack"),onChange:t=>e({placeholder:t}),value:t})))),(0,r.createElement)(a.InspectorAdvancedControls,null,(0,r.createElement)(s.BaseControl,{label:__("Additional instructions","jetpack"),help:__("Give Jetpack AI additional instructions for answer length, format, and tone.","jetpack")},(0,r.createElement)(s.TextareaControl,{value:c,onChange:u})),(0,r.createElement)(s.ToggleControl,{label:__("Show copy answer button.","jetpack"),help:__("Allow users to easily copy the answer.","jetpack"),checked:n,onChange:t=>e({showCopy:t})}),(0,r.createElement)(s.ToggleControl,{label:__("Show rating button.","jetpack"),help:__("Allow users to rate the answer and give feedback.","jetpack"),checked:i,onChange:t=>e({showFeedback:t})}),(0,r.createElement)(s.ToggleControl,{label:__("Show list of sources.","jetpack"),help:__("Show used sources at the bottom of the answer.","jetpack"),checked:l,onChange:t=>e({showSources:t})})))}},74021:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(51806),a=n(42290),s=n(52175),o=n(55609),i=n(9818),l=n(98825),c=n(56352),u=n(23719);function d({attributes:e,setAttributes:t,clientId:n}){const d=(0,s.useBlockProps)(),p=(0,i.useSelect)((e=>e("core/block-editor").isBlockSelected(n)),[n]);return(0,r.createElement)("div",d,(0,r.createElement)(l.Z,null),(0,r.createElement)(c.Z,null),(0,r.createElement)("div",{className:"jetpack-ai-chat-question-wrapper"},(0,r.createElement)(o.TextControl,{className:"jetpack-ai-chat-question-input",placeholder:e.placeholder,disabled:!0}),(0,r.createElement)(s.RichText,{className:"wp-block-button__link jetpack-ai-chat-question-button",onChange:e=>t({askButtonLabel:e}),value:e.askButtonLabel,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),p&&(0,r.createElement)(a.Eo,null),(0,r.createElement)(s.InspectorControls,null,(0,r.createElement)(u.V,{askButtonLabel:e.askButtonLabel,placeholder:e.placeholder,setAttributes:t,showCopy:e.showCopy,showFeedback:e.showFeedback,showSources:e.showSources})))}},86116:(e,t,n)=>{"use strict";var r=n(31985),a=n(21540),s=n(74021),o=n(148);(0,r.S)(a,{edit:s.Z,save:o.Z})},148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(51806),a=n(52175);function s({attributes:e}){const t=a.useBlockProps.save({"data-ask-button-label":e.askButtonLabel});return(0,r.createElement)("div",t)}},77567:(e,t,n)=>{"use strict";n.d(t,{K:()=>r});const r=["A digital Illustration of the a purely mechanical television, 4k, detailed, fantasy vivid colors","3D render of a floating futuristic castle in a clear sky, digital art","Hedgehog smelling a flower | clear blue sky | intricate artwork by Beatrix Potter | cottagecore aesthetic | 8K | highly detailed | wide angle |","Hyper realistic photo of a high end futuristic single-level house where walls are made of windows, light coming through the window, mid century modern style, cinematic lighting","Pink ape Astronaut in space holding a claymate in a photorealistic style, digital art","Studio photography set of high detail irregular marble stones with gold lines stacked in impossible balance, perfect composition, cinematic light photo studio, beige color scheme, indirect lighting, 8k, elegant and luxury style","Ultrawide, highway, with golden ratio style, 4K , sides are prairies, light is Golden hour, sky with red Clouds, ultrarealistic, CinémaScope, ultra wide format, ratio 16/9, 1/1000 sec, maximum resolution, Sharp details","A photo of cat flying out to space as an astronaut, digital art","A hyper realistic rilakkuma enjoying an icecream in the snow","A lush tropical forest with a waterfall.","A majestic snowy mountain peak.","A beautiful sunset over a beach.","A serene lake surrounded by trees.","A picturesque countryside with rolling hills.","A colorful hot air balloon in the sky.","A peaceful Zen garden.","A grand castle on a hill.","A lively street market in a bustling city.","A delightful flower garden in full bloom.","A cozy cabin in the woods.","A vibrant coral reef teeming with sea life.","A classic European city with cobblestone streets.","A stunning waterfall cascading into a crystal clear pool.","A secluded cabin on the edge of a lake.","A beautiful desert landscape with sand dunes.","A majestic elephant in its natural habitat.","A charming countryside village with thatched roof cottages.","A dreamy castle floating on a cloud.","A whimsical tree house in a forest.","A vibrant city skyline at night.","A picturesque vineyard with rows of grapevines.","A peaceful Japanese garden with a koi pond.","A charming lighthouse on a rocky coastline.","A beautiful waterfall surrounded by greenery.","A dreamy castle with a moat and drawbridge.","A colorful hot air balloon festival.","A beautiful garden with a fountain and sculptures.","A picturesque countryside with a windmill.","A stunning mountain landscape with a rainbow."]},84295:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(13419),s=n(86989),o=n.n(s),i=n(52175),l=n(4981),c=n(55609),u=n(9818),d=n(69307),p=n(65736),m=n(77567);const __=p.__;function h({attributes:e,setAttributes:t,clientId:n}){const[s,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)([]),[f,b]=(0,d.useState)(null),[v,k]=(0,d.useState)(""),{replaceBlock:y}=(0,u.useDispatch)(i.store),[w,E]=(0,d.useState)(null),[_]=(0,d.useState)((C=m.K)[Math.floor(Math.random()*C.length)]);var C;const x=__("Retry","jetpack"),S=__("Submit","jetpack"),j=w?x:S,{tracks:P}=(0,a.z$)(),{mediaUpload:N}=(0,u.useSelect)((e=>{const{getSettings:t}=e(i.store);return{mediaUpload:t().mediaUpload}}),[]),L=(0,u.useSelect)((e=>e("core/editor").getCurrentPostId())),T=({image:e,inModal:t=!1})=>(0,r.createElement)(c.Flex,{direction:"column"},t&&(0,r.createElement)(c.FlexItem,{style:{"text-align":"center"}},(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>A(e)},__("Use this image","jetpack"))),(0,r.createElement)(c.FlexBlock,null,(0,r.createElement)("img",{className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>b(e)})),!t&&(0,r.createElement)(c.FlexBlock,null,(0,r.createElement)(c.Flex,{direction:"column",style:{"align-items":"center"}},(0,r.createElement)(c.FlexItem,null,(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>A(e)},__("Use this image","jetpack")))))),A=async t=>{if(s)return;p(!0),E(null);const r=await fetch(t),a=await r.blob(),o=new File([a],"jetpack_ai_image.png",{type:"image/png"});N({filesList:[o],onFileChange:([t])=>{t.id&&y(n,(0,l.createBlock)("core/image",{url:t.url,caption:e.requestedPrompt,alt:e.requestedPrompt}))},allowedTypes:["image"],onError:e=>{console.error(e),p(!1)}}),P.recordEvent("jetpack_ai_dalle_generation_upload",{post_id:L})};return(0,r.createElement)("div",(0,i.useBlockProps)(),(0,r.createElement)(c.Placeholder,{label:__("AI Image","jetpack"),notices:w&&[(0,r.createElement)("div",null,w)]},!s&&0===h.length&&(0,r.createElement)(c.Flex,{expanded:!0},(0,r.createElement)(c.FlexBlock,null,(0,r.createElement)(c.TextareaControl,{label:__("What would you like to see?","jetpack"),placeholder:_,allowedFormats:[],onChange:k,rows:6}),(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>{p(!1),g([]),E(null),function(e,t,n,r,a,s){n(!0),a(null),t({requestedPrompt:e}),o()({path:"/wpcom/v2/jetpack-ai/images/generations",method:"POST",data:{prompt:e,post_id:s}}).then((e=>{n(!1);const t=e.data.map((e=>"data:image/png;base64,"+e.b64_json));r(t)})).catch((e=>{e.message?a(e.message):a(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),n(!1)}))}(""===v.trim()?_:v,t,p,g,E,L),P.recordEvent("jetpack_ai_dalle_generation",{post_id:L})}},j))),!s&&h.length>0&&(0,r.createElement)(c.Flex,{direction:"column",style:{width:"100%"}},(0,r.createElement)(c.FlexBlock,{style:{textAlign:"center",margin:"12px",fontStyle:"italic",width:"100%"}},e.requestedPrompt),(0,r.createElement)(c.FlexBlock,{style:{fontSize:"20px",lineHeight:"38px"}},__("Please choose your image","jetpack")),(0,r.createElement)(c.Flex,{direction:"row",wrap:!0},h.map((e=>(0,r.createElement)(T,{image:e}))))),!s&&f&&(0,r.createElement)(c.Modal,{onRequestClose:()=>b(null)},(0,r.createElement)(T,{image:f,inModal:!0})),e.content&&(0,r.createElement)("div",{className:"content"},e.content),s&&(0,r.createElement)(c.FlexBlock,{style:{padding:"10px",textAlign:"center"}},(0,r.createElement)(c.Spinner,{style:{height:"calc(4px * 20)",width:"calc(4px * 20)"}}))))}},6454:(e,t,n)=>{"use strict";var r=n(31985),a=n(41107),s=n(84295);(0,r.S)(a,{edit:s.Z,save:()=>""})},55410:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(86989),o=n.n(s),i=n(52175),l=n(55609),c=n(9818),u=n(69307),d=n(65736),p=n(59958);const __=d.__,m=(e="",t=[],n="",r="")=>{const a=t.filter((function(e){return e&&e.attributes&&e.attributes.content})).map((function(e){return e.attributes.content.replaceAll("
    ","\n")})).join("\n").slice(-1024);if(!(e||a||n||r))return!1;let s="";return s=e?(0,d.sprintf)(/** translators: This will be the beginning of a prompt that will be sent to OpenAI based on the post title. */ __("Please help me write a short piece of a blog post titled '%1$s'","jetpack"),e):__("Please help me write a short piece of a blog post","jetpack"),n&&( diff --git a/_inc/blocks/editor.asset.php b/_inc/blocks/editor.asset.php index eea590df42..4dab916b64 100644 --- a/_inc/blocks/editor.asset.php +++ b/_inc/blocks/editor.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '7ca37b7df911b311f9f6'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'd7c69cd0df890502492e'); diff --git a/_inc/blocks/editor.js b/_inc/blocks/editor.js index b4ffe9405f..a2b0f1bee6 100644 --- a/_inc/blocks/editor.js +++ b/_inc/blocks/editor.js @@ -4,9 +4,9 @@ _n("This post will be shared to %d connection.","This post will be shared to %d _n("%d character remaining","%d characters remaining",o,"jetpack"),o)})}},62578:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(55609),a=n(65736),s=n(61074),o=n(6163),i=n(65235),l=n.n(i),c=n(25162),u=n.n(c),d=n(82283);const __=a.__,p=({children:e,type:t="default",actions:n=[],onDismiss:a})=>{const i=l()(d.Z.notice,d.Z[`notice--${t}`]);return React.createElement("div",{className:i},React.createElement("div",{className:d.Z.content}," ",e," "),a&&React.createElement("button",{className:d.Z.dismiss,onClick:a},React.createElement(r.VisuallyHidden,null,__("Dismiss notice","jetpack")),React.createElement(s.Z,{icon:o.Z})),n&&n.length>0&&React.createElement("div",{className:d.Z.actions},n.map((e=>e))))};p.propTypes={children:u().node.isRequired,type:u().oneOf(["default","highlight","warning","error"]),actions:u().arrayOf(u().element),onDismiss:u().func};const m=p},8714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(55609),a=n(9818),s=n(12238),o=n(69307),i=n(65736),l=n(14085),c=n(86419),u=n(37568),d=n(49021),p=n(95788),m=n(3176),h=n(91474),g=n(23761);const __=i.__,f=({prePublish:e,children:t})=>{const{refresh:n,hasConnections:i,hasEnabledConnections:f}=(0,u.Z)(),b=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),{isPublicizeEnabled:v,hidePublicizeFeature:k,togglePublicizeFeature:y}=(0,l.Z)();(0,c.M1)((function(){f&&n()}),[f,n]);const w=e?o.Fragment:r.PanelBody,E=e?{}:{title:__("Share this post","jetpack"),className:g.Z.panel};return React.createElement(w,E,t,!k&&React.createElement(o.Fragment,null,!b&&React.createElement(r.ToggleControl,{label:v?__("Share when publishing","jetpack"):__("Sharing is disabled","jetpack",0),onChange:y,checked:v,disabled:!i}),React.createElement(d.Z,null),React.createElement(p.Z,null),React.createElement(h.o,null)),b&&React.createElement(m.u,null))}},91750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n(88275),a=n(13419),s=n(9818),o=n(72067),i=n(12238),l=n(65736),c=n(37548),u=n(34607),d=n(45078);const __=l.__;function p(){const{isCurrentPostPublished:e}=(0,s.useSelect)((e=>e(i.store)),[]);return e()?React.createElement(o.PluginPostPublishPanel,{initialOpen:!0,title:__("Manual sharing","jetpack"),id:"publicize-manual-sharing",icon:React.createElement(a.Pm,null)},React.createElement(r.ZP,null,React.createElement(c.T,{className:d.Z.description,variant:"body-small"}),React.createElement(u.n,null))):null}},52403:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(6895),a=n(13419),s=n(86989),o=n.n(s),i=n(72067),l=n(69307),c=n(14085),u=n(86419),d=n(37568),p=n(19649);const m=()=>{const[e,t]=(0,l.useState)((0,a.Pb)()?.social?.reviewRequestDismissed??!0),[n,s]=(0,l.useState)(!1),{hasEnabledConnections:m}=(0,d.Z)(),{isPublicizeEnabled:h,isPostAlreadyShared:g}=(0,c.Z)();(0,u.e3)((()=>{s(!g&&h&&m)}),[g,m,h]);const f=(0,l.useCallback)((()=>{const e=(0,a.Pb)()?.social?.dismissReviewRequestPath??null;o()({path:e,method:"POST",data:{dismissed:!0}}).catch((e=>{throw e})),t(!0)}),[]);return e||!n?null:React.createElement(i.PluginPostPublishPanel,{id:"publicize-title"},React.createElement(p.Z,{href:(0,r.Z)("jetpack-social-plugin-reviews"),onClose:f}))}},77106:(e,t,n)=>{"use strict";n(9818),n(23177)},19649:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(88275),a=n(90526),s=n(13419),o=n(65736),i=n(99196),l=n(2097);const __=o.__,c=({href:e,onClose:t})=>{const{recordEvent:n}=(0,s.z$)({pageViewEventName:"social_plugin_review_prompt",pageViewNamespace:"jetpack",pageViewSuffix:"view"}),c=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_new_review_click")}),[n]),u=(0,i.useCallback)((()=>{n("jetpack_social_plugin_review_prompt_dismiss_click"),t()}),[n,t]);return React.createElement(r.ZP,null,React.createElement("div",{className:l.Z.prompt},React.createElement("h2",{className:l.Z.header},/* translators: %s is the celebration emoji */ /* translators: %s is the celebration emoji */ (0,o.sprintf)(__("Presto! %s","jetpack"),String.fromCodePoint(127881))),React.createElement("p",null,__("Just like that, Jetpack Social has shared your post to your connected social accounts.","jetpack")),React.createElement("p",null,__("Please leave a review to let others know how easy getting your posts on social media can be!","jetpack")),React.createElement("div",{className:l.Z.buttons},React.createElement(a.Z,{onClick:c,isExternalLink:!0,href:e,className:l.Z.button},__("Leave a Review","jetpack")),React.createElement(a.Z,{onClick:u,variant:"link",className:l.Z.button},__("Dismiss","jetpack")))))}},69709:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(65736),a=n(14085),s=n(78619);const __=r.__;function o(){const{connectionsAdminUrl:e}=(0,a.Z)();return React.createElement("a",{className:s.Z["settings-link"],href:e,target:"_blank",rel:"noreferrer",title:__("Connect an account","jetpack")},React.createElement("svg",{width:"24",height:"24",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",fill:"#F6F7F7"}),React.createElement("path",{d:"M19 13.3333H14.6667V9H13.3333V13.3333H9V14.6667H13.3333V19H14.6667V14.6667H19V13.3333Z",fill:"black"}),React.createElement("rect",{x:"0.375",y:"0.375",width:"27.25",height:"27.25",rx:"1.125",stroke:"#A7AAAD",strokeWidth:"0.75",strokeDasharray:"2 2"})))}},2817:(e,t,n)=>{"use strict";n.d(t,{o:()=>a});var r=n(65736);const __=r.__,a=[{label:__("X","jetpack"),networkName:"x",url:"https://x.com/intent/tweet?text={{text}}&url={{url}}"},{label:__("WhatsApp","jetpack"),networkName:"whatsapp",url:"https://api.whatsapp.com/send?text={{text}}"},{label:__("Facebook","jetpack"),networkName:"facebook",url:"https://www.facebook.com/sharer/sharer.php?u={{url}}"}]},22917:(e,t,n)=>{"use strict";n(34607)},34607:(e,t,n)=>{"use strict";n.d(t,{n:()=>g});var r=n(3396),a=n(90526),s=n(45106),o=n(14203),i=n(13419),l=n(69307),c=n(65736),u=n(65235),d=n.n(u),p=n(2817),m=n(30664),h=n(38730);const __=c.__;function g({buttonStyle:e="icon",buttonVariant:t}){const n=(0,h.S)(),{recordEvent:u}=(0,i.z$)(),g=(0,l.useCallback)((()=>{u("jetpack_social_share_button_clicked",{network:"clipboard"})}),[u]),f=(0,l.useCallback)((()=>n("{{text}}\n{{url}}",!1)),[n]),b=(0,l.useCallback)((function(e,t){return function(n){n.preventDefault(),u("jetpack_social_share_button_clicked",t),window.open(e,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600")}}),[u]);return React.createElement("div",{className:d()(m.Z["share-buttons"],{[m.Z.vertical]:e.includes("text")})},p.o.map((({label:o,networkName:i,url:l})=>{const u=n(l),d="icon"===e?React.createElement(r.av,{serviceName:i}):null,p=(0,c.sprintf)(/* translators: %s is the name of a social network, e.g. Twitter. */ __("Share on %s","jetpack"),o);return React.createElement("div",{className:m.Z.container,key:i},React.createElement(a.Z,{icon:d,variant:t,"aria-label":p,href:u,target:"_blank",rel:"noopener noreferrer",onClick:b(u,{network:i}),className:"icon"===e?m.Z[i]:"has-text"},"icon"===e?null:React.createElement(React.Fragment,null,"icon-text"===e&&React.createElement(r.av,{className:m.Z[i],serviceName:i}),React.createElement(s.ZP,{className:m.Z.label,component:"span"},p))))})),React.createElement("div",{className:m.Z.container},React.createElement(o.Z,{buttonStyle:e,onCopy:g,textToCopy:f,className:"icon"===e?m.Z.clipboard:" has-text",variant:t},"icon"===e?null:React.createElement(s.ZP,{className:m.Z.label,component:"span"},__("Copy to clipboard","jetpack")))))}},38730:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var r=n(9818),a=n(69307),s=n(71806);function o(){const{shareMessage:e}=(0,s.R)(),{message:t,link:n}=(0,r.useSelect)((t=>{const n=t("core/editor").getEditedPostAttribute;return{link:n("link"),message:e||n("meta")?.jetpack_seo_html_title||n("title")}}),[e]);return(0,a.useCallback)(((e,r=!0)=>{let a=t,s=n;return e.includes("{{url}}")||(a=a+"\n\n"+s,s=""),r&&(a=encodeURIComponent(a),s=encodeURIComponent(s)),e.replace("{{text}}",a).replace("{{url}}",s)}),[n,t])}},32637:(e,t,n)=>{"use strict";n.d(t,{r:()=>d});var r=n(43521),a=n(69307),s=n(65736),o=n(65235),i=n.n(o),l=n(73640);const __=s.__,_x=s._x,c={error:"var(--jp-red-50)",warning:"var(--jp-yellow-20)",default:"var(--jp-green)"},u={error:"var(--jp-red-50)",warning:"var(--jp-yellow-20)",default:"var(--jp-green-5)"},d=({usedCount:e,scheduledCount:t,remainingCount:n,className:s,noticeType:o="default",legendCaption:d})=>{const p=(0,a.useMemo)((()=>{const r=__("scheduled","jetpack"),a=__("used or scheduled","jetpack");return[("default"===o||0===t)&&{count:e,backgroundColor:c[o],label:__("used","jetpack")},t>0&&{count:"default"===o?t:t+e,backgroundColor:u[o],label:"default"===o?r:a},{count:n,backgroundColor:"var(--jp-gray-off)",label:_x("left","Referring to the quantity remaning, not the direction - left/right.","jetpack")}].filter(Boolean)}),[e,o,t,n]);return React.createElement("div",{className:i()(l.Z.wrapper,s)},React.createElement(r.Z,{totalCount:e+t+n,items:p,className:l.Z["bar-wrapper"],tableCaption:d,legendTitle:d,recordTypeLabel:__("Share type","jetpack"),recordCountLabel:__("Usage","jetpack")}))}},91474:(e,t,n)=>{"use strict";n.d(t,{o:()=>h});var r=n(55609),a=n(9818),s=n(12238),o=n(69307),i=n(65736),l=n(53961),c=n(14085),u=n(45579),d=n(37568);const __=i.__;function p(e=__("Unable to share the Post","jetpack")){const{createErrorNotice:t}=(0,a.dispatch)(l.store);t(e,{id:"publicize-post-share-message"})}function m(){const{hasEnabledConnections:e}=(0,d.Z)(),{isPublicizeEnabled:t}=(0,c.Z)(),{isFetching:n,isError:i,isSuccess:m,doPublicize:h}=(0,u.Z)(),g=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]);(0,o.useEffect)((()=>{if(!n)return i?p():void(m&&function(){const{createSuccessNotice:e}=(0,a.dispatch)(l.store);e(__("Post shared","jetpack"),{id:"publicize-post-share-message",type:"snackbar"})}())}),[n,i,m]);const f=!t||!e||!g||n,b=(0,o.useCallback)((()=>{if(!g)return p(__("You must publish your post before you can share it.","jetpack"));(0,a.dispatch)(l.store).removeNotice("publicize-post-share-message"),h()}),[h,g]);return React.createElement(r.Button,{variant:"secondary",onClick:b,disabled:f,isBusy:n},__("Share post","jetpack"))}function h(){const{isRePublicizeUpgradableViaUpsell:e}=(0,c.Z)();return(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[])?e?null:React.createElement(r.PanelRow,null,React.createElement(m,null)):null}},54005:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(55609),a=n(69307),s=n(65736),o=n(75263),i=n(9888),l=n(81469);const __=s.__,c=({prePublish:e=!1})=>{const t=e?a.Fragment:r.PanelBody,n=e?{}:{title:__("Social Image Generator","jetpack")},{isEnabled:s,setIsEnabled:c}=(0,o.Z)(),[u,d]=(0,a.useState)(!1),p=(0,a.useCallback)((()=>d(!0)),[]),m=(0,a.useCallback)((()=>d(!1)),[]);return React.createElement(t,n,u&&React.createElement(l.Z,{onClose:m}),React.createElement(r.ToggleControl,{label:__("Enable Social Image","jetpack"),help:s?"":__("Social Image is disabled for this post.","jetpack"),checked:s,onChange:c}),s&&React.createElement(React.Fragment,null,React.createElement("hr",null),React.createElement(i.ZP,null),React.createElement("hr",null),React.createElement(r.Button,{variant:"secondary",onClick:p,label:__("Open the Social Image Generator settings","jetpack")},__("Settings","jetpack"))))}},81469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(75263),l=n(98811),c=n(9888),u=n(88649),d=n(39356),p=n(40088);const __=o.__,m=["image/jpeg","image/png"],h=__("Choose Image","jetpack"),g=({onClose:e})=>{const{customText:t,imageType:n,imageId:o,template:g,updateSettings:f}=(0,i.Z)(),[b,v]=(0,s.useState)(o),[k,y]=(0,s.useState)(n||"featured"),[w,E]=(0,s.useState)(t),[_,C]=(0,s.useState)(g),[x]=(0,l.Z)(b),S=(0,s.useCallback)((()=>{f({template:_,image_type:k,custom_text:w||"",..."custom"===k&&{image_id:b}}),e()}),[f,_,k,b,w,e]),j=(0,s.useCallback)((e=>{v(e?.id)}),[v]);return React.createElement(r.ZP,{targetDom:document.body},React.createElement(a.Modal,{onRequestClose:e},React.createElement(c.ZP,{className:p.Z.preview,imageId:b,customText:w,imageType:k,template:_}),React.createElement(a.SelectControl,{label:__("Image Type","jetpack"),value:k||"featured",options:[{label:__("Featured Image","jetpack"),value:"featured"},{label:__("Custom Image","jetpack"),value:"custom"},{label:__("No Image","jetpack"),value:"none"}],onChange:y}),"custom"===k&&React.createElement(u.Z,{buttonLabel:h,subTitle:__("Add a custom image","jetpack"),mediaId:b,mediaDetails:x,onChange:j,allowedMediaTypes:m,wrapperClassName:p.Z.mediaPicker}),React.createElement(a.TextControl,{className:p.Z.customText,value:w||"",onChange:E,label:__("Custom Header","jetpack"),help:__("By default the post title is used for the image. You can use this field to set your own text.","jetpack")}),React.createElement(a.BaseControl,{label:__("Templates","jetpack"),className:p.Z.templateControl},React.createElement(d.Z,{value:_,onTemplateSelected:C})),React.createElement(a.Button,{onClick:e,variant:"tertiary"},__("Cancel","jetpack")),React.createElement(a.Button,{onClick:S,variant:"primary"},__("Save","jetpack"))))}},79631:(e,t,n)=>{"use strict";n(9818),n(69307),n(65736),n(99196),n(23177),n(8350)},8350:(e,t,n)=>{"use strict";n(55609),n(69307),n(65736),n(39356),n(15214)},39356:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(69307),a=n(65736),s=n(65235),o=n.n(s),i=n(47320),l=n(57227);const __=a.__,c=({value:e=null,onTemplateSelected:t=null})=>{const n=(0,r.useCallback)((e=>{const n=e.target.id;t?.(n)}),[t]);return React.createElement("div",{className:i.Z.templates},l.Z.map((t=>React.createElement("button",{onClick:n,id:t.name,key:t.name,className:o()(i.Z.template,{[i.Z["template--active"]]:t.name===e})},React.createElement("img",{src:t.image,alt:t.label}),React.createElement("span",{className:"screen-reader-text"},/* translators: %s is the name of the template */ /* translators: %s is the name of the template */ -(0,a.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(30253),a=n(91948),s=n(5353);const o=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},76848:(e,t,n)=>{"use strict";n(9818),n(69307),n(99196),n(23177)},53513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(88219),l=n(89696);const __=o.__,c=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d({disabled:e=!1}){const{shouldUploadAttachedMedia:t,updateShouldUploadAttachedMedia:n}=(0,i.Z)(),o=(0,s.useCallback)((e=>{n(e)}),[n]),d=e?a.Disabled:s.Fragment,p=e?{className:l.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(d,p,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:t,onChange:o,label:__("Share as a social post","jetpack"),help:e?c:u})))}},63855:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(13477),o=n(9818),i=n(48751),l=n(23177);const c=(0,o.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,i.Z)(),{title:n,excerpt:r,content:c}=e,u=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n}=e(l.Eg).getConnectionProfileDetails(l.uJ);return{displayName:t,avatarUrl:n}}));return React.createElement(s.S,a()({},e,{type:"article",user:u,customText:t||r||c||n}))}))},83704:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(82674),a=n.n(r),s=n(17915),o=n(9818),i=n(22629),l=n(99196),c=n.n(l);const u=function(e){const t=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,i.decodeEntities)(t("root","site").title)}));return c().createElement(s.X,a()({},e,{siteTitle:t}))}},4124:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(4049),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,image:n,media:s}=e,{username:c,profileImage:u}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.M$))),{message:d}=(0,i.Z)(),p=d||t;return o().createElement(r.V,{image:n,media:s,name:c,profileImage:u,caption:p})}},27725:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(93453),a=n(9818),s=n(65736),o=n(99196),i=n.n(o),l=n(48751),c=n(23177);const __=s.__;function u(e){const{title:t,url:n,image:s,media:o}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(c.Eg).getConnectionProfileDetails(c.qk))),{message:p}=(0,l.Z)(),m=`${p||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:s,name:u,profileImage:d,title:t,description:m,url:n,media:o})}},28586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(82674),a=n.n(r),s=n(60312),o=n(9818),i=n(22629),l=n(71806),c=n(48751),u=n(23177);const d=e=>{const{message:t}=(0,c.Z)(),{content:n,siteName:r}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,i.decodeEntities)(n().title)}})),{shouldUploadAttachedMedia:d}=(0,l.R)(),p=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n,username:r}=e(u.Eg).getConnectionProfileDetails(u.cs);return{displayName:t,avatarUrl:n,address:r}})),m=e.media?.[0],h=m?.type.startsWith("image/")?m.url:null;return React.createElement(s.I,a()({},e,{siteName:r,user:p,description:n,customText:t,customImage:h,isSocialPost:d}))}},8454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(55609),a=n(65736),s=n(39517),o=n(41809),i=n(9279);const __=a.__,l=function({onClose:e,initialTabName:t}){const n=(0,o.P)(),{image:a,media:l,title:c,description:u,url:d}=(0,i.u)();return React.createElement(r.Modal,{onRequestClose:e,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:e,icon:s.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:n,initialTabName:t},(e=>React.createElement("div",null,React.createElement(e.preview,{title:c,description:u,url:d,image:a,media:l})))))}},18553:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(93122),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,url:n,image:s,media:c}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.Cd))),{message:p}=(0,i.Z)(),m=`${p||t} ${c.length?n:""}`.trim();return o().createElement(r.m,{image:s,name:u,profileImage:d,title:t,description:m,url:n,media:c})}},74140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(55609),a=n(65736),s=n(41809);const __=a.__,_x=a._x,o=({openModal:e})=>{const t=(0,s.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},t.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:e,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(1044),o=n(9818),i=n(48751),l=n(23177);const c=e=>{const{content:t,author:n}=(0,o.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{message:r}=(0,i.Z)(),c=(0,o.useSelect)((e=>{const{displayName:t,profileImage:r}=e(l.Eg).getConnectionProfileDetails(l.Bb);return{displayName:t||n,avatarUrl:r}}),[n]);return React.createElement(s.b,a()({},e,{user:c,description:t,customText:r}))}},24766:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(835),a=n(9818),s=n(99196),o=n.n(s),i=n(71806),l=n(23177);const c=function({title:e,description:t,image:n,url:s,media:c}){const{shareMessage:u}=(0,i.R)(),d=(0,a.useSelect)((r=>{const{displayName:a,profileImage:o,username:i}=r(l.Eg).getConnectionProfileDetails(l.wV);return[{name:a,profileImage:o,screenName:i,text:u+(c.length?` ${s}`:""),cardType:n?"summary_large_image":"summary",title:e,description:t,image:n,media:c,url:s}]}),[e,n,t,c,s,u]);return o().createElement(r.c,{tweets:d,hidePostPreview:!0})}},41809:(e,t,n)=>{"use strict";n.d(t,{P:()=>k});var r=n(82674),a=n.n(r),s=n(3396),o=n(65736),i=n(99196),l=n.n(i),c=n(23177),u=n(42032),d=n(63855),p=n(83704),m=n(4124),h=n(27725),g=n(28586),f=n(18553),b=n(94714),v=n(24766);const __=o.__;function k(){const e=(0,u.getSupportedAdditionalConnections)(),t=e.includes(c.M$),n=e.includes(c.cs),r=e.includes(c.Cd);return(0,i.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"google"},e)),name:"google",preview:p.Z},{title:__("X","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"x"},e)),name:"x",preview:v.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:d.Z},t?{title:__("Instagram","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:m.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:h.y},r?{title:__("Nextdoor","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"nextdoor"},e)),name:"nextdoor",preview:f.T}:null,{title:__("Tumblr","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"tumblr-alt"},e)),name:"tumblr",preview:b.Z},n?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:g.Z}:null].filter(Boolean)),[t,n,r])}},9279:(e,t,n)=>{"use strict";n.d(t,{u:()=>l});var r=n(9818),a=n(65736),s=n(71806),o=n(90785),i=n(25399);const __=a.__;function l(){const{attachedMedia:e,imageGeneratorSettings:t,shouldUploadAttachedMedia:n}=(0,s.R)();return(0,r.useSelect)((r=>{const{getMedia:a}=r("core"),{getEditedPostAttribute:s,getEditedPostContent:l}=r("core/editor"),c=s("featured_media");let u=c?(0,i.i)(a(c)):"";const d=t.enabled?(0,o.t)(t.token):"";if(d)u=d;else if(e?.[0]?.id){const[t]=e;!!t.id&&a(t.id)?.mime_type?.startsWith("image/")&&t.url&&(u=t.url)}if(!u){const e=(0,i.T)(l());e&&(u=e)}const p=[];if(n)if(d)p.push({type:"image/jpeg",url:d,alt:""});else{const t=e=>{const t=a(e);return t?{type:t.mime_type,url:(0,i.i)(t),alt:t.alt_text}:null};for(const{id:n}of e){const e=t(n);e&&p.push(e)}if(0===p.length&&c){const e=t(c);e&&p.push(e)}}return{title:s("meta")?.jetpack_seo_html_title||s("title"),description:s("meta")?.advanced_seo_description||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:s("link"),image:u,media:p,initialTabName:null}}),[n,e,t])}},25399:(e,t,n)=>{"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}function a(e){const t=(new DOMParser).parseFromString(e,"text/html"),n=Array.from(t.querySelectorAll("img")),r=n[0]?.src;return r??null}n.d(t,{T:()=>a,i:()=>r})},13858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(69307),a=n(87728);const s=({sourceUrl:e,mime:t,duration:n})=>{const[s,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(0),c=(0,r.useRef)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{c.current?.load()}),[e]);const p=(0,r.useCallback)((()=>{c.current.pause(),c.current.currentTime=0,clearInterval(u.current),clearTimeout(d.current),l(0),o(!1)}),[]),m=(0,r.useCallback)((()=>{d.current=setTimeout((()=>{s||(c.current.play(),o(!0),u.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[s]),h=()=>{const e=n-i,t=Math.floor(e/60),r=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${r}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:m,onMouseLeave:p},React.createElement("video",{ref:c,onEnded:p,muted:!0},React.createElement("source",{src:e,type:t})),React.createElement(h,null))}},88219:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(71806);function a(){const{attachedMedia:e,shouldUploadAttachedMedia:t,updateJetpackSocialOptions:n}=(0,r.R)();return{attachedMedia:e,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>n("attached_media",e),updateShouldUploadAttachedMedia:e=>n("should_upload_attached_media",e)}}},75323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(13419),a=n(86989),s=n.n(a),o=n(69307);const i={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},l=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function c(){const[e,t]=(0,o.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,o.useCallback)(((e,n=-1)=>{const r=l(n);t((t=>({...t,[e]:r}))),s()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_dismissed_notices:{[e]:r}}})}),[]),a=(0,o.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,o.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:i})),[e,a,n])}},39118:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(12238);const s=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9818),a=n(12238),s=n(69307),o=n(71806);const i=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function l(){const{imageGeneratorSettings:e,jetpackSocialOptions:t,updateJetpackSocialOptions:n}=(0,o.R)(),{isPostPublished:l}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),c=(0,s.useCallback)(((t,r)=>{const a={...e,[t]:r};n("image_generator_settings",a)}),[e,n]),u=(0,s.useCallback)((t=>{const r={...e,...t};n("image_generator_settings",r)}),[e,n]);return{...i(t.image_generator_settings,l),setIsEnabled:e=>c("enabled",e),setToken:e=>c("token",e),updateSettings:u}}},98811:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307);const s=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(!n.full)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.medium||n.large,a={width:r.width,height:r.height,sourceUrl:r.source_url};return{mediaData:{width:n.full.width,height:n.full.height,sourceUrl:n.full.source_url},metaData:t,previewData:a}};function o(e=null){const[t,n]=(0,a.useState)([{}]),o=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),i=(0,a.useCallback)((async()=>{try{const e=await s(o);n([e??{}])}catch{n([{}])}}),[o]);return(0,a.useEffect)((()=>{i()}),[i]),t}},46791:(e,t,n)=>{"use strict";n.d(t,{Wv:()=>l,ZP:()=>d,rs:()=>s});var r=n(69307),a=n(1795);const s="NO_MEDIA_ERROR",o="FILE_SIZE_ERROR",i="DIMENSION_ERROR";function l(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(l(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},u=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?s:null;if(!c.requiresMedia&&!r)return null;const{mime:u,fileSize:d}=e;if(!u||!c.allowedMediaTypes.includes(u.toLowerCase()))return"FILE_TYPE_ERROR";if(!t?.width||!t?.height)return i;const p=d?d/Math.pow(1e3,2):null;return l(u)?((e,t,n,r,s)=>{const{minSize:l=0,maxSize:c=a.zc,minLength:u=0,maxLength:d=a.zc,maxWidth:p=a.zc,aspectRatio:m=a.ay.video.aspectRatio}=s;if(!e||e>c||ed)return"VIDEO_LENGTH_TOO_LONG_ERROR";const h=n/r;return hm.max||n>p?i:null})(p,e.length,t.width,t.height,c.video):((e,t,n,r)=>{const{maxSize:s=a.zc,minWidth:l=0,maxWidth:c=a.zc,aspectRatio:u=a.ay.image.aspectRatio}=r,d=t/n;return du.max||t>c||ts?o:null})(p,t.width,t.height,c.image)},d=(e,t,{isSocialImageGeneratorEnabledForPost:n,shouldUploadAttachedMedia:a})=>{const s=(0,r.useRef)({});return(0,r.useMemo)((()=>{const r=n?{}:e.reduce(((e,{connection_id:n,service_name:r})=>{const s=u(t.metaData,t.mediaData,r,a);return s&&(e[n]=s),e}),{});return JSON.stringify(r)!==JSON.stringify(s.current)&&(s.current=r),{validationErrors:s.current,isConvertible:c(t.metaData)}}),[n,e,t.metaData,t.mediaData,a])}},1795:(e,t,n)=>{"use strict";n.d(t,{$8:()=>g,ay:()=>h,bD:()=>f,uo:()=>b,zc:()=>m});const r="video/mp4",a="video/mov",s="video/videopress",o=["image/jpeg","image/jpg","image/png"],i=o.concat(["image/gif","image/bmp"]),l=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],c=o.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),u=["video/webm","video/quicktime","video/ogg"],d=o.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),p=[a,"video/avi","video/mpg","video/mpeg","video/m4v"],m=1e5,h={requiresMedia:!1,allowedMediaTypes:o.concat([r,s,a]),image:{maxSize:4,minWidth:0,maxWidth:m,aspectRatio:{min:0,max:m}},video:{minLength:0,minSize:0,maxSize:m,maxLength:m,maxWidth:m,aspectRatio:{min:0,max:m}}},g={twitter:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:i.concat([s,...l]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:o.concat([r,a,s]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,s],image:{maxSize:8,minWidth:320,maxWidth:1440,aspectRatio:{min:.8,max:1.91}},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat([...u,r,s]),image:{maxSize:10},video:{maxSize:40}},nextdoor:{allowedMediaTypes:d.concat([...p,r,s]),image:{maxSize:10},video:{maxSize:500}}},f=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],b=[...new Set([...o,...i,...c,...l,...u,...f])]},71806:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(9818),a=n(12238),s=n(69307),o=n(42032);function i(){const{editPost:e}=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>{const t=e(a.store).getEditedPostAttribute("meta")||{},n=t.jetpack_publicize_feature_enabled??!0,r=t.jetpack_social_options||{};return{isPublicizeEnabled:n,jetpackSocialOptions:r,attachedMedia:r.attached_media||[],imageGeneratorSettings:r.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,o.getShareMessageMaxLength)()),shouldUploadAttachedMedia:r.should_upload_attached_media??!1}}),[]),n=(0,s.useCallback)(((t,n)=>{e({meta:{[t]:n}})}),[e]),i=(0,s.useCallback)((()=>{n("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,n]),l=(0,s.useCallback)(((e,r)=>{n("jetpack_social_options",{...t.jetpackSocialOptions,[e]:r})}),[t.jetpackSocialOptions,n]);return(0,s.useMemo)((()=>({...t,togglePublicizeFeature:i,updateJetpackSocialOptions:l,updateMeta:n})),[t,i,l,n])}},14085:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(13419),a=n(9818),s=n(12238),o=n(71806);const i="republicize";function l(){const e=(0,r.Pb)()?.social?.sharesData??{},t=e.is_share_limit_enabled,n=(0,r.OZ)(i)?.available||t,l=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),c=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",{isPublicizeEnabled:u,togglePublicizeFeature:d,isPostAlreadyShared:p}=(0,o.R)(),m=(0,r.X1)(i)&&!n,h=l?n:u,g=l&&m,f=l&&!n,b=!!(0,r.Pb)()?.social?.hasPaidPlan,v=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,k=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:u,isPublicizeEnabled:h,togglePublicizeFeature:d,isPublicizeDisabledBySitePlan:g,isRePublicizeFeatureAvailable:n,isRePublicizeUpgradableViaUpsell:m,hidePublicizeFeature:f,isShareLimitEnabled:t,isPostAlreadyShared:p,numberOfSharesRemaining:e.shares_remaining,shouldShowAdvancedPlanNudge:e.show_advanced_plan_upgrade_nudge,hasPaidPlan:b,isEnhancedPublishingEnabled:v,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:c+(0,r.lQ)(),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:k,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9818),a=n(69307),s=n(22552),o=n(23177);function i(){const e=(0,s.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(o.Eg).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},96672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(94333),a=n(69307),s=n(22552),o=n(37568);function i(){const e=(0,a.useRef)(!1),t=(0,s.Z)(),{refresh:n}=(0,o.Z)(),i=(0,r.useDebounce)(n,2e3);return()=>{t||(e.current=!0,i.cancel()),t&&e.current&&(i(),e.current=!1)}}},86419:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,e3:()=>l});var r=n(94333),a=n(9818),s=n(12238),o=n(69307);function i(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{i&&!n&&e()}),[n,i,e,t])}function l(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{!i&&n&&e()}),[n,i,e,t])}},34431:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(9818),a=n(65736),s=n(23177);const __=a.__,_n=a._n;function o({scheduledCountAdjustment:e=0,usedCountAdjustment:t=0}={}){return(0,r.useSelect)((n=>{const r=n(s.h),o=r.getShareLimit(),i=r.getScheduledSharesCount()+e,l=r.getSharesUsedCount()+t,c=l+i,u=r.numberOfSharesRemaining(),d=function(e){const t=Number.isFinite(e)?(0,a.sprintf)( +(0,a.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(30253),a=n(91948),s=n(5353);const o=[{name:"highway",label:"Highway",image:n(27956)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:s}]},76848:(e,t,n)=>{"use strict";n(9818),n(69307),n(99196),n(23177)},53513:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(88275),a=n(55609),s=n(69307),o=n(65736),i=n(88219),l=n(89696);const __=o.__,c=__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),u=__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack");function d({disabled:e=!1}){const{shouldUploadAttachedMedia:t,updateShouldUploadAttachedMedia:n}=(0,i.Z)(),o=(0,s.useCallback)((e=>{n(e)}),[n]),d=e?a.Disabled:s.Fragment,p=e?{className:l.Z.disabled}:{};return React.createElement(r.ZP,null,React.createElement(d,p,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:t,onChange:o,label:__("Share as a social post","jetpack"),help:e?c:u})))}},63855:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(13477),o=n(9818),i=n(48751),l=n(23177);const c=(0,o.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,i.Z)(),{title:n,excerpt:r,content:c}=e,u=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n}=e(l.Eg).getConnectionProfileDetails(l.uJ);return{displayName:t,avatarUrl:n}}));return React.createElement(s.S,a()({},e,{type:"article",user:u,customText:t||r||c||n}))}))},83704:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(82674),a=n.n(r),s=n(17915),o=n(9818),i=n(22629),l=n(99196),c=n.n(l);const u=function(e){const t=(0,o.useSelect)((e=>{const{getEntityRecord:t}=e("core");return(0,i.decodeEntities)(t("root","site").title)}));return c().createElement(s.X,a()({},e,{siteTitle:t}))}},4124:(e,t,n)=>{"use strict";n.d(t,{m:()=>c});var r=n(4049),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,image:n,media:s}=e,{username:c,profileImage:u}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.M$))),{message:d}=(0,i.Z)(),p=d||t;return o().createElement(r.V,{image:n,media:s,name:c,profileImage:u,caption:p})}},27725:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(93453),a=n(9818),s=n(65736),o=n(99196),i=n.n(o),l=n(48751),c=n(23177);const __=s.__;function u(e){const{title:t,url:n,image:s,media:o}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(c.Eg).getConnectionProfileDetails(c.qk))),{message:p}=(0,l.Z)(),m=`${p||t} ${o.length?n:""}`.trim();return i().createElement(r.S,{jobTitle:__("Job Title (Company Name)","jetpack"),image:s,name:u,profileImage:d,title:t,description:m,url:n,media:o})}},28586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(82674),a=n.n(r),s=n(60312),o=n(9818),i=n(22629),l=n(71806),c=n(48751),u=n(23177);const d=e=>{const{message:t}=(0,c.Z)(),{content:n,siteName:r}=(0,o.useSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),{getSite:n}=e("core");return{content:t("content").split("\x3c!--more")[0],siteName:(0,i.decodeEntities)(n().title)}})),{shouldUploadAttachedMedia:d}=(0,l.R)(),p=(0,o.useSelect)((e=>{const{displayName:t,profileImage:n,username:r}=e(u.Eg).getConnectionProfileDetails(u.cs);return{displayName:t,avatarUrl:n,address:r}})),m=e.media?.[0],h=m?.type.startsWith("image/")?m.url:null;return React.createElement(s.I,a()({},e,{siteName:r,user:p,description:n,customText:t,customImage:h,isSocialPost:d}))}},8454:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(55609),a=n(65736),s=n(39517),o=n(41809),i=n(9279);const __=a.__,l=function({onClose:e,initialTabName:t}){const n=(0,o.P)(),{image:a,media:l,title:c,description:u,url:d}=(0,i.u)();return React.createElement(r.Modal,{onRequestClose:e,className:"jetpack-social-previews__modal",__experimentalHideHeader:!0},React.createElement(r.Button,{className:"jetpack-social-previews__modal--close-btn",onClick:e,icon:s.Z,label:__("Close","jetpack")}),React.createElement(r.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:n,initialTabName:t},(e=>React.createElement("div",null,React.createElement(e.preview,{title:c,description:u,url:d,image:a,media:l})))))}},18553:(e,t,n)=>{"use strict";n.d(t,{T:()=>c});var r=n(93122),a=n(9818),s=n(99196),o=n.n(s),i=n(48751),l=n(23177);function c(e){const{title:t,url:n,image:s,media:c}=e,{displayName:u,profileImage:d}=(0,a.useSelect)((e=>e(l.Eg).getConnectionProfileDetails(l.Cd))),{message:p}=(0,i.Z)(),m=`${p||t} ${c.length?n:""}`.trim();return o().createElement(r.m,{image:s,name:u,profileImage:d,title:t,description:m,url:n,media:c})}},74140:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(55609),a=n(65736),s=n(41809);const __=a.__,_x=a._x,o=({openModal:e})=>{const t=(0,s.P)();return React.createElement("div",{className:"jetpack-social-previews__panel"},React.createElement("p",null,__("Preview what this will look like on social networks and Google search.","jetpack")),React.createElement("div",{className:"jetpack-gutenberg-social-icons"},t.map((e=>React.createElement(e.icon,{key:e.name,className:"jetpack-social-previews__icon"})))),React.createElement(r.Button,{variant:"secondary",onClick:e,label:__("Open Social Previews","jetpack")},_x("Preview","Button label that opens the social previews modal","jetpack")))}},94714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(82674),a=n.n(r),s=n(1044),o=n(9818),i=n(48751),l=n(23177);const c=e=>{const{content:t,author:n}=(0,o.useSelect)((e=>{const{getUser:t}=e("core"),{getEditedPostAttribute:n}=e("core/editor"),r=n("author"),a=r&&t(r);return{content:n("content").split("\x3c!--more")[0],author:a?.name}})),{message:r}=(0,i.Z)(),c=(0,o.useSelect)((e=>{const{displayName:t,profileImage:r}=e(l.Eg).getConnectionProfileDetails(l.Bb);return{displayName:t||n,avatarUrl:r}}),[n]);return React.createElement(s.b,a()({},e,{user:c,description:t,customText:r}))}},24766:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(835),a=n(9818),s=n(99196),o=n.n(s),i=n(71806),l=n(23177);const c=function({title:e,description:t,image:n,url:s,media:c}){const{shareMessage:u}=(0,i.R)(),d=(0,a.useSelect)((r=>{const{displayName:a,profileImage:o,username:i}=r(l.Eg).getConnectionProfileDetails(l.wV);return[{name:a,profileImage:o,screenName:i,text:u+(c.length?` ${s}`:""),cardType:n?"summary_large_image":"summary",title:e,description:t,image:n,media:c,url:s}]}),[e,n,t,c,s,u]);return o().createElement(r.c,{tweets:d,hidePostPreview:!0})}},41809:(e,t,n)=>{"use strict";n.d(t,{P:()=>k});var r=n(82674),a=n.n(r),s=n(3396),o=n(65736),i=n(99196),l=n.n(i),c=n(23177),u=n(42032),d=n(63855),p=n(83704),m=n(4124),h=n(27725),g=n(28586),f=n(18553),b=n(94714),v=n(24766);const __=o.__;function k(){const e=(0,u.getSupportedAdditionalConnections)(),t=e.includes(c.M$),n=e.includes(c.cs),r=e.includes(c.Cd);return(0,i.useMemo)((()=>[{title:__("Google Search","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"google"},e)),name:"google",preview:p.Z},{title:__("X","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"x"},e)),name:"x",preview:v.Z},{title:__("Facebook","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"facebook"},e)),name:"facebook",preview:d.Z},t?{title:__("Instagram","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"instagram"},e)),name:"instagram",preview:m.m}:null,{title:__("LinkedIn","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"linkedin"},e)),name:"linkedin",preview:h.y},r?{title:__("Nextdoor","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"nextdoor"},e)),name:"nextdoor",preview:f.T}:null,{title:__("Tumblr","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"tumblr-alt"},e)),name:"tumblr",preview:b.Z},n?{title:__("Mastodon","jetpack"),icon:e=>l().createElement(s.av,a()({serviceName:"mastodon"},e)),name:"mastodon",preview:g.Z}:null].filter(Boolean)),[t,n,r])}},9279:(e,t,n)=>{"use strict";n.d(t,{u:()=>l});var r=n(9818),a=n(65736),s=n(71806),o=n(90785),i=n(25399);const __=a.__;function l(){const{attachedMedia:e,imageGeneratorSettings:t,shouldUploadAttachedMedia:n}=(0,s.R)();return(0,r.useSelect)((r=>{const{getMedia:a}=r("core"),{getEditedPostAttribute:s,getEditedPostContent:l}=r("core/editor"),c=s("featured_media");let u=c?(0,i.i)(a(c)):"";const d=t.enabled?(0,o.t)(t.token):"";if(d)u=d;else if(e?.[0]?.id){const[t]=e;!!t.id&&a(t.id)?.mime_type?.startsWith("image/")&&t.url&&(u=t.url)}if(!u){const e=(0,i.T)(l());e&&(u=e)}const p=[];if(n)if(d)p.push({type:"image/jpeg",url:d,alt:""});else{const t=e=>{const t=a(e);return t?{type:t.mime_type,url:(0,i.i)(t),alt:t.alt_text}:null};for(const{id:n}of e){const e=t(n);e&&p.push(e)}if(0===p.length&&c){const e=t(c);e&&p.push(e)}}return{title:s("meta")?.jetpack_seo_html_title||s("title"),description:s("meta")?.advanced_seo_description||s("excerpt")||s("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:s("link"),image:u,media:p,initialTabName:null}}),[n,e,t])}},25399:(e,t,n)=>{"use strict";function r(e){return e?e.media_details?.sizes?.large?.source_url||e.source_url:null}function a(e){const t=(new DOMParser).parseFromString(e,"text/html"),n=Array.from(t.querySelectorAll("img")),r=n[0]?.src;return r??null}n.d(t,{T:()=>a,i:()=>r})},13858:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(69307),a=n(87728);const s=({sourceUrl:e,mime:t,duration:n})=>{const[s,o]=(0,r.useState)(!1),[i,l]=(0,r.useState)(0),c=(0,r.useRef)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{c.current?.load()}),[e]);const p=(0,r.useCallback)((()=>{c.current.pause(),c.current.currentTime=0,clearInterval(u.current),clearTimeout(d.current),l(0),o(!1)}),[]),m=(0,r.useCallback)((()=>{d.current=setTimeout((()=>{s||(c.current.play(),o(!0),u.current=setInterval((()=>{l((e=>e+1))}),1e3))}),500)}),[s]),h=()=>{const e=n-i,t=Math.floor(e/60),r=String(Math.floor(e%60)).padStart(2,"0");return React.createElement("div",{className:a.Z.progress},React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"6",height:"8",fill:"none"},React.createElement("path",{fill:"#fff",d:"M5.25 3.567a.5.5 0 0 1 0 .866L.75 7.031A.5.5 0 0 1 0 6.598V1.402A.5.5 0 0 1 .75.969l4.5 2.598Z"})),React.createElement("span",{className:a.Z.duration},`${t}:${r}`))};return React.createElement("div",{className:a.Z.wrapper,onMouseEnter:m,onMouseLeave:p},React.createElement("video",{ref:c,onEnded:p,muted:!0},React.createElement("source",{src:e,type:t})),React.createElement(h,null))}},88219:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(71806);function a(){const{attachedMedia:e,shouldUploadAttachedMedia:t,updateJetpackSocialOptions:n}=(0,r.R)();return{attachedMedia:e,shouldUploadAttachedMedia:t,updateAttachedMedia:e=>n("attached_media",e),updateShouldUploadAttachedMedia:e=>n("should_upload_attached_media",e)}}},75323:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(13419),a=n(86989),s=n.n(a),o=n(69307);const i={instagram:"instagram",advancedUpgradeEditor:"advanced-upgrade-nudge-editor",advancedUpgradeAdmin:"advanced-upgrade-nudge-admin",autoConversion:"auto-conversion-editor-notice"},l=e=>-1===e?0:new Date(Date.now()+1e3*e).getTime();function c(){const[e,t]=(0,o.useState)((()=>(0,r.Pb)()?.social?.dismissedNotices??window?.jetpackSocialInitialState?.jetpackSettings?.dismissedNotices??{})),n=(0,o.useCallback)(((e,n=-1)=>{const r=l(n);t((t=>({...t,[e]:r}))),s()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_dismissed_notices:{[e]:r}}})}),[]),a=(0,o.useCallback)((t=>{const n=e[t];return!(0===n||n>Date.now())}),[e]);return(0,o.useMemo)((()=>({dismissedNotices:e,shouldShowNotice:a,dismissNotice:n,NOTICES:i})),[e,a,n])}},39118:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(12238);const s=()=>(0,r.useSelect)((e=>e(a.store).getEditedPostAttribute("featured_media")))},75263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(9818),a=n(12238),s=n(69307),o=n(71806);const i=(e,t)=>({isEnabled:e?.enabled??!t,customText:e?.custom_text??null,imageType:e?.image_type??null,imageId:e?.image_id??null,template:e?.template??null,token:e?.token??null});function l(){const{imageGeneratorSettings:e,jetpackSocialOptions:t,updateJetpackSocialOptions:n}=(0,o.R)(),{isPostPublished:l}=(0,r.useSelect)((e=>({isPostPublished:e(a.store).isCurrentPostPublished()}))),c=(0,s.useCallback)(((t,r)=>{const a={...e,[t]:r};n("image_generator_settings",a)}),[e,n]),u=(0,s.useCallback)((t=>{const r={...e,...t};n("image_generator_settings",r)}),[e,n]);return{...i(t.image_generator_settings,l),setIsEnabled:e=>c("enabled",e),setToken:e=>c("token",e),updateSettings:u}}},98811:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307);const s=async e=>{if(!e)return{};let t={mime:e.mime_type,fileSize:e.media_details.filesize,length:e.media_details?.length};"video/videopress"===e.mime_type&&(t=await(async e=>{if(!e?.media_details?.videopress?.original||!e?.media_details?.videopress?.duration)return{};const t=await fetch(e?.media_details?.videopress?.original,{method:"HEAD"}),n=t.headers.get("content-length"),r=t.headers.get("content-type");return n&&r?{mime:r,fileSize:n,length:Math.round(e.media_details.videopress.duration/1e3)}:{}})(e));const n=e?.media_details?.sizes??{};if(!n.full)return{mediaData:{width:e.media_details.width,height:e.media_details.height,sourceUrl:e.source_url},metaData:t};const r=n.medium||n.large,a={width:r.width,height:r.height,sourceUrl:r.source_url};return{mediaData:{width:n.full.width,height:n.full.height,sourceUrl:n.full.source_url},metaData:t,previewData:a}};function o(e=null){const[t,n]=(0,a.useState)([{}]),o=(0,r.useSelect)((t=>t("core").getMedia(e,{context:"view"})),[e]),i=(0,a.useCallback)((async()=>{try{const e=await s(o);n([e??{}])}catch{n([{}])}}),[o]);return(0,a.useEffect)((()=>{i()}),[i]),t}},46791:(e,t,n)=>{"use strict";n.d(t,{Wv:()=>l,ZP:()=>d,rs:()=>s});var r=n(69307),a=n(1795);const s="NO_MEDIA_ERROR",o="FILE_SIZE_ERROR",i="DIMENSION_ERROR";function l(e){return"video"===e.split("/")[0]}const c=e=>{if(!e?.mime||!e?.fileSize)return!1;const{mime:t,fileSize:n}=e;if(l(t))return!1;if(!a.bD.includes(t))return!1;return!((n?n/Math.pow(1e3,2):null)>=55)},u=(e,t,n,r)=>{const c=a.$8[n]??a.ay;if(!e||0===Object.keys(e).length)return c.requiresMedia?s:null;if(!c.requiresMedia&&!r)return null;const{mime:u,fileSize:d}=e;if(!u||!c.allowedMediaTypes.includes(u.toLowerCase()))return"FILE_TYPE_ERROR";if(!t?.width||!t?.height)return i;const p=d?d/Math.pow(1e3,2):null;return l(u)?((e,t,n,r,s)=>{const{minSize:l=0,maxSize:c=a.zc,minLength:u=0,maxLength:d=a.zc,maxWidth:p=a.zc,aspectRatio:m=a.ay.video.aspectRatio}=s;if(!e||e>c||ed)return"VIDEO_LENGTH_TOO_LONG_ERROR";const h=n/r;return hm.max||n>p?i:null})(p,e.length,t.width,t.height,c.video):((e,t,n,r)=>{const{maxSize:s=a.zc,minWidth:l=0,maxWidth:c=a.zc,aspectRatio:u=a.ay.image.aspectRatio}=r,d=t/n;return du.max||t>c||ts?o:null})(p,t.width,t.height,c.image)},d=(e,t,{isSocialImageGeneratorEnabledForPost:n,shouldUploadAttachedMedia:a})=>{const s=(0,r.useRef)({});return(0,r.useMemo)((()=>{const r=n?{}:e.reduce(((e,{connection_id:n,service_name:r})=>{const s=u(t.metaData,t.mediaData,r,a);return s&&(e[n]=s),e}),{});return JSON.stringify(r)!==JSON.stringify(s.current)&&(s.current=r),{validationErrors:s.current,isConvertible:c(t.metaData)}}),[n,e,t.metaData,t.mediaData,a])}},1795:(e,t,n)=>{"use strict";n.d(t,{$8:()=>g,ay:()=>h,bD:()=>f,uo:()=>b,zc:()=>m});const r="video/mp4",a="video/mov",s="video/videopress",o=["image/jpeg","image/jpg","image/png"],i=o.concat(["image/gif","image/bmp"]),l=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],c=o.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),u=["video/webm","video/quicktime","video/ogg"],d=o.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),p=[a,"video/avi","video/mpg","video/mpeg","video/m4v"],m=1e5,h={requiresMedia:!1,allowedMediaTypes:o.concat([r,s,a]),image:{maxSize:4,minWidth:0,maxWidth:m,aspectRatio:{min:0,max:m}},video:{minLength:0,minSize:0,maxSize:m,maxLength:m,maxWidth:m,aspectRatio:{min:0,max:m}}},g={twitter:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:5},video:{maxSize:512,maxLength:140}},facebook:{allowedMediaTypes:i.concat([s,...l]),image:{maxSize:8},video:{maxSize:1e4,maxLength:14400}},tumblr:{allowedMediaTypes:o.concat([r,a,s]),image:{maxSize:20},video:{maxSize:500,maxLength:600}},linkedin:{allowedMediaTypes:o.concat([r,s]),image:{maxSize:20},video:{minSize:.075,maxSize:200,maxLength:600,minLength:3}},"instagram-business":{requiresMedia:!0,allowedMediaTypes:["image/jpg","image/jpeg",r,a,s],image:{maxSize:8,minWidth:320,maxWidth:1440,aspectRatio:{min:.8,max:1.91}},video:{maxLength:90,minLength:3,maxSize:1e3,maxWidth:1920,aspectRatio:{min:.01,max:10}}},mastodon:{allowedMediaTypes:c.concat([...u,r,s]),image:{maxSize:10},video:{maxSize:40}},nextdoor:{allowedMediaTypes:d.concat([...p,r,s]),image:{maxSize:10},video:{maxSize:500}}},f=["image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"],b=[...new Set([...o,...i,...c,...l,...u,...f])]},71806:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r=n(9818),a=n(12238),s=n(69307),o=n(42032);function i(){const{editPost:e}=(0,r.useDispatch)(a.store),t=(0,r.useSelect)((e=>{const t=e(a.store).getEditedPostAttribute("meta")||{},n=t.jetpack_publicize_feature_enabled??!0,r=t.jetpack_social_options||{};return{isPublicizeEnabled:n,jetpackSocialOptions:r,attachedMedia:r.attached_media||[],imageGeneratorSettings:r.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,o.getShareMessageMaxLength)()),shouldUploadAttachedMedia:r.should_upload_attached_media??!1}}),[]),n=(0,s.useCallback)(((t,n)=>{e({meta:{[t]:n}})}),[e]),i=(0,s.useCallback)((()=>{n("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,n]),l=(0,s.useCallback)(((e,r)=>{n("jetpack_social_options",{...t.jetpackSocialOptions,[e]:r})}),[t.jetpackSocialOptions,n]);return(0,s.useMemo)((()=>({...t,togglePublicizeFeature:i,updateJetpackSocialOptions:l,updateMeta:n})),[t,i,l,n])}},14085:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(13419),a=n(9818),s=n(12238),o=n(71806);const i="republicize";function l(){const e=(0,r.Pb)()?.social?.sharesData??{},t=(0,r.Pb)()?.wpcomBlogId,n=e.is_share_limit_enabled,l=(0,r.OZ)(i)?.available||n,c=(0,a.useSelect)((e=>e(s.store).isCurrentPostPublished()),[]),u=(0,r.Pb)()?.social?.publicizeConnectionsUrl??"https://wordpress.com/marketing/connections/",{isPublicizeEnabled:d,togglePublicizeFeature:p,isPostAlreadyShared:m}=(0,o.R)(),h=(0,r.X1)(i)&&!l,g=c?l:d,f=c&&h,b=c&&!l,v=!!(0,r.Pb)()?.social?.hasPaidPlan,k=!!(0,r.Pb)()?.social?.isEnhancedPublishingEnabled,y=!!(0,r.Pb)()?.social?.isAutoConversionEnabled;return{isPublicizeEnabledMeta:d,isPublicizeEnabled:g,togglePublicizeFeature:p,isPublicizeDisabledBySitePlan:f,isRePublicizeFeatureAvailable:l,isRePublicizeUpgradableViaUpsell:h,hidePublicizeFeature:b,isShareLimitEnabled:n,isPostAlreadyShared:m,numberOfSharesRemaining:e.shares_remaining,shouldShowAdvancedPlanNudge:e.show_advanced_plan_upgrade_nudge,hasPaidPlan:v,isEnhancedPublishingEnabled:k,isSocialImageGeneratorAvailable:!!(0,r.Pb)()?.social?.isSocialImageGeneratorAvailable,isSocialImageGeneratorEnabled:!!(0,r.Pb)()?.social?.isSocialImageGeneratorEnabled,connectionsAdminUrl:u+(t??(0,r.lQ)()),adminUrl:(0,r.Pb)()?.social?.adminUrl,isAutoConversionEnabled:y,jetpackSharingSettingsUrl:(0,r.Pb)()?.social?.jetpackSharingSettingsUrl}}},6230:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9818),a=n(69307),s=n(22552),o=n(23177);function i(){const e=(0,s.Z)(),t=(0,a.useRef)(!1),n=(0,r.useDispatch)(o.Eg).refreshAutoConversionSettings;return{refreshAutoConversionSettings:()=>{e||(t.current=!0),e&&t.current&&(n(),t.current=!1)}}}},96672:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(94333),a=n(69307),s=n(22552),o=n(37568);function i(){const e=(0,a.useRef)(!1),t=(0,s.Z)(),{refresh:n}=(0,o.Z)(),i=(0,r.useDebounce)(n,2e3);return()=>{t||(e.current=!0,i.cancel()),t&&e.current&&(i(),e.current=!1)}}},86419:(e,t,n)=>{"use strict";n.d(t,{M1:()=>i,e3:()=>l});var r=n(94333),a=n(9818),s=n(12238),o=n(69307);function i(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{i&&!n&&e()}),[n,i,e,t])}function l(e,t){const n=(0,a.useSelect)((e=>e(s.store).isPublishingPost()),[]),i=(0,r.usePrevious)(n);(0,o.useEffect)((()=>{!i&&n&&e()}),[n,i,e,t])}},34431:(e,t,n)=>{"use strict";n.d(t,{U:()=>o});var r=n(9818),a=n(65736),s=n(23177);const __=a.__,_n=a._n;function o({scheduledCountAdjustment:e=0,usedCountAdjustment:t=0}={}){return(0,r.useSelect)((n=>{const r=n(s.h),o=r.getShareLimit(),i=r.getScheduledSharesCount()+e,l=r.getSharesUsedCount()+t,c=l+i,u=r.numberOfSharesRemaining(),d=function(e){const t=Number.isFinite(e)?(0,a.sprintf)( // translators: %d: The number of shares to social media remaining -_n("You have %d auto-share remaining.","You have %d auto-shares remaining.",e,"jetpack"),e):"";return{default:"",exceeded:__("You have reached your auto-share limit. Scheduled posts will not be shared until shares become available.","jetpack"),full:__("You have reached your auto-share limit.","jetpack"),approaching:t}}(u);let p="default",m="none",h=d.default;return c>o?(p="error",m="exceeded",h=d.exceeded):c===o?(m="full",p="error",h=d.full):c>=.9*o?(m="approaching",p="error",h=d.approaching):c>=.8*o&&(m="approaching",p="warning",h=d.approaching),{status:m,noticeType:p,message:h,usedCount:l,scheduledCount:i,remainingCount:u}}),[e,t])}},45579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(9818),i=n(12238),l=n(69307),c=n(65736),u=n(37568),d=n(48751);const __=c.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||a;const[c,m]=(0,l.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,l.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!c.isFetching)return m({...r,isFetching:!0}),s()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then(((e={})=>{const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,c.isFetching,h]);return{...c,doPublicize:g}}},37568:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(23177);function s(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)(a.h);return{...(0,r.useSelect)((e=>{const t=e(a.h),n=t.getConnections(),r=t.getEnabledConnections(),s=t.getDisabledConnections().map((e=>e.id));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:r.length>0,skippedConnections:s,enabledConnections:r}}),[]),toggleById:t,refresh:e}}},48751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(42032),a=n(71806);function s(){const{updateMeta:e,shareMessage:t}=(0,a.R)();return{message:t,maxLength:(0,r.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(9818),a=n(12238),s=n(23177),o=n(86419);function i(){const{mergeConnections:e}=(0,r.useDispatch)(s.h),{didPostSaveRequestSucceed:t,isCurrentPostPublished:n,getEditedPostAttribute:i}=(0,r.useSelect)((e=>e(a.store)),[]);(0,o.M1)((()=>{if(t()&&n()){const t=i("jetpack_publicize_connections");t?.length&&e(t)}}),[t,n,i])}},21052:(e,t,n)=>{"use strict";n.d(t,{Au:()=>l,Wh:()=>c,ZP:()=>u,hi:()=>i,wO:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_AUTO_CONVERSION_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateAutoConversionSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Fl)(e);const t=yield(0,s.wi)();return yield c(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,r.select)(a.Eg).getAutoConversionSettings();return yield c(t),!1}finally{yield l()}},setAutoConversionSettings:c,refreshAutoConversionSettings:function*(){try{yield i();const e=yield(0,s.wi)();return yield c(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield l()}}}},23013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeConnections:()=>u,refreshConnectionTestResults:()=>d,setConnections:()=>l,syncConnectionsToPostMeta:()=>p,toggleConnection:()=>c,toggleConnectionById:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(12238),i=n(74442);function l(e){return{type:i.b,connections:e}}function c(e){return{type:i.L,connectionId:e}}function u(e){return function({dispatch:t,select:n}){const r=n.getConnections(),a=[],s={done:!1,enabled:Boolean(n.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...s,...r.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};a.push(e)}t(l(a))}}function d(e=!1){return async function({dispatch:t}){try{const n=(0,r.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(u(await s()({path:n}))),e&&t(p())}catch(e){}}}function p(){return function({registry:e,select:t}){const n=t.getConnections();return e.dispatch(o.store).editPost({jetpack_publicize_connections:n})}}function m(e,t=!0){return function({dispatch:n}){n(c(e)),t&&n(p())}}},74442:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,b:()=>r});const r="SET_CONNECTIONS",a="TOGGLE_CONNECTION"},54725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(21052),a=n(23013),s=n(371),o=n(72438),i=n(4462);const l={...s.ZP,...i.ZP,...r.ZP,...o.Z,...a}},371:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>l,dz:()=>o,ff:()=>i});var r=n(9818),a=n(23177),s=n(4957);const o="SET_JETPACK_SETTINGS";function i(e){return{type:o,options:e}}const l={updateJetpackSettings:function*(e){try{yield i({is_updating:!0}),yield i(e),yield(0,s.RF)(e);const t=yield(0,s.es)();return yield i(t),!0}catch(e){const t=(0,r.select)(a.Eg).getJetpackSettings();return yield i(t),!1}finally{yield i({is_updating:!1})}},setJetpackSettings:i}},72438:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4957),a=n(21052),s=n(4462);const o={refreshJetpackSocialSettings:function*(){try{yield(0,a.hi)(),yield(0,s.ds)();const e=yield(0,r.mu)();return yield(0,a.Wh)(e.jetpack_social_autoconvert_images),yield(0,s.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,a.Au)(),yield(0,s.Gr)()}}}},4462:(e,t,n)=>{"use strict";n.d(t,{Gr:()=>l,ZP:()=>u,ch:()=>c,ds:()=>i,kg:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateSocialImageGeneratorSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Ux)(e);const t=yield(0,s.oB)();return yield c(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,r.select)(a.Eg).getSocialImageGeneratorSettings();return yield c(t),!1}finally{yield l()}},setSocialImageGeneratorSettings:c,refreshSocialImageGeneratorSettings:function*(){try{yield i();const e=yield(0,s.oB)();return yield c(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield l()}}}},4957:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>k,es:()=>p,mu:()=>b,oB:()=>h,wi:()=>f});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_SETTINGS",o="UPDATE_JETPACK_SETTINGS",i="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",p=()=>({type:s}),m=e=>({type:o,settings:e}),h=()=>({type:i}),g=e=>({type:l,settings:e}),f=()=>({type:c}),b=()=>({type:d}),v=e=>({type:u,settings:e}),k={[s]:function(){return a()({path:"/jetpack/v4/social/settings"})},[o]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[i]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[l]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[c]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[u]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>f,Cd:()=>g,Eg:()=>c,M$:()=>p,cs:()=>h,h:()=>v,qk:()=>m,uJ:()=>d,wV:()=>b});var r=n(9818),a=n(54725),s=n(4957),o=n(45272),i=n(15781),l=n(22987);const c="jetpack-social-plugin",u={reducer:o.Z,actions:a.Z,selectors:l.Z,resolvers:i.ZP,controls:s.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",p="instagram-business",m="linkedin",h="mastodon",g="nextdoor",f="tumblr",b="twitter",v=(0,r.createReduxStore)(c,u);(0,r.register)(v)},20750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(21052);const a=(e={},t)=>t.type===r.wO?{...e,...t.options}:e},71837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(74442);const a=(e={},t)=>{switch(t.type){case r.b:return{...e,connections:t.connections};case r.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9818),a=n(20750),s=n(71837),o=n(80697),i=n(35652),l=n(28696),c=n(54489);const u=(0,r.combineReducers)({sharesData:i.Z,siteData:l.Z,connectionData:s.Z,jetpackSettings:o.Z,socialImageGeneratorSettings:c.Z,autoConversionSettings:a.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(371);const a=(e={},t)=>t.type===r.dz?{...e,...t.options}:e},35652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},28696:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},54489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4462);const a=(e={},t)=>t.type===r.kg?{...e,...t.options}:e},15781:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>c});var r=n(12238),a=n(21052),s=n(23013),o=n(371),i=n(4462),l=n(4957);const c={getJetpackSettings:function*(){try{const e=yield(0,l.es)();if(e)return(0,o.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,l.oB)();if(e)return(0,i.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,l.wi)();if(e)return(0,a.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const n=t.select(r.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,s.setConnections)(n||[]))}}}},68113:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,n)=>{"use strict";function r(e){return e.connectionData?.connections??[]}function a(e){return e.connectionData?.adminUrl??null}function s(e){return r(e).length>0}function o(e){return r(e).filter((e=>!1===e.test_success))}function i(e){return r(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function l(e){return r(e).filter((e=>e.enabled))}function c(e){return r(e).filter((e=>!e.enabled))}function u(e,t,{forceDefaults:n=!1}={}){let a="",s="",o="";if(!n){const n=r(e).find((({service_name:e})=>t===e));if(n){const{display_name:e,profile_display_name:r,profile_picture:i}=n;a="twitter"===t?r:e,o="twitter"===t?e:n.username,s=i}}return{displayName:a,profileImage:s,username:o}}n.r(t),n.d(t,{getConnectionProfileDetails:()=>u,getConnections:()=>r,getConnectionsAdminUrl:()=>a,getDisabledConnections:()=>c,getEnabledConnections:()=>l,getFailedConnections:()=>o,getMustReauthConnections:()=>i,hasConnections:()=>s})},22987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(68113),a=n(43354),s=n(82836),o=n(31473),i=n(85675),l=n(45073);const c={...i.Z,...a,...s.Z,...o,...l.Z,...r.Z}},82836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScheduledSharesCount:()=>l,getShareLimit:()=>o,getSharedPostsCount:()=>u,getSharesUsedCount:()=>i,getTotalSharesCount:()=>c,isShareLimitEnabled:()=>a,numberOfSharesRemaining:()=>p,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>s});var r=n(82836);function a(e){return e.sharesData?.is_share_limit_enabled??!1}function s(e){return!r.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&a(e)}function o(e){return e.sharesData?.share_limit??30}function i(e){return e.sharesData?.publicized_count??0}function l(e){return e.sharesData?.to_be_publicized_count??0}function c(e){const t=i(e)+l(e);return Math.max(t,0)}function u(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function p(e,t={}){if(!s(e))return 1/0;const{includeScheduled:n}={includeScheduled:!0,...t},r=i(e),a=o(e),c=n?l(e):0;return Math.max(a-r-c,0)}},85675:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=255;function a(){return r}},12677:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(13419);function a(){return(0,r.Pb)()?.social?.supportedAdditionalConnections||[]}},42032:(e,t,n)=>{"use strict";n.d(t,{getShareMessageMaxLength:()=>r.A,getSupportedAdditionalConnections:()=>a.h});var r=n(5463),a=n(12677),s=n(581);n.o(s,"useSyncPostDataToStore")&&n.d(t,{useSyncPostDataToStore:function(){return s.useSyncPostDataToStore}})},581:()=>{},13419:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>u.Z,FK:()=>c.FK,HD:()=>c.HD,M6:()=>s.M6,OZ:()=>o.Z,Pb:()=>r.Z,Pm:()=>m.Z,Qq:()=>c.Qq,Rl:()=>c.Rl,T:()=>l.Z,Ug:()=>s.Ug,Wp:()=>s.Wp,X1:()=>c.X1,_D:()=>c._D,aQ:()=>s.aQ,dM:()=>h.d,el:()=>p.Z,lQ:()=>a.Z,lt:()=>h.l,m3:()=>c.m3,o_:()=>i.Z,og:()=>g.Z,z$:()=>d.Z});var r=n(50148),a=n(35004),s=n(99505),o=n(48052),i=n(76714),l=n(80354),c=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959),g=n(19499);n(39058)},6342:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78868),a=n(99196),s=n.n(a);const o=()=>s().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:(e,t,n)=>{"use strict";n.d(t,{d:()=>s,l:()=>o});var r=n(69307),a=n(12953);function s(e){const t={};let n="span",a=e.icon;const s=document.createElement("div");s.innerHTML=e.icon;const o=s.querySelector("svg");return o&&(n="svg",a=o.innerHTML,Array.from(o.attributes).forEach((({nodeName:e,nodeValue:n})=>t[e]=n))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function o(e){return{src:s(e),foreground:(0,a.Z)()}}},12953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(99505);const a="#069e08";function s(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},19499:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){const e=(0,r.Z)();return e?.blocks_variation??"production"}},50148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:(e,t,n)=>{"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:()=>r})},61053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(6975),a=n(31294),s=n(69307);const{tracks:o}=r.Z,{recordEvent:i}=o,l=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:l={}}={})=>{const[c,u]=(0,s.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,s.useCallback)((async(e,t={})=>{d&&g&&h&&i(e,t)}),[d,g,h]);return(0,s.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,s.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(c||(b(r,l),u(!0)))}),[c,t,e,n,p,l,b]),{recordEvent:b,tracks:o}}},11380:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307),s=n(39058);const o=e=>{const{isModuleActive:t,isChangingStatus:n,isLoadingModules:o}=(0,r.useSelect)((t=>{const n=t(s.p);return{isModuleActive:n.isModuleActive(e),isChangingStatus:n.isModuleUpdating(e),isLoadingModules:n.areModulesLoading(e)}}),[s.p]),{updateJetpackModuleStatus:i}=(0,r.useDispatch)(s.p),l=(0,a.useCallback)((t=>i({name:e,active:t})),[e,i]);return(0,a.useMemo)((()=>({isLoadingModules:o,isChangingStatus:n,isModuleActive:t,changeStatus:l})),[o,n,t,l])}},68586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},44166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>d});var r=n(9818),a=n(99505),s=n(82162),o=n(39058);const i="SET_JETPACK_MODULES",l="SET_MODULE_UPDATING";function c(e){return d({isLoading:e})}function u(e,t){return{type:l,name:e,isUpdating:t}}function d(e){return{type:i,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,s.zL)(e);const t=yield(0,s.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,a.Wp)())return!0;try{yield c(!0);const e=yield(0,s.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield c(!1)}}}},82162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>i,ZP:()=>c,zL:()=>l});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_MODULES",o="UPDATE_JETPACK_MODULE_STATUS",i=()=>({type:s}),l=e=>({type:o,settings:e}),c={[s]:function(){return a()({path:"/jetpack/v4/module/all",method:"GET"})},[o]:function({settings:e}){return a()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(9818),a=n(44166),s=n(82162),o=n(42469),i=n(55133),l=n(43524);const c="jetpack-modules",u=(0,r.createReduxStore)(c,{reducer:o.Z,actions:a.ZP,controls:s.ZP,resolvers:i.Z,selectors:l.Z});(0,r.register)(u);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,r.dispatch)(c).setJetpackModules({data:{...d}})},42469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r={isLoading:!1,isUpdating:{},data:{}},a=(e=r,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(44166),a=n(82162);const s={getJetpackModules:function*(){try{const e=yield(0,a.Bs)();if(e)return(0,r.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(99505);const a={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,r.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,n)=>{"use strict";n.d(t,{FK:()=>g,HD:()=>f,Qq:()=>u,Rl:()=>m,X1:()=>d,_D:()=>p,m3:()=>b});var r=n(65736),a=n(96483),s=n(92819),o=n(50148),i=n(48052),l=n(35004),c=n(99505);const __=r.__;function u({planSlug:e,plan:t,postId:n,postType:r}){const o=(0,s.startsWith)(e,"jetpack_")?e:(0,s.get)(t,["path_slug"]),i=(void 0===r?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(r)?"":"edit";return(0,c.Wp)()?(0,a.addQueryArgs)("/"+(0,s.compact)([e,r,(0,l.Z)(),n]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:n,plan_upgraded:1})})();return(0,c.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:i,customerType:"business"}):o&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${o}`,{redirect_to:i})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,i.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,i.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,s.get)((0,o.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,s.map)(h,"name").includes(e),b=e=>(0,s.head)((0,s.filter)(h,(({name:t})=>t===e)))},76714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(98817),a=n(48052);function s(e,t){const{available:n,unavailableReason:s}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:(e,t,n)=>{"use strict";n.d(t,{M6:()=>i,Ug:()=>o,Wp:()=>s,aQ:()=>l});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===a()}function o(){return"atomic"===a()}function i(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function l(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(82674),a=n.n(r),s=n(94333);const o=e=>(0,s.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},83059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>j});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(586),p=n(3639),m=n(92710),h=n(58532),g=n(51128),f=n.n(g),b=(n(99196),n(49259)),v=n(63634),k=n(854),y=n(6747),w=n(81612),E=n(27298);const __=u.__,_=f()("jetpack-ai-assistant:dropdown"),C=[{name:__("Correct spelling and grammar","jetpack"),key:"correct-spelling",aiSuggestion:v.Hd,icon:d.Z},{name:__("Simplify","jetpack"),key:"simplify",aiSuggestion:v.hI,icon:p.Z},{name:__("Summarize","jetpack"),key:"summarize",aiSuggestion:v.Lq,icon:m.Z},{name:__("Expand","jetpack"),key:"make-longer",aiSuggestion:v.TV,icon:h.Z}];function x(e){return e.filter((e=>null!=e)).map((e=>(0,o.getBlockContent)(e))).join("\n\n")}function S({onClose:e,blockType:t}){const[n,o]=(0,c.useState)(!1),{getSelectedBlockClientIds:u,getBlocksByClientId:d}=(0,l.useSelect)("core/block-editor"),{removeBlocks:p,replaceBlock:m}=(0,l.useDispatch)("core/block-editor");(0,c.useEffect)((()=>{const e=u(),t=x(d(e)),n=(0,k.t$)(t);return o(!n.length)}),[d,u]);const{tracks:h}=(0,s.z$)(),g=(n,r={})=>{const a=u(),s=d(a),o=x(s);e(),_("requestSuggestion",n,r),h.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:n,block_type:t});const[i]=s,[l,...c]=a,g={...i?.attributes||{},content:o},f=(0,y.b)(t,g),v={clientId:l,type:n,options:{...r,contentType:"generated",fromExtension:!0}};localStorage.setItem((0,b.$M)(f.clientId),JSON.stringify(v)),m(l,f),p(c)};return(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"jetpack-ai-assistant__info"},__("Add content to activate the tools below","jetpack")),(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(i.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:()=>{const e=u(),n=d(e),r=x(n),[a,...s]=e,[o]=n,i={...o?.attributes||{},content:r};m(a,(0,y.b)(t,i)),p(s),h.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:t})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),C.map((e=>(0,r.createElement)(i.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{g(e.aiSuggestion,{})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(E.IP,{onChange:e=>{g(v.Lg,{tone:e})},disabled:n}),(0,r.createElement)(w.xK,{onChange:e=>{g(v.Nw,{language:e})},disabled:n})))}function j({blockType:e}){const{tracks:t}=(0,s.z$)();return(0,r.createElement)(i.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{className:"jetpack-ai-assistant__button",showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,label:__("AI Assistant","jetpack"),icon:a.u_}),onToggle:n=>{n&&t.recordEvent("jetpack_ai_assistant_extension_toolbar_menu_show",{block_type:e})},renderContent:({onClose:t})=>(0,r.createElement)(S,{onClose:t,blockType:e})})}},3180:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},87445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(6895),s=n(55609),o=n(65736);const __=o.__;const i=function(){const e=(0,a.Z)("jetpack-ai-feedback");return(0,r.createElement)("div",{className:"jetpack-ai-feedback-control"},(0,r.createElement)(s.BaseControl,{label:__("Feedback","jetpack")},(0,r.createElement)("p",null,__("Your feedback is valuable in our commitment to refine and improve this feature.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:e},__("Share your feedback","jetpack"))))}},81612:(e,t,n)=>{"use strict";n.d(t,{QA:()=>h,ZP:()=>f,xK:()=>b});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(61074),l=n(46936),c=n(43618);n(99196);const __=o.__,u=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],d=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,p=__("Translate","jetpack"),m=d?.split("-")[0]||"en",h=(d?.split("-"),{en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),g=({value:e,onChange:t})=>{const n=[...u.filter((e=>e!==m))];return u.includes(m)&&n.unshift(m),(0,r.createElement)(s.MenuGroup,{label:__("Select language","jetpack")},n.map((n=>(0,r.createElement)(s.MenuItem,{key:`key-${n}`,onClick:()=>t(n+" ("+h[n].label+")"),isSelected:e===n},h[n].label))))};function f({value:e=m,label:t=p,onChange:n,disabled:o=!1}){const{tracks:l}=(0,a.z$)();return o?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(i.Z,{icon:c.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:c.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"i18n"})}},(()=>(0,r.createElement)(g,{value:e,onChange:n})))}function b({value:e=m,label:t=p,onChange:n,disabled:a=!1}){return(0,r.createElement)(s.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:t,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},t),(0,r.createElement)(i.Z,{icon:l.Z})),disabled:a}},(({onClose:t})=>(0,r.createElement)(g,{onChange:e=>{n(e),t()},value:e})))}},50297:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(51806),a=n(55609),s=n(65736);const __=s.__,o=({image:e,inModal:t=!1,saveImage:n,setImageModal:s})=>(0,r.createElement)(a.Flex,{direction:"column"},t&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>s(e)})),!t&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))))))},24404:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,l="make-longer",c="makeLonger",u="make-shorter",d="makeShorter",p="summarize",m="summarize",h=[{name:__("Summarize","jetpack"),key:p,aiSuggestion:m},{name:__("Make longer","jetpack"),key:l,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:u,aiSuggestion:d}];function g({key:e,label:t=__("Improve","jetpack"),exclude:n=[],onChange:o,disabled:l=!1}){const{tracks:c}=(0,a.z$)();return l?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(s.Icon,{icon:i.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:i.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&c.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"improve"})}},(()=>{const a=h.filter((e=>!n.includes(e.key)));return(0,r.createElement)(s.MenuGroup,{label:t},a.map((t=>(0,r.createElement)(s.MenuItem,{key:`key-${t.key}`,onClick:()=>o(t.aiSuggestion,{contentType:"generated"}),isSelected:e===t.key},t.name))))}))}},85642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840),l=n(58532),c=n(586),u=n(3639),d=n(92710),p=n(32677);n(99196);const __=o.__,m=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}],h=[{label:__("Say it differently…","jetpack"),description:{original:"Rewrite it in a way that ",translated:__("Rewrite it in a way that ","jetpack")}},{label:__("Add…","jetpack"),description:{original:"Add more details about ",translated:__("Add more details about ","jetpack")}},{label:__("Remove…","jetpack"),description:{original:"Remove unnecessary details about ",translated:__("Remove unnecessary details about ","jetpack")}}];function g({hasContentBefore:e,hasContent:t,hasPostTitle:n,contentIsLoaded:o,onPromptSelect:g,onSuggestionSelect:f}){const b=__("Write with AI…","jetpack"),{tracks:v}=(0,a.z$)();return(0,r.createElement)(s.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:b,text:b,onToggle:e=>{e&&v.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"write-with-ai"})}},(({onClose:a})=>o?(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},h.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))):(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(s.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(s.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>f("continue")},__("Continue writing","jetpack")),(0,r.createElement)(s.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>f("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(s.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>f("simplify")},__("Simplify","jetpack"))),t&&(0,r.createElement)(s.MenuGroup,{label:__("Based on entire content…","jetpack")},t&&(0,r.createElement)(s.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>f("summarize")},__("Summarize","jetpack")),t&&(0,r.createElement)(s.MenuItem,{icon:p.Z,iconPosition:"left",onClick:()=>f("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},n&&(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>f("titleSummary")},__("Summary based on title","jetpack")),m.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))))))}},27298:(e,t,n)=>{"use strict";n.d(t,{IP:()=>m,Nj:()=>u,ZP:()=>h,bu:()=>d});var r=n(51806),a=n(42290),s=n(13419),o=n(55609),i=n(65736),l=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},p=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${d[n].emoji} ${d[n].label}`))));function m({label:e=__("Change tone","jetpack"),value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.Z})),disabled:s}},(({onClose:e})=>(0,r.createElement)(p,{value:t,onChange:t=>{n(t),e()}})))}function h({value:e=u,onChange:t,disabled:n=!1}){const i=__("Change tone","jetpack"),{tracks:l}=(0,s.z$)();return n?(0,r.createElement)(o.Tooltip,{text:i},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.v_}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:i,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(p,{value:e,onChange:t})))}},4965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(52175),s=n(55609),o=n(65736),i=n(79201),l=n(48381),c=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=o.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:o,handleImageRequest:h,handleTryAgain:g,showRetry:f,contentBefore:b,hasPostTitle:v,wholeContent:k,setUserPrompt:y,recordEvent:w,isGeneratingTitle:E})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,!f&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(p.ZP,{hasContentBefore:!!b?.length,hasContent:!!k?.length,hasPostTitle:v,contentIsLoaded:e,onPromptSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),y(e.translated)},onSuggestionSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Lg}),t(c.Lg,{tone:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(u.ZP,{value:"en",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Nw}),t(c.Nw,{language:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(d.ZP,{onChange:t,exclude:E?["summarize"]:[],disabled:!e}))),(f||g)&&(0,r.createElement)(s.ToolbarGroup,null,!f&&e&&g&&(0,r.createElement)(s.ToolbarButton,{onClick:g},__("Try Again","jetpack")),f&&e&&(0,r.createElement)(s.ToolbarButton,{icon:i.Z,onClick:o},__("Accept","jetpack")),f&&(0,r.createElement)(s.ToolbarButton,{icon:l.Z,onClick:n},__("Retry","jetpack"))),false))},5246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r=n(51806),a=n(6895),s=n(13419),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(99196),d=n(26546),p=n(23795),m=n(63206),h=n(18135),g=n(71449);const __=i.__,f=c()("jetpack-ai-assistant:upgrade-prompt"),b=e=>{const{upgradeType:t}=(0,h.Z)();return"vip"===t?(0,r.createElement)(d.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(({placement:e=null})=>{const{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:l}=(0,m.Z)(),c=(0,g.d)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y,usagePeriod:w}=(0,h.Z)(),E=(0,p.U_)(k)===p.dt?w?.requestsCount:y,{tracks:_}=(0,s.z$)(),C=(0,u.useCallback)((t=>{f("upgrade",e),_.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:E,placement:e}),n(t)}),[n,k,E,_,e]),x=(0,u.useCallback)((()=>{f("contact us",e),_.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[_,e]);if(!c)return(0,r.createElement)(d.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null});if(v){if(!b){const e=(0,a.Z)("jetpack-ai-tiers-more-requests-contact");return(0,r.createElement)(d.p,{buttonText:__("Contact Us","jetpack"),description:__("You have reached the request limit for your current plan.","jetpack"),className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:x})}return(0,r.createElement)(d.p,{buttonText:(0,i.sprintf)(/* Translators: number of requests */ +_n("You have %d auto-share remaining.","You have %d auto-shares remaining.",e,"jetpack"),e):"";return{default:"",exceeded:__("You have reached your auto-share limit. Scheduled posts will not be shared until shares become available.","jetpack"),full:__("You have reached your auto-share limit.","jetpack"),approaching:t}}(u);let p="default",m="none",h=d.default;return c>o?(p="error",m="exceeded",h=d.exceeded):c===o?(m="full",p="error",h=d.full):c>=.9*o?(m="approaching",p="error",h=d.approaching):c>=.8*o&&(m="approaching",p="warning",h=d.approaching),{status:m,noticeType:p,message:h,usedCount:l,scheduledCount:i,remainingCount:u}}),[e,t])}},45579:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(9818),i=n(12238),l=n(69307),c=n(65736),u=n(37568),d=n(48751);const __=c.__;function p(e){const t=e?.code,n=e?.errors?.length;if(!t&&!n)return!1;let r="";return t&&(r=__("Unable to share the Post","jetpack")),n&&(r=__("Unable to share the Post","jetpack")),{message:r,result:e}}function m(e){const{message:t}=(0,d.Z)(),{skippedConnections:n}=(0,u.Z)(),a=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||a;const[c,m]=(0,l.useState)({data:[],error:{}}),h=((0,r.Pb)()?.social?.resharePath??"/wpcom/v2/posts/{postId}/publicize").replace("{postId}",e),g=(0,l.useCallback)((function(){const r={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!c.isFetching)return m({...r,isFetching:!0}),s()({path:h,method:"POST",data:{message:t,skipped_connections:n}}).then(((e={})=>{const t=p(e);if(t)return m((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));m((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:e?.results,error:{}})))})).catch((e=>{m((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:p(e)})))})),function(){m(r)}}),[e,t,n,c.isFetching,h]);return{...c,doPublicize:g}}},37568:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9818),a=n(23177);function s(){const{refreshConnectionTestResults:e,toggleConnectionById:t}=(0,r.useDispatch)(a.h);return{...(0,r.useSelect)((e=>{const t=e(a.h),n=t.getConnections(),r=t.getEnabledConnections(),s=t.getDisabledConnections().map((e=>e.id));return{connections:n,hasConnections:n.length>0,hasEnabledConnections:r.length>0,skippedConnections:s,enabledConnections:r}}),[]),toggleById:t,refresh:e}}},48751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(42032),a=n(71806);function s(){const{updateMeta:e,shareMessage:t}=(0,a.R)();return{message:t,maxLength:(0,r.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(9818),a=n(12238),s=n(23177),o=n(86419);function i(){const{mergeConnections:e}=(0,r.useDispatch)(s.h),{didPostSaveRequestSucceed:t,isCurrentPostPublished:n,getEditedPostAttribute:i}=(0,r.useSelect)((e=>e(a.store)),[]);(0,o.M1)((()=>{if(t()&&n()){const t=i("jetpack_publicize_connections");t?.length&&e(t)}}),[t,n,i])}},21052:(e,t,n)=>{"use strict";n.d(t,{Au:()=>l,Wh:()=>c,ZP:()=>u,hi:()=>i,wO:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_AUTO_CONVERSION_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateAutoConversionSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Fl)(e);const t=yield(0,s.wi)();return yield c(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,r.select)(a.Eg).getAutoConversionSettings();return yield c(t),!1}finally{yield l()}},setAutoConversionSettings:c,refreshAutoConversionSettings:function*(){try{yield i();const e=yield(0,s.wi)();return yield c(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield l()}}}},23013:(e,t,n)=>{"use strict";n.r(t),n.d(t,{mergeConnections:()=>u,refreshConnectionTestResults:()=>d,setConnections:()=>l,syncConnectionsToPostMeta:()=>p,toggleConnection:()=>c,toggleConnectionById:()=>m});var r=n(13419),a=n(86989),s=n.n(a),o=n(12238),i=n(74442);function l(e){return{type:i.b,connections:e}}function c(e){return{type:i.L,connectionId:e}}function u(e){return function({dispatch:t,select:n}){const r=n.getConnections(),a=[],s={done:!1,enabled:Boolean(n.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...s,...r.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};a.push(e)}t(l(a))}}function d(e=!1){return async function({dispatch:t}){try{const n=(0,r.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(u(await s()({path:n}))),e&&t(p())}catch(e){}}}function p(){return function({registry:e,select:t}){const n=t.getConnections();return e.dispatch(o.store).editPost({jetpack_publicize_connections:n})}}function m(e,t=!0){return function({dispatch:n}){n(c(e)),t&&n(p())}}},74442:(e,t,n)=>{"use strict";n.d(t,{L:()=>a,b:()=>r});const r="SET_CONNECTIONS",a="TOGGLE_CONNECTION"},54725:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(21052),a=n(23013),s=n(371),o=n(72438),i=n(4462);const l={...s.ZP,...i.ZP,...r.ZP,...o.Z,...a}},371:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>l,dz:()=>o,ff:()=>i});var r=n(9818),a=n(23177),s=n(4957);const o="SET_JETPACK_SETTINGS";function i(e){return{type:o,options:e}}const l={updateJetpackSettings:function*(e){try{yield i({is_updating:!0}),yield i(e),yield(0,s.RF)(e);const t=yield(0,s.es)();return yield i(t),!0}catch(e){const t=(0,r.select)(a.Eg).getJetpackSettings();return yield i(t),!1}finally{yield i({is_updating:!1})}},setJetpackSettings:i}},72438:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(4957),a=n(21052),s=n(4462);const o={refreshJetpackSocialSettings:function*(){try{yield(0,a.hi)(),yield(0,s.ds)();const e=yield(0,r.mu)();return yield(0,a.Wh)(e.jetpack_social_autoconvert_images),yield(0,s.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,a.Au)(),yield(0,s.Gr)()}}}},4462:(e,t,n)=>{"use strict";n.d(t,{Gr:()=>l,ZP:()=>u,ch:()=>c,ds:()=>i,kg:()=>o});var r=n(9818),a=n(23177),s=n(4957);const o="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function i(){return c({isUpdating:!0})}function l(){return c({isUpdating:!1})}function c(e){return{type:o,options:e}}const u={updateSocialImageGeneratorSettings:function*(e){try{yield i(),yield c(e),yield(0,s.Ux)(e);const t=yield(0,s.oB)();return yield c(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,r.select)(a.Eg).getSocialImageGeneratorSettings();return yield c(t),!1}finally{yield l()}},setSocialImageGeneratorSettings:c,refreshSocialImageGeneratorSettings:function*(){try{yield i();const e=yield(0,s.oB)();return yield c(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield l()}}}},4957:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>k,es:()=>p,mu:()=>b,oB:()=>h,wi:()=>f});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_SETTINGS",o="UPDATE_JETPACK_SETTINGS",i="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="FETCH_AUTO_CONVERSION_SETTINGS",u="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",p=()=>({type:s}),m=e=>({type:o,settings:e}),h=()=>({type:i}),g=e=>({type:l,settings:e}),f=()=>({type:c}),b=()=>({type:d}),v=e=>({type:u,settings:e}),k={[s]:function(){return a()({path:"/jetpack/v4/social/settings"})},[o]:function(e){return a()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[i]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[l]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[c]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[u]:function(e){return a()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return a()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,n)=>{"use strict";n.d(t,{Bb:()=>f,Cd:()=>g,Eg:()=>c,M$:()=>p,cs:()=>h,h:()=>v,qk:()=>m,uJ:()=>d,wV:()=>b});var r=n(9818),a=n(54725),s=n(4957),o=n(45272),i=n(15781),l=n(22987);const c="jetpack-social-plugin",u={reducer:o.Z,actions:a.Z,selectors:l.Z,resolvers:i.ZP,controls:s.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",p="instagram-business",m="linkedin",h="mastodon",g="nextdoor",f="tumblr",b="twitter",v=(0,r.createReduxStore)(c,u);(0,r.register)(v)},20750:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(21052);const a=(e={},t)=>t.type===r.wO?{...e,...t.options}:e},71837:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(74442);const a=(e={},t)=>{switch(t.type){case r.b:return{...e,connections:t.connections};case r.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9818),a=n(20750),s=n(71837),o=n(80697),i=n(35652),l=n(28696),c=n(54489);const u=(0,r.combineReducers)({sharesData:i.Z,siteData:l.Z,connectionData:s.Z,jetpackSettings:o.Z,socialImageGeneratorSettings:c.Z,autoConversionSettings:a.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(371);const a=(e={},t)=>t.type===r.dz?{...e,...t.options}:e},35652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},28696:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=(e={})=>e},54489:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(4462);const a=(e={},t)=>t.type===r.kg?{...e,...t.options}:e},15781:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>c});var r=n(12238),a=n(21052),s=n(23013),o=n(371),i=n(4462),l=n(4957);const c={getJetpackSettings:function*(){try{const e=yield(0,l.es)();if(e)return(0,o.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,l.oB)();if(e)return(0,i.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,l.wi)();if(e)return(0,a.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const n=t.select(r.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,s.setConnections)(n||[]))}}}},68113:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,n)=>{"use strict";function r(e){return e.connectionData?.connections??[]}function a(e){return e.connectionData?.adminUrl??null}function s(e){return r(e).length>0}function o(e){return r(e).filter((e=>!1===e.test_success))}function i(e){return r(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function l(e){return r(e).filter((e=>e.enabled))}function c(e){return r(e).filter((e=>!e.enabled))}function u(e,t,{forceDefaults:n=!1}={}){let a="",s="",o="";if(!n){const n=r(e).find((({service_name:e})=>t===e));if(n){const{display_name:e,profile_display_name:r,profile_picture:i}=n;a="twitter"===t?r:e,o="twitter"===t?e:n.username,s=i}}return{displayName:a,profileImage:s,username:o}}n.r(t),n.d(t,{getConnectionProfileDetails:()=>u,getConnections:()=>r,getConnectionsAdminUrl:()=>a,getDisabledConnections:()=>c,getEnabledConnections:()=>l,getFailedConnections:()=>o,getMustReauthConnections:()=>i,hasConnections:()=>s})},22987:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(68113),a=n(43354),s=n(82836),o=n(31473),i=n(85675),l=n(45073);const c={...i.Z,...a,...s.Z,...o,...l.Z,...r.Z}},82836:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getScheduledSharesCount:()=>l,getShareLimit:()=>o,getSharedPostsCount:()=>u,getSharesUsedCount:()=>i,getTotalSharesCount:()=>c,isShareLimitEnabled:()=>a,numberOfSharesRemaining:()=>p,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>s});var r=n(82836);function a(e){return e.sharesData?.is_share_limit_enabled??!1}function s(e){return!r.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&a(e)}function o(e){return e.sharesData?.share_limit??30}function i(e){return e.sharesData?.publicized_count??0}function l(e){return e.sharesData?.to_be_publicized_count??0}function c(e){const t=i(e)+l(e);return Math.max(t,0)}function u(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function p(e,t={}){if(!s(e))return 1/0;const{includeScheduled:n}={includeScheduled:!0,...t},r=i(e),a=o(e),c=n?l(e):0;return Math.max(a-r-c,0)}},85675:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getBlogID:e=>e.siteData?.blogID??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=255;function a(){return r}},12677:(e,t,n)=>{"use strict";n.d(t,{h:()=>a});var r=n(13419);function a(){return(0,r.Pb)()?.social?.supportedAdditionalConnections||[]}},42032:(e,t,n)=>{"use strict";n.d(t,{getShareMessageMaxLength:()=>r.A,getSupportedAdditionalConnections:()=>a.h});var r=n(5463),a=n(12677),s=n(581);n.o(s,"useSyncPostDataToStore")&&n.d(t,{useSyncPostDataToStore:function(){return s.useSyncPostDataToStore}})},581:()=>{},13419:(e,t,n)=>{"use strict";n.d(t,{Dp:()=>u.Z,FK:()=>c.FK,HD:()=>c.HD,M6:()=>s.M6,OZ:()=>o.Z,Pb:()=>r.Z,Pm:()=>m.Z,Qq:()=>c.Qq,Rl:()=>c.Rl,T:()=>l.Z,Ug:()=>s.Ug,Wp:()=>s.Wp,X1:()=>c.X1,_D:()=>c._D,aQ:()=>s.aQ,dM:()=>h.d,el:()=>p.Z,lQ:()=>a.Z,lt:()=>h.l,m3:()=>c.m3,o_:()=>i.Z,og:()=>g.Z,z$:()=>d.Z});var r=n(50148),a=n(35004),s=n(99505),o=n(48052),i=n(76714),l=n(80354),c=n(75404),u=n(68586),d=n(61053),p=n(11380),m=n(6342),h=n(96959),g=n(19499);n(39058)},6342:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(78868),a=n(99196),s=n.n(a);const o=()=>s().createElement(r.Z,{className:"jetpack-editor-panel-logo",height:16,logoColor:"#1E1E1E",showText:!1})},96959:(e,t,n)=>{"use strict";n.d(t,{d:()=>s,l:()=>o});var r=n(69307),a=n(12953);function s(e){const t={};let n="span",a=e.icon;const s=document.createElement("div");s.innerHTML=e.icon;const o=s.querySelector("svg");return o&&(n="svg",a=o.innerHTML,Array.from(o.attributes).forEach((({nodeName:e,nodeValue:n})=>t[e]=n))),(0,r.createElement)(n,{...t,dangerouslySetInnerHTML:{__html:a||""}})}function o(e){return{src:s(e),foreground:(0,a.Z)()}}},12953:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(99505);const a="#069e08";function s(){return(0,r.Ug)()||(0,r.Wp)()?null:a}},19499:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){const e=(0,r.Z)();return e?.blocks_variation??"production"}},50148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="Jetpack_Editor_Initial_State";function a(){return"object"==typeof window?window?.[r]??null:null}},48052:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(e){const t=(0,r.Z)(),n=t?.available_blocks?.[e]?.available??!1,a=t?.available_blocks?.[e]?.unavailable_reason??"unknown";return{available:n,...!n&&{details:t?.available_blocks?.[e]?.details??[],unavailableReason:a}}}},35004:(e,t,n)=>{"use strict";function r(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}n.d(t,{Z:()=>r})},61053:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(6975),a=n(31294),s=n(69307);const{tracks:o}=r.Z,{recordEvent:i}=o,l=({pageViewEventName:e=null,pageViewNamespace:t="jetpack",pageViewSuffix:n="page_view",pageViewEventProperties:l={}}={})=>{const[c,u]=(0,s.useState)(!1),{isUserConnected:d,isRegistered:p,userConnectionData:m={}}=(0,a.Z)(),{wpcomUser:{login:h,ID:g}={},blogId:f}=m.currentUser||{},b=(0,s.useCallback)((async(e,t={})=>{d&&g&&h&&i(e,t)}),[d,g,h]);return(0,s.useEffect)((()=>{d&&g&&h&&f&&r.Z.initialize(g,h,{blog_id:f})}),[f,g,h,d]),(0,s.useEffect)((()=>{const r=e?`${t}_${e}_${n}`:null;p&&r&&(c||(b(r,l),u(!0)))}),[c,t,e,n,p,l,b]),{recordEvent:b,tracks:o}}},11380:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(9818),a=n(69307),s=n(39058);const o=e=>{const{isModuleActive:t,isChangingStatus:n,isLoadingModules:o}=(0,r.useSelect)((t=>{const n=t(s.p);return{isModuleActive:n.isModuleActive(e),isChangingStatus:n.isModuleUpdating(e),isLoadingModules:n.areModulesLoading(e)}}),[s.p]),{updateJetpackModuleStatus:i}=(0,r.useDispatch)(s.p),l=(0,a.useCallback)((t=>i({name:e,active:t})),[e,i]);return(0,a.useMemo)((()=>({isLoadingModules:o,isChangingStatus:n,isModuleActive:t,changeStatus:l})),[o,n,t,l])}},68586:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(50148);function a(){return(0,r.Z)()?.jetpack?.is_current_user_connected??!1}},44166:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>p,rW:()=>d});var r=n(9818),a=n(99505),s=n(82162),o=n(39058);const i="SET_JETPACK_MODULES",l="SET_MODULE_UPDATING";function c(e){return d({isLoading:e})}function u(e,t){return{type:l,name:e,isUpdating:t}}function d(e){return{type:i,options:e}}const p={updateJetpackModuleStatus:function*(e){try{yield u(e.name,!0),yield(0,s.zL)(e);const t=yield(0,s.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield u(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,a.Wp)())return!0;try{yield c(!0);const e=yield(0,s.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,r.select)(o.p).getJetpackModules();return yield d(t),!1}finally{yield c(!1)}}}},82162:(e,t,n)=>{"use strict";n.d(t,{Bs:()=>i,ZP:()=>c,zL:()=>l});var r=n(86989),a=n.n(r);const s="FETCH_JETPACK_MODULES",o="UPDATE_JETPACK_MODULE_STATUS",i=()=>({type:s}),l=e=>({type:o,settings:e}),c={[s]:function(){return a()({path:"/jetpack/v4/module/all",method:"GET"})},[o]:function({settings:e}){return a()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,n)=>{"use strict";n.d(t,{p:()=>c});var r=n(9818),a=n(44166),s=n(82162),o=n(42469),i=n(55133),l=n(43524);const c="jetpack-modules",u=(0,r.createReduxStore)(c,{reducer:o.Z,actions:a.ZP,controls:s.ZP,resolvers:i.Z,selectors:l.Z});(0,r.register)(u);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,r.dispatch)(c).setJetpackModules({data:{...d}})},42469:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r={isLoading:!1,isUpdating:{},data:{}},a=(e=r,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(44166),a=n(82162);const s={getJetpackModules:function*(){try{const e=yield(0,a.Bs)();if(e)return(0,r.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(99505);const a={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,r.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,n)=>{"use strict";n.d(t,{FK:()=>g,HD:()=>f,Qq:()=>u,Rl:()=>m,X1:()=>d,_D:()=>p,m3:()=>b});var r=n(65736),a=n(96483),s=n(92819),o=n(50148),i=n(48052),l=n(35004),c=n(99505);const __=r.__;function u({planSlug:e,plan:t,postId:n,postType:r}){const o=(0,s.startsWith)(e,"jetpack_")?e:(0,s.get)(t,["path_slug"]),i=(void 0===r?()=>{const e=new URLSearchParams(window.location.search);return(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/site-editor.php`,{postId:e.get("postId"),postType:e.get("postType"),plan_upgraded:1})}:()=>{const e=["page","post"].includes(r)?"":"edit";return(0,c.Wp)()?(0,a.addQueryArgs)("/"+(0,s.compact)([e,r,(0,l.Z)(),n]).join("/"),{plan_upgraded:1}):(0,a.addQueryArgs)(window.location.protocol+`//${(0,l.Z)().replace("::","/")}/wp-admin/post.php`,{action:"edit",post:n,plan_upgraded:1})})();return(0,c.Ug)()?(0,a.addQueryArgs)(`https://wordpress.com/plans/${(0,l.Z)()}`,{redirect_to:i,customerType:"business"}):o&&(0,a.addQueryArgs)(`https://wordpress.com/checkout/${(0,l.Z)()}/${o}`,{redirect_to:i})}function d(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{available:n,unavailableReason:r}=(0,i.Z)(t);return!n&&"missing_plan"===r}function p(e,t){return"missing_plan"===e&&t.required_plan}function m(e){if(!e)return!1;const t=/^jetpack\//.test(e)?e.substr(8,e.length):e,{details:n,unavailableReason:r}=(0,i.Z)(t);return p(r,n)}const h=[{name:"core/cover",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"video",description:__("Upgrade your plan to use video covers","jetpack")},{name:"core/audio",mediaPlaceholder:!0,mediaReplaceFlow:!0,fileType:"audio",description:__("Upgrade your plan to upload audio","jetpack")}];function g(){return(0,s.get)((0,o.Z)(),"jetpack.enable_upgrade_nudge",!1)}const f=e=>(0,s.map)(h,"name").includes(e),b=e=>(0,s.head)((0,s.filter)(h,(({name:t})=>t===e)))},76714:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(98817),a=n(48052);function s(e,t){const{available:n,unavailableReason:s}=(0,a.Z)(e);return!!n&&(0,r.registerPlugin)(`jetpack-${e}`,t)}},99505:(e,t,n)=>{"use strict";n.d(t,{M6:()=>i,Ug:()=>o,Wp:()=>s,aQ:()=>l});var r=n(50148);function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function s(){return"simple"===a()}function o(){return"atomic"===a()}function i(){const e=(0,r.Z)();return e?.jetpack?.is_private_site??!1}function l(){const e=(0,r.Z)();return e?.jetpack?.is_coming_soon??!1}},80354:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(82674),a=n.n(r),s=n(94333);const o=e=>(0,s.createHigherOrderComponent)((t=>n=>React.createElement(t,a()({},n,{className:n.name===e?"has-warning is-interactive":n.className}))),"withHasWarningIsInteractiveClassNames")},83059:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>j});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(586),p=n(3639),m=n(92710),h=n(58532),g=n(51128),f=n.n(g),b=(n(99196),n(49259)),v=n(63634),k=n(854),y=n(6747),w=n(81612),E=n(27298);const __=u.__,_=f()("jetpack-ai-assistant:dropdown"),C=[{name:__("Correct spelling and grammar","jetpack"),key:"correct-spelling",aiSuggestion:v.Hd,icon:d.Z},{name:__("Simplify","jetpack"),key:"simplify",aiSuggestion:v.hI,icon:p.Z},{name:__("Summarize","jetpack"),key:"summarize",aiSuggestion:v.Lq,icon:m.Z},{name:__("Expand","jetpack"),key:"make-longer",aiSuggestion:v.TV,icon:h.Z}];function x(e){return e.filter((e=>null!=e)).map((e=>(0,o.getBlockContent)(e))).join("\n\n")}function S({onClose:e,blockType:t}){const[n,o]=(0,c.useState)(!1),{getSelectedBlockClientIds:u,getBlocksByClientId:d}=(0,l.useSelect)("core/block-editor"),{removeBlocks:p,replaceBlock:m}=(0,l.useDispatch)("core/block-editor");(0,c.useEffect)((()=>{const e=u(),t=x(d(e)),n=(0,k.t$)(t);return o(!n.length)}),[d,u]);const{tracks:h}=(0,s.z$)(),g=(n,r={})=>{const a=u(),s=d(a),o=x(s);e(),_("requestSuggestion",n,r),h.recordEvent("jetpack_editor_ai_assistant_extension_toolbar_button_click",{suggestion:n,block_type:t});const[i]=s,[l,...c]=a,g={...i?.attributes||{},content:o},f=(0,y.b)(t,g),v={clientId:l,type:n,options:{...r,contentType:"generated",fromExtension:!0}};localStorage.setItem((0,b.$M)(f.clientId),JSON.stringify(v)),m(l,f),p(c)};return(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(i.Notice,{status:"warning",isDismissible:!1,className:"jetpack-ai-assistant__info"},__("Add content to activate the tools below","jetpack")),(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(i.MenuItem,{icon:a.u_,iconPosition:"left",key:"key-ai-assistant",onClick:()=>{const e=u(),n=d(e),r=x(n),[a,...s]=e,[o]=n,i={...o?.attributes||{},content:r};m(a,(0,y.b)(t,i)),p(s),h.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:t})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},__("Ask AI Assistant","jetpack"))),C.map((e=>(0,r.createElement)(i.MenuItem,{icon:e?.icon,iconPosition:"left",key:`key-${e.key}`,onClick:()=>{g(e.aiSuggestion,{})},disabled:n},(0,r.createElement)("div",{className:"jetpack-ai-assistant__menu-item"},e.name)))),(0,r.createElement)(E.IP,{onChange:e=>{g(v.Lg,{tone:e})},disabled:n}),(0,r.createElement)(w.xK,{onChange:e=>{g(v.Nw,{language:e})},disabled:n})))}function j({blockType:e}){const{tracks:t}=(0,s.z$)();return(0,r.createElement)(i.Dropdown,{popoverProps:{variant:"toolbar"},renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(i.ToolbarButton,{className:"jetpack-ai-assistant__button",showTooltip:!0,onClick:t,"aria-haspopup":"true","aria-expanded":e,label:__("AI Assistant","jetpack"),icon:a.u_}),onToggle:n=>{n&&t.recordEvent("jetpack_ai_assistant_extension_toolbar_menu_show",{block_type:e})},renderContent:({onClose:t})=>(0,r.createElement)(S,{onClose:t,blockType:e})})}},3180:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},87445:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(6895),s=n(55609),o=n(65736);const __=o.__;const i=function(){const e=(0,a.Z)("jetpack-ai-feedback");return(0,r.createElement)("div",{className:"jetpack-ai-feedback-control"},(0,r.createElement)(s.BaseControl,{label:__("Feedback","jetpack")},(0,r.createElement)("p",null,__("Your feedback is valuable in our commitment to refine and improve this feature.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:e},__("Share your feedback","jetpack"))))}},81612:(e,t,n)=>{"use strict";n.d(t,{QA:()=>h,ZP:()=>f,xK:()=>b});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(61074),l=n(46936),c=n(43618);n(99196);const __=o.__,u=["en","es","fr","de","it","pt","ru","zh","ja","ar","hi","ko"],d=window?.Jetpack_Editor_Initial_State?.siteLocale||navigator?.language,p=__("Translate","jetpack"),m=d?.split("-")[0]||"en",h=(d?.split("-"),{en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")},id:{label:__("Indonesian","jetpack")},tl:{label:__("Filipino","jetpack")},vi:{label:__("Vietnamese","jetpack")}}),g=({value:e,onChange:t})=>{const n=[...u.filter((e=>e!==m))];return u.includes(m)&&n.unshift(m),(0,r.createElement)(s.MenuGroup,{label:__("Select language","jetpack")},n.map((n=>(0,r.createElement)(s.MenuItem,{key:`key-${n}`,onClick:()=>t(n+" ("+h[n].label+")"),isSelected:e===n},h[n].label))))};function f({value:e=m,label:t=p,onChange:n,disabled:o=!1}){const{tracks:l}=(0,a.z$)();return o?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(i.Z,{icon:c.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:c.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"i18n"})}},(()=>(0,r.createElement)(g,{value:e,onChange:n})))}function b({value:e=m,label:t=p,onChange:n,disabled:a=!1}){return(0,r.createElement)(s.DropdownMenu,{className:"ai-assistant__i18n-dropdown",icon:c.Z,label:t,toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__i18n-dropdown__toggle-label"},t),(0,r.createElement)(i.Z,{icon:l.Z})),disabled:a}},(({onClose:t})=>(0,r.createElement)(g,{onChange:e=>{n(e),t()},value:e})))}},50297:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(51806),a=n(55609),s=n(65736);const __=s.__,o=({image:e,inModal:t=!1,saveImage:n,setImageModal:s})=>(0,r.createElement)(a.Flex,{direction:"column"},t&&(0,r.createElement)(a.FlexItem,{style:{textAlign:"center"}},(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))),(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)("input",{type:"image",className:"wp-block-ai-image-image",src:e,alt:"",onClick:()=>s(e)})),!t&&(0,r.createElement)(a.FlexBlock,null,(0,r.createElement)(a.Flex,{direction:"column",style:{alignItems:"center"}},(0,r.createElement)(a.FlexItem,null,(0,r.createElement)(a.Button,{variant:"primary",onClick:()=>n(e)},__("Use this image","jetpack"))))))},24404:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840);n(99196);const __=o.__,l="make-longer",c="makeLonger",u="make-shorter",d="makeShorter",p="summarize",m="summarize",h=[{name:__("Summarize","jetpack"),key:p,aiSuggestion:m},{name:__("Make longer","jetpack"),key:l,aiSuggestion:c},{name:__("Make shorter","jetpack"),key:u,aiSuggestion:d}];function g({key:e,label:t=__("Improve","jetpack"),exclude:n=[],onChange:o,disabled:l=!1}){const{tracks:c}=(0,a.z$)();return l?(0,r.createElement)(s.Tooltip,{text:t},(0,r.createElement)(s.Button,{disabled:!0},(0,r.createElement)(s.Icon,{icon:i.Z}))):(0,r.createElement)(s.ToolbarDropdownMenu,{icon:i.Z,label:t,popoverProps:{variant:"toolbar"},onToggle:e=>{e&&c.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"improve"})}},(()=>{const a=h.filter((e=>!n.includes(e.key)));return(0,r.createElement)(s.MenuGroup,{label:t},a.map((t=>(0,r.createElement)(s.MenuItem,{key:`key-${t.key}`,onClick:()=>o(t.aiSuggestion,{contentType:"generated"}),isSelected:e===t.key},t.name))))}))}},85642:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g});var r=n(51806),a=n(13419),s=n(55609),o=n(65736),i=n(77840),l=n(58532),c=n(586),u=n(3639),d=n(92710),p=n(32677);n(99196);const __=o.__,m=[{label:__("Post about…","jetpack"),description:{original:"Write a post about ",translated:__("Write a post about ","jetpack")}},{label:__("Informative article on…","jetpack"),description:{original:"Craft an informative article explaining ",translated:__("Craft an informative article explaining ","jetpack")}},{label:__("Step-by-step tutorial on…","jetpack"),description:{original:"Write a step-by-step tutorial on ",translated:__("Write a step-by-step tutorial on ","jetpack")}},{label:__("Motivational post on…","jetpack"),description:{original:"Create a motivational post on ",translated:__("Create a motivational post on ","jetpack")}}],h=[{label:__("Say it differently…","jetpack"),description:{original:"Rewrite it in a way that ",translated:__("Rewrite it in a way that ","jetpack")}},{label:__("Add…","jetpack"),description:{original:"Add more details about ",translated:__("Add more details about ","jetpack")}},{label:__("Remove…","jetpack"),description:{original:"Remove unnecessary details about ",translated:__("Remove unnecessary details about ","jetpack")}}];function g({hasContentBefore:e,hasContent:t,hasPostTitle:n,contentIsLoaded:o,onPromptSelect:g,onSuggestionSelect:f}){const b=__("Write with AI…","jetpack"),{tracks:v}=(0,a.z$)();return(0,r.createElement)(s.ToolbarDropdownMenu,{className:"jetpack-ai-assistant__templates-control",icon:null,label:b,text:b,onToggle:e=>{e&&v.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"write-with-ai"})}},(({onClose:a})=>o?(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},h.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))):(0,r.createElement)(r.Fragment,null,e&&(0,r.createElement)(s.MenuGroup,{label:__("Based on preceding content…","jetpack")},(0,r.createElement)(s.MenuItem,{icon:l.Z,iconPosition:"left",onClick:()=>f("continue")},__("Continue writing","jetpack")),(0,r.createElement)(s.MenuItem,{icon:c.Z,iconPosition:"left",onClick:()=>f("correctSpelling")},__("Correct spelling and grammar","jetpack")),(0,r.createElement)(s.MenuItem,{icon:u.Z,iconPosition:"left",onClick:()=>f("simplify")},__("Simplify","jetpack"))),t&&(0,r.createElement)(s.MenuGroup,{label:__("Based on entire content…","jetpack")},t&&(0,r.createElement)(s.MenuItem,{icon:d.Z,iconPosition:"left",onClick:()=>f("summarize")},__("Summarize","jetpack")),t&&(0,r.createElement)(s.MenuItem,{icon:p.Z,iconPosition:"left",onClick:()=>f("generateTitle")},__("Generate a post title","jetpack"))),(0,r.createElement)(s.MenuGroup,{label:__("Write…","jetpack")},n&&(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",onClick:()=>f("titleSummary")},__("Summary based on title","jetpack")),m.map(((e,t)=>(0,r.createElement)(s.MenuItem,{icon:i.Z,iconPosition:"left",key:`key-${t}`,onClick:()=>{a(),g(e.description)}},e.label)))))))}},27298:(e,t,n)=>{"use strict";n.d(t,{IP:()=>m,Nj:()=>u,ZP:()=>h,bu:()=>d});var r=n(51806),a=n(42290),s=n(13419),o=n(55609),i=n(65736),l=n(46936);n(99196);const __=i.__,c=["formal","informal","optimistic","humorous","serious","skeptical","empathetic","confident","passionate","provocative"],u="formal",d={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},p=({value:e,onChange:t})=>(0,r.createElement)(o.MenuGroup,{label:__("Select tone","jetpack")},c.map((n=>(0,r.createElement)(o.MenuItem,{key:`key-${n}`,onClick:()=>t(n),isSelected:e===n},`${d[n].emoji} ${d[n].label}`))));function m({label:e=__("Change tone","jetpack"),value:t=u,onChange:n,disabled:s=!1}){return(0,r.createElement)(o.DropdownMenu,{icon:a.v_,label:e,className:"ai-assistant__tone-dropdown",popoverProps:{variant:"toolbar"},toggleProps:{children:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"ai-assistant__tone-dropdown__toggle-label"},e),(0,r.createElement)(o.Icon,{icon:l.Z})),disabled:s}},(({onClose:e})=>(0,r.createElement)(p,{value:t,onChange:t=>{n(t),e()}})))}function h({value:e=u,onChange:t,disabled:n=!1}){const i=__("Change tone","jetpack"),{tracks:l}=(0,s.z$)();return n?(0,r.createElement)(o.Tooltip,{text:i},(0,r.createElement)(o.Button,{disabled:!0},(0,r.createElement)(o.Icon,{icon:a.v_}))):(0,r.createElement)(o.ToolbarDropdownMenu,{icon:a.v_,label:i,popoverProps:{variant:"toolbar"},disabled:n,onToggle:e=>{e&&l.recordEvent("jetpack_ai_assistant_block_toolbar_menu_show",{tool:"tone"})}},(()=>(0,r.createElement)(p,{value:e,onChange:t})))}},4965:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n(51806),a=n(52175),s=n(55609),o=n(65736),i=n(79201),l=n(48381),c=(n(75022),n(63634)),u=n(81612),d=n(24404),p=n(85642),m=n(27298);const __=o.__,h=({contentIsLoaded:e,getSuggestionFromOpenAI:t,retryRequest:n,handleAcceptContent:o,handleImageRequest:h,handleTryAgain:g,showRetry:f,contentBefore:b,hasPostTitle:v,wholeContent:k,setUserPrompt:y,recordEvent:w,isGeneratingTitle:E})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,!f&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(p.ZP,{hasContentBefore:!!b?.length,hasContent:!!k?.length,hasPostTitle:v,contentIsLoaded:e,onPromptSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"prompt-template",prompt:e.original}),y(e.translated)},onSuggestionSelect:e=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:e}),t(e)}})),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(m.ZP,{value:"neutral",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Lg}),t(c.Lg,{tone:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(u.ZP,{value:"en",onChange:n=>{w("jetpack_editor_ai_assistant_block_toolbar_button_click",{type:"suggestion",suggestion:c.Nw}),t(c.Nw,{language:n,contentType:e?"generated":null})},disabled:!e&&!k?.length}),(0,r.createElement)(d.ZP,{onChange:t,exclude:E?["summarize"]:[],disabled:!e}))),(f||g)&&(0,r.createElement)(s.ToolbarGroup,null,!f&&e&&g&&(0,r.createElement)(s.ToolbarButton,{onClick:g},__("Try Again","jetpack")),f&&e&&(0,r.createElement)(s.ToolbarButton,{icon:i.Z,onClick:o},__("Accept","jetpack")),f&&(0,r.createElement)(s.ToolbarButton,{icon:l.Z,onClick:n},__("Retry","jetpack"))),false))},5246:(e,t,n)=>{"use strict";n.d(t,{Z:()=>b});var r=n(51806),a=n(6895),s=n(13419),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(99196),d=n(26546),p=n(23795),m=n(63206),h=n(18135),g=n(71449);const __=i.__,f=c()("jetpack-ai-assistant:upgrade-prompt"),b=e=>{const{upgradeType:t}=(0,h.Z)();return"vip"===t?(0,r.createElement)(d.p,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. Please reach out to your VIP account team.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null}):(({placement:e=null})=>{const{checkoutUrl:t,autosaveAndRedirect:n,isRedirecting:l}=(0,m.Z)(),c=(0,g.d)(),{nextTier:b,tierPlansEnabled:v,currentTier:k,requestsCount:y,usagePeriod:w}=(0,h.Z)(),E=(0,p.U_)(k)===p.dt?w?.requestsCount:y,{tracks:_}=(0,s.z$)(),C=(0,u.useCallback)((t=>{f("upgrade",e),_.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:k?.slug,requests_count:E,placement:e}),n(t)}),[n,k,E,_,e]),x=(0,u.useCallback)((()=>{f("contact us",e),_.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[_,e]);if(!c)return(0,r.createElement)(d.p,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Reach out to the site administrator to upgrade and keep using Jetpack AI.","jetpack"),{strong:(0,r.createElement)("strong",null)}),visible:!0,align:null,title:null,context:null});if(v){if(!b){const e=(0,a.Z)("jetpack-ai-tiers-more-requests-contact");return(0,r.createElement)(d.p,{buttonText:__("Contact Us","jetpack"),description:__("You have reached the request limit for your current plan.","jetpack"),className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:x})}return(0,r.createElement)(d.p,{buttonText:(0,i.sprintf)(/* Translators: number of requests */ __("Upgrade to %d requests","jetpack"),b.limit),checkoutUrl:t,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)((0,i.sprintf)(/* Translators: number of requests */ __("You have reached the requests limit for your current plan. Upgrade now to increase your requests limit to %d.","jetpack"),b.limit),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:C,isRedirecting:l,visible:!0,align:"center",title:null,context:null})}return(0,r.createElement)(d.p,{buttonText:"Upgrade",checkoutUrl:t,className:"jetpack-ai-upgrade-banner",description:(0,o.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! Upgrade now to keep using it.","jetpack"),{strong:(0,r.createElement)("strong",null)}),goToCheckoutPage:n,isRedirecting:l,visible:!0,align:null,title:null,context:null})})(e)}},45624:(e,t,n)=>{"use strict";n.d(t,{Z:()=>I});var r=n(82674),a=n.n(r),s=n(51806),o=n(42290),i=n(13419),l=n(52175),c=n(4981),u=n(55609),d=n(94333),p=n(9818),m=n(69307),h=n(65736),g=n(65235),f=n.n(g),b=n(10185),v=n.n(b),k=n(99196),y=n(84102),w=n(80013),E=n(3180),_=n(87445),C=n(50297),x=n(4965),S=n(5246),j=n(49259),P=n(18135),N=n(60751),L=n(71449),T=n(3687),A=n(63634);const __=h.__,M=new(v())({breaks:!0}),R="post"===window?.Jetpack_Editor_Initial_State?.screenBase,Z=window?.Jetpack_Editor_Initial_State?.["ai-assistant"]?.["is-playground-visible"];function I({attributes:e,setAttributes:t,clientId:n,isSelected:r}){const[h,g]=(0,m.useState)({}),[b,v]=(0,m.useState)(!1),[I,B]=(0,m.useState)([]),[z,D]=(0,m.useState)(null),[F,O]=(0,m.useState)(null),{tracks:U}=(0,i.z$)(),H=(0,p.useSelect)((e=>e("core/editor").getCurrentPostId())),{getBlock:V}=(0,p.useSelect)("core/block-editor"),q=(0,k.useRef)(null),G=(0,k.useRef)(null),{replaceBlocks:$,replaceBlock:W,removeBlock:J}=(0,p.useDispatch)("core/block-editor"),{editPost:K}=(0,p.useDispatch)("core/editor"),{mediaUpload:Y}=(0,p.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return{mediaUpload:t().mediaUpload}}),[]),{isOverLimit:X,requireUpgrade:Q,increaseRequestsCount:ee}=(0,P.Z)(),te=()=>{setTimeout((()=>{q.current?.focus?.()}),100)},ne=()=>{setTimeout((()=>{G.current?.focus?.()}),100)},re=(0,d.useViewportMatch)("medium","<"),{isLoadingCategories:ae,isLoadingCompletion:se,wasCompletionJustRequested:oe,getSuggestionFromOpenAI:ie,stopSuggestion:le,showRetry:ce,contentBefore:ue,postTitle:de,retryRequest:pe,wholeContent:me,requestingState:he}=(0,N.Z)({onSuggestionDone:(0,m.useCallback)((()=>{te(),ee()}),[ee]),onUnclearPrompt:(0,m.useCallback)((()=>{ne(),ee()}),[ee]),onModeration:te,attributes:e,clientId:n,content:e.content,setError:g,tracks:U,userPrompt:e.userPrompt,requireUpgrade:Q,requestingState:e.requestingState}),ge=(0,L.b)(),fe=(0,j.$M)(n);(0,k.useEffect)((()=>{if(!fe)return;const e=JSON.parse(localStorage.getItem(fe));if(!e)return;const{type:t,options:n}=e;localStorage.removeItem(fe),ie(t,n)}),[fe,ie]),(0,k.useEffect)((()=>{h&&O(!1)}),[h]);const be=(0,k.useRef)(e?.content);(0,k.useEffect)((()=>{if(!e?.useGutenbergSyntax)return;if(!be?.current?.length)return;const t=V(n);if(t?.innerBlocks?.length)return;const r=(0,c.parse)(be.current);r?.length&&$(n,r)}),[be,n,$,V,e?.useGutenbergSyntax]),(0,k.useEffect)((()=>{["init","done"].includes(he)&&t({requestingState:he})}),[he,t]);const ve=async t=>{if(b)return;v(!0),g({});const r=await fetch(t),a=await r.blob(),s=new File([a],"jetpack_ai_image.png",{type:"image/png"});Y({filesList:[s],onFileChange:([t])=>{t.id&&W(n,(0,c.createBlock)("core/image",{url:t.url,caption:e.requestedPrompt,alt:e.requestedPrompt}))},allowedTypes:["image"],onError:e=>{console.error(e),v(!1)}}),U.recordEvent("jetpack_ai_dalle_generation_upload",{post_id:H})},ke=e?.useGutenbergSyntax,ye=se||ae,we=!!e.content,Ee="generateTitle"===e.promptType,_e=__("Accept","jetpack"),Ce=__("Accept title","jetpack"),xe=Ee?Ce:_e,Se=(...e)=>{ie(...e),ne()},je=async()=>{let t=[];if(ke)t=V(n),t=t?.innerBlocks||[];else{const n=M.render(e.content||"").replace(/
  • \s+

    /g,"

  • ").replace(/<\/p>\s+<\/li>/g,"
  • ");t=(0,c.rawHandler)({HTML:n})}await $(n,t);const r=(e=>{let t=null;return e.forEach((e=>{const n=document.querySelector(`.wp-block[data-block="${e.clientId}"]`);if(!n)return;"true"===n.contentEditable&&(t=n);const r=n.querySelectorAll("[contenteditable=true]");t=r.length?r[r.length-1]:t})),t})(t);r&&(e=>{const t=window.getSelection();t.selectAllChildren(e),t.collapseToEnd(),e.focus()})(r)},Pe=()=>{je(),U.recordEvent("jetpack_ai_assistant_block_accept",{feature:"ai-assistant"})},Ne=()=>{R?(K({title:e.content?e.content.trim():""}),J(n),U.recordEvent("jetpack_ai_assistant_block_accept",{feature:"ai-assistant"})):Pe()},Le=()=>{le(),te(),U.recordEvent("jetpack_ai_assistant_block_stop",{feature:"ai-assistant"})},[Te,Ae]=(0,m.useState)(!1),Me=()=>{Ae(!Te)},Re=(0,l.useBlockProps)({ref:G,className:f()({"is-waiting-response":oe})}),Ze=(0,l.useInnerBlocksProps)(Re),Ie=__("Ask Jetpack AI…","jetpack"),Be=__("Write about… Make a table for…","jetpack"),ze=(0,s.createElement)(s.Fragment,null,X&&r&&(0,s.createElement)(S.Z,{placement:"ai-assistant-block"}),!ge&&(0,s.createElement)(E.Z,null));return(0,s.createElement)(u.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{esc:()=>{["requesting","suggesting"].includes(he)&&Le()}}},(0,s.createElement)("div",Re,h?.message&&!F&&"error_quota_exceeded"!==h?.code&&(0,s.createElement)(u.Notice,{status:h.status,isDismissible:!1,className:"jetpack-ai-assistant__error"},h.message),we&&!ke&&(0,s.createElement)("div",{className:"jetpack-ai-assistant__content"},(0,s.createElement)(m.RawHTML,null,M.render(e.content))),we&&ke&&(0,s.createElement)("div",a()({className:"jetpack-ai-assistant__content is-layout-building-mode"},Ze)),(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(u.PanelBody,{initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(y.Z,{placement:w.I}))),(0,s.createElement)(u.PanelBody,{initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(_.Z,null)))),Z&&(0,s.createElement)(l.InspectorControls,null,(0,s.createElement)(u.PanelBody,{title:__("AI Playground","jetpack"),initialOpen:!0},(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(u.ToggleControl,{label:__("Gutenberg Syntax","jetpack"),onChange:e=>t({useGutenbergSyntax:e}),checked:e.useGutenbergSyntax})),(0,s.createElement)(u.PanelRow,null,(0,s.createElement)(u.ToggleControl,{label:__("GPT-4","jetpack"),onChange:e=>t({useGpt4:e}),checked:e.useGpt4})),(0,s.createElement)(u.PanelRow,null,Te&&(0,s.createElement)(u.Modal,{title:__("Custom System Prompt","jetpack"),onRequestClose:Me},(0,s.createElement)(u.TextareaControl,{rows:20,label:__("Set up the custom system prompt ","jetpack"),onChange:e=>t({customSystemPrompt:e}),className:"jetpack-ai-assistant__custom-prompt",value:e.customSystemPrompt||(0,A.t4)({useGutenbergSyntax:e.useGutenbergSyntax,useGpt4:e.useGpt4})?.content}),(0,s.createElement)("div",{className:"jetpack-ai-assistant__custom-prompt__footer"},(0,s.createElement)(u.Button,{onClick:()=>t({customSystemPrompt:""}),variant:"secondary"},__("Restore the prompt","jetpack")),(0,s.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Close","jetpack")))),(0,s.createElement)(u.Button,{onClick:Me,variant:"secondary"},__("Set system custom prompt","jetpack"))))),!ye&&ge&&!Q&&(0,s.createElement)(x.Z,{isWaitingState:ye,contentIsLoaded:we,getSuggestionFromOpenAI:ie,retryRequest:pe,handleAcceptContent:Pe,handleAcceptTitle:Ne,handleGetSuggestion:Se,handleImageRequest:()=>{B([]),g({}),(0,T.b)(""===e.userPrompt.trim()?__("What would you like to see?","jetpack"):e.userPrompt,t,v,B,g,H),U.recordEvent("jetpack_ai_dalle_generation",{post_id:H})},handleTryAgain:null,showRetry:ce,contentBefore:ue,hasPostTitle:!!de?.length,wholeContent:me,promptType:e.promptType,setUserPrompt:e=>{if(!q?.current)return;q.current.focus(),t({userPrompt:e})},recordEvent:U.recordEvent,isGeneratingTitle:Ee}),(0,s.createElement)(o.tK,{ref:q,disabled:Q||!ge,value:e.userPrompt,placeholder:e?.content?Ie:Be,onChange:e=>{O(!0),t({userPrompt:e})},onSend:()=>{Se("userPrompt"),U.recordEvent("jetpack_ai_assistant_block_generate",{feature:"ai-assistant"})},onStop:Le,onAccept:()=>{Ee?Ne():Pe()},onDiscard:()=>{const r=e?.content===V(n).attributes?.content;t({content:e?.originalContent,promptType:void 0,messages:e?.originalMessages}),je(),r?U.recordEvent("jetpack_ai_assistant_block_dismiss"):U.recordEvent("jetpack_ai_assistant_block_discard",{feature:"ai-assistant"})},state:he,isTransparent:Q||!ge,showButtonLabels:!re,showAccept:"init"!==he&&we&&!ye,acceptLabel:xe,showGuideLine:we,showRemove:e?.content?.length>0,bannerComponent:ze}),!b&&I.length>0&&(0,s.createElement)(u.Flex,{direction:"column",style:{width:"100%"}},(0,s.createElement)(u.FlexBlock,{style:{textAlign:"center",margin:"12px",fontStyle:"italic",width:"100%"}},e.requestedPrompt),(0,s.createElement)(u.FlexBlock,{style:{fontSize:"20px",lineHeight:"38px"}},__("Please choose your image","jetpack")),(0,s.createElement)(u.Flex,{direction:"row",wrap:!0},I.map((e=>(0,s.createElement)(C.Z,{setImageModal:D,saveImage:ve,image:e,key:e}))))),!b&&z&&(0,s.createElement)(u.Modal,{onRequestClose:()=>D(null)},(0,s.createElement)(C.Z,{saveImage:ve,setImageModal:D,image:z,inModal:!0}))))}},27559:(e,t,n)=>{"use strict";var r=n(31985),a=n(23536),s=n(45624),o=n(6747);n(81765),n(54765),n(94662);(0,r.S)(a,{edit:s.Z,save:()=>null,transforms:o.Z})},54765:(e,t,n)=>{"use strict";n.d(t,{J7:()=>u,NP:()=>l});var r=n(4981),a=n(9818),s=n(92694),o=n(23536),i=n(71449);const l=["core/paragraph","core/heading","core/list"],c=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-support"];function u(){if(!(0,r.getBlockType)(o.name))return!1;if(!c)return!1;if(!(0,i.b)())return!1;const{errorCode:e}=(0,a.select)("wordpress-com/plans")?.getAiAssistantFeature?.()||{};if(e)return!1;const{getHiddenBlockTypes:t}=(0,a.select)("core/edit-post")||{};return!(t?.()||[]).includes(o.name)}(0,s.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return l.includes(t)&&u()?{...e,supports:{...e.supports,"jetpack/ai":{assistant:!0}}}:e}),100)},49259:(e,t,n)=>{"use strict";n.d(t,{$M:()=>i,ZP:()=>l});var r=n(51806),a=n(52175),s=n(94333),o=(n(99196),n(83059));function i(e){return`ai-assistant-block-${e}`}const l=(0,s.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(a.BlockControls,{group:"block"},(0,r.createElement)(o.ZP,{blockType:n})))}),"withAIAssistant")},79191:(e,t,n)=>{"use strict";n.d(t,{Z:()=>C});var r=n(51806),a=n(42290),s=n(13419),o=n(4981),i=n(55609),l=n(94333),c=n(9818),u=n(69307),d=n(65736),p=n(53961),m=n(65235),h=n.n(m),g=(n(99196),n(3180)),f=n(5246),b=n(18135),v=n(71449),k=n(63634),y=n(79817),w=n(44110);const __=d.__,E={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480};function _(e){if(!e?.length)return"";const t=(0,c.select)("core/block-editor").getBlock(e);if(!t)return"";const{innerBlocks:n}=t;return n?.length?n.reduce(((e,t)=>e+(0,o.serialize)(t)+"\n\n"),""):""}function C({clientId:e,className:t=""}){const n=(0,u.useRef)(null),o=(0,u.useRef)(null),{tracks:d}=(0,s.z$)(),m=(0,v.b)(),{inputValue:C,setInputValue:x,isVisible:S,assistantAnchor:j}=(0,u.useContext)(y.D),{dequeueAiAssistantFeatureAyncRequest:P}=(0,c.useDispatch)("wordpress-com/plans"),N=()=>{setTimeout((()=>{o.current?.focus?.()}),100)},{requestSuggestion:L,requestingState:T,stopSuggestion:A,requestingError:M}=(0,a.X_)({onDone:N}),{requireUpgrade:R}=(0,b.Z)(),Z=M?.code===a.$L||R,I="requesting"===T||"suggesting"===T,B="suggesting"===T||"done"===T,z=__("Ask Jetpack AI to create your form","jetpack"),D=__("Creating your form. Please wait a few moments.","jetpack"),{removeNotice:F}=(0,c.useDispatch)(p.store),O=(0,u.useCallback)((()=>{if(!C?.length)return;F(w.uu);const t=(0,k.r1)(k.Re,{request:C,content:_(e)});P(),L(t,{feature:"jetpack-form-ai-extension"}),d.recordEvent("jetpack_ai_assistant_block_generate",{feature:"jetpack-form-ai-extension"}),n?.current?.focus()}),[e,P,C,F,L,d]),U=(0,u.useCallback)((()=>{A(),N(),d.recordEvent("jetpack_ai_assistant_block_stop",{feature:"jetpack-form-ai-extension"})}),[A,d]),H=(0,l.useViewportMatch)("medium","<"),V=H&&j,q=(0,u.useRef)(null),G=(0,u.useRef)(H),[$,W]=(0,u.useState)(H);if((0,u.useEffect)((()=>{const e=n?.current;if(e)return q?.current||(q.current=new ResizeObserver((e=>{if(!S)return;if(V)return;const t=e[0].contentRect.width{q?.current?.disconnect()}}),[V,S]),(0,u.useEffect)((()=>{S&&d.recordEvent("jetpack_ai_assistant_prompt_show",{block_type:"jetpack/contact-form"})}),[S,d]),(0,u.useEffect)((()=>{const e=setTimeout((()=>{S&&o?.current&&o.current.focus()}),300);return function(){clearTimeout(e)}}),[]),!S)return null;const J=(0,r.createElement)("div",{className:"jetpack-ai-assistant__bar-wrapper"},(0,r.createElement)(i.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{esc:()=>{["requesting","suggesting"].includes(T)&&U()}}},(0,r.createElement)("div",{ref:n,className:h()("jetpack-ai-assistant__bar",{[t]:t,"is-fixed":V,"is-mobile-mode":$}),tabIndex:-1},Z&&(0,r.createElement)(f.Z,{placement:"jetpack-form-block"}),!m&&(0,r.createElement)(g.Z,null),(0,r.createElement)(a.tK,{ref:o,disabled:Z||!m,value:C,placeholder:I?D:z,onChange:x,onSend:O,onStop:U,state:T,isTransparent:Z||!m,showButtonLabels:!$,showGuideLine:B}))));return V?(0,u.createPortal)(J,j):J}},81732:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m});var r=n(51806),a=n(42290),s=n(55609),o=n(94333),i=n(69307),l=n(65736),c=n(99196),u=n(79817),d=n(44110);const __=l.__,p="jetpack-ai-assistant-bar__slot";function m({jetpackFormClientId:e}){const{isVisible:t,toggle:n,setAnchor:l,assistantAnchor:m}=(0,i.useContext)(u.D),{requestingState:h}=(0,a.X_)(),g=(0,i.useRef)(null),f=(0,o.useViewportMatch)("medium","<");(0,c.useEffect)((()=>{if(!g.current)return;const e=g.current.closest(".block-editor-block-contextual-toolbar");if(!e)return;let t=e.parentElement?.querySelector(`.${p}`);if(t)return e.after(t),l(t);t=document.createElement("div"),t.setAttribute("role","toolbar"),t.setAttribute("aria-label",__("AI Assistant","jetpack")),t.setAttribute("aria-orientation","horizontal"),t.className=p;const n=e.offsetHeight;t.style.top=`${n}px`,e.after(t),l(t)}),[l]),(0,c.useEffect)((()=>{f||m?.remove()}),[f,m]);const b=(0,i.useCallback)((()=>{if(!e)return n();(0,d.Vl)(e,n)}),[e,n]),v="requesting"===h||"suggesting"===h;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.KeyboardShortcuts,{bindGlobal:!0,shortcuts:{"mod+/":n}}),(0,r.createElement)(s.ToolbarButton,{ref:g,showTooltip:!0,onClick:b,"aria-haspopup":"true","aria-expanded":t,label:__("Ask AI Assistant","jetpack"),icon:a.u_,disabled:v}))}},59090:(e,t,n)=>{"use strict";n.d(t,{aE:()=>r,nB:()=>a});const r=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-form-support"]?.available,a=["jetpack/field-name","jetpack/field-email","jetpack/field-text","jetpack/field-textarea","jetpack/field-checkbox","jetpack/field-date","jetpack/field-telephone","jetpack/field-url","jetpack/field-checkbox-multiple","jetpack/field-radio","jetpack/field-select","jetpack/field-consent","jetpack/button"]},94662:(e,t,n)=>{"use strict";n.d(t,{G:()=>f});var r=n(51806),a=n(42290),s=n(13419),o=n(52175),i=n(4981),l=n(94333),c=n(9818),u=n(69307),d=n(92694),p=(n(99196),n(79191)),m=n(81732),h=n(59090),g=n(44110);function f(e,{checkChildrenBlocks:t=!1,clientId:n}={clientId:""}){const r=(0,i.getBlockType)("jetpack/ai-assistant"),{isModuleActive:a}=(0,s.el)("contact-form");if(!a)return!1;if(!r)return!1;if("string"!=typeof e)return!1;if(!h.aE)return!1;if(!n?.length)return!1;if(t){if(!h.nB.includes(e))return!1}else if("jetpack/contact-form"!==e)return!1;const{getHiddenBlockTypes:o}=(0,c.select)("core/edit-post")||{};return!(o?.()||[]).includes(e)}const b=(0,l.createHigherOrderComponent)((e=>t=>{const n=f(t?.name,{clientId:t.clientId}),{increaseAiAssistantRequestsCount:s}=(0,c.useDispatch)("wordpress-com/plans"),{eventSource:i}=(0,a.X_)({onDone:(0,u.useCallback)((()=>{s()}),[s]),onError:(0,u.useCallback)((e=>{"error_network"!==e.code&&"error_quota_exceeded"!==e.code&&s()}),[s])}),l=(0,u.useCallback)((()=>{i&&i?.close()}),[i]);if((0,u.useEffect)((()=>()=>{"jetpack/contact-form"===t?.name&&l()}),[l,t?.name]),!n)return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(p.Z,{clientId:t.clientId}),(0,r.createElement)(o.BlockControls,{group:"block"},(0,r.createElement)(m.Z,null)))}),"jetpackFormEditWithAiComponents");(0,d.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return"jetpack/contact-form"!==t?e:{...e,edit:(0,a.oN)((0,g.ZP)(b(e.edit)))}}),100);const v=(0,l.createHigherOrderComponent)((e=>t=>{const n=(0,c.useSelect)((e=>{const n=e("core/block-editor"),{getBlockParentsByBlockName:r}=n;return r(t.clientId,"jetpack/contact-form")?.[0]}),[t.clientId]);if(!f(t?.name,{checkChildrenBlocks:!0,clientId:n}))return(0,r.createElement)(e,t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,t),(0,r.createElement)(o.BlockControls,{group:"parent"},(0,r.createElement)(m.Z,{jetpackFormClientId:n})))}),"jetpackFormChildrenEditWithAiComponents");(0,d.addFilter)("blocks.registerBlockType","jetpack/ai-assistant-support",(function(e,t){return h.nB.includes(t)?{...e,edit:v(e.edit)}:e}))},79817:(e,t,n)=>{"use strict";n.d(t,{D:()=>s,v:()=>o});var r=n(51806),a=n(69307);const s=(0,a.createContext)({}),o=({value:e,children:t})=>(0,r.createElement)(s.Provider,{value:e,children:t})},44110:(e,t,n)=>{"use strict";n.d(t,{Vl:()=>b,ZP:()=>v,uu:()=>f});var r=n(51806),a=n(42290),s=n(4981),o=n(55609),i=n(94333),l=n(9818),c=n(69307),u=n(65736),d=n(53961),p=(n(99196),n(94662)),m=n(5863),h=n(56359),g=n(79817);const __=u.__,f="ai-assistant";function b(e,t){(0,l.dispatch)("core/block-editor").selectBlock(e).then(t)}const v=(0,i.createHigherOrderComponent)((e=>t=>{const{clientId:n,isSelected:i}=t,{replaceInnerBlocks:u}=(0,l.useDispatch)("core/block-editor"),v=(0,l.useSelect)((e=>e("core/editor")),[]),k=(0,l.useSelect)((e=>e("core/block-editor")),[]),y=v.getCurrentPostId(),w=k.getBlock(n),[E,_]=(0,c.useState)(""),C="jetpack/contact-form"===w?.name&&0===w?.innerBlocks?.length,[x,S]=(0,c.useState)(C),[j,P]=(0,c.useState)(!1),[N,L]=(0,c.useState)(null),T=(0,c.useRef)([]),A=(0,c.useCallback)((()=>{S(!0)}),[]),M=(0,c.useCallback)((()=>{S(!1)}),[]),R=(0,c.useCallback)((()=>{S(!x)}),[x]),Z=(0,c.useCallback)((e=>{L(e)}),[]),{createNotice:I}=(0,l.useDispatch)(d.store),B=(0,c.useCallback)((({severity:e,message:t,code:n})=>{n!==a.$L&&I(e,t,{isDismissible:!0,id:f})}),[I]);(0,c.useEffect)((()=>{i||M()}),[i,M]);const z=(0,c.useMemo)((()=>({inputValue:E,setInputValue:_,isVisible:x,show:A,hide:M,toggle:R,isFixed:j,setAssistantFixed:P,assistantAnchor:N,setAnchor:Z})),[E,x,A,M,R,j,N,Z]),D=(0,c.useCallback)(((e,t=!1)=>{const r=e.replace(//g,""),a=(0,h.J)(r),o=(0,s.parse)(a).filter((e=>e.isValid&&!["core/freeform","core/missing","core/html"].includes(e.name)));let i=!1;if(o.length0){const e=o[o.length-1],t=T.current[o.length-1];i=!(0,m.c)(e,t)}if(o.length>0&&(o.length!==T.current.length||i)&&(u(n,o),T.current=o),t){const e=o.filter((e=>"jetpack/button"===e.name));if(T.current=T.current||[],e.length>1){let t=0;T.current=T.current.filter((n=>"jetpack/button"!==n.name||(t++,t===e.length))),u(n,T.current)}else 0===e.length&&u(n,[...T.current,(0,s.createBlock)("jetpack/button",{label:__("Submit","jetpack"),element:"button",text:__("Submit","jetpack"),borderRadius:8,lock:{remove:!0}})]);T.current=[]}}),[n,u]);return(0,a.X_)({askQuestionOptions:{postId:y},onDone:e=>{D(e,!0),_("")},onSuggestion:D,onError:B}),(0,p.G)(t.name,{clientId:t.clientId})?(0,r.createElement)(g.v,{value:z},(0,r.createElement)(o.KeyboardShortcuts,{shortcuts:{"mod+/":()=>b(n,A)}},(0,r.createElement)(e,t))):(0,r.createElement)(e,t)}),"withUiHandlerDataProvider")},63206:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6895),a=n(13419),s=n(46867),o=n(18135);function i(){const{nextTier:e,tierPlansEnabled:t}=(0,o.Z)(),n=t?(0,r.Z)("jetpack-ai-yearly-tier-upgrade-nudge",{site:(0,a.lQ)(),path:`jetpack_ai_yearly:-q-${e?.limit}`,query:`redirect_to=${window.location.href}`}):(0,r.Z)("jetpack-ai-monthly-plan-ai-assistant-block-banner",{site:(0,a.lQ)()}),i=(0,a.Ug)()||(0,a.Wp)()?n:`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/add-jetpack-ai`,{autosaveAndRedirect:l,isRedirecting:c}=(0,s.Z)(i);return{checkoutUrl:i,autosaveAndRedirect:l,isRedirecting:c}}},18135:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9818);function a(){const{data:e,loading:t}=(0,r.useSelect)((e=>{const{getAiAssistantFeature:t,getIsRequestingAiAssistantFeature:n}=e("wordpress-com/plans");return{data:t(),loading:n()}}),[]),{fetchAiAssistantFeature:n,increaseAiAssistantRequestsCount:a}=(0,r.useDispatch)("wordpress-com/plans");return{...e,loading:t,error:null,refresh:n,increaseRequestsCount:a}}},42890:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(6975),a=n(69307);const s=window?.Jetpack_Editor_Initial_State?.tracksUserData||null,o=parseInt(window?.Jetpack_Editor_Initial_State?.wpcomBlogId)||0,i=()=>((0,a.useEffect)((()=>{s&&r.Z.initialize(s?.userid,s?.username,o?{blog_id:o}:{})}),[]),r.Z)},60751:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(42290),a=n(4981),s=n(9818),o=n(69307),i=n(65736),l=n(51128),c=n.n(l),u=n(27298),d=n(63634),p=n(854);const __=i.__,m=c()("jetpack-ai-assistant:event"),h=c()("jetpack-ai-assistant:prompt"),g=({attributes:e,clientId:t,content:n,setError:i,tracks:l,userPrompt:c,onSuggestionDone:g,onUnclearPrompt:f,onModeration:b,requireUpgrade:v,requestingState:k})=>{const[y,w]=(0,o.useState)(!1),[E,_]=(0,o.useState)(!1),[C,x]=(0,o.useState)(!1),[S,j]=(0,o.useState)(!1),[P,N]=(0,o.useState)(""),{updateBlockAttributes:L}=(0,s.useDispatch)("core/block-editor"),{dequeueAiAssistantFeatureAyncRequest:T,setAiAssistantFeatureRequireUpgrade:A}=(0,s.useDispatch)("wordpress-com/plans"),[M,R]=(0,o.useState)(k||"init"),Z=(0,o.useRef)(),I=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("title")));let B=!1;const z=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("categories")))||[],D=(0,s.useSelect)((e=>z.map((t=>{const n=e("core").getEntityRecord("taxonomy","category",t);if(n)return n;B=!0})).filter(Boolean)),[z]),F=(0,s.useSelect)((e=>e("core/editor").getEditedPostAttribute("tags")),[])||[],O=(0,s.useSelect)((e=>F.map((t=>{const n=e("core").getEntityRecord("taxonomy","post_tag",t);if(n)return n;B=!0})).filter(Boolean)),[F]);(0,o.useEffect)((()=>(w(B),()=>{Z?.current&&(m("Cleaning things up..."),Z?.current?.close())})),[B,Z]);const U=(0,s.useSelect)((e=>e("core/editor").getCurrentPostId())),H=(D.filter((e=>1!==e.id)).map((({name:e})=>e)).join(", "),O.map((({name:e})=>e)).join(", "),async(o,g={})=>{T();const k=g?.functions?.reduce(((e,{name:t,implementation:n})=>({...e,[t]:n})),{});if(v)return R("error"),_(!1),x(!1),j(!1),void i({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"});if(g={retryRequest:!1,tone:u.Nj,...g},E)return;j(!1),i({});let y=P;l.recordEvent("jetpack_ai_chat_completion",{post_id:U});const w=[...e.messages]??[];let C={};if(g.retryRequest)C=y[y.length-1];else{const r=e?.isLayoutBuldingModeEnable?(0,p.WN)(t):(0,p.xN)();y=(0,d.Iq)({generatedContent:n,allPostContent:r,postContentAbove:(0,p.h7)(t),currentPostTitle:I,options:g,userPrompt:c,type:o,isGeneratingTitle:"generateTitle"===e.promptType,useGutenbergSyntax:!!e?.useGutenbergSyntax,customSystemPrompt:e?.customSystemPrompt}),C=y.pop(),y=[...y,...w],y.push(C),N(y),"generateTitle"!==e.promptType&&L(t,{promptType:o})}try{_(!0),x(!0),y.forEach((({role:e,content:t},n)=>h("(%s/%s) %o\n%s",n+1,y.length,`[${e}]`,t))),R("requesting"),Z.current=await(0,r.jt)(y,{postId:U,requireUpgrade:v,feature:e?.useGpt4?"ai-assistant-experimental":"ai-assistant",functions:g?.functions}),R("suggesting")}catch(e){e.message?i({message:e.message,code:e?.code||"unknown",status:"error"}):i({message:__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack"),code:"unknown",status:"error"}),j(!0),_(!1),x(!1)}const S=async t=>{const{detail:n}=t,a={role:"assistant",content:null,function_call:n},s=await(k[n.name]?.(JSON.parse(n.arguments))),o={role:"function",name:n?.name,content:JSON.stringify(s)};y=[...y,a,o],Z?.current?.removeEventListener("function_done",S),Z?.current?.removeEventListener("done",M),Z?.current?.removeEventListener("error_unclear_prompt",B),Z?.current?.removeEventListener("error_network",D),Z?.current?.removeEventListener("error_context_too_large",z),Z?.current?.removeEventListener("error_service_unavailable",F),Z?.current?.removeEventListener("error_quota_exceeded",O),Z?.current?.removeEventListener("error_moderation",H),Z?.current?.removeEventListener("suggestion",q),Z.current=await(0,r.jt)(y,{postId:U,requireUpgrade:v,feature:e?.useGpt4?"ai-assistant-experimental":null,functions:g.functions}),Z?.current?.addEventListener("function_done",S),Z?.current?.addEventListener("done",M),Z?.current?.addEventListener("error_unclear_prompt",B),Z?.current?.addEventListener("error_network",D),Z?.current?.addEventListener("error_context_too_large",z),Z?.current?.addEventListener("error_service_unavailable",F),Z?.current?.addEventListener("error_quota_exceeded",O),Z?.current?.addEventListener("error_moderation",H),Z?.current?.addEventListener("suggestion",q)},M=n=>{const{detail:r}=n;R("done");const o=r.replaceAll(d._W,""),i={role:"assistant",content:o};w.push(C,i),h("Add %o\n%s",`[${C.role}]`,C.content),h("Add %o\n%s",`[${i.role}]`,i.content),w.length>20&&w.splice(0,w.length-20),V();const l=e?.useGutenbergSyntax;if(L(t,{content:o,messages:w}),!l)return;const{replaceInnerBlocks:c}=(0,s.dispatch)("core/block-editor"),u=(0,a.parse)(r).filter((e=>e.isValid));c(t,u)},B=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),i({code:"error_unclear_prompt",message:__("Your request was unclear. Mind trying again?","jetpack"),status:"info"}),f?.()},z=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!1),i({code:"error_context_too_large",message:__("The content is too large to be processed all at once. Please try to shorten it or divide it into smaller parts.","jetpack"),status:"info"})},D=({detail:r})=>{R("error");const{name:a,message:s}=r;"TypeError"===a&&"Failed to fetch"===s&&(w.splice(0,8),L(t,{messages:w}),y=(0,d.Iq)({generatedContent:n,allPostContent:(0,p.xN)(),postContentAbove:(0,p.h7)(t),currentPostTitle:I,options:g,userPrompt:c,type:o,isGeneratingTitle:"generateTitle"===e.promptType,useGutenbergSyntax:!!e?.useGutenbergSyntax,customSystemPrompt:e?.customSystemPrompt}),N([...y,...w,C])),Z?.current?.close(),_(!1),x(!1),j(!0),i({code:"error_network",message:__("It was not possible to process your request. Mind trying again?","jetpack"),status:"info"})},F=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!0),i({code:"error_service_unavailable",message:__("Jetpack AI services are currently unavailable. Sorry for the inconvenience.","jetpack"),status:"info"})},O=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!1),A(!0),i({code:"error_quota_exceeded",message:__("You have reached the limit of requests for this site.","jetpack"),status:"info"})},H=()=>{R("error"),Z?.current?.close(),_(!1),x(!1),j(!1),i({code:"error_moderation",message:__("This request has been flagged by our moderation system. Please try to rephrase it and try again.","jetpack"),status:"info"}),b?.()},q=e=>{x(!1),m("(suggestion)",e?.detail),L(t,{content:e?.detail?.replaceAll(d._W,"")})};return Z?.current?.addEventListener("function_done",S),Z?.current?.addEventListener("done",M),Z?.current?.addEventListener("error_unclear_prompt",B),Z?.current?.addEventListener("error_network",D),Z?.current?.addEventListener("error_context_too_large",z),Z?.current?.addEventListener("error_service_unavailable",F),Z?.current?.addEventListener("error_quota_exceeded",O),Z?.current?.addEventListener("error_moderation",H),Z?.current?.addEventListener("suggestion",q),Z?.current});function V(){Z?.current&&(Z?.current?.close(),_(!1),x(!1),g?.(),R("done"))}return{isLoadingCategories:y,isLoadingCompletion:E,wasCompletionJustRequested:C,setIsLoadingCategories:w,setShowRetry:j,showRetry:S,postTitle:I,contentBefore:(0,p.h7)(t),wholeContent:(0,p.xN)(),requestingState:M,getSuggestionFromOpenAI:H,stopSuggestion:V,retryRequest:()=>H("",{retryRequest:!0})}}},71449:(e,t,n)=>{"use strict";n.d(t,{b:()=>u,d:()=>d});var r=n(13419),a=n(51128),s=n.n(a);const o=window?.JP_CONNECTION_INITIAL_STATE,i=s()("jetpack-ai-assistant:connection");let l=!1;const c=e=>{l||(i(e),l=!0)};function u(){return(0,r.Wp)()?(c("Simple site connected ✅"),!0):(0,r.Ug)()?(c("Atomic site connected ✅"),!0):o?.connectionStatus?.isUserConnected?(c("Jetpack user is connected ✅"),!0):(c("User is not connected ❌"),!1)}function d(){if((0,r.Wp)())return!0;return!1==!(o?.userConnectionData?.currentUser?.permissions??{}).manage_options}},3687:(e,t,n)=>{"use strict";n.d(t,{b:()=>o});var r=n(86989),a=n.n(r),s=n(65736);const __=s.__;function o(e,t,n,r,s,o){n(!0),s(null),t({requestedPrompt:e}),a()({path:"/wpcom/v2/jetpack-ai/images/generations",method:"POST",data:{prompt:e,post_id:o}}).then((e=>{n(!1);const t=e.data.map((e=>"data:image/png;base64,"+e.b64_json));r(t)})).catch((e=>{e.message?s(e.message):s(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),n(!1)}))}},57832:(e,t,n)=>{"use strict";n.d(t,{v_:()=>i,x1:()=>l});var r=n(63634);const a="title",s="content",o=null;function i(e,t){return{role:"jetpack-ai",context:{type:"ai-assistant-initial-prompt",for:u(e),...t?.length?{custom_system_prompt:t}:{}}}}function l({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:a,options:s,type:o,userPrompt:i,isGeneratingTitle:l}){const u=[],d="generated"===s?.contentType;let p=null;switch(o){case r.qA:p=a;break;case r.sz:case r.hI:case r.Hd:p=n;break;case r.jf:p=t;break;case r.TV:case r.DR:p=e;break;case r.Lg:case r.Lq:case r.Nw:p=d?e:t;break;case r.Gh:p=e||t}const m=function(e,t){return!e&&t?.length>0?{role:"jetpack-ai",context:{type:"ai-assistant-relevant-content",content:t}}:null}(o===r.Gh?!!e?.length:d,p);return m&&u.push(m),u.push({role:"jetpack-ai",context:c({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:a,options:s,type:o,userPrompt:i,isGeneratingTitle:l})}),u}function c({options:e,type:t,userPrompt:n,isGeneratingTitle:i}){const l=function(e,t,n){return e?a:!t||n?s:o}(i,"generated"===e?.contentType,e?.fromExtension||!1);return{type:u(t),...l?{subject:l}:{},...t===r.Lg&&e?.tone?{tone:e.tone}:{},...t===r.Nw&&e?.language?{language:e.language}:{},...t===r.Gh&&n?{request:n}:{}}}function u(e){return{[r.qA]:"ai-assistant-summary-by-title",[r.sz]:"ai-assistant-continue-writing",[r.hI]:"ai-assistant-simplify",[r.Hd]:"ai-assistant-correct-spelling",[r.jf]:"ai-assistant-generate-title",[r.TV]:"ai-assistant-make-longer",[r.DR]:"ai-assistant-make-shorter",[r.Lg]:"ai-assistant-change-tone",[r.Lq]:"ai-assistant-summarize",[r.Nw]:"ai-assistant-change-language",[r.Gh]:"ai-assistant-user-prompt"}[e]}},63634:(e,t,n)=>{"use strict";n.d(t,{DR:()=>p,Gh:()=>f,Hd:()=>c,Iq:()=>T,Lg:()=>m,Lq:()=>h,Nw:()=>g,Re:()=>b,SV:()=>v,TV:()=>d,_W:()=>y,hI:()=>l,jf:()=>u,qA:()=>o,r1:()=>A,sz:()=>i,t4:()=>w});var r=n(51128),a=n.n(r),s=n(57832);const o="titleSummary",i="continue",l="simplify",c="correctSpelling",u="generateTitle",d="makeLonger",p="makeShorter",m="changeTone",h="summarize",g="changeLanguage",f="userPrompt",b="jetpackFormCustomPrompt",v=!0,k=a()("jetpack-ai-assistant:prompt"),y="````";function w({context:e="You are an advanced polyglot ghostwriter. Your task is to generate and modify content based on user requests. This functionality is integrated into the Jetpack product developed by Automattic. Users interact with you through a Gutenberg block, you are inside the WordPress editor",rules:t,useGutenbergSyntax:n=!1,useMarkdown:r=!0,customSystemPrompt:a=null}){let s="";t?.length&&(s=t.map((e=>`- ${e}.`)).join("\n")+"\n");let o=`${e}. Strictly follow these rules:\n\n${s}${r?"- Format your responses in Markdown syntax, ready to be published.":""}\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`;return n&&(o=`${e}. Strictly follow these rules:\n\t\n${s}- Format your responses in Gutenberg HTML format including HTML comments for WordPress blocks. All responses must be valid Gutenberg HTML.\n- Use only WordPress core blocks\n- Execute the request without any acknowledgement to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n`),a&&(o=a),{role:"system",content:o}}function E(e){return`${y}${e.replaceAll(y,"")}${y}`}function _({content:e,role:t="user"}){return[{role:t,content:`Repeat the text delimited with ${y}, without the delimiter, correcting any spelling and grammar mistakes directly in the text without providing feedback about the corrections, keeping the language of the text: ${E(e)}`}]}function C({content:e,role:t="user"}){return[{role:t,content:`Simplify the text delimited with ${y}, using words and phrases that are easier to understand and keeping the language of the text: ${E(e)}`}]}function x({content:e,role:t="user"}){return[{role:t,content:`Summarize the text delimited with ${y}, keeping the language of the text: ${E(e)}`}]}function S({content:e,role:t="user"}){return[{role:t,content:`Expand the text delimited with ${y} to about double its size, keeping the language of the text: ${E(e)}`}]}function j({content:e,language:t,role:n="user"}){return[{role:n,content:`Translate the text delimited with ${y} to ${t}, preserving the same core meaning and tone: ${E(e)}`}]}function P({content:e,tone:t,role:n="user"}){return[{role:n,content:`Rewrite the text delimited with ${y}, with a ${t} tone, keeping the language of the text: ${E(e)}`}]}function N({content:e,request:t}){if(!t)throw new Error("You must provide a custom prompt for the Jetpack Form Custom Prompt");return[{role:"jetpack-ai",context:{type:"form-ai-extension",content:e,request:t}}]}const L=({rules:e=[],request:t=null,relevantContent:n=null,isContentGenerated:r=!1,isGeneratingTitle:a=!1,useGutenbergSyntax:s=!1,customSystemPrompt:o=null})=>{if(!t&&!n)throw new Error("You must provide either a request or content");const i=[w({rules:e,useGutenbergSyntax:s,customSystemPrompt:o})];if(null!=n&&n?.length){const e=n.replaceAll(y,"");r||i.push({role:"user",content:`The specific relevant content for this request, if necessary, delimited with ${y} characters: ${y}${e}${y}`})}const l={role:"user",content:t};return a&&(l.content+=" Only output a title, do not generate body content."),i.push(l),i.forEach((e=>{k(`Role: ${e?.role}.\nMessage: ${e?.content}\n---`)})),i};function T({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:r,options:a,type:b,userPrompt:k,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E}){if(v){return[(0,s.v_)(b,E),...(0,s.x1)({generatedContent:e,allPostContent:t,postContentAbove:n,currentPostTitle:r,options:a,type:b,userPrompt:k,isGeneratingTitle:y})]}const _="generated"===a?.contentType,C=function(e,t=!1,n){const r="generated"===n?.contentType;let a="the title";t||(a=r?"your last answer":"the content");const s=`. Do not switch to any language other than the language of ${a} in your response`;switch(e){case o:return{request:`Write a short piece for a blog post based on ${a}, keeping the same language`};case i:return{request:`Continue writing from ${a}${s}.`,rules:r?[]:["Only output the continuation of the content, without repeating it"]};case l:return{request:`Simplify ${a}${s}.`,rules:["Use words and phrases that are easier to understand for non-technical people","Use as much of the original language as possible"]};case c:return{request:`Repeat ${a}, correcting any spelling and grammar mistakes, and do not add new content${s}.`};case u:return{request:"Generate a new title for this blog post and only output the title.",rules:["Only output the raw title, without any prefix or quotes"]};case d:return{request:`Make ${a} longer${s}.`};case p:return{request:`Make ${a} shorter${s}.`};case m:return{request:`Rewrite ${a} with ${/^[aeiou]/i.test(n.tone)?"an":"a"} ${n.tone} tone${s}.`};case h:return{request:`Summarize ${a}${s}.`};case g:return{request:`Translate ${a} to the following language: ${n.language}.`};default:return null}}(b,y,a);if(b!==f){let a;switch(b){case o:a=r;break;case i:case l:case c:a=n;break;case u:a=t;break;case d:case p:a=e;break;case m:case h:case g:a=_?e:t}return L({...C,relevantContent:a,isContentGenerated:_,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E})}return L({request:k,relevantContent:e||t,isContentGenerated:!!e?.length,isGeneratingTitle:y,useGutenbergSyntax:w,customSystemPrompt:E})}function A(e,t){k("Addressing prompt type: %o %o",e,t);const{prevMessages:n=[]}=t,r={role:"system",content:"You are an advanced polyglot ghostwriter. Your task is to help the user create and modify content based on their requests.\nWriting rules:\n- Execute the request without any acknowledgment or explanation to the user.\n- Avoid sensitive or controversial topics and ensure your responses are grammatically correct and coherent.\n- If you cannot generate a meaningful response to a user's request, reply with “__JETPACK_AI_ERROR__“. This term should only be used in this context, it is used to generate user facing errors.\n"},a=[...n];switch(a.push(r),e){case c:return[...a,..._(t)];case l:return[...a,...C(t)];case h:return[...a,...x(t)];case d:return[...a,...S(t)];case g:return[...a,...j(t)];case m:return[...a,...P(t)];case b:return[...n,...N(t)];default:throw new Error(`Unknown prompt type: ${e}`)}}},74359:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r=new(n(92213).Z)({emDelimiter:"_",headingStyle:"atx"});r.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}});const a=r},854:(e,t,n)=>{"use strict";n.d(t,{WN:()=>l,h7:()=>o,t$:()=>c,xN:()=>i});var r=n(4981),a=n(9818),s=n(74359);function o(e){if(!e)return"";const t=(0,a.select)("core/block-editor"),n=t.getBlockIndex(e),o=t.getBlocks().slice(0,n)??[];return o?.length?s.Z.turndown((0,r.serialize)(o)):""}function i(){const e=(0,a.select)("core/block-editor").getBlocks();return e?.length?s.Z.turndown((0,r.serialize)(e)):""}function l(e){const t=(0,a.select)("core/block-editor").getBlock(e);return t?.innerBlocks?.length?t.innerBlocks.filter((e=>null!=e)).map((e=>(0,r.getBlockContent)(e.clientId))).join("\n\n"):""}function c(e){if(!e?.replace(/\s+/,"").length)return"";const t=document.createElement("div");t.innerHTML=e;const{textContent:n,innerText:r}=t;return n&&!n.replace(/\s+/,"").length||r&&!r.replace(/\s+/,"").length?"":t.textContent||t.innerText||""}},5863:(e,t,n)=>{"use strict";n.d(t,{c:()=>s});const r=e=>{delete e.clientId;for(const t of e.innerBlocks??[])r(t);return e},a=e=>r((e=>JSON.parse(JSON.stringify(e)))(e));function s(e,t){const n=a(e),r=a(t);return JSON.stringify(n)===JSON.stringify(r)}},56359:(e,t,n)=>{"use strict";function r(e){const t=document.createElement("div");return t.innerHTML=e,t.innerHTML}n.d(t,{J:()=>r})},81765:(e,t,n)=>{"use strict";var r=n(4981),a=n(92694),s=n(54765),o=n(49259);(0,a.addFilter)("blocks.registerBlockType","jetpack/handle-jetpack-ai-supports",(function(e){const t=(0,r.getBlockSupport)(e,"jetpack/ai");return t&&t?.assistant&&(0,s.J7)()?{...e,edit:(0,o.ZP)(e.edit)}:e}),100)},6747:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u,b:()=>c});var r=n(4981),a=n(23536),s=n(54765),o=n(63634),i=n(74359);const l=[];function c(e,t){const{content:n,...s}=t;let l=n;"core/heading"===e&&t?.level&&(l=l.replace(/<(\/?)h\d([^>]*)>/g,`<$1h${t.level}$2>`));const c=i.Z.turndown(l),u=[];return o.SV?u.push({role:"jetpack-ai",context:{type:"ai-assistant-relevant-content",content:c}}):(u.push({role:"user",content:"Tell me some content for this block, please."}),u.push({role:"assistant",content:c})),(0,r.createBlock)(a.name,{...s,content:c,originalContent:c,messages:u,originalMessages:u})}for(const e of s.NP)l.push({type:"block",blocks:[e],isMatch:()=>(0,s.J7)(),transform:(t,n)=>{const a=(0,r.getSaveContent)(e,t,n);return c(e,{...t,content:a})}});const u={from:l}},98825:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{const e=`${window?.Jetpack_Editor_Initial_State?.adminUrl}admin.php?page=my-jetpack#/connection`,{autosaveAndRedirect:t,isRedirecting:n}=(0,o.Z)(e);if(window?.Jetpack_Editor_Initial_State?.jetpack?.is_current_user_connected)return null;return(0,r.createElement)(s.p,{buttonText:__("Reconnect Jetpack","jetpack"),checkoutUrl:e,className:"jetpack-ai-connect-banner",description:__("Your account is not connected to Jetpack at the moment.","jetpack"),goToCheckoutPage:e=>{t(e)},isRedirecting:n,visible:!0,align:null,title:null,context:null})}},56352:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(51806),a=n(65736),s=n(26546),o=n(46867);const __=a.__,i=()=>{let e=window?.Jetpack_Editor_Initial_State?.adminUrl||"";e=e.replace(/wp-admin\/\?frame-nonce=[a-z0-9]+/,"wp-admin/");const t=`${e}admin.php?page=jetpack-search`,{autosaveAndRedirect:n,isRedirecting:a}=(0,o.Z)(t);if(window?.Jetpack_AIChatBlock?.jetpackSettings?.instant_search_enabled)return null;return(0,r.createElement)(s.p,{buttonText:__("Enable Jetpack Search","jetpack"),checkoutUrl:t,className:"jetpack-ai-connect-banner",description:__("You need to enable Jetpack Search so that Jetpack AI can index your site.","jetpack"),goToCheckoutPage:e=>{n(e)},isRedirecting:a,visible:!0,align:null,title:null,context:null})}},23719:(e,t,n)=>{"use strict";n.d(t,{V:()=>l});var r=n(51806),a=n(52175),s=n(55609),o=n(37798),i=n(65736);const __=i.__;function l({setAttributes:e,placeholder:t,showCopy:n,showFeedback:i,showSources:l}){const[c,u]=(0,o.useEntityProp)("root","site","jetpack_search_ai_prompt_override");return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,r.createElement)(s.BaseControl,{label:__("Placeholder Text","jetpack"),className:"jetpack-ai-chat__ask-button-text"},(0,r.createElement)(s.TextControl,{placeholder:__("Ask a question about this site.","jetpack"),onChange:t=>e({placeholder:t}),value:t})))),(0,r.createElement)(a.InspectorAdvancedControls,null,(0,r.createElement)(s.BaseControl,{label:__("Additional instructions","jetpack"),help:__("Give Jetpack AI additional instructions for answer length, format, and tone.","jetpack")},(0,r.createElement)(s.TextareaControl,{value:c,onChange:u})),(0,r.createElement)(s.ToggleControl,{label:__("Show copy answer button.","jetpack"),help:__("Allow users to easily copy the answer.","jetpack"),checked:n,onChange:t=>e({showCopy:t})}),(0,r.createElement)(s.ToggleControl,{label:__("Show rating button.","jetpack"),help:__("Allow users to rate the answer and give feedback.","jetpack"),checked:i,onChange:t=>e({showFeedback:t})}),(0,r.createElement)(s.ToggleControl,{label:__("Show list of sources.","jetpack"),help:__("Show used sources at the bottom of the answer.","jetpack"),checked:l,onChange:t=>e({showSources:t})})))}},74021:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(51806),a=n(42290),s=n(52175),o=n(55609),i=n(9818),l=n(98825),c=n(56352),u=n(23719);function d({attributes:e,setAttributes:t,clientId:n}){const d=(0,s.useBlockProps)(),p=(0,i.useSelect)((e=>e("core/block-editor").isBlockSelected(n)),[n]);return(0,r.createElement)("div",d,(0,r.createElement)(l.Z,null),(0,r.createElement)(c.Z,null),(0,r.createElement)("div",{className:"jetpack-ai-chat-question-wrapper"},(0,r.createElement)(o.TextControl,{className:"jetpack-ai-chat-question-input",placeholder:e.placeholder,disabled:!0}),(0,r.createElement)(s.RichText,{className:"wp-block-button__link jetpack-ai-chat-question-button",onChange:e=>t({askButtonLabel:e}),value:e.askButtonLabel,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),p&&(0,r.createElement)(a.Eo,null),(0,r.createElement)(s.InspectorControls,null,(0,r.createElement)(u.V,{askButtonLabel:e.askButtonLabel,placeholder:e.placeholder,setAttributes:t,showCopy:e.showCopy,showFeedback:e.showFeedback,showSources:e.showSources})))}},86116:(e,t,n)=>{"use strict";var r=n(31985),a=n(21540),s=n(74021),o=n(148);(0,r.S)(a,{edit:s.Z,save:o.Z})},148:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(51806),a=n(52175);function s({attributes:e}){const t=a.useBlockProps.save({"data-ask-button-label":e.askButtonLabel});return(0,r.createElement)("div",t)}},14303:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(51806),a=n(86989),s=n.n(a),o=n(52175),i=n(55609),l=n(9818),c=n(69307),u=n(65736),d=n(96483),p=n(65235),m=n.n(p),h=n(44266);const __=u.__,_x=u._x;const g=(0,i.withNotices)((function({attributes:e,noticeOperations:t,noticeUI:n,setAttributes:a}){const p=(0,c.useRef)(!1),{answersLink:g,answersLinkText:f,gravatars:b,promptFetched:v,promptId:k,promptLabel:y,promptText:w,showLabel:E,showResponses:_,tagsAdded:C,isBloganuary:x}=e,S=(0,o.useBlockProps)({className:"jetpack-blogging-prompt"});(0,h.n)(k,C,(e=>a({tagsAdded:e})));const j=(0,l.useSelect)((e=>{const{getEntityRecord:t,hasFinishedResolution:n}=e("core"),r=t("root","site")?.language||"en_US";return n("getEntityRecord",["root","site"])?r:null}),[]);(0,c.useEffect)((()=>{if(!j||p.current||v)return;const e=()=>{a({promptFetched:!1,promptId:null,tagsAdded:!1}),p.current=!1,t.removeAllNotices()};let n="/wpcom/v3/blogging-prompts";if(k)n+="/"+encodeURIComponent(k);else{const e=new Date;n+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}n=(0,d.addQueryArgs)(n,{_locale:j,force_year:(new Date)?.getFullYear()}),p.current=!0,s()({path:n}).then((e=>{const t=k?e:e[0];a({answersLink:t.answered_link,answersLinkText:t.answered_link_text,gravatars:t.answered_users_sample.map((({avatar:e})=>({url:e}))),promptFetched:!0,promptLabel:t.label,promptText:t.text,promptId:t.id,isBloganuary:!!t.bloganuary_id})})).catch((n=>{a({promptFetched:!0});const s="rest_post_invalid_id"===n.code&&k?(o=k,(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %d is the prompt id. */ __("Prompt with id %d not found.","jetpack"),o)," ",(0,r.createElement)(i.Button,{variant:"link",onClick:e},__("Reset prompt","jetpack")))):(t=>(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %s is the error message. */ diff --git a/_inc/build/admin.asset.php b/_inc/build/admin.asset.php index 54b51ee5f2..71f911ac33 100644 --- a/_inc/build/admin.asset.php +++ b/_inc/build/admin.asset.php @@ -1 +1 @@ - array('jquery', 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '90795b06fb4c50d364b6'); + array('jquery', 'lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => 'bbb92b33aafcdf56e720'); diff --git a/_inc/build/admin.js b/_inc/build/admin.js index 38cdbe9a8d..a1b3e4926a 100644 --- a/_inc/build/admin.js +++ b/_inc/build/admin.js @@ -13,7 +13,7 @@ __("Welcome to Jetpack %s traveler!","jetpack"),c.partner.name),buttonLabel:(0,i __("Set up & redeem %s","jetpack"),c.product.title),redirectUri:`admin.php?page=jetpack&partnerCoupon=${c.coupon_code}`,connectionStatus:r},d().createElement("p",null,(0,i.sprintf)(/* translators: %s: Name of a Jetpack product. */ __("Redeem your coupon and get started with %s for free the first year!","jetpack"),c.product.title)),d().createElement("ul",null,c.product.features.map(((e,t)=>d().createElement("li",{key:t},e)))),r.hasConnectedOwner&&d().createElement(a.Z,{label:(0,i.sprintf)(/* translators: %s: Name of a Jetpack product. */ __("Redeem %s","jetpack"),c.product.title),onClick:k})))};m.propTypes={apiRoot:l().string.isRequired,apiNonce:l().string.isRequired,assetBaseUrl:l().string.isRequired,connectionStatus:l().object.isRequired,partnerCoupon:l().object.isRequired,registrationNonce:l().string.isRequired,siteRawUrl:l().string.isRequired,tracksUserData:l().bool.isRequired,analytics:l().object};const h=m},1862:(e,t,s)=>{"use strict";s.d(t,{es:()=>a.Z});var a=s(10221);s(84859),s(881)},81050:(e,t,s)=>{"use strict";s.d(t,{AutoConversionToggle:()=>n.Z,RefreshJetpackSocialSettingsWrapper:()=>r.Z,SocialImageGeneratorToggle:()=>a.Z,TemplatePickerButton:()=>i.Z});s(23177),s(4277),s(49021),s(95788),s(8454),s(74140),s(54005),s(8350);var a=s(76848),n=s(92116),i=s(79631),r=(s(8714),s(19649),s(52403),s(91750),s(77106));s(37568),s(48751),s(14085),s(45579),s(75323),s(42032),s(91474),s(19890),s(32637),s(86419),s(34431),s(71806),s(22917)},92116:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(48229),n=s(9818),i=s(69307),r=s(99196),o=s.n(r),c=s(23177);const l=({toggleClass:e,children:t})=>{const{isEnabled:s,isUpdating:r}=(0,n.useSelect)((e=>{const t=e(c.Eg);return{isEnabled:t.isAutoConversionEnabled(),isUpdating:t.isAutoConversionSettingsUpdating()}}),[]),l=(0,n.useDispatch)(c.Eg).updateAutoConversionSettings,p=(0,i.useCallback)((()=>{l({enabled:!s})}),[s,l]);return o().createElement(a.Z,{className:e,disabled:r,checked:s,onChange:p,label:t})}},85761:(e,t,s)=>{"use strict";s.d(t,{Z:()=>p});var a=s(3396),n=s(69307),i=s(65235),r=s.n(i),o=s(15844),c=s.n(o);const l=e=>{const{checked:t,serviceName:s,label:i,onClick:o,profilePicture:c}=e,[l,p]=(0,n.useState)(!!c),d=(0,n.useCallback)((()=>p(!1)),[]),u=(0,n.useCallback)((e=>{13===e.keyCode&&o()}),[o]);return React.createElement("div",{onClick:o,onKeyDown:u,role:"switch","aria-checked":t,tabIndex:"0",className:r()("components-connection-icon",{"components-connection-icon__picture":l})},l&&React.createElement("img",{src:c,alt:i,onError:d}),React.createElement(a.av,{alt:i,serviceName:"instagram-business"===s?"instagram":"twitter"===s?"x":s,className:"jetpack-publicize-gutenberg-social-icon"}))};l.propTypes={serviceName:c().string,label:c().string,profilePicture:c().string};const p=l},24479:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(65235),n=s.n(a),i=s(15844),r=s.n(i),o=s(85761);const c=e=>{const{checked:t,disabled:s,onChange:a,serviceName:i,label:r,profilePicture:c}=e,l=n()("components-connection-toggle",{"is-not-checked":!t,"is-disabled":s});return React.createElement("div",{className:l,title:r},React.createElement(o.Z,{checked:t,label:r,onClick:a,serviceName:i,profilePicture:c}))};c.propTypes={className:r().string,checked:r().bool,id:r().string.isRequired,disabled:r().bool,onChange:r().func,serviceName:r().string,label:r().string,profilePicture:r().string};const l=c},49021:(e,t,s)=>{"use strict";var a=s(55609),n=s(94333),i=s(9818),r=s(69307),o=s(65736),c=s(23177);const __=o.__;class l extends r.Component{componentDidMount(){this.props.refreshConnections()}refreshConnectionClick=e=>{const{href:t,title:s}=e.target;e.preventDefault();const a=window.open(t,s,""),n=window.setInterval((()=>{!1!==a.closed&&(window.clearInterval(n),this.props.refreshConnections())}),500)};renderRefreshableConnections(){const{failedConnections:e}=this.props,t=e.filter((e=>e.can_refresh));return t.length?React.createElement(a.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},React.createElement("p",null,__("Before you hit Publish, please refresh the following connection(s) to make sure we can share your post:","jetpack")),t.map((e=>React.createElement(a.Button,{href:e.refresh_url,isSmall:!0,key:e.id,onClick:this.refreshConnectionClick,title:e.refresh_text},e.refresh_text)))):null}renderNonRefreshableConnections(){const{failedConnections:e}=this.props,t=e.filter((e=>!e.can_refresh));return t.length?t.map((e=>React.createElement(a.Notice,{className:"jetpack-publicize-notice",isDismissible:!1,status:"error"},React.createElement("p",null,e.test_message)))):null}render(){return React.createElement(r.Fragment,null,this.renderRefreshableConnections(),this.renderNonRefreshableConnections())}}(0,n.compose)([(0,i.withSelect)((e=>({failedConnections:e(c.Eg).getFailedConnections()}))),(0,i.withDispatch)((e=>({refreshConnections:e(c.Eg).refreshConnectionTestResults})))])(l)},4277:(e,t,s)=>{"use strict";var a=s(13419),n=s(55609),i=s(9818),r=s(69307),o=s(65736),c=s(23177),l=s(24479),p=s(28161),d=s(91853);const __=o.__;class u extends r.Component{maybeDisplayLinkedInNotice=()=>this.connectionNeedsReauth()&&React.createElement(n.Notice,{className:p.Z["publicize-notice"],isDismissible:!1,status:"error"},React.createElement("p",null,__("Your LinkedIn connection needs to be reauthenticated to continue working – head to Sharing to take care of it.","jetpack")),React.createElement(n.ExternalLink,{href:`https://wordpress.com/marketing/connections/${(0,a.lQ)()}`},__("Go to Sharing settings","jetpack")));connectionNeedsReauth=()=>this.props.mustReauthConnections.includes(this.props.name);onConnectionChange=()=>{const{id:e}=this.props;this.isDisabled()||this.props.toggleConnection(e)};connectionIsFailing(){const{failedConnections:e,name:t}=this.props;return e.some((e=>e.service_name===t))}isDisabled(){return this.props.disabled||this.connectionIsFailing()||this.connectionNeedsReauth()}render(){const{enabled:e,id:t,label:s,name:a,profilePicture:n}=this.props,i="connection-"+a+"-"+t,r=a.replace("_","-"),o=React.createElement(l.Z,{id:i,className:d.Z["connection-toggle"],checked:e,onChange:this.onConnectionChange,disabled:this.isDisabled(),serviceName:r,label:s,profilePicture:n});return React.createElement("li",null,this.maybeDisplayLinkedInNotice(),React.createElement("div",{className:d.Z["connection-container"]},o))}}(0,i.withSelect)((e=>({failedConnections:e(c.Eg).getFailedConnections(),mustReauthConnections:e(c.Eg).getMustReauthConnections()})))(u)},1922:(e,t,s)=>{"use strict";s(13419),s(55609),s(69307),s(65736),s(81050),s(75323),s(62578)},87029:(e,t,s)=>{"use strict";s(13419),s(55609),s(69307),s(65736),s(81050),s(75323),s(62578),s(75631)},63503:(e,t,s)=>{"use strict";s(55609),s(69307),s(65736),s(81050),s(37568),s(62578)},75457:(e,t,s)=>{"use strict";s(9818),s(69307),s(81050),s(88219),s(39118),s(75263),s(98811),s(46791),s(37568),s(23177),s(4277),s(69709),s(75631)},82356:(e,t,s)=>{"use strict";s(55609),s(65736),s(14085),s(37568),s(75631)},95788:(e,t,s)=>{"use strict";s(55609),s(9818),s(69307),s(65736),s(81050),s(88219),s(75323),s(39118),s(75263),s(98811),s(46791),s(6230),s(96672),s(37568),s(23177),s(42032),s(1922),s(87029),s(63503),s(75457),s(82356),s(50523),s(89698),s(27730),s(63411),s(22124),s(45334)},50523:(e,t,s)=>{"use strict";s(55609),s(65736),s(81050),s(62578)},89698:(e,t,s)=>{"use strict";s(55609),s(69307),s(65736),s(81050),s(75323),s(62578)},27730:(e,t,s)=>{"use strict";s(13419),s(55609),s(9818),s(65736),s(34431),s(23177),s(32637),s(27941),s(75631),s(6785)},27941:(e,t,s)=>{"use strict";s(13419),s(55609),s(9818),s(65736),s(34431),s(23177),s(62578),s(6785)},63411:(e,t,s)=>{"use strict";s(65736),s(81050),s(88219),s(39118),s(75263),s(48751),s(29753),s(71961)},22124:(e,t,s)=>{"use strict";s(55609),s(69307),s(65736),s(81050),s(37568),s(62578)},6785:(e,t,s)=>{"use strict";s(9818),s(12238),s(69307)},45334:(e,t,s)=>{"use strict";s(55609),s(65736),s(62578)},9888:(e,t,s)=>{"use strict";s(86989),s(55609),s(9818),s(12238),s(65736),s(65235),s(99196),s(75263),s(58487)},3176:(e,t,s)=>{"use strict";s(55609),s(65736),s(34607),s(37548),s(42911)},37548:(e,t,s)=>{"use strict";s(55609),s(65736)},88649:(e,t,s)=>{"use strict";s(52175),s(55609),s(69307),s(65736),s(65235),s(46791),s(1795),s(13858),s(69339)},29753:(e,t,s)=>{"use strict";s(55609),s(69307);var a=s(65736);s(99196),s(88219),s(98811),s(88649),s(53513),s(45811);const __=a.__;__("Choose Media","jetpack")},71961:(e,t,s)=>{"use strict";s(55609),s(65736)},62578:(e,t,s)=>{"use strict";var a=s(55609),n=s(65736),i=s(61074),r=s(6163),o=s(65235),c=s.n(o),l=s(15844),p=s.n(l),d=s(82283);const __=n.__,u=({children:e,type:t="default",actions:s=[],onDismiss:n})=>{const o=c()(d.Z.notice,d.Z[`notice--${t}`]);return React.createElement("div",{className:o},React.createElement("div",{className:d.Z.content}," ",e," "),n&&React.createElement("button",{className:d.Z.dismiss,onClick:n},React.createElement(a.VisuallyHidden,null,__("Dismiss notice","jetpack")),React.createElement(i.Z,{icon:r.Z})),s&&s.length>0&&React.createElement("div",{className:d.Z.actions},s.map((e=>e))))};u.propTypes={children:p().node.isRequired,type:p().oneOf(["default","highlight","warning","error"]),actions:p().arrayOf(p().element),onDismiss:p().func}},8714:(e,t,s)=>{"use strict";s(55609),s(9818),s(12238),s(69307),s(65736),s(14085),s(86419),s(37568),s(49021),s(95788),s(3176),s(91474),s(23761)},91750:(e,t,s)=>{"use strict";s(13419),s(9818),s(72067),s(12238),s(65736),s(37548),s(34607),s(45078)},52403:(e,t,s)=>{"use strict";s(13419),s(86989),s(72067),s(69307),s(14085),s(86419),s(37568),s(19649)},77106:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var a=s(9818),n=s(23177);function i({shouldRefresh:e,children:t}){const s=(0,a.useDispatch)(n.Eg).refreshJetpackSocialSettings;return e&&s(),t}},19649:(e,t,s)=>{"use strict";s(13419),s(65736),s(99196),s(2097)},69709:(e,t,s)=>{"use strict";s(65736),s(14085),s(78619)},2817:(e,t,s)=>{"use strict";var a=s(65736);const __=a.__;__("X","jetpack"),__("WhatsApp","jetpack"),__("Facebook","jetpack")},22917:(e,t,s)=>{"use strict";s(34607)},34607:(e,t,s)=>{"use strict";s(13419),s(69307),s(65736),s(65235),s(2817),s(30664),s(38730)},38730:(e,t,s)=>{"use strict";s(9818),s(69307),s(71806)},32637:(e,t,s)=>{"use strict";s(69307),s(65736),s(65235),s(73640)},91474:(e,t,s)=>{"use strict";s(55609),s(9818),s(12238),s(69307),s(65736),s(53961),s(14085),s(45579),s(37568)},54005:(e,t,s)=>{"use strict";s(55609),s(69307),s(65736),s(75263),s(9888),s(81469)},81469:(e,t,s)=>{"use strict";s(55609),s(69307);var a=s(65736);s(75263),s(98811),s(9888),s(88649),s(39356),s(40088);const __=a.__;__("Choose Image","jetpack")},79631:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var a=s(32054),n=s(90526),i=s(9818),r=s(69307),o=s(65736),c=s(99196),l=s.n(c),p=s(23177),d=s(8350);const __=o.__,u=()=>{const[e,t]=(0,r.useState)(null),{isEnabled:s,isUpdating:o,defaultTemplate:c}=(0,i.useSelect)((e=>{const t=e(p.Eg);return{isEnabled:t.isSocialImageGeneratorEnabled(),isUpdating:t.isUpdatingSocialImageGeneratorSettings(),defaultTemplate:t.getSocialImageGeneratorDefaultTemplate()}}),[]),u=(0,i.useDispatch)(p.Eg).updateSocialImageGeneratorSettings;(0,r.useEffect)((()=>{if(e){u({template:e})}}),[e,u]);const[m]=(0,a.Z)("sm"),h=(0,r.useCallback)((({open:e})=>l().createElement(n.Z,{fullWidth:m,variant:"secondary",size:"small",disabled:o||!s,onClick:e},__("Change default template","jetpack"))),[s,m,o]);return l().createElement(d.Z,{value:e||c,onSelect:t,render:h})}},8350:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(88275),n=s(55609),i=s(69307),r=s(65736),o=s(39356),c=s(15214);const __=r.__,l=({onSelect:e,render:t,value:s=null})=>{const[r,l]=(0,i.useState)(!1),[p,d]=(0,i.useState)(s),u=(0,i.useCallback)((()=>l(!0)),[l]),m=(0,i.useCallback)((()=>{l(!1)}),[l]),h=(0,i.useCallback)((()=>{e(p),l(!1)}),[e,l,p]);return React.createElement(a.ZP,{targetDom:document.body},t({open:u}),r&&React.createElement(n.Modal,{onRequestClose:m,title:__("Pick a Template","jetpack")},React.createElement(o.Z,{value:p,onTemplateSelected:d}),React.createElement("div",{className:c.Z.footer},React.createElement(n.Button,{variant:"tertiary",onClick:m},__("Cancel","jetpack")),React.createElement(n.Button,{variant:"primary",onClick:h},__("Save","jetpack")))))}},39356:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(69307),n=s(65736),i=s(65235),r=s.n(i),o=s(47320),c=s(57227);const __=n.__,l=({value:e=null,onTemplateSelected:t=null})=>{const s=(0,a.useCallback)((e=>{const s=e.target.id;t?.(s)}),[t]);return React.createElement("div",{className:o.Z.templates},c.Z.map((t=>React.createElement("button",{onClick:s,id:t.name,key:t.name,className:r()(o.Z.template,{[o.Z["template--active"]]:t.name===e})},React.createElement("img",{src:t.image,alt:t.label}),React.createElement("span",{className:"screen-reader-text"},/* translators: %s is the name of the template */ /* translators: %s is the name of the template */ -(0,n.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});var a=s(30253),n=s(91948),i=s(5353);const r=[{name:"highway",label:"Highway",image:s(27956)},{name:"dois",label:"Dois",image:a},{name:"edge",label:"Edge",image:n},{name:"fullscreen",label:"Fullscreen",image:i}]},76848:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(48229),n=s(9818),i=s(69307),r=s(99196),o=s.n(r),c=s(23177);const l=({toggleClass:e,children:t})=>{const{isEnabled:s,isUpdating:r}=(0,n.useSelect)((e=>{const t=e(c.Eg);return{isEnabled:t.isSocialImageGeneratorEnabled(),isUpdating:t.isUpdatingSocialImageGeneratorSettings()}}),[]),l=(0,n.useDispatch)(c.Eg).updateSocialImageGeneratorSettings,p=(0,i.useCallback)((()=>{l({enabled:!s})}),[s,l]);return o().createElement(a.Z,{className:e,disabled:r,checked:s,onChange:p,label:t})}},53513:(e,t,s)=>{"use strict";s(55609),s(69307);var a=s(65736);s(88219),s(89696);const __=a.__;__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack")},63855:(e,t,s)=>{"use strict";var a=s(82674),n=s.n(a),i=s(13477),r=s(9818),o=s(48751),c=s(23177);(0,r.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,o.Z)(),{title:s,excerpt:a,content:l}=e,p=(0,r.useSelect)((e=>{const{displayName:t,profileImage:s}=e(c.Eg).getConnectionProfileDetails(c.uJ);return{displayName:t,avatarUrl:s}}));return React.createElement(i.S,n()({},e,{type:"article",user:p,customText:t||a||l||s}))}))},83704:(e,t,s)=>{"use strict";s(82674),s(9818),s(22629),s(99196)},4124:(e,t,s)=>{"use strict";s(9818),s(99196),s(48751),s(23177)},27725:(e,t,s)=>{"use strict";s(9818),s(65736),s(99196),s(48751),s(23177)},28586:(e,t,s)=>{"use strict";s(82674),s(9818),s(22629),s(71806),s(48751),s(23177)},8454:(e,t,s)=>{"use strict";s(55609),s(65736),s(41809),s(9279)},18553:(e,t,s)=>{"use strict";s(9818),s(99196),s(48751),s(23177)},74140:(e,t,s)=>{"use strict";s(55609),s(65736),s(41809)},94714:(e,t,s)=>{"use strict";s(82674),s(9818),s(48751),s(23177)},24766:(e,t,s)=>{"use strict";s(9818),s(99196),s(71806),s(23177)},41809:(e,t,s)=>{"use strict";s(82674),s(65736),s(99196),s(23177),s(42032),s(63855),s(83704),s(4124),s(27725),s(28586),s(18553),s(94714),s(24766)},9279:(e,t,s)=>{"use strict";s(9818),s(65736),s(71806)},13858:(e,t,s)=>{"use strict";s(69307),s(87728)},88219:(e,t,s)=>{"use strict";s(71806)},75323:(e,t,s)=>{"use strict";s(13419),s(86989),s(69307)},39118:(e,t,s)=>{"use strict";s(9818),s(12238)},75263:(e,t,s)=>{"use strict";s(9818),s(12238),s(69307),s(71806)},98811:(e,t,s)=>{"use strict";s(9818),s(69307)},46791:(e,t,s)=>{"use strict";s(69307),s(1795)},1795:(e,t,s)=>{"use strict";const a="video/mp4",n="video/mov",i="video/videopress",r=["image/jpeg","image/jpg","image/png"],o=r.concat(["image/gif","image/bmp"]),c=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],l=r.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),p=["video/webm","video/quicktime","video/ogg"],d=r.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),u=[n,"video/avi","video/mpg","video/mpeg","video/m4v"];r.concat([a,i,n]),r.concat([a,i]),o.concat([i,...c]),r.concat([a,n,i]),r.concat([a,i]),l.concat([...p,a,i]),d.concat([...u,a,i]),new Set([...r,...o,...l,...c,...p,"image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"])},71806:(e,t,s)=>{"use strict";s.d(t,{R:()=>o});var a=s(9818),n=s(12238),i=s(69307),r=s(42032);function o(){const{editPost:e}=(0,a.useDispatch)(n.store),t=(0,a.useSelect)((e=>{const t=e(n.store).getEditedPostAttribute("meta")||{},s=t.jetpack_publicize_feature_enabled??!0,a=t.jetpack_social_options||{};return{isPublicizeEnabled:s,jetpackSocialOptions:a,attachedMedia:a.attached_media||[],imageGeneratorSettings:a.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,r.getShareMessageMaxLength)()),shouldUploadAttachedMedia:a.should_upload_attached_media??!1}}),[]),s=(0,i.useCallback)(((t,s)=>{e({meta:{[t]:s}})}),[e]),o=(0,i.useCallback)((()=>{s("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,s]),c=(0,i.useCallback)(((e,a)=>{s("jetpack_social_options",{...t.jetpackSocialOptions,[e]:a})}),[t.jetpackSocialOptions,s]);return(0,i.useMemo)((()=>({...t,togglePublicizeFeature:o,updateJetpackSocialOptions:c,updateMeta:s})),[t,o,c,s])}},14085:(e,t,s)=>{"use strict";s(13419),s(9818),s(12238),s(71806)},6230:(e,t,s)=>{"use strict";s(9818),s(69307),s(23177)},96672:(e,t,s)=>{"use strict";s(94333),s(69307),s(37568)},86419:(e,t,s)=>{"use strict";s(94333),s(9818),s(12238),s(69307)},34431:(e,t,s)=>{"use strict";s(9818),s(65736),s(23177)},45579:(e,t,s)=>{"use strict";s(13419),s(86989),s(9818),s(12238),s(69307),s(65736),s(37568),s(48751)},37568:(e,t,s)=>{"use strict";s(9818),s(23177)},48751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var a=s(42032),n=s(71806);function i(){const{updateMeta:e,shareMessage:t}=(0,n.R)();return{message:t,maxLength:(0,a.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,s)=>{"use strict";s(9818),s(12238),s(23177),s(86419)},21052:(e,t,s)=>{"use strict";s.d(t,{Au:()=>c,Wh:()=>l,ZP:()=>p,hi:()=>o,wO:()=>r});var a=s(9818),n=s(23177),i=s(4957);const r="SET_AUTO_CONVERSION_SETTINGS";function o(){return l({isUpdating:!0})}function c(){return l({isUpdating:!1})}function l(e){return{type:r,options:e}}const p={updateAutoConversionSettings:function*(e){try{yield o(),yield l(e),yield(0,i.Fl)(e);const t=yield(0,i.wi)();return yield l(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,a.select)(n.Eg).getAutoConversionSettings();return yield l(t),!1}finally{yield c()}},setAutoConversionSettings:l,refreshAutoConversionSettings:function*(){try{yield o();const e=yield(0,i.wi)();return yield l(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield c()}}}},23013:(e,t,s)=>{"use strict";s.r(t),s.d(t,{mergeConnections:()=>p,refreshConnectionTestResults:()=>d,setConnections:()=>c,syncConnectionsToPostMeta:()=>u,toggleConnection:()=>l,toggleConnectionById:()=>m});var a=s(13419),n=s(86989),i=s.n(n),r=s(12238),o=s(74442);function c(e){return{type:o.b,connections:e}}function l(e){return{type:o.L,connectionId:e}}function p(e){return function({dispatch:t,select:s}){const a=s.getConnections(),n=[],i={done:!1,enabled:Boolean(s.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...i,...a.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};n.push(e)}t(c(n))}}function d(e=!1){return async function({dispatch:t}){try{const s=(0,a.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(p(await i()({path:s}))),e&&t(u())}catch(e){}}}function u(){return function({registry:e,select:t}){const s=t.getConnections();return e.dispatch(r.store).editPost({jetpack_publicize_connections:s})}}function m(e,t=!0){return function({dispatch:s}){s(l(e)),t&&s(u())}}},74442:(e,t,s)=>{"use strict";s.d(t,{L:()=>n,b:()=>a});const a="SET_CONNECTIONS",n="TOGGLE_CONNECTION"},54725:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var a=s(21052),n=s(23013),i=s(371),r=s(72438),o=s(4462);const c={...i.ZP,...o.ZP,...a.ZP,...r.Z,...n}},371:(e,t,s)=>{"use strict";s.d(t,{ZP:()=>c,dz:()=>r,ff:()=>o});var a=s(9818),n=s(23177),i=s(4957);const r="SET_JETPACK_SETTINGS";function o(e){return{type:r,options:e}}const c={updateJetpackSettings:function*(e){try{yield o({is_updating:!0}),yield o(e),yield(0,i.RF)(e);const t=yield(0,i.es)();return yield o(t),!0}catch(e){const t=(0,a.select)(n.Eg).getJetpackSettings();return yield o(t),!1}finally{yield o({is_updating:!1})}},setJetpackSettings:o}},72438:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});var a=s(4957),n=s(21052),i=s(4462);const r={refreshJetpackSocialSettings:function*(){try{yield(0,n.hi)(),yield(0,i.ds)();const e=yield(0,a.mu)();return yield(0,n.Wh)(e.jetpack_social_autoconvert_images),yield(0,i.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,n.Au)(),yield(0,i.Gr)()}}}},4462:(e,t,s)=>{"use strict";s.d(t,{Gr:()=>c,ZP:()=>p,ch:()=>l,ds:()=>o,kg:()=>r});var a=s(9818),n=s(23177),i=s(4957);const r="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function o(){return l({isUpdating:!0})}function c(){return l({isUpdating:!1})}function l(e){return{type:r,options:e}}const p={updateSocialImageGeneratorSettings:function*(e){try{yield o(),yield l(e),yield(0,i.Ux)(e);const t=yield(0,i.oB)();return yield l(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,a.select)(n.Eg).getSocialImageGeneratorSettings();return yield l(t),!1}finally{yield c()}},setSocialImageGeneratorSettings:l,refreshSocialImageGeneratorSettings:function*(){try{yield o();const e=yield(0,i.oB)();return yield l(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield c()}}}},4957:(e,t,s)=>{"use strict";s.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>E,es:()=>u,mu:()=>f,oB:()=>h,wi:()=>k});var a=s(86989),n=s.n(a);const i="FETCH_JETPACK_SETTINGS",r="UPDATE_JETPACK_SETTINGS",o="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="FETCH_AUTO_CONVERSION_SETTINGS",p="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",u=()=>({type:i}),m=e=>({type:r,settings:e}),h=()=>({type:o}),g=e=>({type:c,settings:e}),k=()=>({type:l}),f=()=>({type:d}),v=e=>({type:p,settings:e}),E={[i]:function(){return n()({path:"/jetpack/v4/social/settings"})},[r]:function(e){return n()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[o]:function(){return n()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[c]:function(e){return n()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[l]:function(){return n()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[p]:function(e){return n()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return n()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,s)=>{"use strict";s.d(t,{Eg:()=>l,uJ:()=>d});var a=s(9818),n=s(54725),i=s(4957),r=s(45272),o=s(15781),c=s(22987);const l="jetpack-social-plugin",p={reducer:r.Z,actions:n.Z,selectors:c.Z,resolvers:o.ZP,controls:i.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",u=(0,a.createReduxStore)(l,p);(0,a.register)(u)},20750:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(21052);const n=(e={},t)=>t.type===a.wO?{...e,...t.options}:e},71837:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(74442);const n=(e={},t)=>{switch(t.type){case a.b:return{...e,connections:t.connections};case a.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,s)=>{"use strict";s.d(t,{Z:()=>p});var a=s(9818),n=s(20750),i=s(71837),r=s(80697),o=s(35652),c=s(28696),l=s(54489);const p=(0,a.combineReducers)({sharesData:o.Z,siteData:c.Z,connectionData:i.Z,jetpackSettings:r.Z,socialImageGeneratorSettings:l.Z,autoConversionSettings:n.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(371);const n=(e={},t)=>t.type===a.dz?{...e,...t.options}:e},35652:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a=(e={})=>e},28696:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a=(e={})=>e},54489:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(4462);const n=(e={},t)=>t.type===a.kg?{...e,...t.options}:e},15781:(e,t,s)=>{"use strict";s.d(t,{ZP:()=>l});var a=s(12238),n=s(21052),i=s(23013),r=s(371),o=s(4462),c=s(4957);const l={getJetpackSettings:function*(){try{const e=yield(0,c.es)();if(e)return(0,r.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,c.oB)();if(e)return(0,o.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,c.wi)();if(e)return(0,n.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const s=t.select(a.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,i.setConnections)(s||[]))}}}},68113:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,s)=>{"use strict";function a(e){return e.connectionData?.connections??[]}function n(e){return e.connectionData?.adminUrl??null}function i(e){return a(e).length>0}function r(e){return a(e).filter((e=>!1===e.test_success))}function o(e){return a(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function c(e){return a(e).filter((e=>e.enabled))}function l(e){return a(e).filter((e=>!e.enabled))}function p(e,t,{forceDefaults:s=!1}={}){let n="",i="",r="";if(!s){const s=a(e).find((({service_name:e})=>t===e));if(s){const{display_name:e,profile_display_name:a,profile_picture:o}=s;n="twitter"===t?a:e,r="twitter"===t?e:s.username,i=o}}return{displayName:n,profileImage:i,username:r}}s.r(t),s.d(t,{getConnectionProfileDetails:()=>p,getConnections:()=>a,getConnectionsAdminUrl:()=>n,getDisabledConnections:()=>l,getEnabledConnections:()=>c,getFailedConnections:()=>r,getMustReauthConnections:()=>o,hasConnections:()=>i})},22987:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(68113),n=s(43354),i=s(82836),r=s(31473),o=s(85675),c=s(45073);const l={...o.Z,...n,...i.Z,...r,...c.Z,...a.Z}},82836:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,s)=>{"use strict";s.r(t),s.d(t,{getScheduledSharesCount:()=>c,getShareLimit:()=>r,getSharedPostsCount:()=>p,getSharesUsedCount:()=>o,getTotalSharesCount:()=>l,isShareLimitEnabled:()=>n,numberOfSharesRemaining:()=>u,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>i});var a=s(82836);function n(e){return e.sharesData?.is_share_limit_enabled??!1}function i(e){return!a.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&n(e)}function r(e){return e.sharesData?.share_limit??30}function o(e){return e.sharesData?.publicized_count??0}function c(e){return e.sharesData?.to_be_publicized_count??0}function l(e){const t=o(e)+c(e);return Math.max(t,0)}function p(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function u(e,t={}){if(!i(e))return 1/0;const{includeScheduled:s}={includeScheduled:!0,...t},a=o(e),n=r(e),l=s?c(e):0;return Math.max(n-a-l,0)}},85675:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});const a=255;function n(){return a}},12677:(e,t,s)=>{"use strict";s(13419)},42032:(e,t,s)=>{"use strict";s.d(t,{getShareMessageMaxLength:()=>a.A});var a=s(5463);s(12677)},13419:(e,t,s)=>{"use strict";s.d(t,{Pb:()=>a.Z,lQ:()=>n.Z});var a=s(50148),n=s(35004);s(76714),s(80354),s(75404),s(61053),s(11380),s(6342),s(96959),s(39058)},6342:(e,t,s)=>{"use strict";s(99196)},96959:(e,t,s)=>{"use strict";s(69307)},50148:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});const a="Jetpack_Editor_Initial_State";function n(){return"object"==typeof window?window?.[a]??null:null}},35004:(e,t,s)=>{"use strict";function a(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}s.d(t,{Z:()=>a})},61053:(e,t,s)=>{"use strict";var a=s(6975);s(69307);const{tracks:n}=a.Z,{recordEvent:i}=n},11380:(e,t,s)=>{"use strict";s(9818),s(69307),s(39058)},44166:(e,t,s)=>{"use strict";s.d(t,{ZP:()=>u,rW:()=>d});var a=s(9818),n=s(99505),i=s(82162),r=s(39058);const o="SET_JETPACK_MODULES",c="SET_MODULE_UPDATING";function l(e){return d({isLoading:e})}function p(e,t){return{type:c,name:e,isUpdating:t}}function d(e){return{type:o,options:e}}const u={updateJetpackModuleStatus:function*(e){try{yield p(e.name,!0),yield(0,i.zL)(e);const t=yield(0,i.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,a.select)(r.p).getJetpackModules();return yield d(t),!1}finally{yield p(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,n.Wp)())return!0;try{yield l(!0);const e=yield(0,i.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,a.select)(r.p).getJetpackModules();return yield d(t),!1}finally{yield l(!1)}}}},82162:(e,t,s)=>{"use strict";s.d(t,{Bs:()=>o,ZP:()=>l,zL:()=>c});var a=s(86989),n=s.n(a);const i="FETCH_JETPACK_MODULES",r="UPDATE_JETPACK_MODULE_STATUS",o=()=>({type:i}),c=e=>({type:r,settings:e}),l={[i]:function(){return n()({path:"/jetpack/v4/module/all",method:"GET"})},[r]:function({settings:e}){return n()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var a=s(9818),n=s(44166),i=s(82162),r=s(42469),o=s(55133),c=s(43524);const l="jetpack-modules",p=(0,a.createReduxStore)(l,{reducer:r.Z,actions:n.ZP,controls:i.ZP,resolvers:o.Z,selectors:c.Z});(0,a.register)(p);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,a.dispatch)(l).setJetpackModules({data:{...d}})},42469:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});const a={isLoading:!1,isUpdating:{},data:{}},n=(e=a,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var a=s(44166),n=s(82162);const i={getJetpackModules:function*(){try{const e=yield(0,n.Bs)();if(e)return(0,a.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(99505);const n={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,a.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,s)=>{"use strict";var a=s(65736);s(96483),s(92819);const __=a.__;__("Upgrade your plan to use video covers","jetpack"),__("Upgrade your plan to upload audio","jetpack")},76714:(e,t,s)=>{"use strict";s(98817)},99505:(e,t,s)=>{"use strict";function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function n(){return"simple"===a()}s.d(t,{Wp:()=>n})},80354:(e,t,s)=>{"use strict";s(82674),s(94333)},4341:(e,t,s)=>{"use strict";s.d(t,{Z:()=>f});var a=s(6895),n=s(65736),i=s(65235),r=s.n(i),o=s(85799),c=s(43255),l=s(84069),p=s(25162),d=s.n(p),u=s(99196),m=s.n(u),h=s(59309),g=s(96300);const __=n.__;class k extends u.Component{static propTypes={inOfflineMode:d().bool.isRequired,siteRawUrl:d().string.isRequired};static defaultProps={inOfflineMode:!1,siteRawUrl:""};trackActivityClick=()=>{l.Z.tracks.recordJetpackClick({type:"activity-link",target:"at-a-glance",feature:"activity-log"})};render(){const{inOfflineMode:e}=this.props,t=__("Jetpack keeps a complete record of everything that happens on your site, taking the guesswork out of site management, debugging, and repair.","jetpack");return m().createElement("div",{className:"jp-dash-item__interior"},m().createElement(c.Z,{label:__("Activity","jetpack"),isModule:!1,className:r()({"jp-dash-item__is-inactive":e}),pro:!1},m().createElement("p",{className:"jp-dash-item__description"},e?__("Unavailable in Offline Mode.","jetpack"):t)),m().createElement(o.Z,{key:"view-activity",className:"jp-dash-item__manage-in-wpcom",compact:!0,href:(0,a.Z)("calypso-activity-log",{site:this.props.siteRawUrl}),target:"_blank",rel:"noopener noreferrer",onClick:this.trackActivityClick},__("View site activity","jetpack")))}}const f=(0,h.$j)((e=>({inOfflineMode:(0,g.Ex)(e)})))(k)},91248:(e,t,s)=>{"use strict";s.d(t,{Z:()=>T});var a=s(82674),n=s.n(a),i=s(64743),r=s(52947),o=s(69307),c=s(65736),l=s(97506),p=s(85799),d=s(43255),u=s(11020),m=s(41549),h=s(85733),g=s(84069),k=s(59584),f=s(92819),v=s(1137),E=s(25162),w=s.n(E),_=s(99196),b=s.n(_),y=s(59309),C=s(17296),j=s(96300),S=s(69508),N=s(33002);const __=c.__,_x=c._x;class x extends _.Component{static propTypes={siteRawUrl:w().string.isRequired,siteAdminUrl:w().string.isRequired,trackUpgradeButtonView:w().func,akismetData:w().oneOfType([w().string,w().object,w().number]).isRequired,isOfflineMode:w().bool.isRequired,upgradeUrl:w().string.isRequired,hasConnectedOwner:w().bool.isRequired};static defaultProps={siteRawUrl:"",siteAdminUrl:"",akismetData:"N/A",isOfflineMode:"",trackUpgradeButtonView:f.noop};trackActivateClick(){g.Z.tracks.recordJetpackClick({type:"activate-link",target:"at-a-glance",feature:"anti-spam"})}onActivateClick=()=>(this.trackActivateClick(),this.props.createNotice("is-info",__("Activating Akismet…","jetpack"),{id:"activating-akismet"}),i.ZP.activateAkismet().then((()=>{this.props.removeNotice("activating-akismet"),window.location.href=this.props.siteAdminUrl+"admin.php?page=akismet-key-config"})).catch((()=>{this.props.removeNotice("activating-akismet"),this.props.createNotice("is-error",__("Could not activate Akismet.","jetpack"),{id:"activate-akismet-failure"})})),!1);trackModerateClick(){g.Z.tracks.recordJetpackClick({type:"moderate-link",target:"at-a-glance",feature:"anti-spam"})}onModerateClick=()=>{this.trackModerateClick()};getContent(){const{akismetData:e,siteAdminUrl:t}=this.props,s=__("Akismet Anti-spam","jetpack"),a={text:__("Comments and contact form submissions are checked against our global database of spam.","jetpack"),link:this.props.isAtomicSite?null:"https://akismet.com/features",privacyLink:"https://automattic.com/privacy/"},i=()=>{let s;return"not_active"===e?s=(0,o.createInterpolateElement)(__("Already have an API key? .","jetpack"),{Button:b().createElement(l.Z,{className:"jp-link-button",onClick:this.onActivateClick})}):"invalid_key"===e&&(s=(0,o.createInterpolateElement)(__("Already have an API key? Get started.","jetpack"),{a:b().createElement("a",{href:t+"admin.php?page=akismet-key-config"})})),b().createElement(h.ZP,{callToAction:_x("Upgrade","Call to action to buy a new plan","jetpack"),title:__("Automatically clear spam from comments and forms.","jetpack"),description:s,disableHref:"false",href:this.props.upgradeUrl,eventFeature:"akismet",path:"dashboard",plan:(0,k.o2o)(k.V37),trackBannerDisplay:this.props.trackUpgradeButtonView,noIcon:!0})},c=()=>b().createElement(h.ZP,{callToAction:__("Connect","jetpack"),title:__("Connect your WordPress.com account to upgrade and automatically clear spam from comments and forms","jetpack"),disableHref:"false",onClick:this.props.connectUser,eventFeature:"akismet",path:"dashboard",plan:(0,k.o2o)(k.V37)}),u=()=>this.props.hasConnectedOwner?i():c();if("N/A"===e)return b().createElement(d.Z,{label:s,module:"akismet",support:a,pro:!0},b().createElement("p",{className:"jp-dash-item__description"},__("Loading…","jetpack")));if(["not_installed","not_active","invalid_key"].includes(e)){const e={label:s,module:"akismet",support:a,className:"jp-dash-item__is-inactive",pro:!0};return this.props.hasAntiSpam||this.props.hasAkismet?b().createElement(d.Z,e,__("Your Jetpack plan provides anti-spam protection through Akismet. Click 'set up' to enable it on your site.","jetpack")):this.props.isOfflineMode?b().createElement(d.Z,e,b().createElement("p",{className:"jp-dash-item__description"},__("Unavailable in Offline Mode.","jetpack"))):b().createElement(d.Z,n()({},e,{overrideContent:u()}))}return[b().createElement(d.Z,{key:"comment-moderation",label:s,module:"akismet",support:a,status:"is-working",pro:!0},(()=>0!==this.props.akismetData?b().createElement(b().Fragment,null,b().createElement("h2",{className:"jp-dash-item__count"},(0,r.Z)(this.props.akismetData)),b().createElement("p",{className:"jp-dash-item__description"},_x("Spam comments blocked.",'Example: "412 Spam comments blocked"',"jetpack"))):b().createElement("div",{className:"jp-dash-item__recently-activated"},b().createElement("p",{className:"jp-dash-item__description"},__("Akismet is now monitoring all comments on your site. Data will display here soon!","jetpack"))))()),!this.props.isOfflineMode&&b().createElement(p.Z,{key:"moderate-comments",className:"jp-dash-item__manage-in-wpcom",compact:!0,href:`${this.props.siteAdminUrl}edit-comments.php`,onClick:this.onModerateClick},__("Moderate comments","jetpack"))]}render(){return b().createElement("div",{className:"jp-dash-item__interior"},b().createElement(u.Z,null),this.getContent())}}const T=(0,y.$j)((e=>({akismetData:(0,C.fU)(e),isAtomicSite:(0,S.Ug)(e),isOfflineMode:(0,j.Ex)(e),upgradeUrl:(0,v.z)(e,"akismet"),nonce:(0,S.VY)(e),hasConnectedOwner:(0,j.it)(e),hasAntiSpam:(0,N.CV)(e,"antispam"),hasAkismet:(0,N.CV)(e,"akismet")})),(e=>({createNotice:m.iI,removeNotice:m.qq,connectUser:()=>e((0,j.bL)())})))(x)},83326:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var a=s(80800),n=s(65736),i=s(97506),r=s(85799),o=s(84069),c=s(99196),l=s.n(c),p=s(59309),d=s(3230);const __=n.__,u=(0,p.$j)((e=>({isDismissed:(0,d.wS)(e)})),(e=>({dismiss:()=>e((0,d.VP)({dismiss_dash_backup_getting_started:!0}))})))((({isDismissed:e,dismiss:t})=>{const s=(0,c.useCallback)((()=>{t(),o.Z.tracks.recordEvent("jetpack_backup_getting_started_video_dismiss",{position:"at_a_glance"})}),[t]),n=(0,c.useCallback)((()=>{o.Z.tracks.recordEvent("jetpack_backup_getting_started_video_click",{position:"at_a_glance"})}),[]);return e?null:l().createElement(r.Z,{className:"dash-backup-getting-started"},l().createElement(i.Z,{borderless:!0,compact:!0,className:"dash-backup-getting-started__dismiss",onClick:s},l().createElement("span",{className:"dashicons dashicons-no"})),l().createElement("a",{href:a.zh,target:"_blank",rel:"noreferrer"},l().createElement("img",{className:"dash-backup-getting-started__thumbnail",src:a.hp+"backup-getting-started-thumbnail.png",srcSet:`${a.hp+"backup-getting-started-thumbnail.png"} 1x, ${a.hp+"backup-getting-started-thumbnail-2x.png"} 2x`,alt:""})),l().createElement("div",{className:"dash-backup-getting-started__content"},l().createElement("h3",{className:"dash-backup-getting-started__header"},__("Getting started with Jetpack Backup","jetpack")),l().createElement("p",{className:"dash-backup-getting-started__text"},__("A short video guide on how to back up your website","jetpack"))),l().createElement(i.Z,{className:"dash-backup-getting-started__cta",href:a.zh,onClick:n,target:"_blank",rel:"noreferrer",compact:!0,primary:!0},__("Watch the video","jetpack")))}))},30647:(e,t,s)=>{"use strict";s.d(t,{v:()=>p});var a=s(43521),n=s(65736),i=s(85799),r=s(84069),o=s(99196),c=s.n(o),l=s(49890);const __=n.__,p=({comments:e,plugins:t,posts:s,onClosePopup:n})=>{const p=(0,o.useRef)(!1);(0,o.useEffect)((()=>{p.current||(r.Z.tracks.recordEvent("jetpack_wpa_aag_backup_bar_chart_view",{comments:e,plugins:t,posts:s}),p.current=!0)}),[]);const d=(0,o.useMemo)((()=>[{count:s,label:__("Posts","jetpack"),backgroundColor:"#00BA37"},{count:t,label:__("Plugins","jetpack"),backgroundColor:"#3895BA"},{count:e,label:__("Comments","jetpack"),backgroundColor:"#E68B28"}]),[e,t,s]);return c().createElement(i.Z,{className:"jp-dash-upgrade-backup"},c().createElement(l.G,{posts:s,comments:e,onClosePopup:n}),c().createElement(a.Z,{items:d}))}},91498:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(84069),n=s(99196),i=s.n(n),r=s(59309),o=s(17296),c=s(30647);const l=(0,r.$j)((e=>{const t=(0,o.yZ)(e)?.general?.stats;return{comments:t?.comments,plugins:Object.keys((0,o.Fb)(e)).length,posts:t?.posts,isFetchingData:(0,o.vz)(e)||(0,o.F2)(e)}}))((({comments:e,isFetchingData:t,plugins:s,posts:r})=>{const[o,l]=(0,n.useState)(!0),p=(0,n.useCallback)((()=>{const t={comments:e,plugins:s,posts:r,target:"backup_bar_chart_close",type:"dismiss"};a.Z.tracks.recordJetpackClick(t),l(!1)}),[e,s,r]);return!t&&o&&r>20?i().createElement(c.v,{posts:r,comments:e,plugins:s,onClosePopup:p}):null}))},49890:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var a=s(80800),n=s(65736),i=s(97506),r=s(99196),o=s.n(r);const __=n.__,c=({posts:e,comments:t,onClosePopup:s})=>o().createElement("div",{className:"jp-dash-upgrade-backup__popup"},o().createElement(i.Z,{onClick:s,className:"jp-dash-upgrade-backup__popup-close-icon",compact:!0,borderless:!0},o().createElement("img",{src:a.hp+"/close.svg",alt:__("Close","jetpack")})),o().createElement("img",{className:"jp-dash-upgrade-backup__popup-lock-icon",src:a.hp+"/lock.svg",alt:__("Locked","jetpack")}),o().createElement("p",{className:"jp-dash-upgrade-backup__popup-title"},__("Upgrade to backup","jetpack")),o().createElement("p",null,(0,n.sprintf)(/* translators: 1 number of posts, 2 number of comments */ +(0,n.sprintf)(__("Pick the %s template","jetpack"),t.label))))))}},57227:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});var a=s(30253),n=s(91948),i=s(5353);const r=[{name:"highway",label:"Highway",image:s(27956)},{name:"dois",label:"Dois",image:a},{name:"edge",label:"Edge",image:n},{name:"fullscreen",label:"Fullscreen",image:i}]},76848:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(48229),n=s(9818),i=s(69307),r=s(99196),o=s.n(r),c=s(23177);const l=({toggleClass:e,children:t})=>{const{isEnabled:s,isUpdating:r}=(0,n.useSelect)((e=>{const t=e(c.Eg);return{isEnabled:t.isSocialImageGeneratorEnabled(),isUpdating:t.isUpdatingSocialImageGeneratorSettings()}}),[]),l=(0,n.useDispatch)(c.Eg).updateSocialImageGeneratorSettings,p=(0,i.useCallback)((()=>{l({enabled:!s})}),[s,l]);return o().createElement(a.Z,{className:e,disabled:r,checked:s,onChange:p,label:t})}},53513:(e,t,s)=>{"use strict";s(55609),s(69307);var a=s(65736);s(88219),s(89696);const __=a.__;__("You need a featured image or media attached to your post to be able to share as a social post.","jetpack"),__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack")},63855:(e,t,s)=>{"use strict";var a=s(82674),n=s.n(a),i=s(13477),r=s(9818),o=s(48751),c=s(23177);(0,r.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor");return{excerpt:t("excerpt"),content:t("content").split("\x3c!--more")[0]}}))((e=>{const{message:t}=(0,o.Z)(),{title:s,excerpt:a,content:l}=e,p=(0,r.useSelect)((e=>{const{displayName:t,profileImage:s}=e(c.Eg).getConnectionProfileDetails(c.uJ);return{displayName:t,avatarUrl:s}}));return React.createElement(i.S,n()({},e,{type:"article",user:p,customText:t||a||l||s}))}))},83704:(e,t,s)=>{"use strict";s(82674),s(9818),s(22629),s(99196)},4124:(e,t,s)=>{"use strict";s(9818),s(99196),s(48751),s(23177)},27725:(e,t,s)=>{"use strict";s(9818),s(65736),s(99196),s(48751),s(23177)},28586:(e,t,s)=>{"use strict";s(82674),s(9818),s(22629),s(71806),s(48751),s(23177)},8454:(e,t,s)=>{"use strict";s(55609),s(65736),s(41809),s(9279)},18553:(e,t,s)=>{"use strict";s(9818),s(99196),s(48751),s(23177)},74140:(e,t,s)=>{"use strict";s(55609),s(65736),s(41809)},94714:(e,t,s)=>{"use strict";s(82674),s(9818),s(48751),s(23177)},24766:(e,t,s)=>{"use strict";s(9818),s(99196),s(71806),s(23177)},41809:(e,t,s)=>{"use strict";s(82674),s(65736),s(99196),s(23177),s(42032),s(63855),s(83704),s(4124),s(27725),s(28586),s(18553),s(94714),s(24766)},9279:(e,t,s)=>{"use strict";s(9818),s(65736),s(71806)},13858:(e,t,s)=>{"use strict";s(69307),s(87728)},88219:(e,t,s)=>{"use strict";s(71806)},75323:(e,t,s)=>{"use strict";s(13419),s(86989),s(69307)},39118:(e,t,s)=>{"use strict";s(9818),s(12238)},75263:(e,t,s)=>{"use strict";s(9818),s(12238),s(69307),s(71806)},98811:(e,t,s)=>{"use strict";s(9818),s(69307)},46791:(e,t,s)=>{"use strict";s(69307),s(1795)},1795:(e,t,s)=>{"use strict";const a="video/mp4",n="video/mov",i="video/videopress",r=["image/jpeg","image/jpg","image/png"],o=r.concat(["image/gif","image/bmp"]),c=["video/3g2","video/3gp","video/3gpp","video/asf","video/avi","video/dat","video/divx","video/dv","video/f4v","video/flv","video/gif","video/m2ts","video/m4v","video/mkv","video/mod","video/mov","video/mp4","video/mpe","video/mpeg","video/mpeg4","video/mpg","video/mts","video/nsv","video/ogm","video/ogv","video/qt","video/tod","video/ts","video/vob","video/wmv"],l=r.concat(["image/gif","image/heic","image/heif","image/webp","image/avif"]),p=["video/webm","video/quicktime","video/ogg"],d=r.concat(["image/gif","image/jpe","image/tif","image/tiff","image/webp"]),u=[n,"video/avi","video/mpg","video/mpeg","video/m4v"];r.concat([a,i,n]),r.concat([a,i]),o.concat([i,...c]),r.concat([a,n,i]),r.concat([a,i]),l.concat([...p,a,i]),d.concat([...u,a,i]),new Set([...r,...o,...l,...c,...p,"image/png","image/jpeg","image/jpg","image/heic","image/heif","image/webp"])},71806:(e,t,s)=>{"use strict";s.d(t,{R:()=>o});var a=s(9818),n=s(12238),i=s(69307),r=s(42032);function o(){const{editPost:e}=(0,a.useDispatch)(n.store),t=(0,a.useSelect)((e=>{const t=e(n.store).getEditedPostAttribute("meta")||{},s=t.jetpack_publicize_feature_enabled??!0,a=t.jetpack_social_options||{};return{isPublicizeEnabled:s,jetpackSocialOptions:a,attachedMedia:a.attached_media||[],imageGeneratorSettings:a.image_generator_settings??{enabled:!1},isPostAlreadyShared:t.jetpack_social_post_already_shared??!1,shareMessage:`${t.jetpack_publicize_message||""}`.substring(0,(0,r.getShareMessageMaxLength)()),shouldUploadAttachedMedia:a.should_upload_attached_media??!1}}),[]),s=(0,i.useCallback)(((t,s)=>{e({meta:{[t]:s}})}),[e]),o=(0,i.useCallback)((()=>{s("jetpack_publicize_feature_enabled",!t.isPublicizeEnabled)}),[t.isPublicizeEnabled,s]),c=(0,i.useCallback)(((e,a)=>{s("jetpack_social_options",{...t.jetpackSocialOptions,[e]:a})}),[t.jetpackSocialOptions,s]);return(0,i.useMemo)((()=>({...t,togglePublicizeFeature:o,updateJetpackSocialOptions:c,updateMeta:s})),[t,o,c,s])}},14085:(e,t,s)=>{"use strict";s(13419),s(9818),s(12238),s(71806)},6230:(e,t,s)=>{"use strict";s(9818),s(69307),s(23177)},96672:(e,t,s)=>{"use strict";s(94333),s(69307),s(37568)},86419:(e,t,s)=>{"use strict";s(94333),s(9818),s(12238),s(69307)},34431:(e,t,s)=>{"use strict";s(9818),s(65736),s(23177)},45579:(e,t,s)=>{"use strict";s(13419),s(86989),s(9818),s(12238),s(69307),s(65736),s(37568),s(48751)},37568:(e,t,s)=>{"use strict";s(9818),s(23177)},48751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var a=s(42032),n=s(71806);function i(){const{updateMeta:e,shareMessage:t}=(0,n.R)();return{message:t,maxLength:(0,a.getShareMessageMaxLength)(),updateMessage:function(t){e("jetpack_publicize_message",t)}}}},19890:(e,t,s)=>{"use strict";s(9818),s(12238),s(23177),s(86419)},21052:(e,t,s)=>{"use strict";s.d(t,{Au:()=>c,Wh:()=>l,ZP:()=>p,hi:()=>o,wO:()=>r});var a=s(9818),n=s(23177),i=s(4957);const r="SET_AUTO_CONVERSION_SETTINGS";function o(){return l({isUpdating:!0})}function c(){return l({isUpdating:!1})}function l(e){return{type:r,options:e}}const p={updateAutoConversionSettings:function*(e){try{yield o(),yield l(e),yield(0,i.Fl)(e);const t=yield(0,i.wi)();return yield l(t.jetpack_social_autoconvert_images),!0}catch(e){const t=(0,a.select)(n.Eg).getAutoConversionSettings();return yield l(t),!1}finally{yield c()}},setAutoConversionSettings:l,refreshAutoConversionSettings:function*(){try{yield o();const e=yield(0,i.wi)();return yield l(e.jetpack_social_autoconvert_images),!0}catch(e){return!1}finally{yield c()}}}},23013:(e,t,s)=>{"use strict";s.r(t),s.d(t,{mergeConnections:()=>p,refreshConnectionTestResults:()=>d,setConnections:()=>c,syncConnectionsToPostMeta:()=>u,toggleConnection:()=>l,toggleConnectionById:()=>m});var a=s(13419),n=s(86989),i=s.n(n),r=s(12238),o=s(74442);function c(e){return{type:o.b,connections:e}}function l(e){return{type:o.L,connectionId:e}}function p(e){return function({dispatch:t,select:s}){const a=s.getConnections(),n=[],i={done:!1,enabled:Boolean(s.numberOfSharesRemaining()),toggleable:!0};for(const t of e){const e={...i,...a.find((e=>e.connection_id?e.connection_id===t.connection_id:e.id===t.id)),...t,is_healthy:t.test_success};n.push(e)}t(c(n))}}function d(e=!1){return async function({dispatch:t}){try{const s=(0,a.Pb)()?.social?.connectionRefreshPath||"/wpcom/v2/publicize/connection-test-results";t(p(await i()({path:s}))),e&&t(u())}catch(e){}}}function u(){return function({registry:e,select:t}){const s=t.getConnections();return e.dispatch(r.store).editPost({jetpack_publicize_connections:s})}}function m(e,t=!0){return function({dispatch:s}){s(l(e)),t&&s(u())}}},74442:(e,t,s)=>{"use strict";s.d(t,{L:()=>n,b:()=>a});const a="SET_CONNECTIONS",n="TOGGLE_CONNECTION"},54725:(e,t,s)=>{"use strict";s.d(t,{Z:()=>c});var a=s(21052),n=s(23013),i=s(371),r=s(72438),o=s(4462);const c={...i.ZP,...o.ZP,...a.ZP,...r.Z,...n}},371:(e,t,s)=>{"use strict";s.d(t,{ZP:()=>c,dz:()=>r,ff:()=>o});var a=s(9818),n=s(23177),i=s(4957);const r="SET_JETPACK_SETTINGS";function o(e){return{type:r,options:e}}const c={updateJetpackSettings:function*(e){try{yield o({is_updating:!0}),yield o(e),yield(0,i.RF)(e);const t=yield(0,i.es)();return yield o(t),!0}catch(e){const t=(0,a.select)(n.Eg).getJetpackSettings();return yield o(t),!1}finally{yield o({is_updating:!1})}},setJetpackSettings:o}},72438:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});var a=s(4957),n=s(21052),i=s(4462);const r={refreshJetpackSocialSettings:function*(){try{yield(0,n.hi)(),yield(0,i.ds)();const e=yield(0,a.mu)();return yield(0,n.Wh)(e.jetpack_social_autoconvert_images),yield(0,i.ch)(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield(0,n.Au)(),yield(0,i.Gr)()}}}},4462:(e,t,s)=>{"use strict";s.d(t,{Gr:()=>c,ZP:()=>p,ch:()=>l,ds:()=>o,kg:()=>r});var a=s(9818),n=s(23177),i=s(4957);const r="SET_SOCIAL_IMAGE_GENERATOR_SETTINGS";function o(){return l({isUpdating:!0})}function c(){return l({isUpdating:!1})}function l(e){return{type:r,options:e}}const p={updateSocialImageGeneratorSettings:function*(e){try{yield o(),yield l(e),yield(0,i.Ux)(e);const t=yield(0,i.oB)();return yield l(t.jetpack_social_image_generator_settings),!0}catch(e){const t=(0,a.select)(n.Eg).getSocialImageGeneratorSettings();return yield l(t),!1}finally{yield c()}},setSocialImageGeneratorSettings:l,refreshSocialImageGeneratorSettings:function*(){try{yield o();const e=yield(0,i.oB)();return yield l(e.jetpack_social_image_generator_settings),!0}catch(e){return!1}finally{yield c()}}}},4957:(e,t,s)=>{"use strict";s.d(t,{Fl:()=>v,RF:()=>m,Ux:()=>g,ZP:()=>E,es:()=>u,mu:()=>f,oB:()=>h,wi:()=>k});var a=s(86989),n=s.n(a);const i="FETCH_JETPACK_SETTINGS",r="UPDATE_JETPACK_SETTINGS",o="FETCH_SOCIAL_IMAGE_GENERATOR_SETTINGS",c="UPDATE_SOCIAL_IMAGE_GENERATOR_SETTINGS",l="FETCH_AUTO_CONVERSION_SETTINGS",p="UPDATE_AUTO_CONVERSION_SETTINGS",d="FETCH_JETPACK_SOCIAL_SETTINGS",u=()=>({type:i}),m=e=>({type:r,settings:e}),h=()=>({type:o}),g=e=>({type:c,settings:e}),k=()=>({type:l}),f=()=>({type:d}),v=e=>({type:p,settings:e}),E={[i]:function(){return n()({path:"/jetpack/v4/social/settings"})},[r]:function(e){return n()({path:"/jetpack/v4/social/settings",method:"POST",data:e.settings})},[o]:function(){return n()({path:"/wp/v2/settings?_fields=jetpack_social_image_generator_settings"})},[c]:function(e){return n()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_image_generator_settings:e.settings}})},[l]:function(){return n()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images"})},[p]:function(e){return n()({path:"/wp/v2/settings",method:"POST",data:{jetpack_social_autoconvert_images:e.settings}})},[d]:function(){return n()({path:"/wp/v2/settings?_fields=jetpack_social_autoconvert_images,jetpack_social_image_generator_settings"})}}},23177:(e,t,s)=>{"use strict";s.d(t,{Eg:()=>l,uJ:()=>d});var a=s(9818),n=s(54725),i=s(4957),r=s(45272),o=s(15781),c=s(22987);const l="jetpack-social-plugin",p={reducer:r.Z,actions:n.Z,selectors:c.Z,resolvers:o.ZP,controls:i.ZP,initialState:window?.jetpackSocialInitialState||window?.Initial_State?.socialInitialState||window?.Jetpack_Editor_Initial_State?.social||{}},d="facebook",u=(0,a.createReduxStore)(l,p);(0,a.register)(u)},20750:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(21052);const n=(e={},t)=>t.type===a.wO?{...e,...t.options}:e},71837:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(74442);const n=(e={},t)=>{switch(t.type){case a.b:return{...e,connections:t.connections};case a.L:return{...e,connections:e.connections.map((e=>(e.connection_id?e.connection_id===t.connectionId:e.id===t.connectionId)?{...e,enabled:!e.enabled}:e))}}return e}},45272:(e,t,s)=>{"use strict";s.d(t,{Z:()=>p});var a=s(9818),n=s(20750),i=s(71837),r=s(80697),o=s(35652),c=s(28696),l=s(54489);const p=(0,a.combineReducers)({sharesData:o.Z,siteData:c.Z,connectionData:i.Z,jetpackSettings:r.Z,socialImageGeneratorSettings:l.Z,autoConversionSettings:n.Z,hasPaidPlan:(e=!1)=>e})},80697:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(371);const n=(e={},t)=>t.type===a.dz?{...e,...t.options}:e},35652:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a=(e={})=>e},28696:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a=(e={})=>e},54489:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(4462);const n=(e={},t)=>t.type===a.kg?{...e,...t.options}:e},15781:(e,t,s)=>{"use strict";s.d(t,{ZP:()=>l});var a=s(12238),n=s(21052),i=s(23013),r=s(371),o=s(4462),c=s(4957);const l={getJetpackSettings:function*(){try{const e=yield(0,c.es)();if(e)return(0,r.ff)(e)}catch(e){console.log(e)}},getSocialImageGeneratorSettings:function*(){try{const e=yield(0,c.oB)();if(e)return(0,o.ch)(e.jetpack_social_image_generator_settings)}catch(e){console.log(e)}},getAutoConversionSettings:function*(){try{const e=yield(0,c.wi)();if(e)return(0,n.Wh)(e.jetpack_social_autoconvert_images)}catch(e){console.log(e)}},getConnections:function(){return function({dispatch:e,registry:t}){const s=t.select(a.store).getEditedPostAttribute("jetpack_publicize_connections");e((0,i.setConnections)(s||[]))}}}},68113:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getAutoConversionSettings:e=>e.autoConversionSettings,isAutoConversionAvailable:e=>e.autoConversionSettings.available,isAutoConversionEnabled:e=>e.autoConversionSettings.available&&e.autoConversionSettings.enabled,isAutoConversionSettingsUpdating:e=>e.autoConversionSettings.isUpdating}},43354:(e,t,s)=>{"use strict";function a(e){return e.connectionData?.connections??[]}function n(e){return e.connectionData?.adminUrl??null}function i(e){return a(e).length>0}function r(e){return a(e).filter((e=>!1===e.test_success))}function o(e){return a(e).filter((e=>"must_reauth"===e.test_success)).map((e=>e.service_name))}function c(e){return a(e).filter((e=>e.enabled))}function l(e){return a(e).filter((e=>!e.enabled))}function p(e,t,{forceDefaults:s=!1}={}){let n="",i="",r="";if(!s){const s=a(e).find((({service_name:e})=>t===e));if(s){const{display_name:e,profile_display_name:a,profile_picture:o}=s;n="twitter"===t?a:e,r="twitter"===t?e:s.username,i=o}}return{displayName:n,profileImage:i,username:r}}s.r(t),s.d(t,{getConnectionProfileDetails:()=>p,getConnections:()=>a,getConnectionsAdminUrl:()=>n,getDisabledConnections:()=>l,getEnabledConnections:()=>c,getFailedConnections:()=>r,getMustReauthConnections:()=>o,hasConnections:()=>i})},22987:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(68113),n=s(43354),i=s(82836),r=s(31473),o=s(85675),c=s(45073);const l={...o.Z,...n,...i.Z,...r,...c.Z,...a.Z}},82836:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getJetpackSettings:e=>e.jetpackSettings,isModuleEnabled:e=>e.jetpackSettings.publicize_active,showPricingPage:e=>e.jetpackSettings.show_pricing_page,isUpdatingJetpackSettings:e=>e.jetpackSettings.is_updating,hasPaidPlan:e=>!(e.jetpackSettings?.showNudge??1),isEnhancedPublishingEnabled:e=>e.jetpackSettings?.isEnhancedPublishingEnabled??!1,getDismissedNotices:e=>e.jetpackSettings?.dismissedNotices}},31473:(e,t,s)=>{"use strict";s.r(t),s.d(t,{getScheduledSharesCount:()=>c,getShareLimit:()=>r,getSharedPostsCount:()=>p,getSharesUsedCount:()=>o,getTotalSharesCount:()=>l,isShareLimitEnabled:()=>n,numberOfSharesRemaining:()=>u,shouldShowAdvancedPlanNudge:()=>d,showShareLimits:()=>i});var a=s(82836);function n(e){return e.sharesData?.is_share_limit_enabled??!1}function i(e){return!a.Z.hasPaidPlan(e)&&!e.hasPaidPlan&&n(e)}function r(e){return e.sharesData?.share_limit??30}function o(e){return e.sharesData?.publicized_count??0}function c(e){return e.sharesData?.to_be_publicized_count??0}function l(e){const t=o(e)+c(e);return Math.max(t,0)}function p(e){return e.sharesData?.shared_posts_count??0}function d(e){return e.sharesData?.show_advanced_plan_upgrade_nudge??!1}function u(e,t={}){if(!i(e))return 1/0;const{includeScheduled:s}={includeScheduled:!0,...t},a=o(e),n=r(e),l=s?c(e):0;return Math.max(n-a-l,0)}},85675:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getAdminUrl:e=>e.siteData?.adminUrl??null,getAPIRootUrl:e=>e.siteData?.apiRoot??null,getAPINonce:e=>e.siteData?.apiNonce??null,getRegistrationNonce:e=>e.siteData?.registrationNonce??null,getSiteSuffix:e=>e.siteData?.siteSuffix??null,getBlogID:e=>e.siteData?.blogID??null,getPluginVersion:e=>e.siteData?.pluginVersion??null}},45073:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});const a={getSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings,isSocialImageGeneratorAvailable:e=>e.socialImageGeneratorSettings.available,isSocialImageGeneratorEnabled:e=>e.socialImageGeneratorSettings.enabled,isUpdatingSocialImageGeneratorSettings:e=>e.socialImageGeneratorSettings.isUpdating,getSocialImageGeneratorDefaultTemplate:e=>e.socialImageGeneratorSettings.template}},5463:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});const a=255;function n(){return a}},12677:(e,t,s)=>{"use strict";s(13419)},42032:(e,t,s)=>{"use strict";s.d(t,{getShareMessageMaxLength:()=>a.A});var a=s(5463);s(12677)},13419:(e,t,s)=>{"use strict";s.d(t,{Pb:()=>a.Z,lQ:()=>n.Z});var a=s(50148),n=s(35004);s(76714),s(80354),s(75404),s(61053),s(11380),s(6342),s(96959),s(39058)},6342:(e,t,s)=>{"use strict";s(99196)},96959:(e,t,s)=>{"use strict";s(69307)},50148:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});const a="Jetpack_Editor_Initial_State";function n(){return"object"==typeof window?window?.[a]??null:null}},35004:(e,t,s)=>{"use strict";function a(){return window&&window.Jetpack_Editor_Initial_State&&window.Jetpack_Editor_Initial_State.siteFragment?window.Jetpack_Editor_Initial_State.siteFragment:null}s.d(t,{Z:()=>a})},61053:(e,t,s)=>{"use strict";var a=s(6975);s(69307);const{tracks:n}=a.Z,{recordEvent:i}=n},11380:(e,t,s)=>{"use strict";s(9818),s(69307),s(39058)},44166:(e,t,s)=>{"use strict";s.d(t,{ZP:()=>u,rW:()=>d});var a=s(9818),n=s(99505),i=s(82162),r=s(39058);const o="SET_JETPACK_MODULES",c="SET_MODULE_UPDATING";function l(e){return d({isLoading:e})}function p(e,t){return{type:c,name:e,isUpdating:t}}function d(e){return{type:o,options:e}}const u={updateJetpackModuleStatus:function*(e){try{yield p(e.name,!0),yield(0,i.zL)(e);const t=yield(0,i.Bs)();return yield d({data:t}),!0}catch(e){const t=(0,a.select)(r.p).getJetpackModules();return yield d(t),!1}finally{yield p(e.name,!1)}},setJetpackModules:d,fetchModules:function*(){if((0,n.Wp)())return!0;try{yield l(!0);const e=yield(0,i.Bs)();return yield d({data:e}),!0}catch(e){const t=(0,a.select)(r.p).getJetpackModules();return yield d(t),!1}finally{yield l(!1)}}}},82162:(e,t,s)=>{"use strict";s.d(t,{Bs:()=>o,ZP:()=>l,zL:()=>c});var a=s(86989),n=s.n(a);const i="FETCH_JETPACK_MODULES",r="UPDATE_JETPACK_MODULE_STATUS",o=()=>({type:i}),c=e=>({type:r,settings:e}),l={[i]:function(){return n()({path:"/jetpack/v4/module/all",method:"GET"})},[r]:function({settings:e}){return n()({path:`/jetpack/v4/module/${e.name}/active`,method:"POST",data:{active:e.active}})}}},39058:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});var a=s(9818),n=s(44166),i=s(82162),r=s(42469),o=s(55133),c=s(43524);const l="jetpack-modules",p=(0,a.createReduxStore)(l,{reducer:r.Z,actions:n.ZP,controls:i.ZP,resolvers:o.Z,selectors:c.Z});(0,a.register)(p);const d=window?.Initial_State?.getModules||window?.Jetpack_Editor_Initial_State?.modules||null;null!==d&&(0,a.dispatch)(l).setJetpackModules({data:{...d}})},42469:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});const a={isLoading:!1,isUpdating:{},data:{}},n=(e=a,t)=>{switch(t.type){case"SET_JETPACK_MODULES":return{...e,...t.options};case"SET_MODULE_UPDATING":return{...e,isUpdating:{...e.isUpdating,[t.name]:t.isUpdating}}}return e}},55133:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var a=s(44166),n=s(82162);const i={getJetpackModules:function*(){try{const e=yield(0,n.Bs)();if(e)return(0,a.rW)({data:e})}catch(e){console.error(e)}}}},43524:(e,t,s)=>{"use strict";s.d(t,{Z:()=>n});var a=s(99505);const n={getJetpackModules:e=>e.data,isModuleActive:(e,t)=>(0,a.Wp)()||(e?.data?.[t]?.activated??!1),areModulesLoading:e=>e.isLoading??!1,isModuleUpdating:(e,t)=>e?.isUpdating?.[t]??!1}},75404:(e,t,s)=>{"use strict";var a=s(65736);s(96483),s(92819);const __=a.__;__("Upgrade your plan to use video covers","jetpack"),__("Upgrade your plan to upload audio","jetpack")},76714:(e,t,s)=>{"use strict";s(98817)},99505:(e,t,s)=>{"use strict";function a(){return"object"==typeof window&&"string"==typeof window._currentSiteType?window._currentSiteType:null}function n(){return"simple"===a()}s.d(t,{Wp:()=>n})},80354:(e,t,s)=>{"use strict";s(82674),s(94333)},4341:(e,t,s)=>{"use strict";s.d(t,{Z:()=>f});var a=s(6895),n=s(65736),i=s(65235),r=s.n(i),o=s(85799),c=s(43255),l=s(84069),p=s(25162),d=s.n(p),u=s(99196),m=s.n(u),h=s(59309),g=s(96300);const __=n.__;class k extends u.Component{static propTypes={inOfflineMode:d().bool.isRequired,siteRawUrl:d().string.isRequired};static defaultProps={inOfflineMode:!1,siteRawUrl:""};trackActivityClick=()=>{l.Z.tracks.recordJetpackClick({type:"activity-link",target:"at-a-glance",feature:"activity-log"})};render(){const{inOfflineMode:e}=this.props,t=__("Jetpack keeps a complete record of everything that happens on your site, taking the guesswork out of site management, debugging, and repair.","jetpack");return m().createElement("div",{className:"jp-dash-item__interior"},m().createElement(c.Z,{label:__("Activity","jetpack"),isModule:!1,className:r()({"jp-dash-item__is-inactive":e}),pro:!1},m().createElement("p",{className:"jp-dash-item__description"},e?__("Unavailable in Offline Mode.","jetpack"):t)),m().createElement(o.Z,{key:"view-activity",className:"jp-dash-item__manage-in-wpcom",compact:!0,href:(0,a.Z)("calypso-activity-log",{site:this.props.siteRawUrl}),target:"_blank",rel:"noopener noreferrer",onClick:this.trackActivityClick},__("View site activity","jetpack")))}}const f=(0,h.$j)((e=>({inOfflineMode:(0,g.Ex)(e)})))(k)},91248:(e,t,s)=>{"use strict";s.d(t,{Z:()=>T});var a=s(82674),n=s.n(a),i=s(64743),r=s(52947),o=s(69307),c=s(65736),l=s(97506),p=s(85799),d=s(43255),u=s(11020),m=s(41549),h=s(85733),g=s(84069),k=s(59584),f=s(92819),v=s(1137),E=s(25162),w=s.n(E),_=s(99196),b=s.n(_),y=s(59309),C=s(17296),j=s(96300),S=s(69508),N=s(33002);const __=c.__,_x=c._x;class x extends _.Component{static propTypes={siteRawUrl:w().string.isRequired,siteAdminUrl:w().string.isRequired,trackUpgradeButtonView:w().func,akismetData:w().oneOfType([w().string,w().object,w().number]).isRequired,isOfflineMode:w().bool.isRequired,upgradeUrl:w().string.isRequired,hasConnectedOwner:w().bool.isRequired};static defaultProps={siteRawUrl:"",siteAdminUrl:"",akismetData:"N/A",isOfflineMode:"",trackUpgradeButtonView:f.noop};trackActivateClick(){g.Z.tracks.recordJetpackClick({type:"activate-link",target:"at-a-glance",feature:"anti-spam"})}onActivateClick=()=>(this.trackActivateClick(),this.props.createNotice("is-info",__("Activating Akismet…","jetpack"),{id:"activating-akismet"}),i.ZP.activateAkismet().then((()=>{this.props.removeNotice("activating-akismet"),window.location.href=this.props.siteAdminUrl+"admin.php?page=akismet-key-config"})).catch((()=>{this.props.removeNotice("activating-akismet"),this.props.createNotice("is-error",__("Could not activate Akismet.","jetpack"),{id:"activate-akismet-failure"})})),!1);trackModerateClick(){g.Z.tracks.recordJetpackClick({type:"moderate-link",target:"at-a-glance",feature:"anti-spam"})}onModerateClick=()=>{this.trackModerateClick()};getContent(){const{akismetData:e,siteAdminUrl:t}=this.props,s=__("Akismet Anti-spam","jetpack"),a={text:__("Comments and contact form submissions are checked against our global database of spam.","jetpack"),link:this.props.isAtomicSite?null:"https://akismet.com/features",privacyLink:"https://automattic.com/privacy/"},i=()=>{let s;return"not_active"===e?s=(0,o.createInterpolateElement)(__("Already have an API key? .","jetpack"),{Button:b().createElement(l.Z,{className:"jp-link-button",onClick:this.onActivateClick})}):"invalid_key"===e&&(s=(0,o.createInterpolateElement)(__("Already have an API key? Get started.","jetpack"),{a:b().createElement("a",{href:t+"admin.php?page=akismet-key-config"})})),b().createElement(h.ZP,{callToAction:_x("Upgrade","Call to action to buy a new plan","jetpack"),title:__("Automatically clear spam from comments and forms.","jetpack"),description:s,disableHref:"false",href:this.props.upgradeUrl,eventFeature:"akismet",path:"dashboard",plan:(0,k.o2o)(k.V37),trackBannerDisplay:this.props.trackUpgradeButtonView,noIcon:!0})},c=()=>b().createElement(h.ZP,{callToAction:__("Connect","jetpack"),title:__("Connect your WordPress.com account to upgrade and automatically clear spam from comments and forms","jetpack"),disableHref:"false",onClick:this.props.connectUser,eventFeature:"akismet",path:"dashboard",plan:(0,k.o2o)(k.V37)}),u=()=>this.props.hasConnectedOwner?i():c();if("N/A"===e)return b().createElement(d.Z,{label:s,module:"akismet",support:a,pro:!0},b().createElement("p",{className:"jp-dash-item__description"},__("Loading…","jetpack")));if(["not_installed","not_active","invalid_key"].includes(e)){const e={label:s,module:"akismet",support:a,className:"jp-dash-item__is-inactive",pro:!0};return this.props.hasAntiSpam||this.props.hasAkismet?b().createElement(d.Z,e,__("Your Jetpack plan provides anti-spam protection through Akismet. Click 'set up' to enable it on your site.","jetpack")):this.props.isOfflineMode?b().createElement(d.Z,e,b().createElement("p",{className:"jp-dash-item__description"},__("Unavailable in Offline Mode.","jetpack"))):b().createElement(d.Z,n()({},e,{overrideContent:u()}))}return[b().createElement(d.Z,{key:"comment-moderation",label:s,module:"akismet",support:a,status:"is-working",pro:!0},(()=>0!==this.props.akismetData?b().createElement(b().Fragment,null,b().createElement("h2",{className:"jp-dash-item__count"},(0,r.Z)(this.props.akismetData)),b().createElement("p",{className:"jp-dash-item__description"},_x("Spam comments blocked.",'Example: "412 Spam comments blocked"',"jetpack"))):b().createElement("div",{className:"jp-dash-item__recently-activated"},b().createElement("p",{className:"jp-dash-item__description"},__("Akismet is now monitoring all comments on your site. Data will display here soon!","jetpack"))))()),!this.props.isOfflineMode&&b().createElement(p.Z,{key:"moderate-comments",className:"jp-dash-item__manage-in-wpcom",compact:!0,href:`${this.props.siteAdminUrl}edit-comments.php`,onClick:this.onModerateClick},__("Moderate comments","jetpack"))]}render(){return b().createElement("div",{className:"jp-dash-item__interior"},b().createElement(u.Z,null),this.getContent())}}const T=(0,y.$j)((e=>({akismetData:(0,C.fU)(e),isAtomicSite:(0,S.Ug)(e),isOfflineMode:(0,j.Ex)(e),upgradeUrl:(0,v.z)(e,"akismet"),nonce:(0,S.VY)(e),hasConnectedOwner:(0,j.it)(e),hasAntiSpam:(0,N.CV)(e,"antispam"),hasAkismet:(0,N.CV)(e,"akismet")})),(e=>({createNotice:m.iI,removeNotice:m.qq,connectUser:()=>e((0,j.bL)())})))(x)},83326:(e,t,s)=>{"use strict";s.d(t,{Z:()=>u});var a=s(80800),n=s(65736),i=s(97506),r=s(85799),o=s(84069),c=s(99196),l=s.n(c),p=s(59309),d=s(3230);const __=n.__,u=(0,p.$j)((e=>({isDismissed:(0,d.wS)(e)})),(e=>({dismiss:()=>e((0,d.VP)({dismiss_dash_backup_getting_started:!0}))})))((({isDismissed:e,dismiss:t})=>{const s=(0,c.useCallback)((()=>{t(),o.Z.tracks.recordEvent("jetpack_backup_getting_started_video_dismiss",{position:"at_a_glance"})}),[t]),n=(0,c.useCallback)((()=>{o.Z.tracks.recordEvent("jetpack_backup_getting_started_video_click",{position:"at_a_glance"})}),[]);return e?null:l().createElement(r.Z,{className:"dash-backup-getting-started"},l().createElement(i.Z,{borderless:!0,compact:!0,className:"dash-backup-getting-started__dismiss",onClick:s},l().createElement("span",{className:"dashicons dashicons-no"})),l().createElement("a",{href:a.zh,target:"_blank",rel:"noreferrer"},l().createElement("img",{className:"dash-backup-getting-started__thumbnail",src:a.hp+"backup-getting-started-thumbnail.png",srcSet:`${a.hp+"backup-getting-started-thumbnail.png"} 1x, ${a.hp+"backup-getting-started-thumbnail-2x.png"} 2x`,alt:""})),l().createElement("div",{className:"dash-backup-getting-started__content"},l().createElement("h3",{className:"dash-backup-getting-started__header"},__("Getting started with Jetpack Backup","jetpack")),l().createElement("p",{className:"dash-backup-getting-started__text"},__("A short video guide on how to back up your website","jetpack"))),l().createElement(i.Z,{className:"dash-backup-getting-started__cta",href:a.zh,onClick:n,target:"_blank",rel:"noreferrer",compact:!0,primary:!0},__("Watch the video","jetpack")))}))},30647:(e,t,s)=>{"use strict";s.d(t,{v:()=>p});var a=s(43521),n=s(65736),i=s(85799),r=s(84069),o=s(99196),c=s.n(o),l=s(49890);const __=n.__,p=({comments:e,plugins:t,posts:s,onClosePopup:n})=>{const p=(0,o.useRef)(!1);(0,o.useEffect)((()=>{p.current||(r.Z.tracks.recordEvent("jetpack_wpa_aag_backup_bar_chart_view",{comments:e,plugins:t,posts:s}),p.current=!0)}),[]);const d=(0,o.useMemo)((()=>[{count:s,label:__("Posts","jetpack"),backgroundColor:"#00BA37"},{count:t,label:__("Plugins","jetpack"),backgroundColor:"#3895BA"},{count:e,label:__("Comments","jetpack"),backgroundColor:"#E68B28"}]),[e,t,s]);return c().createElement(i.Z,{className:"jp-dash-upgrade-backup"},c().createElement(l.G,{posts:s,comments:e,onClosePopup:n}),c().createElement(a.Z,{items:d}))}},91498:(e,t,s)=>{"use strict";s.d(t,{Z:()=>l});var a=s(84069),n=s(99196),i=s.n(n),r=s(59309),o=s(17296),c=s(30647);const l=(0,r.$j)((e=>{const t=(0,o.yZ)(e)?.general?.stats;return{comments:t?.comments,plugins:Object.keys((0,o.Fb)(e)).length,posts:t?.posts,isFetchingData:(0,o.vz)(e)||(0,o.F2)(e)}}))((({comments:e,isFetchingData:t,plugins:s,posts:r})=>{const[o,l]=(0,n.useState)(!0),p=(0,n.useCallback)((()=>{const t={comments:e,plugins:s,posts:r,target:"backup_bar_chart_close",type:"dismiss"};a.Z.tracks.recordJetpackClick(t),l(!1)}),[e,s,r]);return!t&&o&&r>20?i().createElement(c.v,{posts:r,comments:e,plugins:s,onClosePopup:p}):null}))},49890:(e,t,s)=>{"use strict";s.d(t,{G:()=>c});var a=s(80800),n=s(65736),i=s(97506),r=s(99196),o=s.n(r);const __=n.__,c=({posts:e,comments:t,onClosePopup:s})=>o().createElement("div",{className:"jp-dash-upgrade-backup__popup"},o().createElement(i.Z,{onClick:s,className:"jp-dash-upgrade-backup__popup-close-icon",compact:!0,borderless:!0},o().createElement("img",{src:a.hp+"/close.svg",alt:__("Close","jetpack")})),o().createElement("img",{className:"jp-dash-upgrade-backup__popup-lock-icon",src:a.hp+"/lock.svg",alt:__("Locked","jetpack")}),o().createElement("p",{className:"jp-dash-upgrade-backup__popup-title"},__("Upgrade to backup","jetpack")),o().createElement("p",null,(0,n.sprintf)(/* translators: 1 number of posts, 2 number of comments */ __("Be sure your %1$d posts, %2$d comments, and more information are safely backed up with Jetpack","jetpack"),e,t)))},92792:(e,t,s)=>{"use strict";s.d(t,{Z:()=>O});var a=s(6895),n=s(55609),i=s(69771),r=s(69307),o=s(65736),c=s(61074),l=s(70157),p=s(97506),d=s(85799),u=s(43255),m=s(75402),h=s(83526),g=s(85733),k=s(84069),f=s(59584),v=s(92819),E=s(1137),w=s(25162),_=s.n(w),b=s(99196),y=s.n(b),C=s(59309),j=s(17296),S=s(96300),N=s(69508),x=s(33002),T=s(61372),M=s(83326),A=s(91498);const __=o.__,_x=o._x,P=e=>y().createElement(u.Z,{label:__("VaultPress Backup","jetpack"),module:e.feature||"backups",support:{text:__("VaultPress Backup allows you to easily restore or download a backup from a specific moment.","jetpack"),link:(0,a.Z)("jetpack-support-backup")},className:e.className+" dash-backups",status:e.status,pro:!0,overrideContent:e.overrideContent},y().createElement("p",{className:"jp-dash-item__description"},e.content));class Z extends b.Component{static propTypes={siteRawUrl:_().string.isRequired,getOptionValue:_().func.isRequired,rewindStatus:_().string.isRequired,rewindStatusReason:_().string.isRequired,trackUpgradeButtonView:_().func,vaultPressData:_().any.isRequired,hasBackups:_().bool.isRequired,hasRealTimeBackups:_().bool.isRequired,isOfflineMode:_().bool.isRequired,isVaultPressInstalled:_().bool.isRequired,isWoA:_().bool.isRequired,upgradeUrl:_().string.isRequired,hasConnectedOwner:_().bool.isRequired,backupUndoEvent:_().any.isRequired};static defaultProps={siteRawUrl:"",getOptionValue:v.noop,vaultPressData:"",isOfflineMode:!1,isVaultPressInstalled:!1,isWoA:!1,rewindStatus:"",trackUpgradeButtonView:v.noop,backupUndoEvent:{}};trackBackupsClick=(e="backups-link")=>function(){k.Z.tracks.recordJetpackClick({type:e,target:"at-a-glance",feature:"backups"})};trackRedeemCouponButtonView=()=>{const{partnerCoupon:e}=this.props;k.Z.tracks.recordEvent("jetpack_wpa_aag_redeem_partner_coupon_button_view",{feature:"backups",coupon_preset:e.preset})};getJetpackBackupBanner(){const{partnerCoupon:e,upgradeUrl:t,siteRawUrl:s,trackUpgradeButtonView:n}=this.props;if(this.props.hasConnectedOwner){if(e&&"jetpack_backup_daily"===e.product.slug){const t=(0,a.Z)("jetpack-plugin-partner-coupon-checkout",{path:e.product.slug,site:s,query:`coupon=${e.coupon_code}`});return y().createElement(g.ZP,{callToAction:__("Redeem","jetpack"),title:(0,o.sprintf)(/* translators: %s: Name of a Jetpack product. */ __("Redeem your coupon and get started with %s for free the first year!","jetpack"),e.product.title),disableHref:"false",href:t,eventFeature:"backups",path:"dashboard",eventProps:{type:"redeem_partner_coupon",coupon_preset:e.preset},plan:(0,f.o2o)(f.N_2),trackBannerDisplay:this.trackRedeemCouponButtonView})}return y().createElement(y().Fragment,null,y().createElement(A.Z,null),y().createElement(g.ZP,{callToAction:_x("Upgrade","Call to action to buy a new plan","jetpack"),title:__("Never worry about losing your site – automatic backups keep your content safe.","jetpack"),disableHref:"false",href:t,eventFeature:"backups",path:"dashboard",plan:(0,f.o2o)(f.N_2),trackBannerDisplay:n}))}return y().createElement(g.ZP,{callToAction:__("Connect","jetpack"),title:__("Connect your WordPress.com account to upgrade and get automatic backups that keep your content safe.","jetpack"),disableHref:"false",onClick:this.props.connectUser,eventFeature:"backups",path:"dashboard",plan:(0,f.o2o)(f.N_2)})}getVPContent(){const{hasBackups:e,isFetchingSite:t,isVaultPressInstalled:s,getOptionValue:n,siteRawUrl:i,vaultPressData:o}=this.props;return n("vaultpress")&&"success"===(0,v.get)(o,"code","")?P({className:"jp-dash-item__is-active",status:"is-working",content:y().createElement("span",null,(0,v.get)(o,"message","")," ",(0,r.createInterpolateElement)(__("View backup details.","jetpack"),{a:y().createElement("a",{href:(0,a.Z)("vaultpress-dashboard"),target:"_blank",rel:"noopener noreferrer"})}))}):t?this.renderLoading():P(e?{className:"jp-dash-item__is-inactive",status:s?"pro-inactive":"pro-uninstalled",content:(0,r.createInterpolateElement)(__("To automatically back up your entire site, please install and activate VaultPress.","jetpack"),{a:y().createElement("a",{href:(0,a.Z)("calypso-plugins-setup",{site:i,query:"only=backups"}),target:"_blank",rel:"noopener noreferrer"})})}:{className:"jp-dash-item__is-inactive",status:"no-pro-uninstalled-or-inactive",overrideContent:this.getJetpackBackupBanner()})}renderManageBackupsLinks(){const{isWoA:e,siteRawUrl:t}=this.props;return y().createElement(d.Z,{compact:!0,key:"manage-backups",className:"jp-dash-item__manage-in-wpcom"},y().createElement("div",{className:"jp-dash-item__action-links"},y().createElement(n.ExternalLink,{href:e?(0,a.Z)("calypso-backups",{site:t}):(0,a.Z)("my-jetpack-manage-backup",{site:t}),target:"_blank",rel:"noopener noreferrer",onClick:this.trackBackupsClick("backups-link")},__("View your site's backups","jetpack")),y().createElement(n.ExternalLink,{href:(0,a.Z)("calypso-activity-log",{site:t,query:"group=rewind"}),target:"_blank",rel:"noopener noreferrer",onClick:this.trackBackupsClick("restore-points-link")},__("View your most recent restore points","jetpack"))))}getRewindContent(){const{hasRealTimeBackups:e,rewindStatus:t,siteRawUrl:s,backupUndoEventLoaded:i}=this.props,o=(e,t,s)=>y().createElement(d.Z,{compact:!0,key:"manage-backups",className:"jp-dash-item__manage-in-wpcom",href:e,target:"_blank",rel:"noopener noreferrer",onClick:this.trackBackupsClick(s)},t),c=e=>P({className:"jp-dash-item__is-active",status:"is-working",feature:"rewind",content:e});switch(t){case"provisioning":return y().createElement(y().Fragment,null,c(__("We are configuring your site's backups.","jetpack")));case"awaiting_credentials":return y().createElement(y().Fragment,null,c(__("Enter your SSH, SFTP or FTP credentials to enable one-click site restores and faster backups","jetpack")),o((0,a.Z)("jetpack-backup-dash-credentials",{site:s}),__("Enter credentials","jetpack"),"enter-credentials-link"));case"active":{if(i)return this.renderUndo();let t=__("We are backing up your site daily.","jetpack");return e&&(t=(0,r.createInterpolateElement)(__("Every change you make will be backed up, in real-time, as you edit your site. Learn More","jetpack"),{ExternalLink:y().createElement(n.ExternalLink,{href:(0,a.Z)("jetpack-blog-realtime-mechanics"),target:"_blank",rel:"noopener noreferrer",onClick:this.trackBackupsClick("realtime-learn-more-link")})})),y().createElement(y().Fragment,null,c(t),this.renderManageBackupsLinks())}}return!1}renderLoading(){return P({className:"",status:"",content:__("Loading…","jetpack")})}renderFromRewindStatus(){return this.props.hasBackups&&"unavailable"===this.props.rewindStatus&&"site_new"===this.props.rewindStatusReason?P({className:"jp-dash-item__is-inactive",status:"pro-inactive",content:__("Your site is new and may still be preparing backup configuration.","jetpack")}):"unavailable"===this.props.rewindStatus||""===this.props.rewindStatus?this.getVPContent():y().createElement("div",{className:"jp-dash-item"},this.getRewindContent())}trackUndoFeatureView(){k.Z.tracks.recordEvent("jetpack_wpa_aag_backup_undo_view")}trackUndoButtonClick(){k.Z.tracks.recordEvent("jetpack_wpa_aag_backup_undo_button_click")}renderUndo(){const{backupUndoEvent:e}=this.props,{activityDate:t,activityTitle:s,activityDescription:n,actorName:o,actorRole:d,actorAvatarUrl:u,undoBackupId:m}=e,h=(0,i.dateI18n)("M jS, g:i a",t),g=y().createElement("div",{className:"dops-card jp-dash-item__card dash-backup-undo"},y().createElement("div",{className:"jp-dash-item__description dash-backup-undo__activity-log"},y().createElement("div",{className:"dash-backup-undo__activity-log-date"},h),y().createElement("div",{className:"dash-backup-undo__activity-log-action"},s),y().createElement("div",{className:"dash-backup-undo__activity-log-description"},n),y().createElement("div",{className:"dash-backup-undo__activity-log-user-meta"},y().createElement("div",{className:"dash-backup-undo__activity-log-user-meta-avatar"},y().createElement("img",{alt:o,src:u??"https://www.gravatar.com/avatar/0?s=96&d=mm",width:"30",height:"30"})),y().createElement("div",{className:"dash-backup-undo__activity-log-user-meta-name"},o,d&&" - "+d))),y().createElement("div",{className:"dash-backup-undo__cta"},(0,r.createInterpolateElement)(__("","jetpack"),{button:y().createElement(p.Z,{href:(0,a.Z)("jetpack-backup-undo-cta",{path:m}),primary:!0,target:"_blank",onClick:this.trackUndoButtonClick}),icon:y().createElement(c.Z,{icon:l.Z})})));return this.trackUndoFeatureView(),y().createElement(y().Fragment,null,P({className:"jp-dash-item__is-active",status:"is-working",feature:"rewind",overrideContent:g}),this.renderManageBackupsLinks())}renderGettingStartedVideo(){return"awaiting_credentials"!==this.props.rewindStatus?null:y().createElement(M.Z,null)}render(){return this.props.showBackups?this.props.isOfflineMode?y().createElement("div",{className:"jp-dash-item__interior"},P({className:"jp-dash-item__is-inactive",status:"no-pro-uninstalled-or-inactive",content:__("Unavailable in Offline Mode.","jetpack")})):(this.props.isFetchingSite&&this.renderLoading(),y().createElement("div",null,y().createElement(h.Z,null),"active"===this.props.rewindStatus&&y().createElement(m.Z,null),this.renderFromRewindStatus(),this.renderGettingStartedVideo())):null}}const O=(0,C.$j)((e=>({vaultPressData:(0,j.XK)(e),isOfflineMode:(0,S.Ex)(e),isVaultPressInstalled:(0,T.P8)(e,"vaultpress/vaultpress.php"),showBackups:(0,N.xR)(e),upgradeUrl:(0,E.z)(e,"backup"),hasConnectedOwner:(0,S.it)(e),isFetchingSite:(0,x._5)(e),hasBackups:(0,x.CV)(e,"backups"),hasRealTimeBackups:(0,x.CV)(e,"real-time-backups"),partnerCoupon:(0,N.DV)(e),isWoA:(0,N.Pw)(e),backupUndoEvent:(0,j.b9)(e),backupUndoEventLoaded:(0,j.O1)(e),backupUndoEventIsFetching:(0,j.Ve)(e)})),(e=>({connectUser:()=>e((0,S.bL)())})))(Z)},96438:(e,t,s)=>{"use strict";s.d(t,{Z:()=>x});var a=s(64743),n=s(60128),i=s(14186),r=s(6895),o=s(55609),c=s(69307),l=s(65736),p=s(65235),d=s.n(p),u=s(42698),m=s(87553),h=s(81114),g=s(84069),k=s(25162),f=s.n(k),v=s(99196),E=s(59309),w=s(96300),_=s(69508),b=s(33002),y=s(61372);const __=l.__,_x=l._x,C="admin.php?page=jetpack-boost",j=["jetpack-boost/jetpack-boost.php","jetpack-boost-dev/jetpack-boost.php"],S="jetpack-boost",N=({siteAdminUrl:e,siteConnectionStatus:t,siteUrl:s,apiRoot:r,apiNonce:o,fetchPluginsData:p,fetchingPluginsData:u,isBoostInstalled:k,isBoostActive:f,hasActiveBoostPurchase:E,latestSpeedScores:w={}})=>{const _="offline"===t,[b,y]=(0,v.useState)(!1),[N,x]=(0,v.useState)(!1),[P,Z]=(0,v.useState)(!1),[O,R]=(0,v.useState)("C"),[L,z]=(0,v.useState)(1),[I,U]=(0,v.useState)(0),[D,V]=(0,v.useState)(0),[B,F]=(0,v.useState)(!1),H=k&&f,J=!(H||_||u||B),q=_x("Boost","The Jetpack Boost product name, without the Jetpack prefix","jetpack"),W=()=>{U(w.scores.mobile),V(w.scores.desktop),R((0,n.yn)(w.scores.mobile,w.scores.desktop)),z($(1e3*w.timestamp))},$=e=>{const t=new Date(e),s=new Date-t;return Math.floor(s/864e5)};(0,v.useEffect)((()=>{w&&$(1e3*w.timestamp)<21?W():(async()=>{if(!_&&!H){y(!0);try{const e=await(0,n.tZ)(!0,r,s,o),t=(0,n.yn)(e.current.mobile,e.current.desktop);R(t),U(e.current.mobile),V(e.current.desktop),z(0),y(!1)}catch(e){g.Z.tracks.recordEvent("jetpack_boost_speed_score_error",{feature:S,position:"at-a-glance",error:e}),w&&w.scores?W():F(!0),y(!1)}}})()}),[]);const K=()=>{switch(O){case"A":return{top:__("A one-second delay in loading times can reduce your site traffic by 10%.","jetpack"),bottom:__("Use Boost’s automated acceleration tools to optimize your performance on the go.","jetpack")};case"B":return{top:__("A one-second improvement in loading times can increase your site traffic by 10%.","jetpack"),bottom:__("Jetpack Boost enhance your site’s performance like top websites, no developer needed.","jetpack")};default:return{top:__("You can lose 10% of your visitors for every additional second your site takes to load.","jetpack"),bottom:__("Make your site blazing fast for free with Boost’s simple dashboard and acceleration tools.","jetpack")}}},G=(0,v.useCallback)((()=>{if(!H)return k?Z(!0):x(!0),g.Z.tracks.recordJetpackClick({target:"boost_instant_tests_install",type:k?"activate":"install",feature:S}),a.ZP.installPlugin(S,"active").then((()=>new Promise((e=>setTimeout(e,2500))))).then((()=>p())).finally((()=>{x(!1),Z(!1)}))}),[p,k,H]);return React.createElement("div",{className:"dash-boost-speed-score"},J?React.createElement(React.Fragment,null,b?React.createElement(h.Z,{className:"dash-boost-speed-score__section-header",label:q}):React.createElement("div",{className:"dash-boost-speed-score__summary"},React.createElement("div",null,React.createElement("span",{className:"dash-boost-speed-score__summary-grade"},(0,l.sprintf)( // translators: %s is the letter grade of the site's speed performance. diff --git a/composer.json b/composer.json index 5b3db8d1e9..fb2bfe3732 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "automattic/jetpack-compat": "^2.0.0", "automattic/jetpack-composer-plugin": "^2.0.0", "automattic/jetpack-config": "^2.0.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-device-detection": "^2.0.1", "automattic/jetpack-error": "^2.0.0", @@ -39,7 +39,7 @@ "automattic/jetpack-my-jetpack": "^4.7.0-alpha", "automattic/jetpack-plugins-installer": "^0.3.1", "automattic/jetpack-post-list": "^0.5.1", - "automattic/jetpack-publicize": "^0.40.0", + "automattic/jetpack-publicize": "^0.41.0-alpha", "automattic/jetpack-redirect": "^2.0.0", "automattic/jetpack-roles": "^2.0.0", "automattic/jetpack-search": "^0.42.0", diff --git a/jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md b/jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md index c02a1aec19..0b6105e7e7 100644 --- a/jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md +++ b/jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.3.0-alpha] - unreleased + +This is an alpha version! The changes listed here are not final. + +### Changed +- Adjust 'get_site_id()' method to return null if there's no blog ID. + ## [2.2.0] - 2024-01-18 ### Added - Adding support for IDC when site URL is an IP address. [#34753] @@ -950,6 +957,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Separate the connection library into its own package. +[2.3.0-alpha]: https://github.com/Automattic/jetpack-connection/compare/v2.2.0...v2.3.0-alpha [2.2.0]: https://github.com/Automattic/jetpack-connection/compare/v2.1.1...v2.2.0 [2.1.1]: https://github.com/Automattic/jetpack-connection/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/Automattic/jetpack-connection/compare/v2.0.3...v2.1.0 diff --git a/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php b/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php index 5096478138..0e7e3258f8 100644 --- a/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php +++ b/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php @@ -12,7 +12,7 @@ */ class Package_Version { - const PACKAGE_VERSION = '2.2.0'; + const PACKAGE_VERSION = '2.3.0-alpha'; const PACKAGE_SLUG = 'connection'; diff --git a/jetpack_vendor/automattic/jetpack-publicize/CHANGELOG.md b/jetpack_vendor/automattic/jetpack-publicize/CHANGELOG.md index bf67590843..1b2b5b1eef 100644 --- a/jetpack_vendor/automattic/jetpack-publicize/CHANGELOG.md +++ b/jetpack_vendor/automattic/jetpack-publicize/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.41.0-alpha] - unreleased + +This is an alpha version! The changes listed here are not final. + +### Changed +- Use Blog ID in links to WPCOM instead of site slug. + ## [0.40.0] - 2024-01-18 ### Changed - Changed dismissed notices endpoint to be a core endpoint [#34544] @@ -458,6 +465,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated package dependencies. - Update package.json metadata. +[0.41.0-alpha]: https://github.com/Automattic/jetpack-publicize/compare/v0.40.0...v0.41.0-alpha [0.40.0]: https://github.com/Automattic/jetpack-publicize/compare/v0.39.0...v0.40.0 [0.39.0]: https://github.com/Automattic/jetpack-publicize/compare/v0.38.3...v0.39.0 [0.38.3]: https://github.com/Automattic/jetpack-publicize/compare/v0.38.2...v0.38.3 diff --git a/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-base.php b/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-base.php index 5ad7774453..6e4a5ec096 100644 --- a/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-base.php +++ b/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-base.php @@ -10,6 +10,7 @@ namespace Automattic\Jetpack\Publicize; use Automattic\Jetpack\Connection\Client; +use Automattic\Jetpack\Connection\Manager as Connection_Manager; use Automattic\Jetpack\Current_Plan; use Automattic\Jetpack\Redirect; use Automattic\Jetpack\Status; @@ -1673,7 +1674,10 @@ protected static function build_sprintf( $args ) { public function publicize_connections_url( $source = 'calypso-marketing-connections' ) { $allowed_sources = array( 'jetpack-social-connections-admin-page', 'jetpack-social-connections-classic-editor', 'calypso-marketing-connections' ); $source = in_array( $source, $allowed_sources, true ) ? $source : 'calypso-marketing-connections'; - return Redirect::get_url( $source, array( 'site' => ( new Status() )->get_site_suffix() ) ); + $blog_id = Connection_Manager::get_site_id( true ); + $site = ( new Status() )->get_site_suffix(); + + return Redirect::get_url( $source, array( 'site' => $blog_id ? $blog_id : $site ) ); } /** diff --git a/jetpack_vendor/i18n-map.php b/jetpack_vendor/i18n-map.php index 13db1f8f5d..51d1b3cb92 100644 --- a/jetpack_vendor/i18n-map.php +++ b/jetpack_vendor/i18n-map.php @@ -38,7 +38,7 @@ ), 'jetpack-connection' => array( 'path' => 'jetpack_vendor/automattic/jetpack-connection', - 'ver' => '2.2.0', + 'ver' => '2.3.0-alpha1706556436', ), 'jetpack-forms' => array( 'path' => 'jetpack_vendor/automattic/jetpack-forms', @@ -90,7 +90,7 @@ ), 'jetpack-publicize-pkg' => array( 'path' => 'jetpack_vendor/automattic/jetpack-publicize', - 'ver' => '0.40.0', + 'ver' => '0.41.0-alpha1706556436', ), 'jetpack-search-pkg' => array( 'path' => 'jetpack_vendor/automattic/jetpack-search', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ee2d30d918..7740e74d19 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -7,7 +7,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-a8c-mc-stats", - "reference": "b6b4961e9767f1c29d309975c49f2f8640bc0651" + "reference": "7a2c3f76c08660fb5a3c510df0c52868f2443cf9" }, "require": { "php": ">=7.0" @@ -60,10 +60,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-abtest", - "reference": "fea9dd5cf01735d368037d5aeecc6c4a30de6464" + "reference": "775159d8ca3156ee465a02553ebadf1eacfa75aa" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-error": "^2.0.0", "php": ">=7.0" }, @@ -122,7 +122,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-admin-ui", - "reference": "cf7686ab98d2cdc01b41dc130ebe4314aabca703" + "reference": "83a8c8f8cdaca5f6de31f7a1b2f1aee57bea033f" }, "require": { "php": ">=7.0" @@ -187,7 +187,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-assets", - "reference": "bf40de81d47c9fc0f4e0b644c332d4572b4a451f" + "reference": "7632f966e3068c701c0f63dc01c5c678a22ca416" }, "require": { "automattic/jetpack-constants": "^2.0.0", @@ -256,7 +256,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-autoloader", - "reference": "cd3064b7040e7e98cd26dc4e1ca003f8f7d1000b" + "reference": "f2af8cdccc30971e9588151eb4659b860ef01b7b" }, "require": { "composer-plugin-api": "^1.1 || ^2.0", @@ -322,7 +322,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-backup", - "reference": "6764ed580f7190cb7b296c5f36b69c409222b84f" + "reference": "b198780cba94d42fe7372bccc6d1d541e8df9133" }, "require": { "automattic/jetpack-admin-ui": "^0.3.2-alpha", @@ -331,7 +331,7 @@ "automattic/jetpack-backup-helper-script-manager": "^0.2.0", "automattic/jetpack-composer-plugin": "^2.0.0", "automattic/jetpack-config": "^2.0.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-identity-crisis": "^0.15.0", "automattic/jetpack-status": "^2.1.0", "automattic/jetpack-sync": "^2.4.2", @@ -412,7 +412,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-backup-helper-script-manager", - "reference": "bdf370be748f1db544c711896315b31660db1a15" + "reference": "42d01f548f1cc228a8aecbcf44b342ec063a417d" }, "require": { "php": ">=7.0" @@ -472,11 +472,11 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-blaze", - "reference": "3a6b80d7528c4b963200d759be38ef72bf3ad173" + "reference": "b53207844f6259478f950e835a0c7ab82478e7a1" }, "require": { "automattic/jetpack-assets": "^2.0.4", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-plans": "^0.4.1", "automattic/jetpack-redirect": "^2.0.0", @@ -553,7 +553,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-blocks", - "reference": "97dcdf45a887c0125d2377e48a5b3ab6cbba7b46" + "reference": "05b86ac96f42d9b260d9fe8e84ab120109eabfc4" }, "require": { "automattic/jetpack-constants": "^2.0.0", @@ -615,7 +615,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-boost-core", - "reference": "77f7f2def1640b001dcbf4604727a57f7278c40c" + "reference": "51b86189b652f5b956a983e545d8f02fc327dafe" }, "require": { "php": ">=7.0" @@ -682,7 +682,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-boost-speed-score", - "reference": "a74a8014b79f8a862cfdde20b13e4a5ddc945dcc" + "reference": "029e327edba50fc6644ba7b68998979dd05e799c" }, "require": { "automattic/jetpack-boost-core": "^0.2.4", @@ -758,7 +758,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-compat", - "reference": "52c814ae703e330df1868a96f9b43deac58e2b47" + "reference": "8920f188350cdd77ba035867571ad680119542b9" }, "require": { "php": ">=7.0" @@ -806,7 +806,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-composer-plugin", - "reference": "d1230c71a0994143e3b0ee3f27bb1ac6080516a9" + "reference": "19897c469f379107587e3bff675122c6fd3c49ac" }, "require": { "composer-plugin-api": "^2.1.0", @@ -866,7 +866,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-config", - "reference": "9886a9de6b01f82ec62d4c755f50156d491c046d" + "reference": "b277a92ea68d4d0f5aecc06223e852c1a747bdb6" }, "require": { "php": ">=7.0" @@ -906,12 +906,12 @@ }, { "name": "automattic/jetpack-connection", - "version": "2.2.0", - "version_normalized": "2.2.0.0", + "version": "2.3.0-alpha.1706556436", + "version_normalized": "2.3.0.0-alpha1706556436", "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-connection", - "reference": "e264b2f0b3c71784846a11a198683e0c40ef7a28" + "reference": "a6fd979f71e3cce28447e07cfdb249ea2cedffdc" }, "require": { "automattic/jetpack-a8c-mc-stats": "^2.0.0", @@ -943,7 +943,7 @@ "link-template": "https://github.com/Automattic/jetpack-connection/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "2.2.x-dev" + "dev-trunk": "2.3.x-dev" } }, "installation-source": "dist", @@ -990,7 +990,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-constants", - "reference": "29d22b1da8374a90dde38f592e6b2a9240ba17e2" + "reference": "513ebe3bb94ebd24d3d1b196ed8754d88ba0d16f" }, "require": { "php": ">=7.0" @@ -1044,7 +1044,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-device-detection", - "reference": "06c350789dc578c877ddf0e5577de9bf4bbf14e6" + "reference": "25906a255b34a9114882c42af28ae6421843ce73" }, "require": { "php": ">=7.0" @@ -1097,7 +1097,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-error", - "reference": "50bb598d5ee6a361dca5f589c341253a2fe3682a" + "reference": "988df12589d88a926c36fa18e84ceac7adab81a2" }, "require": { "php": ">=7.0" @@ -1150,18 +1150,18 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-forms", - "reference": "8d7cb3282508cbc66952913d0305816da1e4e102" + "reference": "4f6ef8fcf17627a0a21cba708f79f7f1a34726b2" }, "require": { "automattic/jetpack-assets": "^2.0.4", "automattic/jetpack-blocks": "^2.0.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-status": "^2.1.0", "php": ">=7.0" }, "require-dev": { "automattic/jetpack-changelogger": "^4.1.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/wordbless": "^0.4.1", "yoast/phpunit-polyfills": "1.1.0" }, @@ -1232,7 +1232,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-google-fonts-provider", - "reference": "4a09e5fff6523aaf6f440c6d3fc063bd05e8f803" + "reference": "edd9cb2ade85f46cc6baaa928dd9a8902cbd1729" }, "require": { "php": ">=7.0" @@ -1287,11 +1287,11 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-identity-crisis", - "reference": "6ffcac179738ad72802b0a35688e36c609ba1daa" + "reference": "5e6a5e380dbf525bbf1d2867ef4cf77bbc8db406" }, "require": { "automattic/jetpack-assets": "^2.0.4", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-logo": "^2.0.0", "automattic/jetpack-status": "^2.1.0", @@ -1366,7 +1366,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-image-cdn", - "reference": "350c5e72b55efcd257a7050252013c24bae79ffe" + "reference": "c2d7c87c6c0f20f9e658b2dae651e572c55a6a7d" }, "require": { "automattic/jetpack-assets": "^2.0.4", @@ -1438,10 +1438,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-import", - "reference": "bd08cbf9d401d510c40c7410080bc27673dc3cca" + "reference": "4a08c7dbdb43245eed7db4dacf3fcdb6536df2e7" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "php": ">=7.0" }, "require-dev": { @@ -1509,7 +1509,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-ip", - "reference": "08f4019c5267280f82acef88d2ecd1717be3e75c" + "reference": "11c6a614ed2ad2573fff23a0339d1176c571ba58" }, "require": { "php": ">=7.0" @@ -1567,12 +1567,12 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-jitm", - "reference": "9f0e8287e6b71f26f2783acb8e8d284d8e8abefb" + "reference": "1fd5da5fa13ee6d3d3e19442d3832e6bce92203a" }, "require": { "automattic/jetpack-a8c-mc-stats": "^2.0.0", "automattic/jetpack-assets": "^2.0.4", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-device-detection": "^2.0.1", "automattic/jetpack-logo": "^2.0.0", "automattic/jetpack-redirect": "^2.0.0", @@ -1642,10 +1642,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-licensing", - "reference": "edfbae93d390a6d9b3fb78a0564c456093a812a6" + "reference": "f8c9bc657885cb816331c26437e4cddfc8ebb18b" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "php": ">=7.0" }, "require-dev": { @@ -1704,7 +1704,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-logo", - "reference": "185c7efb153fb71135c3a3bdfeb3eaee4be19840" + "reference": "e1fd7626a0bf7580f1641e7458353ffecad78b3b" }, "require": { "php": ">=7.0" @@ -1757,12 +1757,12 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-my-jetpack", - "reference": "f8df63c07de53030f15e5d11dd34834a6963d57d" + "reference": "d0e877af43a5c9a2ae7f17bf5c665995c7d0609f" }, "require": { "automattic/jetpack-admin-ui": "^0.3.2-alpha", "automattic/jetpack-assets": "^2.0.4", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-jitm": "^3.0.2", "automattic/jetpack-licensing": "^2.0.1", @@ -1849,7 +1849,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-password-checker", - "reference": "e60582efbfb2496063674873a1c7422ea0fcd3ee" + "reference": "b9a87b70763a40417d0249b79db6c32fc5fd8e40" }, "require": { "php": ">=7.0" @@ -1910,10 +1910,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-plans", - "reference": "b3f84b02fd2dae82c821af255693a979d957b76d" + "reference": "52f3ced5b9ee8934aa3d04df53a6a1d612a456f7" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "php": ">=7.0" }, "require-dev": { @@ -1978,7 +1978,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-plugins-installer", - "reference": "6b983eeacd742ae9edd307f5970d7b6aaefbbef7" + "reference": "41fd3b8824767862d185d1b4582e3622043dc98d" }, "require": { "automattic/jetpack-a8c-mc-stats": "^2.0.0", @@ -2033,7 +2033,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-post-list", - "reference": "d26082c5e3cee347fd9898d9fbc5b253092961a4" + "reference": "f77ab4f4e8ba4ecdf9f1e8a890d0ab46f603f9db" }, "require": { "automattic/jetpack-assets": "^2.0.4", @@ -2093,18 +2093,18 @@ }, { "name": "automattic/jetpack-publicize", - "version": "0.40.0", - "version_normalized": "0.40.0.0", + "version": "0.41.0-alpha.1706556436", + "version_normalized": "0.41.0.0-alpha1706556436", "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-publicize", - "reference": "f3ae1fa2f3a271a6364df018a99a7d04aba1e38c" + "reference": "6ca5e1d3229db6281178beb69d69fcce11716ebf" }, "require": { "automattic/jetpack-assets": "^2.0.4", "automattic/jetpack-autoloader": "^3.0.2", "automattic/jetpack-config": "^2.0.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-plans": "^0.4.1", "automattic/jetpack-redirect": "^2.0.0", "php": ">=7.0" @@ -2126,7 +2126,7 @@ "link-template": "https://github.com/Automattic/jetpack-publicize/compare/v${old}...v${new}" }, "branch-alias": { - "dev-trunk": "0.40.x-dev" + "dev-trunk": "0.41.x-dev" } }, "installation-source": "dist", @@ -2178,7 +2178,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-redirect", - "reference": "8286516237870641468fc26c607583b6ec5dd371" + "reference": "ec841accf810340d7ae41408d05da90ef2c79b67" }, "require": { "automattic/jetpack-status": "^2.1.0", @@ -2233,7 +2233,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-roles", - "reference": "348324a24c44b720adb33428869dc8346c82f6a5" + "reference": "6b4a31246533a68f70a82a55f777477da4379e8d" }, "require": { "php": ">=7.0" @@ -2287,12 +2287,12 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-search", - "reference": "5345e14941960807d8964534c63f6a96867190d2" + "reference": "98c12531002b465cf6076b8ef39e99598e2f5689" }, "require": { "automattic/jetpack-assets": "^2.0.4", "automattic/jetpack-config": "^2.0.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-my-jetpack": "^4.7.0-alpha", "automattic/jetpack-status": "^2.1.0", @@ -2374,11 +2374,11 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-stats", - "reference": "59e7d83d2db86c8a5328c16538c53b275d6e9189" + "reference": "b14ef861f27d7c52ab03814038a08ae5be190d06" }, "require": { "automattic/jetpack-assets": "^2.0.4", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-status": "^2.1.0", "php": ">=7.0" @@ -2439,10 +2439,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-stats-admin", - "reference": "ebbaa6b006fd9723cd22ced1a690ce1fe21082a9" + "reference": "4242cd96376a1b6753f7151bfa8919c74d204641" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-jitm": "^3.0.2", "automattic/jetpack-plans": "^0.4.1", @@ -2512,7 +2512,7 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-status", - "reference": "0c97f1552422477b1aa0f7c7f954adf8d0da6f2d" + "reference": "21d886333cb1c2b578144a1ae5ae4d29349a2acc" }, "require": { "automattic/jetpack-constants": "^2.0.0", @@ -2568,10 +2568,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-sync", - "reference": "c494246b881961bd9c3f349b79ee1055f1ce5cc7" + "reference": "621abf960946d9f2b1ae7f51a1812578d1ece48a" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-identity-crisis": "^0.15.0", "automattic/jetpack-ip": "^0.2.1", @@ -2639,12 +2639,12 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-videopress", - "reference": "1492e0f4d02d0b49e39b6fabb00a7a33e96bdc2f" + "reference": "cc835cc55e43a3c57972d6154c1cca54603fa1a9" }, "require": { "automattic/jetpack-admin-ui": "^0.3.2-alpha", "automattic/jetpack-assets": "^2.0.4", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-plans": "^0.4.1", "php": ">=7.0" }, @@ -2721,10 +2721,10 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-waf", - "reference": "64e14853bb6fbd49d03431c2b6c4e88206661731" + "reference": "40f2b70e81752297088bebecb721ef57796d8898" }, "require": { - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-ip": "^0.2.1", "automattic/jetpack-status": "^2.1.0", @@ -2795,12 +2795,12 @@ "dist": { "type": "path", "url": "/tmp/jetpack-build/Automattic/jetpack-wordads", - "reference": "90baf6fa48739add3802c36cf4bc1e663e97f76e" + "reference": "077c65c9b6aa9d66486789575b1073b8c176baac" }, "require": { "automattic/jetpack-assets": "^2.0.4", "automattic/jetpack-config": "^2.0.0", - "automattic/jetpack-connection": "^2.2.0", + "automattic/jetpack-connection": "^2.3.0-alpha", "automattic/jetpack-constants": "^2.0.0", "automattic/jetpack-status": "^2.1.0", "php": ">=7.0" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a2328c309e..a02d965758 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -22,7 +22,7 @@ 'automattic/jetpack-a8c-mc-stats' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => 'b6b4961e9767f1c29d309975c49f2f8640bc0651', + 'reference' => '7a2c3f76c08660fb5a3c510df0c52868f2443cf9', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-a8c-mc-stats', 'aliases' => array(), @@ -31,7 +31,7 @@ 'automattic/jetpack-abtest' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => 'fea9dd5cf01735d368037d5aeecc6c4a30de6464', + 'reference' => '775159d8ca3156ee465a02553ebadf1eacfa75aa', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-abtest', 'aliases' => array(), @@ -40,7 +40,7 @@ 'automattic/jetpack-admin-ui' => array( 'pretty_version' => '0.3.2-alpha.1706547209', 'version' => '0.3.2.0-alpha1706547209', - 'reference' => 'cf7686ab98d2cdc01b41dc130ebe4314aabca703', + 'reference' => '83a8c8f8cdaca5f6de31f7a1b2f1aee57bea033f', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-admin-ui', 'aliases' => array(), @@ -49,7 +49,7 @@ 'automattic/jetpack-assets' => array( 'pretty_version' => '2.0.4', 'version' => '2.0.4.0', - 'reference' => 'bf40de81d47c9fc0f4e0b644c332d4572b4a451f', + 'reference' => '7632f966e3068c701c0f63dc01c5c678a22ca416', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-assets', 'aliases' => array(), @@ -58,7 +58,7 @@ 'automattic/jetpack-autoloader' => array( 'pretty_version' => '3.0.2', 'version' => '3.0.2.0', - 'reference' => 'cd3064b7040e7e98cd26dc4e1ca003f8f7d1000b', + 'reference' => 'f2af8cdccc30971e9588151eb4659b860ef01b7b', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../automattic/jetpack-autoloader', 'aliases' => array(), @@ -67,7 +67,7 @@ 'automattic/jetpack-backup' => array( 'pretty_version' => '3.1.0', 'version' => '3.1.0.0', - 'reference' => '6764ed580f7190cb7b296c5f36b69c409222b84f', + 'reference' => 'b198780cba94d42fe7372bccc6d1d541e8df9133', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-backup', 'aliases' => array(), @@ -76,7 +76,7 @@ 'automattic/jetpack-backup-helper-script-manager' => array( 'pretty_version' => '0.2.0', 'version' => '0.2.0.0', - 'reference' => 'bdf370be748f1db544c711896315b31660db1a15', + 'reference' => '42d01f548f1cc228a8aecbcf44b342ec063a417d', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-backup-helper-script-manager', 'aliases' => array(), @@ -85,7 +85,7 @@ 'automattic/jetpack-blaze' => array( 'pretty_version' => '0.15.1', 'version' => '0.15.1.0', - 'reference' => '3a6b80d7528c4b963200d759be38ef72bf3ad173', + 'reference' => 'b53207844f6259478f950e835a0c7ab82478e7a1', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-blaze', 'aliases' => array(), @@ -94,7 +94,7 @@ 'automattic/jetpack-blocks' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '97dcdf45a887c0125d2377e48a5b3ab6cbba7b46', + 'reference' => '05b86ac96f42d9b260d9fe8e84ab120109eabfc4', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-blocks', 'aliases' => array(), @@ -103,7 +103,7 @@ 'automattic/jetpack-boost-core' => array( 'pretty_version' => '0.2.4', 'version' => '0.2.4.0', - 'reference' => '77f7f2def1640b001dcbf4604727a57f7278c40c', + 'reference' => '51b86189b652f5b956a983e545d8f02fc327dafe', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-boost-core', 'aliases' => array(), @@ -112,7 +112,7 @@ 'automattic/jetpack-boost-speed-score' => array( 'pretty_version' => '0.3.3', 'version' => '0.3.3.0', - 'reference' => 'a74a8014b79f8a862cfdde20b13e4a5ddc945dcc', + 'reference' => '029e327edba50fc6644ba7b68998979dd05e799c', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-boost-speed-score', 'aliases' => array(), @@ -121,7 +121,7 @@ 'automattic/jetpack-compat' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '52c814ae703e330df1868a96f9b43deac58e2b47', + 'reference' => '8920f188350cdd77ba035867571ad680119542b9', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-compat', 'aliases' => array(), @@ -130,7 +130,7 @@ 'automattic/jetpack-composer-plugin' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => 'd1230c71a0994143e3b0ee3f27bb1ac6080516a9', + 'reference' => '19897c469f379107587e3bff675122c6fd3c49ac', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../automattic/jetpack-composer-plugin', 'aliases' => array(), @@ -139,16 +139,16 @@ 'automattic/jetpack-config' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '9886a9de6b01f82ec62d4c755f50156d491c046d', + 'reference' => 'b277a92ea68d4d0f5aecc06223e852c1a747bdb6', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-config', 'aliases' => array(), 'dev_requirement' => false, ), 'automattic/jetpack-connection' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'reference' => 'e264b2f0b3c71784846a11a198683e0c40ef7a28', + 'pretty_version' => '2.3.0-alpha.1706556436', + 'version' => '2.3.0.0-alpha1706556436', + 'reference' => 'a6fd979f71e3cce28447e07cfdb249ea2cedffdc', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-connection', 'aliases' => array(), @@ -157,7 +157,7 @@ 'automattic/jetpack-constants' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '29d22b1da8374a90dde38f592e6b2a9240ba17e2', + 'reference' => '513ebe3bb94ebd24d3d1b196ed8754d88ba0d16f', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-constants', 'aliases' => array(), @@ -166,7 +166,7 @@ 'automattic/jetpack-device-detection' => array( 'pretty_version' => '2.0.1', 'version' => '2.0.1.0', - 'reference' => '06c350789dc578c877ddf0e5577de9bf4bbf14e6', + 'reference' => '25906a255b34a9114882c42af28ae6421843ce73', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-device-detection', 'aliases' => array(), @@ -175,7 +175,7 @@ 'automattic/jetpack-error' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '50bb598d5ee6a361dca5f589c341253a2fe3682a', + 'reference' => '988df12589d88a926c36fa18e84ceac7adab81a2', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-error', 'aliases' => array(), @@ -184,7 +184,7 @@ 'automattic/jetpack-forms' => array( 'pretty_version' => '0.30.1', 'version' => '0.30.1.0', - 'reference' => '8d7cb3282508cbc66952913d0305816da1e4e102', + 'reference' => '4f6ef8fcf17627a0a21cba708f79f7f1a34726b2', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-forms', 'aliases' => array(), @@ -193,7 +193,7 @@ 'automattic/jetpack-google-fonts-provider' => array( 'pretty_version' => '0.7.1', 'version' => '0.7.1.0', - 'reference' => '4a09e5fff6523aaf6f440c6d3fc063bd05e8f803', + 'reference' => 'edd9cb2ade85f46cc6baaa928dd9a8902cbd1729', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-google-fonts-provider', 'aliases' => array(), @@ -202,7 +202,7 @@ 'automattic/jetpack-identity-crisis' => array( 'pretty_version' => '0.15.0', 'version' => '0.15.0.0', - 'reference' => '6ffcac179738ad72802b0a35688e36c609ba1daa', + 'reference' => '5e6a5e380dbf525bbf1d2867ef4cf77bbc8db406', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-identity-crisis', 'aliases' => array(), @@ -211,7 +211,7 @@ 'automattic/jetpack-image-cdn' => array( 'pretty_version' => '0.3.2', 'version' => '0.3.2.0', - 'reference' => '350c5e72b55efcd257a7050252013c24bae79ffe', + 'reference' => 'c2d7c87c6c0f20f9e658b2dae651e572c55a6a7d', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-image-cdn', 'aliases' => array(), @@ -220,7 +220,7 @@ 'automattic/jetpack-import' => array( 'pretty_version' => '0.8.1', 'version' => '0.8.1.0', - 'reference' => 'bd08cbf9d401d510c40c7410080bc27673dc3cca', + 'reference' => '4a08c7dbdb43245eed7db4dacf3fcdb6536df2e7', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-import', 'aliases' => array(), @@ -229,7 +229,7 @@ 'automattic/jetpack-ip' => array( 'pretty_version' => '0.2.1', 'version' => '0.2.1.0', - 'reference' => '08f4019c5267280f82acef88d2ecd1717be3e75c', + 'reference' => '11c6a614ed2ad2573fff23a0339d1176c571ba58', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-ip', 'aliases' => array(), @@ -238,7 +238,7 @@ 'automattic/jetpack-jitm' => array( 'pretty_version' => '3.0.2', 'version' => '3.0.2.0', - 'reference' => '9f0e8287e6b71f26f2783acb8e8d284d8e8abefb', + 'reference' => '1fd5da5fa13ee6d3d3e19442d3832e6bce92203a', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-jitm', 'aliases' => array(), @@ -247,7 +247,7 @@ 'automattic/jetpack-licensing' => array( 'pretty_version' => '2.0.1', 'version' => '2.0.1.0', - 'reference' => 'edfbae93d390a6d9b3fb78a0564c456093a812a6', + 'reference' => 'f8c9bc657885cb816331c26437e4cddfc8ebb18b', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-licensing', 'aliases' => array(), @@ -256,7 +256,7 @@ 'automattic/jetpack-logo' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '185c7efb153fb71135c3a3bdfeb3eaee4be19840', + 'reference' => 'e1fd7626a0bf7580f1641e7458353ffecad78b3b', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-logo', 'aliases' => array(), @@ -265,7 +265,7 @@ 'automattic/jetpack-my-jetpack' => array( 'pretty_version' => '4.7.0-alpha.1706309878', 'version' => '4.7.0.0-alpha1706309878', - 'reference' => 'f8df63c07de53030f15e5d11dd34834a6963d57d', + 'reference' => 'd0e877af43a5c9a2ae7f17bf5c665995c7d0609f', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-my-jetpack', 'aliases' => array(), @@ -274,7 +274,7 @@ 'automattic/jetpack-password-checker' => array( 'pretty_version' => '0.3.0', 'version' => '0.3.0.0', - 'reference' => 'e60582efbfb2496063674873a1c7422ea0fcd3ee', + 'reference' => 'b9a87b70763a40417d0249b79db6c32fc5fd8e40', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-password-checker', 'aliases' => array(), @@ -283,7 +283,7 @@ 'automattic/jetpack-plans' => array( 'pretty_version' => '0.4.1', 'version' => '0.4.1.0', - 'reference' => 'b3f84b02fd2dae82c821af255693a979d957b76d', + 'reference' => '52f3ced5b9ee8934aa3d04df53a6a1d612a456f7', 'type' => 'library', 'install_path' => __DIR__ . '/../automattic/jetpack-plans', 'aliases' => array(), @@ -292,7 +292,7 @@ 'automattic/jetpack-plugins-installer' => array( 'pretty_version' => '0.3.1', 'version' => '0.3.1.0', - 'reference' => '6b983eeacd742ae9edd307f5970d7b6aaefbbef7', + 'reference' => '41fd3b8824767862d185d1b4582e3622043dc98d', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-plugins-installer', 'aliases' => array(), @@ -301,16 +301,16 @@ 'automattic/jetpack-post-list' => array( 'pretty_version' => '0.5.1', 'version' => '0.5.1.0', - 'reference' => 'd26082c5e3cee347fd9898d9fbc5b253092961a4', + 'reference' => 'f77ab4f4e8ba4ecdf9f1e8a890d0ab46f603f9db', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-post-list', 'aliases' => array(), 'dev_requirement' => false, ), 'automattic/jetpack-publicize' => array( - 'pretty_version' => '0.40.0', - 'version' => '0.40.0.0', - 'reference' => 'f3ae1fa2f3a271a6364df018a99a7d04aba1e38c', + 'pretty_version' => '0.41.0-alpha.1706556436', + 'version' => '0.41.0.0-alpha1706556436', + 'reference' => '6ca5e1d3229db6281178beb69d69fcce11716ebf', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-publicize', 'aliases' => array(), @@ -319,7 +319,7 @@ 'automattic/jetpack-redirect' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '8286516237870641468fc26c607583b6ec5dd371', + 'reference' => 'ec841accf810340d7ae41408d05da90ef2c79b67', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-redirect', 'aliases' => array(), @@ -328,7 +328,7 @@ 'automattic/jetpack-roles' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => '348324a24c44b720adb33428869dc8346c82f6a5', + 'reference' => '6b4a31246533a68f70a82a55f777477da4379e8d', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-roles', 'aliases' => array(), @@ -337,7 +337,7 @@ 'automattic/jetpack-search' => array( 'pretty_version' => '0.42.0', 'version' => '0.42.0.0', - 'reference' => '5345e14941960807d8964534c63f6a96867190d2', + 'reference' => '98c12531002b465cf6076b8ef39e99598e2f5689', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-search', 'aliases' => array(), @@ -346,7 +346,7 @@ 'automattic/jetpack-stats' => array( 'pretty_version' => '0.9.0', 'version' => '0.9.0.0', - 'reference' => '59e7d83d2db86c8a5328c16538c53b275d6e9189', + 'reference' => 'b14ef861f27d7c52ab03814038a08ae5be190d06', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-stats', 'aliases' => array(), @@ -355,7 +355,7 @@ 'automattic/jetpack-stats-admin' => array( 'pretty_version' => '0.15.1', 'version' => '0.15.1.0', - 'reference' => 'ebbaa6b006fd9723cd22ced1a690ce1fe21082a9', + 'reference' => '4242cd96376a1b6753f7151bfa8919c74d204641', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-stats-admin', 'aliases' => array(), @@ -364,7 +364,7 @@ 'automattic/jetpack-status' => array( 'pretty_version' => '2.1.0', 'version' => '2.1.0.0', - 'reference' => '0c97f1552422477b1aa0f7c7f954adf8d0da6f2d', + 'reference' => '21d886333cb1c2b578144a1ae5ae4d29349a2acc', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-status', 'aliases' => array(), @@ -373,7 +373,7 @@ 'automattic/jetpack-sync' => array( 'pretty_version' => '2.4.2', 'version' => '2.4.2.0', - 'reference' => 'c494246b881961bd9c3f349b79ee1055f1ce5cc7', + 'reference' => '621abf960946d9f2b1ae7f51a1812578d1ece48a', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-sync', 'aliases' => array(), @@ -382,7 +382,7 @@ 'automattic/jetpack-videopress' => array( 'pretty_version' => '0.22.3', 'version' => '0.22.3.0', - 'reference' => '1492e0f4d02d0b49e39b6fabb00a7a33e96bdc2f', + 'reference' => 'cc835cc55e43a3c57972d6154c1cca54603fa1a9', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-videopress', 'aliases' => array(), @@ -391,7 +391,7 @@ 'automattic/jetpack-waf' => array( 'pretty_version' => '0.12.4', 'version' => '0.12.4.0', - 'reference' => '64e14853bb6fbd49d03431c2b6c4e88206661731', + 'reference' => '40f2b70e81752297088bebecb721ef57796d8898', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-waf', 'aliases' => array(), @@ -400,7 +400,7 @@ 'automattic/jetpack-wordads' => array( 'pretty_version' => '0.3.5', 'version' => '0.3.5.0', - 'reference' => '90baf6fa48739add3802c36cf4bc1e663e97f76e', + 'reference' => '077c65c9b6aa9d66486789575b1073b8c176baac', 'type' => 'jetpack-library', 'install_path' => __DIR__ . '/../../jetpack_vendor/automattic/jetpack-wordads', 'aliases' => array(), diff --git a/vendor/composer/jetpack_autoload_classmap.php b/vendor/composer/jetpack_autoload_classmap.php index ed32c3df6f..820056416e 100644 --- a/vendor/composer/jetpack_autoload_classmap.php +++ b/vendor/composer/jetpack_autoload_classmap.php @@ -187,95 +187,95 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-config/src/class-config.php' ), 'Automattic\\Jetpack\\Connection\\Client' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-client.php' ), 'Automattic\\Jetpack\\Connection\\Connection_Notice' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-connection-notice.php' ), 'Automattic\\Jetpack\\Connection\\Error_Handler' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-error-handler.php' ), 'Automattic\\Jetpack\\Connection\\Initial_State' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-initial-state.php' ), 'Automattic\\Jetpack\\Connection\\Manager' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-manager.php' ), 'Automattic\\Jetpack\\Connection\\Manager_Interface' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/interface-manager.php' ), 'Automattic\\Jetpack\\Connection\\Nonce_Handler' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-nonce-handler.php' ), 'Automattic\\Jetpack\\Connection\\Package_Version' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version.php' ), 'Automattic\\Jetpack\\Connection\\Package_Version_Tracker' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-package-version-tracker.php' ), 'Automattic\\Jetpack\\Connection\\Plugin' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin.php' ), 'Automattic\\Jetpack\\Connection\\Plugin_Storage' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-plugin-storage.php' ), 'Automattic\\Jetpack\\Connection\\REST_Connector' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-connector.php' ), 'Automattic\\Jetpack\\Connection\\Rest_Authentication' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-rest-authentication.php' ), 'Automattic\\Jetpack\\Connection\\Secrets' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-secrets.php' ), 'Automattic\\Jetpack\\Connection\\Server_Sandbox' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-server-sandbox.php' ), 'Automattic\\Jetpack\\Connection\\Tokens' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens.php' ), 'Automattic\\Jetpack\\Connection\\Tokens_Locks' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tokens-locks.php' ), 'Automattic\\Jetpack\\Connection\\Urls' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-urls.php' ), 'Automattic\\Jetpack\\Connection\\Utils' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-utils.php' ), 'Automattic\\Jetpack\\Connection\\Webhooks' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-webhooks.php' ), 'Automattic\\Jetpack\\Connection\\Webhooks\\Authorize_Redirect' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/webhooks/class-authorize-redirect.php' ), 'Automattic\\Jetpack\\Connection\\XMLRPC_Async_Call' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-async-call.php' ), 'Automattic\\Jetpack\\Connection\\XMLRPC_Connector' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-xmlrpc-connector.php' ), 'Automattic\\Jetpack\\Constants' => array( @@ -391,7 +391,7 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-forms/src/class-wpcom-rest-api-v2-endpoint-forms.php' ), 'Automattic\\Jetpack\\Heartbeat' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-heartbeat.php' ), 'Automattic\\Jetpack\\IP\\Utils' => array( @@ -663,11 +663,11 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-my-jetpack/src/class-wpcom-products.php' ), 'Automattic\\Jetpack\\Partner' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner.php' ), 'Automattic\\Jetpack\\Partner_Coupon' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-partner-coupon.php' ), 'Automattic\\Jetpack\\Password_Checker' => array( @@ -699,75 +699,75 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-post-list/src/class-post-thumbnail.php' ), 'Automattic\\Jetpack\\Publicize\\Auto_Conversion\\REST_Settings_Controller' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/auto-conversion-settings/class-rest-settings-controller.php' ), 'Automattic\\Jetpack\\Publicize\\Auto_Conversion\\Settings' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/auto-conversion-settings/class-settings.php' ), 'Automattic\\Jetpack\\Publicize\\Connections_Post_Field' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-connections-post-field.php' ), 'Automattic\\Jetpack\\Publicize\\Jetpack_Social_Settings\\Dismissed_Notices' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/jetpack-social-settings/class-dismissed-notices.php' ), 'Automattic\\Jetpack\\Publicize\\Jetpack_Social_Settings\\Settings' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/jetpack-social-settings/class-settings.php' ), 'Automattic\\Jetpack\\Publicize\\Keyring_Helper' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-keyring-helper.php' ), 'Automattic\\Jetpack\\Publicize\\Publicize' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize.php' ), 'Automattic\\Jetpack\\Publicize\\Publicize_Base' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-base.php' ), 'Automattic\\Jetpack\\Publicize\\Publicize_Setup' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-setup.php' ), 'Automattic\\Jetpack\\Publicize\\Publicize_UI' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-ui.php' ), 'Automattic\\Jetpack\\Publicize\\REST_Controller' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-rest-controller.php' ), 'Automattic\\Jetpack\\Publicize\\Share_Limits' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/class-share-limits.php' ), 'Automattic\\Jetpack\\Publicize\\Social_Image_Generator\\Post_Settings' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-post-settings.php' ), 'Automattic\\Jetpack\\Publicize\\Social_Image_Generator\\REST_Settings_Controller' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-rest-settings-controller.php' ), 'Automattic\\Jetpack\\Publicize\\Social_Image_Generator\\REST_Token_Controller' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-rest-token-controller.php' ), 'Automattic\\Jetpack\\Publicize\\Social_Image_Generator\\Settings' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-settings.php' ), 'Automattic\\Jetpack\\Publicize\\Social_Image_Generator\\Setup' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-setup.php' ), 'Automattic\\Jetpack\\Publicize\\Social_Image_Generator\\Templates' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/class-templates.php' ), 'Automattic\\Jetpack\\Redirect' => array( @@ -1159,11 +1159,11 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-sync/src/class-utils.php' ), 'Automattic\\Jetpack\\Terms_Of_Service' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-terms-of-service.php' ), 'Automattic\\Jetpack\\Tracking' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/src/class-tracking.php' ), 'Automattic\\Jetpack\\VideoPress\\AJAX' => array( @@ -1407,11 +1407,11 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-compat/legacy/class-jetpack-client.php' ), 'Jetpack_IXR_Client' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php' ), 'Jetpack_IXR_ClientMulticall' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-clientmulticall.php' ), 'Jetpack_Modules_Overrides' => array( @@ -1419,11 +1419,11 @@ 'path' => $baseDir . '/src/class-jetpack-modules-overrides.php' ), 'Jetpack_Options' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-options.php' ), 'Jetpack_Signature' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-signature.php' ), 'Jetpack_Sync_Actions' => array( @@ -1439,15 +1439,15 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-compat/legacy/class-jetpack-sync-settings.php' ), 'Jetpack_Tracks_Client' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-client.php' ), 'Jetpack_Tracks_Event' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-tracks-event.php' ), 'Jetpack_XMLRPC_Server' => array( - 'version' => '2.2.0.0', + 'version' => '2.3.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-xmlrpc-server.php' ), 'Latest_Autoloader_Guard' => array( diff --git a/vendor/composer/jetpack_autoload_filemap.php b/vendor/composer/jetpack_autoload_filemap.php index 1439fec4f3..e9a8b7103f 100644 --- a/vendor/composer/jetpack_autoload_filemap.php +++ b/vendor/composer/jetpack_autoload_filemap.php @@ -19,7 +19,7 @@ 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-compat/functions.php' ), 'e6f7f640a6586216432b53e5c9d1b472' => array( - 'version' => '0.40.0.0', + 'version' => '0.41.0.0-alpha1706556436', 'path' => $baseDir . '/jetpack_vendor/automattic/jetpack-publicize/src/social-image-generator/utilities.php' ), '3d45c7e6a7f0e71849e33afe4b3b3ede' => array(