_n("You have %d share remaining in the next 30 days. <upgradeLink>Upgrade now</upgradeLink> to share more.","You have %d shares remaining in the next 30 days. <upgradeLink>Upgrade now</upgradeLink> to share more.",v,"jetpack"),v),{upgradeLink:React.createElement("a",{className:b.Z["upgrade-link"],href:(0,r.Z)("jetpack-social-basic-plan-block-editor",{site:(0,a.lQ)(),query:"redirect_to="+encodeURIComponent(window.location.href)}),onClick:Z})}),React.createElement("br",null),(0,s.createInterpolateElement)(/* translators: %d is the number of shares remaining, moreLink is the link to find out more information about the plan */
__("<moreLink>More about Jetpack Social</moreLink>.","jetpack"),{moreLink:React.createElement("a",{className:b.Z["more-link"],href:(0,r.Z)("jetpack-social-block-editor-more-info",{site:(0,a.lQ)(),...w?{query:"redirect_to="+encodeURIComponent(w)}:{}}),target:"_blank",rel:"noreferrer",onClick:Z})})))),R.length>0&&React.createElement(f.Z,{type:"error"},(0,s.createInterpolateElement)(_n("One of your social connections is broken. Reconnect them on the <fixLink>connection management</fixLink> page.","Some of your social connections are broken. Reconnect them on the <fixLink>connection management</fixLink> page.",R.length,"jetpack"),{fixLink:React.createElement(o.ExternalLink,{href:E})})),React.createElement(o.PanelRow,null,React.createElement("ul",{className:b.Z["connections-list"]},_.map((e=>{let{display_name:r,enabled:a,id:o,service_name:i,toggleable:s,profile_picture:l,is_healthy:c}=e;returnReact.createElement(p.Z,{disabled:!t||!a&&s&&I||!1===c,enabled:a&&!n&&!1!==c,key:o,id:o,label:r,name:i,toggleConnection:C,profilePicture:l})}))))),!n&&React.createElement(s.Fragment,null,React.createElement(g.Z,null),t&&_.some((e=>e.enabled))&&React.createElement(React.Fragment,null,React.createElement(h.Z,{maxLength:L,onChange:P,message:x})),k&&React.createElement(m.Z,{disabled:N,notice:N?__("It is not possible to add an image or video when Social Image Generator is enabled.","jetpack"):null})))}},9888:function(e,t,n){"use strict";n.d(t,{ZP:function(){returnk}});varr=n(6895),a=n(88275),o=n(86989),i=n.n(o),s=n(55609),l=n(9818),c=n(12238),u=n(65736),d=n(65235),p=n.n(d),m=n(99196),h=n.n(m),f=n(75263),g=n(58487);const__=u.__,b="featured-image-still-loading",v=(e,t,n,r)=>{if("none"===e||"custom"===e&&!t||"featured"===(null!=e?e:"featured")&&!n)returnnull;consta=r("custom"===e?t:n);returna?(e=>e?.media_details?.sizes?.large?.source_url||e?.source_url)(a):b};functionk(){const[e,t]=(0,m.useState)(null),[n,o]=(0,m.useState)(!0),{customText:u,imageType:d,imageId:k,template:y}=(0,f.Z)(),{title:E,imageUrl:w}=(0,l.useSelect)((e=>{constt=e(c.store).getEditedPostAttribute("featured_media");return{title:e(c.store).getEditedPostAttribute("title"),imageUrl:v(d,k,t,e("core").getMedia)}})),_=(0,m.useMemo)((()=>u||E||" "),[u,E]),C=(0,m.useRef)(_),S=(0,m.useRef)(e);(0,m.useEffect)((()=>{S.current=e})),(0,m.useEffect)((()=>{conste=setTimeout((async()=>{if(o(!0),w===b)return;conste=awaiti()({path:"/jetpack/v4/social-image-generator/generate-preview-token",method:"POST",data:{text:_,image_url:w,template:y}}),n=(0,r.Z)("sigenerate",{query:`t=${e}`});n!==S.current?t(n):o(!1)}),_===C.current?0:1500);return()=>{clearTimeout(e),C.current=_}}),[_,y,w]);constj=(0,m.useCallback)((()=>{o(!1)}),[]);returnh().createElement(a.ZP,null,h().createElement(s.BaseControl,{label:__("Preview","jetpack")},h().createElement("div",{className:g.Z.container},h().createElement("img",{className:p()({[g.Z.hidden]:n}),src:e,alt:__("Generated preview","jetpack"),onLoad:j}),n&&h().createElement(s.Spinner,{"data-testid":"spinner"}))))}},88649:function(e,t,n){"use strict";n.d(t,{Z:function(){returnh}});varr=n(90526),a=n(88275),o=n(52175),i=n(55609),s=n(69307),l=n(65736),c=n(61074),u=n(6163),d=n(46791),p=n(13858),m=n(69339);const__=l.__;functionh(e){let{buttonLabel:t,subTitle:n,mediaId:l=null,mediaDetails:h={},onChange:f,allowedMediaTypes:g}=e;const{mediaData:{width:b,height:v,sourceUrl:k}={},metaData:{mime:y,length:E=null}={}}=h,w=!(k&&b&&v&&y),_=(0,s.useCallback)((()=>f(null)),[f]),C=(0,s.useCallback)((e=>{f(e)}),[f]),S=(0,s.useCallback)((e=>{constt=(0,d.Wv)(y);returnt&&!E?null:React.createElement("div",{className:m.Z["preview-wrapper"]},React.createElement("button",{className:m.Z.remove,onClick:_},React.createElement(i.VisuallyHidden,null,__("Remove media","jetpack")),React.createElement(c.Z,{icon:u.Z})),React.createElement("button",{className:m.Z.preview,onClick:e},t?React.createElement(p.Z,{sourceUrl:k,mime:y,duration:E}):React.createElement(i.ResponsiveWrapper,{naturalWidth:b,naturalHeight:v,isInline:!0},React.createElement("img",{src:k,alt:""}))))}),[v,E,y,_,k,b]),j=
__("This media is over %d MB and cannot be used for these platforms.","jetpack"),_),[d.L7]:__("The selected video is too long for these platforms.","jetpack"),[d.GQ]:__("The selected video is too short for these platforms.","jetpack")};(0,l.useEffect)((()=>{if(!w.metaData||!k.length)return;conste=C(w.metaData);e&&(v(e),y([]))}),[k,y,C,w]);constx=(0,i.useCallback)((e=>{if(e){const{id:t,url:n}=e;y([{id:t,url:n}])}elsey([]);v(null)}),[y]),P=(0,i.useCallback)((()=>v(null)),[]),L=t?o.Disabled:l.Fragment,T=t?{className:f.Z.disabled,"data-testid":"disabled"}:{};returnReact.createElement(r.ZP,null,React.createElement(o.BaseControl,{label:__("Media","jetpack"),className:f.Z.wrapper},n?React.createElement(o.Notice,{className:f.Z.notice,isDismissible:!1,status:"warning"},React.createElement("p",{"data-testid":"notice"},n)):React.createElement("p",{className:f.Z.subtitle},__("Choose a visual to accompany your post.","jetpack")),React.createElement(L,T,React.createElement(m.Z,{buttonLabel:g,subTitle:__("Add an image or video","jetpack"),mediaId:k[0]?.id,mediaDetails:w,onChange:x,allowedMediaTypes:S}),React.createElement(o.ExternalLink,{href:(0,a.Z)("jetpack-social-media-support-information")},__("Learn photo and video best practices","jetpack"))),b&&React.createElement(o.Notice,{className:f.Z.notice,isDismissible:!0,onDismiss:P,status:"warning"},React.createElement("p",null,j[b]),React.createElement(o.ExternalLink,{href:(0,a.Z)("jetpack-social-media-support-information")},__("Troubleshooting tips","jetpack")))),React.createElement(h.Z,null))}},71961:function(e,t,n){"use strict";n.d(t,{Z:function(){returno}});varr=n(55609),a=n(65736);const__=a.__,_n=a._n;functiono(e){let{message:t="",onChange:n,disabled:o,maxLength:i}=e;consts=i-t.length;returnReact.createElement(r.TextareaControl,{value:t,label:__("Message","jetpack"),onChange:n,disabled:o,maxLength:i,placeholder:__("Write a message for your audience here.","jetpack"),rows:4,help:(0,a.sprintf)(/* translators: placeholder is a number. */
_n("%d character remaining","%d characters remaining",s,"jetpack"),s)})}},62578:function(e,t,n){"use strict";varr=n(65235),a=n.n(r),o=n(25162),i=n.n(o),s=n(82283);constl=e=>{let{children:t,type:n="default"}=e;constr=a()(s.Z.notice,s.Z[`notice--${n}`]);returnReact.createElement("div",{className:r},t)};l.propTypes={children:i().node.isRequired,type:i().oneOf(["default","warning","error"])},t.Z=l},8714:function(e,t,n){"use strict";varr=n(55609),a=n(9818),o=n(12238),i=n(69307),s=n(65736),l=n(14085),c=n(86419),u=n(37568),d=n(49021),p=n(95788),m=n(91474),h=n(63609);const__=s.__;t.Z=e=>{let{prePublish:t,enableTweetStorm:n,children:s}=e;const{refresh:f,hasConnections:g,hasEnabledConnections:b}=(0,u.Z)(),v=(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]),{isPublicizeEnabled:k,hidePublicizeFeature:y,isPublicizeDisabledBySitePlan:E,togglePublicizeFeature:w,isShareLimitEnabled:_,numberOfSharesRemaining:C,hasPaidPlan:S,connectionsAdminUrl:j,adminUrl:x,isEnhancedPublishingEnabled:P,isSocialImageGeneratorEnabled:L}=(0,l.Z)();(0,c.M1)((function(){b&&f()}),[b,f]);constT=t?i.Fragment:r.PanelBody,N=t?{}:{title:__("Share this post","jetpack")};returnReact.createElement(T,N,s,!y&&React.createElement(i.Fragment,null,!v&&React.createElement(r.PanelRow,null,React.createElement(r.ToggleControl,{className:"jetpack-publicize-toggle",label:k?__("Share when publishing","jetpack"):__("Sharing is disabled","jetpack",0),onChange:w,checked:k,disabled:!g})),React.createElement(d.Z,null),React.createElement(p.Z,{isPublicizeEnabled:k,isPublicizeDisabledBySitePlan:E,connectionsAdminUrl:j,numberOfSharesRemaining:_&&!S?C:null,isEnhancedPublishingEnabled:P,isSocialImageGeneratorEnabled:L,adminUrl:x}),n&&k&&React.createElement(h.Z,{prePublish:t}),React.createElement(m.o,null)))}},19649:function(e,t,n){"use strict";n(13419),n(65736),n(99196),n(2097)},69709:function(e,t,n){"use strict";n.d(t,{Z:function(){returnd}});varr=n(55609),a=n(65736),o=n(92819),i=n(90105),s=n(14085),l=n(37568),c=n(78619);const__=a.__,u=2e3;functiond(){const{refresh:e}=(0,l.Z)(),t=(0,o.debounce)((function(t){t&&e()}),u),{connectionsAdminUrl:n}=(0,s.Z)();returnReact.createElement(i.Z,{onChange:t},React.createElement("div",{className:c.Z["add-connection-wrapper"]},React.createElement(r.ExternalLink,{href:n,target:"_blank"},__("Connect an account","jetpack"))))}},91474:function(e,t,n){"use strict";n.d(t,{o:function(){returnh}});varr=n(55609),a=n(9818),o=n(12238),i=n(69307),s=n(65736),l=n(53961),c=n(14085),u=n(45579),d=n(37568);const__=s.__;functionp(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:__("Unable to share the Post","jetpack");const{createErrorNotice:t}=(0,a.dispatch)(l.store);t(e,{id:"publicize-post-share-message"})}functionm(){const{hasEnabledConnections:e}=(0,d.Z)(),{isPublicizeEnabled:t}=(0,c.Z)(),{isFetching:n,isError:s,isSuccess:m,doPublicize:h}=(0,u.Z)(),f=(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[]);(0,i.useEffect)((()=>{if(!n)returns?p():void(m&&function(){const{createSuccessNotice:e}=(0,a.dispatch)(l.store);e(__("Post shared","jetpack"),{id:"publicize-post-share-message",type:"snackbar"})}())}),[n,s,m]);constg=!t||!e||!f||n,b=(0,i.useCallback)((()=>{if(!f)returnp(__("You must publish your post before you can share it.","jetpack"));(0,a.dispatch)(l.store).removeNotice("publicize-post-share-message"),h()}),[h,f]);returnReact.createElement(r.Button,{variant:"secondary",onClick:b,disabled:g,isBusy:n},__("Share post","jetpack"))}functionh(){const{isRePublicizeUpgradableViaUpsell:e}=(0,c.Z)();return(0,a.useSelect)((e=>e(o.store).isCurrentPostPublished()),[])?e?null:React.createElement(r.PanelRow,null,React.createElement(m,null)):null}},54005:function(e,t,n){"use strict";varr=n(55609),a=n(69307),o=n(65736),i=n(75263),s=n(98811),l=n(9888),c=n(88649),u=n(35676);const__=o.__,d=["image/jpeg","image/png"],p=__("Choose Image","jetpack");t.Z=e=>{let{prePublish:t=!1}=e;constn=t?a.Fragment:r.PanelBody,o=t?{}:{title:__("Social Image Generator","jetpack")},{isEnabled:m,setIsEnabled:h,customText:f,setCustomText:g,imageType:
(0,i.sprintf)(__("Pick the %s template","jetpack"),e.label)))))),u().createElement("div",{className:d.Z.footer},u().createElement(a.Button,{variant:"tertiary",onClick:b},__("Cancel","jetpack")),u().createElement(a.Button,{variant:"primary",onClick:v},__("Save","jetpack")))))}},56983:function(e,t,n){"use strict";varr=n(16581),a=n(68398),o=n(74064);consti=[{name:"highway",label:"Highway",image:n(15733)},{name:"dois",label:"Dois",image:r},{name:"edge",label:"Edge",image:a},{name:"fullscreen",label:"Fullscreen",image:o}];t.Z=i},53513:function(e,t,n){"use strict";n.d(t,{Z:function(){returnc}});varr=n(88275),a=n(55609),o=n(65736),i=n(99196),s=n(88219),l=n(89696);const__=o.__;functionc(){const{shouldUploadAttachedMedia:e,updateShouldUploadAttachedMedia:t}=(0,s.Z)(),n=(0,i.useCallback)((e=>{t(e)}),[t]);returnReact.createElement(r.ZP,null,React.createElement(a.CheckboxControl,{className:l.Z.checkbox,checked:e,onChange:n,label:__("Share as a social post","jetpack"),help:__("By default, the image and text appear on social media as a link preview. To optimize engagement, share as a social post.","jetpack")}))}},53966:function(e,t,n){"use strict";n.d(t,{z:function(){returnc}});varr=n(82674),a=n.n(r),o=n(27143),i=n(79988),s=n(50149),l=n(65736);const__=l.__,c=[{title:__("Google Search","jetpack"),icon:"google",name:"google",preview:o.Z},{title:__("Facebook","jetpack"),icon:"facebook",name:"facebook",preview:e=>React.createElement(i.Z,a()({type:"article"},e))},{title:__("Twitter","jetpack"),icon:"twitter",name:"twitter",preview:e=>React.createElement(s.Z,e)}]},8454:function(e,t,n){"use strict";varr=n(3396),a=n(55609),o=n(9818),i=n(69307),s=n(65736),l=n(53966),c=n(25399);const__=s.__;t.Z=(0,o.withSelect)((e=>{const{getMedia:t,getUser:n}=e("core"),{getCurrentPost:r,getEditedPostAttribute:a}=e("core/editor"),{getTweetTemplate:o,getTweetStorm:i,getShareMessage:s,isTweetStorm:l}=e("jetpack/publicize"),u=a("featured_media"),d=a("author"),p=d&&n(d),m={post:r(),title:a("meta")?.jetpack_seo_html_title||a("title"),description:a("meta")?.advanced_seo_description||a("excerpt")||a("content").split("\x3c!--more")[0]||__("Visit the post for more.","jetpack"),url:a("link"),author:p?.name,image:!!u&&(0,c.i)(t(u))};leth=[];returnl()?h=i():h.push({...o(),text:s(),card:{...m,type:m.image?"summary_large_image":"summary"}}),{...m,tweets:h,isTweetStorm:l()}}))((function(e){let{onClose:t,image:n,title:o,description:s,url:c,author:u,isTweetStorm:d,tweets:p}=e;constm=l.z.map((e=>({...e,title:React.createElement(i.Fragment,null,React.createElement(r.av,{serviceName:e.icon}),e.title)})));returnReact.createElement(a.Modal,{onRequestClose:t,title:__("Social Previews","jetpack"),className:"jetpack-social-previews__modal"},React.createElement(a.TabPanel,{className:"jetpack-social-previews__modal-previews",tabs:m,initialTabName:d?"twitter":null,orientation:"vertical"},(e=>React.createElement("div",null,React.createElement(e.preview,{title:o,description:s,url:c,author:u,image:n,isTweetStorm:d,tweets:p})))))}))},74140:function(e,t,n){"use strict";varr=n(3396),a=n(55609),o=n(65736),i=n(53966);const__=o.__;t.Z=e=>{let{openModal:t}=e;returnReact.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"},i.z.map((e=>React.createElement(r.av,{key:e.icon,serviceName:e.icon,className:"jetpack-social-previews__icon"})))),React.createElement(a.Button,{variant:"secondary",onClick:t,label:__("Open Social Previews","jetpack")},__("Preview","jetpack")))}},25399:function(e,t,n){"use strict";functionr(e){returne?e.media_details?.sizes?.large?.source_url||e.source_url:null}n.d(t,{i:function(){returnr}})},68407:function(e,t,n){"use strict";n.d(t,{H8:function(){returnl},nE:function(){returns}});varr=n(94333),a=n(9818),o=n(92694),i=n(36797);consts={"core/gallery":{contentAttributes:["images"]},"core/heading":{contentAttributes:["content"]},"core/image":{contentAttributes:[
__("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"),t&&(
/** translators: This will be the follow up of a prompt that will be sent to OpenAI based on comma-seperated category names. */
a+=(0,d.sprintf)(__(", published in categories '%1$s'","jetpack"),t)),n&&(
/** translators: This will be the follow up of a prompt that will be sent to OpenAI based on comma-seperated category names. */
a+=(0,d.sprintf)(__(" and tagged '%1$s'","jetpack"),n)),a+=__(". Please only output generated content ready for publishing.","jetpack"),r&&(
/** translators: This will be the end of a prompt that will be sent to OpenAI with the last MAXIMUM_NUMBER_OF_CHARACTERS_SENT_FROM_CONTENT characters of content.*/
a+=(0,d.sprintf)(__(" Please continue from here:\n\n … %s","jetpack"),r)),a.trim()};functionh(e){let{html:t,showAnimation:n,onAnimationDone:a}=e;const[o,i]=(0,u.useState)("");return(0,u.useEffect)((()=>{if(n){conste=t.split(" ");for(lett=1;t<e.length;t++){constn=e.slice(0,t).join(" ");setTimeout((()=>i(n)),50*t)}setTimeout((()=>{i(t),a()}),50*e.length)}elsei(t)}),[]),(0,r.createElement)("div",{className:"content"},(0,r.createElement)(u.RawHTML,null,o))}functionf(e){let{attributes:t,setAttributes:n,clientId:o}=e;const[d,f]=(0,u.useState)(!1),[g,b]=(0,u.useState)(!1),[v,k]=(0,u.useState)(!1),[y,E]=(0,u.useState)(!1),[w,_]=(0,u.useState)(!1),{tracks:C}=(0,a.z$)(),S=(0,c.useSelect)((e=>e("core/editor").getEditedPostAttribute("title")));letj=!1;constx=(0,c.useSelect)((e=>e("core/editor").getEditedPostAttribute("categories")))||[],P=(0,c.useSelect)((e=>x.map((t=>{constn=e("core").getEntityRecord("taxonomy","category",t);if(n)returnn;j=!0})).filter(Boolean)),[x]),L=(0,c.useSelect)((e=>e("core/editor").getEditedPostAttribute("tags")),[])||[],T=(0,c.useSelect)((e=>L.map((t=>{constn=e("core").getEntityRecord("taxonomy","post_tag",t);if(n)returnn;j=!0})).filter(Boolean)),[L]);(0,u.useEffect)((()=>{b(j)}),[j]);constN=(0,c.useSelect)((e=>e("core/editor").getCurrentPostId())),A=P.filter((e=>1!==e.id)).map((e=>{let{name:t}=e;returnt})).join(", "),R=T.map((e=>{let{name:t}=e;returnt})).join(", "),I=(0,c.useSelect)((e=>{vart;constn=e("core/block-editor"),r=n.getBlockIndex(o);returnnull!==(t=n.getBlocks().slice(0,r))&&void0!==t?t:[]})),M=()=>{if(t.content||d)return;E(!1),_(!1),k(!1),f(!0);conste={content:m(S,I,A,R)};C.recordEvent("jetpack_ai_gpt3_completion",{post_id:N}),i()({path:"/wpcom/v2/jetpack-ai/completions",method:"POST",data:e}).then((e=>{constt=e.trim().replaceAll("\n","<br/>");n({content:t}),f(!1)})).catch((e=>{e.message?_(e.message):_(__("Whoops, we have encountered an error. AI is like really, really hard and this is an experimental feature. Please try again later.","jetpack")),E(!0),f(!1)}))},B=d||g,Z=!!t.content,F=Z||B;return(0,c.useSelect)((()=>{if(!F){conste=m(S,I,A,R);(()=>{conste="jetpack/"+p.u2;returnI.filter((t=>t.name&&t.name===e&&!t.attributes.content)).length>0})()?_(/** translators: This will be an error message when multiple Open AI paragraph blocks are triggered on the same page. */
__("Please write a longer title or a few more words in the opening preceding the AI block. Our AI model needs some content.","jetpack")),k(!0))}}),[S,I,A,R,F,v,y]),(0,r.createElement)("div",(0,s.useBlockProps)(),!d&&!g&&w&&(0,r.createElement)(l.Placeholder,{label:__("AI Paragraph","jetpack"),instructions:w},y&&(0,r.createElement)(l.Button,{variant:"primary",onClick:()=>M()},__("Retry","jetpack"))),Z&&(0,r.createElement)(h,{showAnimation:!t.animationDone,onAnimationDone:()=>{n({animationDone:!0})},html:t.content}),!t.content&&B&&(0,r.createElement)("div",{style:{padding:"10px",textAlign:"center"}},(0,r.createElement)(l.Spinner,{style:{height:"calc(4px * 20)",width:"calc(4px * 20)"}})))}},16042:function(e,t,n){"use strict";varr=n(31985),a=n(61209);(0,r.Z)(a.u2,a.Xd)},61209:function(e,t,n){"use strict";n.d(t,{Xd:function(){returnh},u2:function(){returnm}});varr=n(51806),a=n(6895),o=n(52175),i=n(4981),s=n(55609),l=n(69307),c=n(65736),u=n(70355),d=n(2472),p=n(55410);const__=c.__,_x=c._x,m="ai-paragraph",h={apiVersion:2,title:__("AI Paragraph (Experimental)","jetpack"),description:(0,r.createElement)(l.Fragment,null,(0,r.createElement)("p",null,__("Automatically generate new paragraphs using your existing content, powered by AI magic.","jetpack")),(0,r.createElement)("p",null,__("We are experimenting with this feature and can tweak or remove it at any point.","jetpack")),(0,r.createElement)(s.ExternalLink,{href:(0,a.Z)("jetpack_ai_feedback")},__("Share your feedback.","jetpack"))),icon:{src:"superhero",foreground:(0,u.m)()},category:"text",keywords:[_x("AI","block search term","jetpack"),_x("GPT","block search term","jetpack"),_x("AL","block search term","jetpack"),_x("Magic","block search term","jetpack")],supports:{align:!0,alignWide:!0,anchor:!0,customClassName:!0,className:!0,html:!0,multiple:!0,reusable:!1},edit:p.ZP,save:e=>{constt=o.useBlockProps.save();return(0,r.createElement)(l.RawHTML,t,e.attributes.content)},attributes:d.Z,transforms:{to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,i.createBlock)("core/paragraph",{content:t})}}]},example:{attributes:{animationDone:!1,content:__("I'm afraid I can't do that, Dave.","jetpack")}}}},37943:function(e,t,n){"use strict";varr=n(24381);t.Z={backgroundColor:{type:"string",validator:r.Z},textColor:{type:"string",validator:r.Z},buttonAndLinkColor:{type:"string",validator:r.Z},style:{type:"string",default:"small",validValues:["small","large"]},asin:{type:"string"},showImage:{default:!0,type:"boolean"},showTitle:{default:!0,type:"boolean"},showSeller:{default:!1,type:"boolean"},showPrice:{default:!0,type:"boolean"},showPurchaseButton:{default:!0,type:"boolean"}}},95216:function(e,t){"use strict";t.Z={products:[{title:"New York Biology Dead Sea Mud Mask for Face and Body - All Natural - Spa Quality Pore Reducer for Acne, Blackheads and Oily Skin - Tightens Skin for A Healthier Complexion - 8.8 oz",asin:"B01NCM25K7",productGroup:"Beauty",authors:[],artists:[],actors:[],manufacturer:"New York Biology",detailPageUrl:"https://www.amazon.com/New-York-Biology-Dead-Mask/dp/B01NCM25K7?psc=1&SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B01NCM25K7",listPrice:"$14.95",imageUrlSmall:"https://images-na.ssl-images-amazon.com/images/I/51asbRHNuVL._SL75_.jpg",imageHeightSmall:75,imageWidthSmall:62,imageUrlMedium:"https://images-na.ssl-images-amazon.com/images/I/51asbRHNuVL._SL160_.jpg",imageHeightMedium:160,imageWidthMedium:133,imageUrlLarge:"https://images-na.ssl-images-amazon.com/images/I/51asbRHNuVL.jpg",imageHeightLarge:500,imageWidthLarge:415,authorshipInfo:"New York Biology"},{title:"Face/Off",asin:"B002PT1KH6",productGroup:"Movie",authors:[],artists:[],actors:["John Travolta","Nicolas Cage","Joan Allen","Alessandro Nivola","Gina Gershon"],detailPageUrl:"https://www.amazon.com/Face-Off-John-Travolta/dp/B002PT1KH6?SubscriptionId=AKIAIA3UEVTLIG7AIKFA&tag=%5Bassociate-id-placeholder%5D&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B002PT1KH6",listPrice:"$9.99",imageUr
__("Prompt with id %d not found.","jetpack"),o)," ",(0,r.createElement)(s.Button,{variant:"link",onClick:e},__("Reset prompt","jetpack")))):(t=>(0,r.createElement)(r.Fragment,null,(0,u.sprintf)(/* translators: %s is the error message. */
__("Error while fetching prompt: %s","jetpack"),t)," ",(0,r.createElement)(s.Button,{variant:"link",onClick:e},__("Retry","jetpack"))))(t.message);varo;n.removeAllNotices(),n.createErrorNotice(a)}))}),[h,n,v,k,m,j]);constx=e=>{m({showLabel:e})},P=e=>{m({showResponses:e})};return(0,r.createElement)("div",S,a,(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.InspectorControls,null,(0,r.createElement)(s.PanelBody,{title:_x("Settings","title of block settings sidebar section","jetpack")},(0,r.createElement)(s.ToggleControl,{label:__("Show daily prompt label","jetpack"),checked:w,onChange:x}),(0,r.createElement)(s.ToggleControl,{label:__("Show other responses","jetpack"),checked:_,onChange:P})))),v?(0,r.createElement)(r.Fragment,null,w&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__label"},y),(0,r.createElement)("div",{className:"jetpack-blogging-prompt__text"},E),_&&k&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__answers"},b&&b.slice(0,3).map((e=>{let{url:t}=e;returnt&&(0,r.createElement)("img",{className:"jetpack-blogging-prompt__answers-gravatar",src:t,key:t})})),(0,r.createElement)("a",{className:"jetpack-blogging-prompt__answers-link",href:f,target:"_blank",rel:"external noreferrer noopener"},g))):(0,r.createElement)("div",{className:"jetpack-blogging-prompt__spinner"},(0,r.createElement)(s.Spinner,null)))}))},35681:function(e,t,n){"use strict";varr=n(4981),a=n(9818),o=n(31985),i=n(46185),s=n(50187);(0,o.Z)(s.u2,s.Xd),function(){vare;constt=newURL(document.location.href);if(!t.pathname.endsWith("/wp-admin/post-new.php"))return;constn=null!==(e=t.searchParams.get("answer_prompt"))&&void0!==e?e:"0",o=parseInt(n);o&&asyncfunction(e){await(0,i.U)();const{insertBlocks:t}=(0,a.dispatch)("core/block-editor");t([(0,r.createBlock)(`jetpack/${s.u2}`,{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,r.createBlock)("core/paragraph")],0,void0,!1)}(o)}()},50187:function(e,t,n){"use strict";n.d(t,{Xd:function(){returnh},u2:function(){returnm}});varr=n(65736),a=n(70355),o=n(5820),i=n(14511),s=n(14303),l=n(19597),c=n(65783),u=n(43807),d=n(45416),p=n(2275);const__=r.__,_x=r._x,m="blogging-prompt",h={apiVersion:2,title:__("Writing Prompt","jetpack"),description:__("Answer a new and inspiring writing prompt each day.","jetpack"),icon:{src:d.Z,foreground:(0,a.m)()},category:(0,o.Z)("text"),keywords:[_x("writing","block search term","jetpack"),_x("blogging","block search term","jetpack")],supports:{align:!1,alignWide:!1,anchor:!1,className:!0,color:{background:!0,gradients:!0,link:!0,text:!0},customClassName:!0,html:!1,inserter:!0,multiple:!1,reusable:!0,spacing:{margin:["top","bottom"],padding:!0,blockGap:!1}},edit:s.Z,save:p.Z,attributes:i.Z,styles:[{name:"block",label:__("Block","jetpack"),isDefault:!0},{name:"quote",label:__("Quote","jetpack")}],example:{attributes:{answersLink:"https://wordpress.com/tag/dailyprompt",answersLinkText:__("View all responses","jetpack"),gravatars:[{url:l},{url:c},{url:u}],promptLabel:__("Daily writing prompt","jetpack"),promptText:__("What's your favorite place to visit?","jetpack"),promptFetched:!0,promptId:1234,showResponses:!0,showLabel:!0,tagsAdded:!0}}}},2275:function(e,t,n){"use strict";varr=n(51806),a=n(52175);t.Z=function(e){let{attributes:t}=e;const{answersLink:n,answersLinkText:o,gravatars:i,promptId:s,promptLabel:l,promptText:c,showLabel:u,showResponses:d}=t,p=a.useBlockProps.save({className:"jetpack-blogging-prompt"});return(0,r.createElement)("div",p,u&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__label"},l),(0,r.createElement)("div",{className:"jetpack-blogging-prompt__text"},c),d&&s&&(0,r.createElement)("div",{className:"jetpack-blogging-prompt__answers"},i.map((e=>{let{url:t}=e;returnt&&(0,r.createElement)("img",{className:"jetpack-blogging-prompt__answers-gravatar","aria-hidden":"true",src:t,key:t})})),(0,r.createElement)("a",{className:"jetpack-blogging-prompt__answers-link",href:n,target:"_blank",rel:"external noreferrer noopener"},o)))}},44266:function(e,t,n){"use strict";n.d(t,{n:function(){returnc}});varr=n(86
__("%s is not a valid email address.","jetpack"),m[0].email):m[0];if(2===m.length)return(0,i.sprintf)(/* translators: placeholders are email addresses. */
__("%1$s and %2$s are not a valid email address.","jetpack"),m[0].email,m[1].email);conste=m.map((e=>e.email));return(0,i.sprintf)(/* translators: placeholder is a list of email addresses. */
__("%s are not a valid email address.","jetpack"),e.join(", "))}returnnull})()),(0,r.createElement)(a.TextControl,{label:__("Email subject line","jetpack"),value:n,placeholder:__("Enter a subject","jetpack"),onChange:e=>d({subject:e})}))}},55740:function(e,t,n){"use strict";varr=n(51806),a=n(52175),o=n(55609),i=n(94333),s=n(65736),l=n(81334),c=n(98677),u=n(15642),d=n(50686),p=n(8e3),m=n(63537);const__=s.__;t.Z=(0,i.compose)((0,l.j)(["borderRadius","borderWidth","labelFontSize","fieldFontSize","lineHeight","labelLineHeight","inputColor","labelColor","fieldBackgroundColor","borderColor"]),i.withInstanceId)((function(e){const{id:t,instanceId:n,required:i,requiredText:s,label:l,setAttributes:h,width:f,defaultValue:g,attributes:b}=e,{blockStyle:v}=(0,m.g)(b);return(0,r.createElement)("div",{id:`jetpack-field-checkbox-${n}`,className:"jetpack-field jetpack-field-checkbox",style:v},(0,r.createElement)("input",{className:"jetpack-field-checkbox__checkbox",type:"checkbox",disabled:!0,checked:g}),(0,r.createElement)(u.Z,{required:i,requiredText:s,label:l,setAttributes:h,attributes:b}),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Checkbox Settings","jetpack")},(0,r.createElement)(o.ToggleControl,{label:__("Checked by default","jetpack"),checked:g,onChange:e=>h({defaultValue:e?"true":""})}))),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Manage Responses","jetpack")},(0,r.createElement)(p.Z,{isChildBlock:!0})),(0,r.createElement)(o.PanelBody,{title:__("Field Settings","jetpack")},(0,r.createElement)(o.ToggleControl,{label:__("Field is required","jetpack"),className:"jetpack-field-label__required",checked:i,onChange:e=>h({required:e}),help:__('You can edit the "required" label in the editor',"jetpack")}),(0,r.createElement)(d.Z,{setAttributes:h,width:f}),(0,r.createElement)(o.ToggleControl,{label:__("Sync fields style","jetpack"),checked:b.shareFieldAttributes,onChange:e=>h({shareFieldAttributes:e}),help:__("Disable to apply individual styling to this block","jetpack")})),(0,r.createElement)(a.PanelColorSettings,{title:__("Color","jetpack"),initialOpen:!1,colorSettings:[{value:b.labelColor,onChange:e=>h({labelColor:e}),label:__("Label Text","jetpack")}]}),(0,r.createElement)(o.PanelBody,{title:__("Label Styles","jetpack"),initialOpen:b.labelFontSize},(0,r.createElement)(a.FontSizePicker,{withSlider:!0,withReset:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,onChange:e=>h({labelFontSize:e}),value:b.labelFontSize}))),(0,r.createElement)(a.InspectorAdvancedControls,null,(0,r.createElement)(c.Z,{setAttributes:h,id:t})))}))},82150:function(e,t,n){"use strict";varr=n(51806),a=n(52175),o=n(55609),i=n(94333),s=n(65736),l=n(81334),c=n(98677),u=n(15642),d=n(50686),p=n(8e3);const__=s.__;t.Z=(0,i.compose)((0,l.j)(["borderRadius","borderWidth","labelFontSize","fieldFontSize","lineHeight","labelLineHeight","inputColor","labelColor","fieldBackgroundColor","borderColor"]),i.withInstanceId)((e=>{vart;let{id:n,instanceId:i,width:l,consentType:m,implicitConsentMessage:h,explicitConsentMessage:f,setAttributes:g,attributes:b}=e;return(0,r.createElement)("div",{id:`jetpack-field-consent-${i}`,className:"jetpack-field jetpack-field-consent"},"explicit"===m&&(0,r.createElement)("input",{className:"jetpack-field-consent__checkbox",type:"checkbox",disabled:!0}),(0,r.createElement)(u.Z,{required:!1,label:null!==(t={implicit:h,explicit:f}[m])&&void0!==t?t:"",attributes:b,setAttributes:g,labelFieldName:`${m}ConsentMessage`,placeholder:(0,s.sprintf)(/* translators: placeholder is a type of consent: implicit or explicit */
__("Add %s consent message…","jetpack"),m)}),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Manage Responses","jetpack")},(0,r.createElement)(p.Z,{isChildBlock:!0})),(0,r.createElement)(o.PanelBody,{title:__("Field Settings","jetpack")},(0,r.createElement)(d.Z,{setAttributes:g,width:l}),(0,r.createElement)(o.ToggleControl,{label:__("Sync fields style","jetpack"),checked:b.shareFieldAttributes,onChange:e=>g({shareFieldAttributes:e}),help:__("Disable to apply individual styling to this block","jetpack")})),(0,r.createElement)(a.PanelColorSettings,{title:__("Color","jetpack"),initialOpen:!1,colorSettings:[{value:b.labelColor,onChange:e=>g({labelColor:e}),label:__("Label Text","jetpack")}]})),(0,r.createElement)(a.InspectorAdvancedControls,null,(0,r.createElement)(c.Z,{setAttributes:g,id:n})),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Consent Settings","jetpack")},(0,r.createElement)(o.BaseControl,null,(0,r.createElement)(o.SelectControl,{label:__("Permission to email","jetpack"),value:m,options:[{label:__("Mention that you can email","jetpack"),value:"implicit"},{label:__("Add a privacy checkbox","jetpack"),value:"explicit"}],onChange:e=>g({consentType:e})})))))}))},26588:function(e,t,n){"use strict";varr=n(51806),a=n(52175),o=n(55609),i=n(65736),s=n(36598),l=n(98677),c=n(50686),u=n(8e3);const__=i.__;t.Z=e=>{let{attributes:t,id:n,placeholder:i,placeholderField:d="placeholder",hidePlaceholder:p,required:m,setAttributes:h,width:f}=e;constg=function(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:parseInt;returnn=>{constr=t(n,10);h({[e]:isNaN(r)?"":r})}},b=[{value:t.labelColor,onChange:e=>h({labelColor:e}),label:__("Label Text","jetpack")},{value:t.inputColor,onChange:e=>h({inputColor:e}),label:__("Field Text","jetpack")},{value:t.fieldBackgroundColor,onChange:e=>h({fieldBackgroundColor:e}),label:__("Field Background","jetpack")},{value:t.borderColor,onChange:e=>h({borderColor:e}),label:__("Border","jetpack")}];return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.BlockControls,null,(0,r.createElement)(o.ToolbarGroup,null,(0,r.createElement)(o.ToolbarButton,{title:__("Required","jetpack"),icon:(0,s.Z)((0,r.createElement)(o.Path,{d:"M8.23118 8L16 16M8 16L15.7688 8 M6.5054 11.893L17.6567 11.9415M12.0585 17.6563L12 6.5",stroke:"currentColor"})),onClick:()=>{h({required:!m})},className:m?"is-pressed":void0}))),(0,r.createElement)(a.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Manage Responses","jetpack")},(0,r.createElement)(u.Z,{isChildBlock:!0})),(0,r.createElement)(o.PanelBody,{title:__("Field Settings","jetpack")},(0,r.createElement)(o.ToggleControl,{label:__("Field is required","jetpack"),className:"jetpack-field-label__required",checked:m,onChange:e=>h({required:e}),help:__('You can edit the "required" label in the editor',"jetpack")}),!p&&(0,r.createElement)(o.TextControl,{label:__("Placeholder text","jetpack"),value:i||"",onChange:e=>h({[d]:e}),help:__("Show visitors an example of the type of content expected. Otherwise, leave blank.","jetpack")}),(0,r.createElement)(c.Z,{setAttributes:h,width:f}),(0,r.createElement)(o.ToggleControl,{label:__("Sync fields style","jetpack"),checked:t.shareFieldAttributes,onChange:e=>h({shareFieldAttributes:e}),help:__("Disable to apply individual styling to this block","jetpack")})),(0,r.createElement)(a.PanelColorSettings,{title:__("Color","jetpack"),initialOpen:!1,colorSettings:b}),(0,r.createElement)(o.PanelBody,{title:__("Input Field Styles","jetpack"),initialOpen:!1},(0,r.createElement)(o.BaseControl,null,(0,r.createElement)(a.FontSizePicker,{withReset:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,onChange:e=>h({fieldFontSize:e}),value:t.fieldFontSize})),(0,r.createElement)(o.BaseControl,null,(0,r.createElement)(a.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"100%",value:t.lineHeight,onChange:g("lineHeight",parseFloat),size:"__unstable-large"})),(0,r.createElement)(o.RangeControl,{label:__("Border Width","jetpack"),v
_x("%s URL","placeholder label","jetpack"),B);return(0,r.createElement)("div",M,(0,r.createElement)(i.BlockControls,null,(0,r.createElement)(l.ToolbarGroup,null,!P&&(0,r.createElement)(l.ToolbarButton,{icon:p.Z,label:__("Edit URL","jetpack"),isActive:P,onClick:()=>{y.removeAllNotices(),L(!P)}}))),P||!x?(0,r.createElement)(m.Z,{className:n,icon:c,instructions:h,label:v||Z,url:A,notices:E,placeholder:_,onSubmit:e=>{if(e&&e.preventDefault(),!w[0].test(A))returny.removeAllNotices(),voidy.createErrorNotice(b);y.removeAllNotices(),L(!1),o({url:A}),S(A)},updateUrl:R}):(0,r.createElement)(f,{children:C,mapUrl:k,url:A,className:n,interactive:T,toggleInteractive:N,noticeUI:E,noticeOperations:y,checkGoogleDocVisibility:j}))}))},37592:function(e,t,n){"use strict";n.d(t,{Qo:function(){returno},Xx:function(){returni},cS:function(){returns}});varr=n(51806),a=n(55609);consto=(0,r.createElement)(a.SVG,{height:"24",viewBox:"0 0 64 88",width:"24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z"}),(0,r.createElement)(a.Path,{fill:"#FDFFFF",d:"M42,0l22,22H42V0z"}),(0,r.createElement)(a.Path,{fill:"#FDFFFF",d:"M50,39H14v-5h36V39z M50,46H14v5h36V46z M40,58H14v5h26V58z"})),i=(0,r.createElement)(a.SVG,{height:"24",viewBox:"0 0 64 88",width:"24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z"}),(0,r.createElement)(a.Path,{fill:"#FDFFFF",d:"M42,0l22,22H42V0z"}),(0,r.createElement)(a.Path,{fill:"#FDFFFF",d:"M12,34.5v28h40v-28H12z M17,39.5h12.5V46H17V39.5z M17,51h12.5v6.5H17V51z M47,57.5H34.5V51H47V57.5z M47,46 H34.5v-6.5H47V46z"})),s=(0,r.createElement)(a.SVG,{height:"24",viewBox:"0 0 64 88",width:"24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M58,88H6c-3.3,0-6-2.7-6-6V6c0-3.3,2.7-6,6-6h36l22,22v60C64,85.3,61.3,88,58,88z"}),(0,r.createElement)(a.Path,{fill:"#FDFFFF",d:"M42,0l22,22H42V0z"}),(0,r.createElement)(a.Path,{fill:"#FDFFFF",d:"M12,34.5v28h40v-28H12z M47,57.5H17v-18h30V57.5z"}))},36123:function(e,t,n){"use strict";n.d(t,{CR:function(){returnp},Xd:function(){returnm},lj:function(){returnd},u2:function(){returnc},wl:function(){returnu}});varr=n(65736),a=n(70355),o=n(79648),i=n(37592),s=n(49552),l=n(366);const__=r.__,_x=r._x,c="google-docs-embed",u={type:"document",title:__("Google Docs","jetpack"),description:__("Embed a Google Document.","jetpack"),name:"google-docs",keywords:[_x("document","block search term","jetpack"),_x("gsuite","block search term","jetpack"),_x("doc","block search term","jetpack")],icon:{src:i.Qo,foreground:(0,a.m)()},patterns:[/^(http|https):\/\/(docs\.google.com)\/document\/d\/([A-Za-z0-9_-]+).*?$/i]},d={type:"spreadsheets",title:__("Google Sheets","jetpack"),description:__("Embed a Google Sheet.","jetpack"),name:"google-sheets",keywords:[_x("sheet","block search term","jetpack"),_x("spreadsheet","block search term","jetpack")],icon:{src:i.Xx,foreground:(0,a.m)()},patterns:[/^(http|https):\/\/(docs\.google.com)\/spreadsheets\/d\/([A-Za-z0-9_-]+).*?$/i]},p={type:"presentation",title:__("Google Slides","jetpack"),description:__("Embed a Google Slides presentation.","jetpack"),name:"google-slides",icon:{src:i.cS,foreground:(0,a.m)()},keywords:[_x("slide","block search term","jetpack"),_x("presentation","block search term","jetpack"),_x("deck","block search term","jetpack")],patterns:[/^(http|https):\/\/(docs\.google.com)\/presentation\/d\/([A-Za-z0-9_-]+).*?$/i]},m={title:__("Google Docs","jetpack"),description:__("Embed a Google Document.","jetpack"),keywords:[_x("document","block search term","jetpack"),_x("gsuite","block search term","jetpack"),_x("doc","block search term","jetpack")],category:"embed",supports:{align:["left","right","center","wide","full"],anchor:!0},attributes:{url:{type:"string",default:""},aspectRatio:{type:"string"},variation:{type:"string"}},variations:[{name:u.name,isDefault:!0,title:u.title,description:u.description,icon:u.icon,attributes:{variation:"google-docs"
_n("There is currently only %s post in your Instagram account.","There are currently only %s posts in your Instagram account.",t,"jetpack"),t):__("There are currently no posts in your Instagram account.","jetpack");return(0,r.createElement)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice"},(0,r.createElement)(a.Notice,{isDismissible:!1,status:"info"},e))})():null,(0,r.createElement)(a.RangeControl,{label:__("Number of Posts","jetpack"),value:m,onChange:e=>u({count:e}),min:1,max:i.u}),(0,r.createElement)(a.RangeControl,{label:__("Number of Columns","jetpack"),value:p,onChange:e=>u({columns:e}),min:1,max:6}),(0,r.createElement)(a.RangeControl,{label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>u({spacing:e}),min:0,max:50}),(0,r.createElement)(a.ToggleControl,{label:__("Stack on mobile","jetpack"),checked:f,onChange:()=>u({isStackedOnMobile:!f})})))}},36420:function(e,t,n){"use strict";varr=n(51806),a=n(13419),o=n(52175),i=n(55609),s=n(69307),l=n(65736),c=n(65235),u=n.n(c),d=n(92819),p=n(4554),m=n(8979),h=n(696),f=n(64129),g=n(44961),b=n(79236),v=n(2681),k=n(75412);const__=l.__;t.Z=(0,i.withNotices)((e=>{const{attributes:t,className:n,isSelected:l,noticeOperations:c,noticeUI:y,setAttributes:E}=e,{accessToken:w,align:_,columns:C,count:S,isStackedOnMobile:j,spacing:x}=t;(0,s.useEffect)((()=>{conste=(0,p.S)(m.Z,t);(0,d.isEqual)(e,t)||E(e)}),[t,E]);const[P,L]=(0,s.useState)(w),{isRequestingWpcomConnectUrl:T,wpcomConnectUrl:N}=(0,v.Z)(),{images:A,isLoadingGallery:R,setImages:I}=(0,k.Z)({accessToken:w,noticeOperations:c,setAttributes:E,setSelectedAccount:L}),{connectToService:M,disconnectFromService:B,isConnecting:Z,isRequestingUserConnections:F,userConnections:D}=(0,b.Z)({accessToken:w,noticeOperations:c,selectedAccount:P,setAttributes:E,setImages:I,setSelectedAccount:L}),z=(0,a.Dp)(),O=S>A.length?A.length:S,U=!R&&(!w||(0,d.isEmpty)(A)),H=!U,$=w&&R&&(0,d.isEmpty)(A),V=!U&&!$,G=u()(n,{[`align${_}`]:_}),q=u()("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${C}`,{"is-stacked-on-mobile":j}),W={gridGap:x,"--latest-instagram-posts-spacing":x?`${x}px`:void0},K={padding:x},X=()=>{P&&h.D!==P?E({accessToken:P,instagramUser:(0,d.find)(D,{token:P}).username}):M()};return(0,r.createElement)("div",{className:G},U&&(0,r.createElement)(i.Placeholder,{icon:"instagram",instructions:z?F||D.length?void0:__("Connect to Instagram to start sharing your images.","jetpack"):__("First, you'll need to connect your WordPress.com account.","jetpack"),label:__("Latest Instagram Posts","jetpack"),notices:y},z?(()=>{conste=D.length>0,t=[...(0,d.map)(D,(e=>({label:`@${e.username}`,value:e.token}))),{label:__("Add a new account","jetpack"),value:h.D}],n=Z||F||e&&!P;return(0,r.createElement)("div",null,e&&(0,r.createElement)(i.RadioControl,{label:__("Select your Instagram account:","jetpack"),onChange:e=>L(e),options:t,selected:P}),h.D===P&&(0,r.createElement)("p",{className:"wp-block-jetpack-instagram-gallery__new-account-instructions"},__("If you are currently logged in to Instagram on this device, you might need to log out of it first.","jetpack")),(0,r.createElement)(i.Button,{disabled:n,variant:"primary",onClick:X},Z&&__("Connecting…","jetpack"),F&&__("Loading your connections…","jetpack"),!Z&&!F&&__("Connect to Instagram","jetpack")))})():(0,r.createElement)(i.Button,{disabled:T||!N,href:N,variant:"secondary"},__("Connect to WordPress.com","jetpack"))),$&&(0,r.createElement)("div",{className:"wp-block-embed is-loading"},(0,r.createElement)(i.Spinner,null),(0,r.createElement)("p",null,__("Embedding…","jetpack"))),V&&(0,r.createElement)("div",{className:q,style:W},(0,d.times)(l?S:O,(e=>(0,r.createElement)("span",{className:u()("wp-block-jetpack-instagram-gallery__grid-post"),key:e,style:K},(e=>{if(A[e]){constn=A[e];return(0,r.createElement)(g.Z,{alt:n.title||n.url,src:n.url,attributes:t,spacing:x})}return(0,r.createElement)("img",{alt:__("Latest Instagram Posts placeholder","jetpack"),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNMy
_n("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length,"jetpack","jetpack"),e.length),"assertive"):t(__("No results.","jetpack"),"assertive"))}render(){const{onChange:e,onKeyDown:t}=this,{children:n,instanceId:r,completer:a}=this.props,{selectedIndex:s,filteredOptions:l}=this.state,{key:c=""}=l[s]||{},{className:u}=a,d=l.length>0,h=d?`components-autocomplete-listbox-${r}`:null,f=d?`components-autocomplete-item-${r}-${c}`:null;return(0,o.createElement)("div",{className:"components-autocomplete"},n({isExpanded:d,listBoxId:h,activeId:f,onChange:e,onKeyDown:t}),d&&(0,o.createElement)(i.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0},(0,o.createElement)("div",{id:h,role:"listbox",className:"components-autocomplete__results"},(0,m.map)(l,((e,t)=>(0,o.createElement)(i.Button,{key:e.key,id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":t===s,disabled:e.isDisabled,className:p()("components-autocomplete__result",u,{"is-selected":t===s}),onClick:()=>this.select(e)},e.label))))))}}t.Z=(0,s.compose)([i.withSpokenMessages,s.withInstanceId,i.withFocusOutside])(f)},9262:function(e,t,n){"use strict";varr=n(90017),a=n.n(r),o=n(69307),i=n(85007),s=n(84634);classlextendso.Component{constructor(){super(...arguments),a()(this,"handleClick",(()=>{const{onClick:e}=this.props;e(this)})),a()(this,"getPoint",(()=>{const{point:e}=this.props;return[e.coordinates.longitude,e.coordinates.latitude]}))}componentDidMount(){this.renderMarker()}componentWillUnmount(){this.marker&&this.marker.remove()}componentDidUpdate(){this.renderMarker()}renderMarker(){const{map:e,point:t,mapboxgl:n,markerColor:r,mapRef:a}=this.props,{handleClick:o}=this,l=[t.coordinates.longitude,t.coordinates.latitude],{currentDoc:c}=(0,i.bL)(a.current),u=this.marker?this.marker.getElement():c.createElement("div");this.marker?this.marker.setLngLat(l):(u.className="wp-block-jetpack-map-marker",this.marker=newn.Marker(u).setLngLat(l).setOffset([0,-19]).addTo(e),this.marker.getElement().addEventListener("click",o)),(0,s.zb)(u,r)}render(){returnnull}}l.defaultProps={point:{},map:null,markerColor:"#000000",mapboxgl:null,onClick:()=>{}},t.Z=l},90055:function(e,t,n){"use strict";functionr(e,t){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[e][t?"details":"no_details"]}n.d(t,{h:function(){returnr}})},84634:function(e,t,n){"use strict";n.d(t,{YB:function(){returna},b2:function(){returnr},k:function(){returno},sy:function(){returni},xt:function(){returnl},zb:function(){returns}});constr=e=>e.hasOwnProperty("lat")&&e.hasOwnProperty("lng")?e:{lat:e.latitude||0,lng:e.longitude||0};functiona(e,t){constn=newe.LngLatBounds;returnt.forEach((e=>{n.extend([e.coordinates.longitude,e.coordinates.latitude])})),n}functiono(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}functioni(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:null;if(t)e.style.height=t+"px";else{constt=e.offsetWidth,n=window.location.search.indexOf("map-block-counter")>-1?window.innerHeight:.8*window.innerHeight,r=Math.min(t*(3/4),n);e.style.height=r+"px"}}functions(e,t){e.innerHTML=`\n\t\t<?xml version="1.0" encoding="UTF-8"?>\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t<g fill-rule="evenodd">\n\t\t\t\t<path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="${t}"/>\n\t\t\t</g>\n\t\t</svg>\n\t`}f
`${(0,u.sprintf)(__("Loading: %s","jetpack"),n)}${a}`,"assertive"),!0})),a()(this,"loadAndPlay",(e=>{this.recordUserInteraction(),this.loadTrack(e)&&this.props.playMediaSource(this.props.playerId)})),a()(this,"getTrack",(e=>this.props.tracks[e])),a()(this,"handleError",(e=>{if(!this.state.hasUserInteraction){constt=window.navigator.userAgent.match(/Trident\/7\./)?"IE11: Playing sounds in webpages setting is not checked":e;this.setState((()=>{thrownewError(t)}))}this.props.errorMediaSource(this.props.playerId),(0,i.speak)(`${__("Error: Episode unavailable - Open in a new tab","jetpack")}`,"assertive")})),a()(this,"handlePlay",(()=>{this.props.playMediaSource(this.props.playerId),this.setState({hasUserInteraction:!0})})),a()(this,"handlePause",(()=>{this.props.pauseMediaSource(this.props.playerId),this.props.playerState!==h.Vy&&this.props.pauseMediaSource(this.props.playerId)})),a()(this,"handleTimeChange",(e=>{this.props.setMediaSourceCurrentTime(this.props.playerId,e)})),a()(this,"handleJump",(()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime-5)})),a()(this,"handleSkip",(()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime+30)})),a()(this,"updateMediaData",(e=>{this.props.updateMediaSourceData(this.props.playerId,{duration:e.target?.duration,domId:e.target?.id})}))}registerPlayer(){conste=this.getTrack(this.state.currentTrack)||{},{playerId:t}=this.props;this.props.registerMediaSource(t,{title:e.title,link:e.link,state:h._5}),this.props.setDefaultMediaSource(t)}componentDidMount(){this.props.playerId&&this.registerPlayer()}componentWillUnmount(){this.props.playerId&&this.props.unregisterMediaSource(this.props.playerId)}componentDidUpdate(e){constt=e=>e?.length?e.map((e=>e.guid)):[],n=t(this.props.tracks),r=newSet(t(e.tracks));n.length===r.size&&n.every((e=>r.has(e)))||this.loadTrack(0)}staticgetDerivedStateFromProps(e,t){returne.tracks.length<=t.currentTrack?{...t,currentTrack:0}:null}render(){const{playerId:e,title:t,link:n,cover:r,tracks:a,attributes:i,currentTime:s,playerState:l}=this.props,{itemsToShow:c,primaryColor:d,customPrimaryColor:h,hexPrimaryColor:v,secondaryColor:k,customSecondaryColor:y,hexSecondaryColor:E,backgroundColor:w,customBackgroundColor:_,hexBackgroundColor:C,showCoverArt:S,showEpisodeTitle:j,showEpisodeDescription:x}=i,{currentTrack:P}=this.state,L=a.slice(0,c),T=this.getTrack(P),N=(0,f.Aq)({primaryColor:d,customPrimaryColor:h,secondaryColor:k,customSecondaryColor:y,backgroundColor:w,customBackgroundColor:_}),A={color:y,backgroundColor:_,"--jetpack-podcast-player-primary":v,"--jetpack-podcast-player-secondary":E,"--jetpack-podcast-player-background":C},R=p()("jetpack-podcast-player",l,N.secondary.classes,N.background.classes);return(0,o.createElement)("section",{className:R,style:A,"aria-labelledby":t||T&&T.title?`${e}__title`:void0,"aria-describedby":T&&T.description?`${e}__track-description`:void0,"data-jetpack-iframe-ignore":!0},(0,o.createElement)(g.Z,{playerId:e,title:t,link:n,cover:r,track:this.getTrack(P),showCoverArt:S,showEpisodeTitle:j,showEpisodeDescription:x,colors:N},(0,o.createElement)(m.Z,{onJumpBack:this.handleJump,onSkipForward:this.handleSkip,trackSource:this.getTrack(P).src,onPlay:this.handlePlay,onPause:this.handlePause,onError:this.handleError,playStatus:l,currentTime:s,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData})),L.length>1&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h4",{id:`jetpack-podcast-player__tracklist-title--${e}`,className:"jetpack-podcast-player--visually-hidden"},(0,u.sprintf)(
__("Playlist: %s","jetpack"),t)),(0,o.createElement)("p",{id:`jetpack-podcast-player__tracklist-description--${e}`,className:"jetpack-podcast-player--visually-hidden"},__("Select an episode to play it in the audio player.","jetpack")),(0,o.createElement)(b.Z,{playerId:e,playerState:l,currentTrack:P,tracks:L,selectTrack:this.selectTrack,colors:N})))}}k.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]},t.Z=(0,s.compose)([v.Z,(0,l.withSelect)(((e,t)=>{const{playerId:n}=t,{getMediaSourceCurrentTime:r,getMediaPlayerState:a}=e(h.tT);return{currentTime:r(n),playerState:a(n)}})),(0,l.withDispatch)((e=>{const{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:a,playMediaSource:o,pauseMediaSource:i,toggleMediaSource:s,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(h.tT);return{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:a,playMediaSource:o,pauseMediaSource:i,toggleMediaSource:s,errorMediaSource:l,setMediaSourceCurrentTime:c}}))])(k)},46843:function(e,t,n){"use strict";varr=n(51806),a=n(69307),o=n(65736);const__=o.__,i=(0,a.memo)((e=>{let{link:t,title:n,colors:a}=e;return(0,r.createElement)("div",{className:"jetpack-podcast-player__track-error"},__("Episode unavailable. ","jetpack"),t&&(0,r.createElement)("span",{className:a.secondary.classes,style:{color:a.secondary.custom}},(0,r.createElement)("a",{className:"jetpack-podcast-player__link",href:t,rel:"noopener noreferrer nofollow",target:"_blank"},(0,r.createElement)("span",{className:"jetpack-podcast-player--visually-hidden"},`${(0,o.sprintf)(/* translators: %s is the title of the track. This text is visually hidden from the screen, but available to screen readers. */
__("%s:","jetpack"),n)}`),__("Open in a new tab","jetpack"))))}));t.Z=i},96817:function(e,t,n){"use strict";var r=n(51806),a=n(69307),o=n(65736),i=n(69650);const __=o.__,s=(0,a.memo)((e=>{let t,n,{isPlaying:a,isError:o,className:s}=e;o?(n="error",
b=n?__("track","jetpack"):void0;return(0,r.createElement)("li",{className:f,style:Object.keys(g).length?g:null},(0,r.createElement)("a",{className:"jetpack-podcast-player__link jetpack-podcast-player__track-link",href:t.link||t.src,role:"button","aria-current":b,onClick:e=>{e.shiftKey||e.metaKey||e.altKey||(e.preventDefault(),i(d))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),i(d))}},(0,r.createElement)(u.Z,{className:"jetpack-podcast-player__track-status-icon",isPlaying:a,isError:o}),(0,r.createElement)("span",{className:"jetpack-podcast-player__track-title"},t.title),t.duration&&(0,r.createElement)("time",{className:"jetpack-podcast-player__track-duration",dateTime:t.duration},t.duration)),n&&o&&(0,r.createElement)(c.Z,{link:t.link,title:t.title,colors:p}))}));t.Z=d},71540:function(e,t,n){"use strict";n.d(t,{Z:function(){returnl}});varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(65736);const__=s.__;functionl(e){classtextendsi.Component{constructor(){super(...arguments),a()(this,"state",{didError:!1,isIE11AudioIssue:!1}),a()(this,"componentDidCatch",((e,t)=>{this.props.onError(e,t)}))}render(){const{didError:t,isIE11AudioIssue:n}=this.state;returnt?(0,o.createElement)("section",{className:"jetpack-podcast-player"},(0,o.createElement)("p",{className:"jetpack-podcast-player__error"},n?__('The podcast player cannot be displayed as your browser settings do not allow for sounds to be played in webpages. This can be changed in your browser’s "Internet options" settings. In the "Advanced" tab you will have to check the box next to "Play sounds in webpages" in the "Multimedia" section. Once you have confirmed that the box is checked, please press "Apply" and then reload this page.',"jetpack"):__("An unexpected error occured within the Podcast Player. Reloading this page might fix the problem.","jetpack",0))):(0,o.createElement)(e,this.props)}}returna()(t,"getDerivedStateFromError",(e=>({didError:!0,isIE11AudioIssue:!!e.message.match(/IE11/)}))),t.defaultProps={onError:()=>{}},t}},63226:function(e,t,n){"use strict";n.d(t,{b:function(){returna},u:function(){returnr}});constr="podcast-feed",a="embed-block"},16542:function(e,t,n){"use strict";varr=n(96483),a=n(24381);consto={url:{type:"string",validator:r.isUrl},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:a.Z},hexPrimaryColor:{type:"string",validator:a.Z},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:a.Z},hexSecondaryColor:{type:"string",validator:a.Z},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:a.Z},hexBackgroundColor:{type:"string",validator:a.Z},exampleFeedData:{type:"object"}};t.Z={attributes:o,supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},save:()=>null}},99800:function(e,t,n){"use strict";varr=n(51806),a=n(13419),o=n(52175),i=n(4981),s=n(55609),l=n(94333),c=n(9818),u=n(69307),d=n(65736),p=n(96483),m=n(51128),h=n.n(m),f=n(92819),g=n(43718),b=n(85007),v=n(4554),k=n(98075),y=n(30723),E=n(71600),w=n(63226),_=n(13331),C=n(93610),S=n(66085);const__=d.__,j=h()("jetpack:podcast-player:edit"),x=(0,a.Wp)()||(0,a.Ug)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/";t.Z=(0,l.compose)([(0,c.withDispatch)(((e,t)=>{let{clientId:n,attributes:r}=t;return{replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(n,(0,i.createBlock)("core/embed",{url:r.url}))}}})),(0,o.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),s.withNotices,l.withInstanceId,g.K])((e=>{let{instanceId:t,className:n,attributes:a,setAttributes:i,noticeOperations:{createErrorNotice:l,removeAllNotices:c},noticeUI:d,primaryColor:m,setPrimaryColor:h,secondaryColor:g,setSecondaryColor:P,fallbackTextColor:L,backgroundColor:T,setBackgroundColor:N,fallbackBackgroundColor:A,isSelected:R,replaceWi
_n("This block will only appear to people who have visited this page more than %d time.","This block will only appear to people who have visited this page more than %d times.",+this.props.attributes.threshold,"jetpack"),this.props.attributes.threshold):1===this.props.attributes.threshold?__("This block will only appear to people who are visiting this page for the first time.","jetpack"):(0,u.sprintf)(/* translators: placeholder is a number. */
_n("This block will only appear to people who are visiting this page for %d time.","This block will only appear to people who have visited this page at most %d times.",+this.props.attributes.threshold,"jetpack"),this.props.attributes.threshold)}render(){return(0,o.createElement)("div",{className:p()(this.props.className,{"wp-block-jetpack-repeat-visitor--is-unselected":!this.props.isSelected})},(0,o.createElement)(s.Placeholder,{icon:h.qv,label:__("Repeat Visitor","jetpack"),className:"wp-block-jetpack-repeat-visitor-placeholder"},(0,o.createElement)(s.TextControl,{className:"wp-block-jetpack-repeat-visitor-threshold",defaultValue:this.props.attributes.threshold,help:this.state.isThresholdValid?"":__("Please enter a valid number.","jetpack"),label:__("Visit count threshold","jetpack"),min:"1",onChange:this.setThreshold,pattern:"[0-9]",type:"number"}),(0,o.createElement)(s.RadioControl,{label:__("Visibility","jetpack"),selected:this.props.attributes.criteria,options:f,onChange:this.setCriteria})),(0,o.createElement)(s.Notice,{status:"info",isDismissible:!1},this.getNoticeLabel()),(0,o.createElement)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container"},(0,o.createElement)(i.InnerBlocks,null)))}}t.Z=(0,l.withSelect)(((e,t)=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=e("core/block-editor");return{isSelected:n(t.clientId)||r(t.clientId)}}))(g)},48516:function(e,t,n){"use strict";varr=n(51806),a=n(52175);t.Z=e=>{let{className:t}=e;return(0,r.createElement)("div",{className:t},(0,r.createElement)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container"},(0,r.createElement)(a.InnerBlocks.Content,null)))}},51100:function(e,t,n){"use strict";n.d(t,{Am:function(){returna},FV:function(){returnr},Kv:function(){returno}});constr="after-visits",a="before-visits",o=3},50323:function(e,t,n){"use strict";varr=n(31985),a=n(30314);(0,r.Z)(a.u2,a.Xd)},30314:function(e,t,n){"use strict";n.d(t,{Xd:function(){returnf},qv:function(){returnh},u2:function(){returnm}});varr=n(51806),a=n(52175),o=n(55609),i=n(65736),s=n(70355),l=n(36598),c=n(4498),u=n(48516),d=n(51100);const__=i.__,_x=i._x,p={attributes:{criteria:{type:"string",default:d.FV},threshold:{type:"number",default:d.Kv}},supports:{html:!1},save:e=>{let{className:t}=e;return(0,r.createElement)("div",{className:t},(0,r.createElement)(a.InnerBlocks.Content,null))}},m="repeat-visitor",h=(0,l.Z)((0,r.createElement)(o.Path,{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})),f={attributes:{criteria:{type:"string",default:d.FV},threshold:{type:"number",default:d.Kv}},category:"widgets",description:__("Control block visibility based on how often a visitor has viewed the page.","jetpack"),icon:{src:h,foreground:(0,s.m)()},keywords:[_x("return","block search term","jetpack"),_x("visitors","block search term","jetpack"),_x("visibility","block search term","jetpack")],supports:{align:["wide","full"],html:!1},title:__("Repeat Visitor","jetpack"),edit:c.Z,save:u.Z,example:{attributes:{criteria:d.FV,threshold:d.Kv},innerBlocks:[{name:"core/paragraph",attributes:{content:__("This block will only appear to a visitor who visited the page three or more times.","jetpack")}}]},deprecated:[p]}},98052:function(e,t,n){"use strict";varr=n(65736);const__=r.__;t.Z={revueUsername:{type:"string"},emailLabel:{type:"string",default:__("Email address","jetpack")},emailPlaceholder:{type:"string",default:__("Enter your email address","jetpack")},firstNameLabel:{type:"string",default:__("First name","jetpack")},firstNamePlaceholder:{type:"string",default:__("Enter your first name","jetpack")},firstNameShow:{type:"boolean",default:!0},lastNameLabel:{type:"string",default:__("Last name","jetpack")},lastNamePlaceholder:{type:"string",default:__("Enter your last name","jetpack")},lastNameShow:{type:"boolean",default:!0}}},67686:function(e,t,n){"use strict";varr=n(51806),a=n(4981),o=n(65736),i=n(92819);c
_n("%d character","%d characters",n.length,"jetpack"),n.length):(0,s.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
__("It's recommended to use less than %d characters in this field.","jetpack"),t);return(0,o.createElement)("div",{className:"jetpack-seo-message-box"},(0,o.createElement)(i.TextareaControl,a()({label:r,help:c,value:n},l)))}},74866:function(e,t,n){"use strict";varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(65736),l=n(4587),c=n(84638);const__=s.__;classuextendsi.Component{constructor(){super(...arguments),a()(this,"onMessageChange",(e=>{this.props.updateMetaValue(e)}))}render(){const{metaValue:e}=this.props;return(0,o.createElement)(l.J,{value:e,onChange:this.onMessageChange,label:__("SEO Description","jetpack"),placeholder:__("Write a description…","jetpack"),rows:4})}}t.Z=(0,c.M)("advanced_seo_description")(u)},86254:function(e,t,n){"use strict";varr=n(13419),a=n(8606);(0,r.o_)(a.u,a.X)},8606:function(e,t,n){"use strict";n.d(t,{X:function(){returng},u:function(){returnf}});varr=n(82674),a=n.n(r),o=n(51806),i=n(78868),s=n(55609),l=n(72067),c=n(69307),u=n(65736),d=n(34613),p=n(74866),m=n(95377),h=n(4773);const__=u.__,f="seo",g={render:()=>{conste={title:__("SEO","jetpack")},t={icon:(0,o.createElement)(i.Z,{showText:!1,height:16,logoColor:"#1E1E1E"}),title:__("SEO","jetpack")};return(0,o.createElement)(c.Fragment,null,(0,o.createElement)(d.Z,null,(0,o.createElement)(s.PanelBody,a()({className:"jetpack-seo-panel"},e),(0,o.createElement)(s.PanelRow,null,(0,o.createElement)(h.Z,null)),(0,o.createElement)(s.PanelRow,null,(0,o.createElement)(p.Z,null)),(0,o.createElement)(s.PanelRow,null,(0,o.createElement)(m.Z,null)))),(0,o.createElement)(l.PluginPrePublishPanel,t,(0,o.createElement)(c.Fragment,null,(0,o.createElement)(s.PanelRow,null,(0,o.createElement)(h.Z,null)),(0,o.createElement)(s.PanelRow,null,(0,o.createElement)(p.Z,null)),(0,o.createElement)(s.PanelRow,null,(0,o.createElement)(m.Z,null)))))}}},95377:function(e,t,n){"use strict";varr=n(51806),a=n(55609),o=n(65736),i=(n(99196),n(84638));const__=o.__;t.Z=(0,i.M)("jetpack_seo_noindex")((e=>{let{metaValue:t,updateMetaValue:n}=e;return(0,r.createElement)(a.CheckboxControl,{label:__("Hide page from search engines","jetpack"),help:__("If selected, a 'noindex' tag will help instruct search engines to not include this page in search results. This page will also be removed from the Jetpack sitemap.","jetpack"),checked:!!t,onChange:e=>{n(e)}})}))},4773:function(e,t,n){"use strict";varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(65736),l=(n(99196),n(4587)),c=n(84638);const__=s.__;classuextendsi.Component{constructor(){super(...arguments),a()(this,"onTitleChange",(e=>{this.props.updateMetaValue(e)}))}render(){const{metaValue:e}=this.props;return(0,o.createElement)(l.J,{value:e,onChange:this.onTitleChange,label:__("SEO Title","jetpack"),placeholder:__("Write a title…","jetpack"),suggestedLimit:70,rows:2})}}t.Z=(0,c.M)("jetpack_seo_html_title")(u)},84638:function(e,t,n){"use strict";n.d(t,{M:function(){returni}});varr=n(94333),a=n(9818),o=n(92819);consti=e=>(0,r.compose)([(0,a.withSelect)((t=>({metaValue:(0,o.get)(t("core/editor").getEditedPostAttribute("meta"),[e],"")}))),(0,a.withDispatch)((t=>({updateMetaValue(n){varr;"boolean"!=typeof(r=n)&&("string"!=typeofr||""!==r&&0===r.trim().length)||t("core/editor").editPost({meta:{[e]:n}})}})))])},14406:function(e,t,n){"use strict";varr=n(13419),a=n(44487);(0,r.o_)(a.u,a.X)},44487:function(e,t,n){"use strict";n.d(t,{X:function(){returnp},u:function(){returnd}});varr=n(51806),a=n(55609),o=n(9818),i=n(69307),s=n(65736),l=n(92819),c=n(26788),u=n(34613);const__=s.__,d="shortlinks",p={render:()=>(0,r.createElement)(h,null)};classmextendsi.Component{render(){const{shortlink:e}=this.props;returne?(0,r.createElement)(u.Z,null,(0,r.createElement)(a.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel",initialOpen:!1},(0,r.createElement)(c.Z,{link:e}))):null}}consth=(0,o.withSelect)((e=>{constt=e("core/editor").getCurrentPost();return{shortlink:(0,l.get)(t,"jetpack_shortlink","")}}))(m)},36825:function(e,t,n){"use strict";n.d(t,{LC:function(){returnr},Rh:function(){returno},a7:f
_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",n,"jetpack"),n)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0):(this.setState({fieldPriceError:__("If you’re selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),a()(this,"validateEmail",(()=>{const{email:e}=this.props.attributes;returne?f.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,p.sprintf)(/* translators: placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),e)}),!1):(this.setState({fieldEmailError:__("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),a()(this,"validateTitle",(()=>{const{title:e}=this.props.attributes;returne?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:__("Please add a brief title so that people know what they’re paying for.","jetpack")}),!1)})),a()(this,"handleEmailChange",(e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})})),a()(this,"handleContentChange",(e=>{this.props.setAttributes({content:e})})),a()(this,"handlePriceChange",(e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})})),a()(this,"handleCurrencyChange",(e=>{this.props.setAttributes({currency:e})})),a()(this,"handleMultipleChange",(e=>{this.props.setAttributes({multiple:!!e})})),a()(this,"handleTitleChange",(e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})})),a()(this,"getCurrencyList",v.Rh.map((e=>{const{symbol:t}=(0,i.X)(e);return{value:e,label:t===e?e:`${e}${(0,g.trimEnd)(t,".")}`}}))),a()(this,"renderSettings",(()=>(0,o.createElement)(s.InspectorControls,null,(0,o.createElement)(l.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,o.createElement)(l.BaseControl,{label:__("Purchase link text","jetpack"),help:__("Enter the text you want to display on a purchase link used as fallback when the PayPal button cannot be used (e.g. emails, AMP, etc.)","jetpack"),className:"jetpack-simple-payments__purchase-link-text"},(0,o.createElement)(l.TextControl,{placeholder:__("Click here to purchase","jetpack"),onChange:e=>this.props.setAttributes({postLinkText:e}),value:this.props.attributes.postLinkText}))))))}componentDidMount(){this.injectPaymentAttributes();const{attributes:e,hasPublishAction:t,postLinkUrl:n,setAttributes:r}=this.props,{productId:a}=e;!a&&t&&this.saveProduct();consto=n&&n!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(o||i)&&r({...o&&{postLinkUrl:n},...i&&{postLinkText:__("Click here to purchase.","jetpack")}})}componentDidUpdate(e){const{hasPublishAction:t,isSelected:n,postLinkUrl:r,setAttributes:a}=this.props;(0,g.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),!e.isSaving&&this.props.isSaving&&t&&this.validateAttributes()?this.saveProduct():e.isSelected&&!n&&this.validateAttributes();consto=r&&r!==this.props.attributes.postLinkUrl,i=!this.props.attributes.postLinkText;(o||i)&&a({...o&&{postLinkUrl:r},...i&&{postLinkText:__("Click here to purchase.","jetpack")}})}injectPaymentAttributes(){const{simplePayment:e,featuredMedia:t}=this.props;if(!this.shouldInjectPaymentAttributes||(0,g.isEmpty)(e))return;const{attributes:n,setAttributes:r}=this.props,{content:a,currency:o,email:i,featuredMediaId:s,featuredMediaUrl:l,featuredMediaTitle:c,multiple:u,price:d,title:p}=n;r({content:(0,g.get)(e,["content","raw"],a),currency:(0,g.get)(e,["meta","spay_currency"],o),email:(0,g.get)(e,["meta","spay_email"],i),featuredMediaId:(0,g.get)(e,["featured_media"],s),featuredMediaUrl:(0,g.get)(t,"url",l),featuredMediaTitle:(0,g.get)(t,"title",c),multiple:Boolean((0,g.get)(e,["meta","spay_multiple"],Boolean(u))),price:(0,g.get)(e,["meta","spay_price"],d||void0),title:(0,g.get)(e,["title","raw"],p)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}toApi(){const{attributes:e}=this.props,{content:t,currency:n,email:r,featuredMediaId:a,multiple:o,price:i,productId:s,title:l}=e;return{id:s,content:t,featured_media:a,meta:{spay_currency:n,spay_email:r,spay_multiple:o,spay_price:i},status:s?"publish":"draft",title:l}}saveProduct(){if(this.state.isSavingProduct)return;const{attributes:e,setAttributes:t}=this.props,{email:n}=e,{saveEntityRecord:r}=(0,u.dispatch)("core");this.setState({isSavingProduct:!0},(()=>{r("postType",v.LC,this.toApi()).then((e=>(e&&t({productId:e.id}),e))).catch((e=>{if(!e||!e.data)return;const{d
__("%s is not a valid email address.","jetpack"),n):null,fieldPriceError:"spay_price"===t?__("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:n}=this.state,{attributes:r,instanceId:a,isSelected:i,setAttributes:s,simplePayment:c}=this.props,{content:u,currency:d,email:p,featuredMediaId:m,featuredMediaUrl:f,featuredMediaTitle:v,multiple:w,price:_,productId:C,title:S}=r,j=C&&(0,g.isEmpty)(c);if(!i&&j)return(0,o.createElement)("div",{className:"simple-payments__loading"},(0,o.createElement)(y.Z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!i&&p&&_&&S&&!e&&!t&&!n)return(0,o.createElement)(y.Z,{"aria-busy":"false",content:u,featuredMediaUrl:f,featuredMediaTitle:v,formattedPrice:(0,E.w)(_,d),multiple:w,title:S});constx=j?l.Disabled:"div";return(0,o.createElement)(x,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,o.createElement)(k.Z,{featuredMediaId:m,featuredMediaUrl:f,featuredMediaTitle:v,setAttributes:s}),(0,o.createElement)("div",null,(0,o.createElement)(l.TextControl,{"aria-describedby":`${a}-title-error`,className:h()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":n}),label:__("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:S}),(0,o.createElement)(b.Z,{id:`${a}-title-error`,isError:!0},n),(0,o.createElement)(l.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:__("Describe your item in a few words","jetpack"),value:u}),(0,o.createElement)("div",{className:"simple-payments__price-container"},(0,o.createElement)(l.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:d}),(0,o.createElement)(l.TextControl,{"aria-describedby":`${a}-price-error`,className:h()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,E.w)(0,d,!1),required:!0,step:"1",type:"number",value:_||""}),(0,o.createElement)(b.Z,{id:`${a}-price-error`,isError:!0},t)),(0,o.createElement)("div",{className:"simple-payments__field-multiple"},(0,o.createElement)(l.ToggleControl,{checked:Boolean(w),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),(0,o.createElement)(l.TextControl,{"aria-describedby":`${a}-email-${e?"error":"help"}`,className:h()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":e}),label:__("Email","jetpack"),onChange:this.handleEmailChange,placeholder:__("Email","jetpack"),required:!0,type:"text",value:p}),(0,o.createElement)(b.Z,{id:`${a}-email-error`,isError:!0},e),(0,o.createElement)(b.Z,{id:`${a}-email-help`},__("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",(0,o.createElement)(l.ExternalLink,{href:"https://www.paypal.com/"},__("Create one on PayPal","jetpack")))))}}const_=(0,u.withSelect)(((e,t)=>{const{getEntityRecord:n,getMedia:r}=e("core"),{isSavingPost:a,getCurrentPost:o}=e("core/editor"),{productId:i,featuredMediaId:s}=t.attributes,l=i?(0,g.pick)(n("postType",v.LC,i),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void0,c=o();return{hasPublishAction:!!(0,g.get)(c,["_links","wp:action-publish"]),isSaving:!!a(),simplePayment:l,featuredMedia:s?r(s):null,postLinkUrl:c.link}}));t.Z=(0,c.compose)(_,c.withInstanceId)(w)},24097:function(e,t,n){"use strict";varr=n(51806),a=n(13419),o=n(55609),i=n(69307),s=n(65736),l=n(70355),c=n(36825),u=n(21559),d=n(83080);const__=s.__,_x=s._x,p=(0,r.createElement)(o.SVG
_n("The price cannot have more than %d decimal place.","The price cannot have more than %d decimal places.",n,"jetpack"),n)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0):(this.setState({fieldPriceError:__("If you’re selling something, you need a price tag. Add yours here.","jetpack")}),!1)})),a()(this,"validateEmail",(()=>{const{email:e}=this.props.attributes;returne?g.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,p.sprintf)(/* translators: Placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),e)}),!1):(this.setState({fieldEmailError:__("We want to make sure payments reach you, so please add an email address.","jetpack")}),!1)})),a()(this,"validateTitle",(()=>{const{title:e}=this.props.attributes;returne?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:__("Please add a brief title so that people know what they’re paying for.","jetpack")}),!1)})),a()(this,"handleEmailChange",(e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})})),a()(this,"handleContentChange",(e=>{this.props.setAttributes({content:e})})),a()(this,"handlePriceChange",(e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})})),a()(this,"handleCurrencyChange",(e=>{this.props.setAttributes({currency:e})})),a()(this,"handleMultipleChange",(e=>{this.props.setAttributes({multiple:!!e})})),a()(this,"handleTitleChange",(e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})})),a()(this,"getCurrencyList",k.Rh.map((e=>{const{symbol:t}=(0,i.X)(e);return{value:e,label:t===e?e:`${e}${(0,b.trimEnd)(t,".")}`}}))),a()(this,"renderSettings",(()=>(0,o.createElement)(s.InspectorControls,null,(0,o.createElement)(y.G,{postLinkText:this.props.attributes.postLinkText,setAttributes:this.props.setAttributes}))))}componentDidMount(){this.injectPaymentAttributes();const{attributes:e,hasPublishAction:t,postLinkUrl:n,setAttributes:r,isPostEditor:a}=this.props,{productId:o}=e;(!o&&t||!a)&&this.saveProduct();consti=n&&n!==this.props.attributes.postLinkUrl,s=!this.props.attributes.postLinkText;(i||s)&&r({...i&&{postLinkUrl:n},...s&&{postLinkText:__("Click here to purchase.","jetpack")}}),window.wp?.customize?.bind("change",(e=>{lett;constn=e.id.match(/^widget_(.+)(?:\[(\d+)\])$/);if(n){t=`${n[1]}-${parseInt(n[2],10)}`}elset=e.id;t===(0,m.getWidgetIdFromBlock)(this.props.block)&&this.validateAttributes()&&this.saveProduct()}))}componentDidUpdate(e){const{hasPublishAction:t,isSelected:n,postLinkUrl:r,setAttributes:a,isPostEditor:o}=this.props;(0,b.isEqual)(e.simplePayment,this.props.simplePayment)||this.injectPaymentAttributes(),e.isSaving||!this.props.isSaving||!t&&o||!this.validateAttributes()?e.isSelected&&!n&&this.validateAttributes():this.saveProduct();consti=r&&r!==this.props.attributes.postLinkUrl,s=!this.props.attributes.postLinkText;(i||s)&&a({...i&&{postLinkUrl:r},...s&&{postLinkText:__("Click here to purchase.","jetpack")}})}injectPaymentAttributes(){const{simplePayment:e,featuredMedia:t}=this.props;if(!this.shouldInjectPaymentAttributes||(0,b.isEmpty)(e))return;const{attributes:n,setAttributes:r}=this.props,{content:a,currency:o,email:i,featuredMediaId:s,featuredMediaUrl:l,featuredMediaTitle:c,multiple:u,price:d,title:p}=n;r({content:(0,b.get)(e,["content","raw"],a),currency:(0,b.get)(e,["meta","spay_currency"],o),email:(0,b.get)(e,["meta","spay_email"],i),featuredMediaId:(0,b.get)(e,["featured_media"],s),featuredMediaUrl:(0,b.get)(t,"url",l),featuredMediaTitle:(0,b.get)(t,"title",c),multiple:Boolean((0,b.get)(e,["meta","spay_multiple"],Boolean(u))),price:(0,b.get)(e,["meta","spay_price"],d||void0),title:(0,b.get)(e,["title","raw"],p)}),this.shouldInjectPaymentAttributes=!this.shouldInjectPaymentAttributes}toApi(){const{attributes:e}=this.props,{content:t,currency:n,email:r,featuredMediaId:a,multiple:o,price:i,productId:s,title:l}=e;return{id:s,content:t,featured_media:a,meta:{spay_currency:n,spay_email:r,spay_multiple:o,spay_price:i},status:s?"publish":"draft",title:l}}saveProduct(){if(this.state.isSavingProduct)return;const{attributes:e,setAttributes:t}=this.props,{email:n}=e,{saveEntityRecord:r}=(0,u.dispatch)("core");this.setState({isSavingProduct:!0},(()=>{r("postType",k.LC,this.toApi()).then((e=>(e&&t({productId:e.id}),e))).catch((e=>{if(!e||!e.data)return;const{data:{key:t}}=e;this.setState({fieldEmailError:"spay_email"===t?(0,p.sprintf)(/* translators: Placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),n):null,fieldPriceError:"spay_price"===t?__("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:n}=this.state,{attributes:r,instanceId:a,isSelected:i,setAttributes:s,simplePayment:c}=this.props,{content:u,currency:d,email:p,featuredMediaId:m,featuredMediaUrl:h,featuredMediaTitle:g,multiple:k,price:y,productId:C,title:S}=r,j=C&&(0,b.isEmpty)(c);if(!i&&j)return(0,o.createElement)("div",{className:"simple-payments__loading"},(0,o.createElement)(w.Z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!i&&p&&y&&S&&!e&&!t&&!n)return(0,o.createElement)(w.Z,{"aria-busy":"false",content:u,featuredMediaUrl:h,featuredMediaTitle:g,formattedPrice:(0,_.T4)(y,d),multiple:k,title:S});constx=j?l.Disabled:"div";return(0,o.createElement)(x,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,o.createElement)(E.Z,{featuredMediaId:m,featuredMediaUrl:h,featuredMediaTitle:g,setAttributes:s}),(0,o.createElement)("div",null,(0,o.createElement)(l.TextControl,{"aria-describedby":`${a}-title-error`,className:f()("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":n}),label:__("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:S}),(0,o.createElement)(v.Z,{id:`${a}-title-error`,isError:!0},n),(0,o.createElement)(l.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:__("Describe your item in a few words","jetpack"),"aria-label":__("Describe your item in a few words","jetpack"),value:u}),(0,o.createElement)("div",{className:"simple-payments__price-container"},(0,o.createElement)(l.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:d}),(0,o.createElement)(l.TextControl,{"aria-describedby":`${a}-price-error`,className:f()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,_.T4)(0,d,!1),required:!0,step:"1",type:"number",value:y||""}),(0,o.createElement)(v.Z,{id:`${a}-price-error`,isError:!0},t)),(0,o.createElement)("div",{className:"simple-payments__field-multiple"},(0,o.createElement)(l.ToggleControl,{checked:Boolean(k),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),(0,o.createElement)(l.TextControl,{"aria-describedby":`${a}-email-${e?"error":"help"}`,className:f()("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":e}),label:__("Email","jetpack"),onChange:this.handleEmailChange,placeholder:__("Email","jetpack"),required:!0,type:"text",value:p}),(0,o.createElement)(v.Z,{id:`${a}-email-error`,isError:!0},e),(0,o.createElement)(v.Z,{id:`${a}-email-help`},__("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",(0,o.createElement)(l.ExternalLink,{href:"https://www.paypal.com/"},__("Create one on PayPal","jetpack")))))}}constS=(0,u.withSelect)(((e,t)=>{const{getEntityRecord:n,getMedia:r}=e("core"),{getCurrentPost:a}=e("core/editor"),{__experimentalGetDirtyEntityRecords:o,isSavingEntityRecord:i}=e("core"),s=o,{productId:l,featuredMediaId:c}=t.attributes,u=l?(0,b.pick)(n("postType",k.LC,l),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void0,d=a();return{block:e("core/block-editor").getBlock(t.clientId),hasPublishAction:!!(0,b.get)(d,["_links","wp:action-publish"]),isSaving:s().some((e=>i(e.kind,e.name,e.key))),simplePayment:u,featuredMedia:c?r(c):null,postLinkUrl:d?.guid?.raw,isPostEditor:Objec
__("Go to slide %s","jetpack"),e)+'"></button>'}elsea+=`<div class="swiper-pagination-simple">${t} / ${n}</div>`;returna}},67240:function(e,t,n){"use strict";varr=n(51806),a=n(19486);t.Z=e=>{let{attributes:{align:t,autoplay:n,delay:o,effect:i,images:s},className:l}=e;return(0,r.createElement)(a.Z,{align:t,autoplay:n,className:l,delay:o,effect:i,images:s})}},19486:function(e,t,n){"use strict";varr=n(90017),a=n.n(r),o=n(51806),i=n(11313),s=n(52175),l=n(55609),c=n(69307),u=n(65736),d=n(65235),p=n.n(d),m=n(92819),h=n(6209),f=n(30847),g=n(85575),b=n(17766);const__=u.__;classvextendsc.Component{constructor(e){vart;super(e),t=this,a()(this,"pendingRequestAnimationFrame",null),a()(this,"resizeObserver",null),a()(this,"initializeResizeObserver",(e=>{this.clearResizeObserver(),this.resizeObserver=newh.Z((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,b.$m)(e),e.update()}))})),this.resizeObserver.observe(e.el)})),a()(this,"clearPendingRequestAnimationFrame",(()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)})),a()(this,"clearResizeObserver",(()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)})),a()(this,"prefersReducedMotion",(()=>"undefined"!=typeofwindow&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)),a()(this,"buildSwiper",(function(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:0;return(0,f.Z)(t.slideshowRef.current,{autoplay:!(!t.props.autoplay||t.prefersReducedMotion())&&{delay:1e3*t.props.delay,disableOnInteraction:!1},effect:t.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:t.btnNextRef.current,prevEl:t.btnPrevRef.current},pagination:{clickable:!0,el:t.paginationRef.current,type:"custom",renderCustom:g.D}},{init:b.UA,imagesReady:b.$m,paginationRender:b.Wj,transitionEnd:b.HV})})),this.slideshowRef=(0,c.createRef)(),this.btnNextRef=(0,c.createRef)(),this.btnPrevRef=(0,c.createRef)(),this.paginationRef=(0,c.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:n,delay:r,effect:a,images:o,onError:i}=this.props;if(t===e.align&&(0,m.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),a!==e.effect||n!==e.autoplay||r!==e.delay||o!==e.images){lett;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{i(__("The Swiper library could not be loaded.","jetpack"))}))}}render(){if(!this.props?.images?.length)returnnull;const{autoplay:e,className:t,delay:n,effect:r,images:a}=this.props;return(0,o.createElement)("div",{className:t,"data-autoplay":e||null,"data-delay":e?n:null,"data-effect":r},(0,o.createElement)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef},(0,o.createElement)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper"},a.map((e=>{let{alt:t,caption:n,id:r,url:a}=e;return(0,o.createElement)("li",{className:p()("wp-block-jetpack-slideshow_slide","swiper-slide",(0,i.isBlobURL)(a)&&"is-transient"),key:r||a},(0,o.createElement)("figure",null,(0,o.createElement)("img",{alt:t,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,src:a}),(0,i.isBlobURL)(a)&&(0,o.createElement)(l.Spinner,null),n&&(0,o.createElement)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:n})))}))),(0,o.createElement)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,o.createElement)("a",{c
_n("<span>%s reader</span> issubscribed.","<span>%s readers</span> aresubscribed.",R,"jetpack"),(0,a.Z)(R)),{span:(0,r.createElement)("span",{style:{fontWeight:"bold"}})})),S&&(0,r.createElement)(s.__experimentalPanelColorGradientSettings,{title:__("Color","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:t.color,onColorChange:L,gradientValue:g.gradientValue,onGradientChange:g.setGradient,label:__("Button Background","jetpack")},{colorValue:I.color,onColorChange:T,label:__("Button Text","jetpack")},{colorValue:n.color,onColorChange:P,label:__("Border","jetpack")}],initialOpen:!0},(0,r.createElement)(s.ContrastChecker,{fontSize:_.size,textColor:I.color,backgroundColor:y.color,fallbackButtonBackgroundColor:E,fallbackTextColor:w})),!S&&(0,r.createElement)(s.PanelColorSettings,{title:__("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:t.color,onChange:L,label:__("Button Background Color","jetpack")},{value:I.color,onChange:T,label:__("Button Text Color","jetpack")},{value:n.color,onColorChange:P,label:__("Border Color","jetpack")}],initialOpen:!1},(0,r.createElement)(s.ContrastChecker,{fontSize:_.size,textColor:I.color,backgroundColor:y.color,fallbackButtonBackgroundColor:E,fallbackTextColor:w})),(0,r.createElement)(l.PanelBody,{title:__("Typography","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel"},(0,r.createElement)(s.FontSizePicker,{withSlider:!0,value:_.size,onChange:e=>{constt=e||m.tm;x({fontSize:t,customFontSize:t})},__nextHasNoMarginBottom:!0})),(0,r.createElement)(l.PanelBody,{title:__("Border","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel"},(0,r.createElement)(l.RangeControl,{value:b,label:__("Border Radius","jetpack"),min:m.G0,max:m.Gp,initialPosition:m.S9,allowReset:!0,onChange:e=>x({borderRadius:e})}),(0,r.createElement)(l.RangeControl,{value:v,label:__("Border Weight","jetpack"),min:m.VF,max:m.K3,initialPosition:m.XJ,allowReset:!0,onChange:e=>x({borderWeight:e})})),(0,r.createElement)(l.PanelBody,{title:__("Spacing","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel"},(0,r.createElement)(l.RangeControl,{value:j,label:__("Space Inside","jetpack"),min:m.xV,max:m.bK,initialPosition:m.HE,allowReset:!0,onChange:e=>x({padding:e})}),(0,r.createElement)(l.RangeControl,{value:A,label:__("Space Between","jetpack"),min:m.Tr,max:m.pC,initialPosition:m.FP,allowReset:!0,onChange:e=>x({spacing:e})}),(0,r.createElement)(p.g,{width:M,onChange:e=>x({buttonWidth:e})})),(0,r.createElement)(l.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel"},(0,r.createElement)(l.ToggleControl,{label:__("Show subscriber count","jetpack"),checked:N,onChange:()=>{x({showSubscribersTotal:!N})},help:()=>{if(!R||R<1)return__("This will remain hidden until there is at least one subscriber.","jetpack")}}),N&&Z?(0,r.createElement)(l.ToggleControl,{disabled:!N,label:__("Include social followers in count","jetpack"),checked:C,onChange:()=>{x({includeSocialFollowers:!C})}}):null,(0,r.createElement)(l.ToggleControl,{label:__("Place button on new line","jetpack"),checked:k,onChange:()=>{x({buttonOnNewLine:!k})}}),!(0,i.Wp)()&&(0,r.createElement)(l.TextareaControl,{value:B,label:__("Success message","jetpack"),help:__("Edit the message displayed when a user subscribes.","jetpack"),onChange:e=>x({successMessage:e})})))}},2916:function(e,t,n){"use strict";varr=n(75623),a=n(45097),o=n(20121),i=n(76609),s=n(11689),l=n(79024),c=n(68600),u=n(39583);t.Z=[u.Z,c.Z,l.Z,s.Z,i.Z,o.Z,a.Z,r.Z]},75623:function(e,t,n){"use strict";varr=n(51806),a=n(69307),o=n(65736),i=n(92819);const__=o.__;t.Z={attributes:{subscribeButton:{type:"string",default:__("Subscribe","jetpack")},showSubscribersTotal:{type:"boolean",default:!1}},migrate:e=>({submitButtonText:e.subscribeButton,showSubscribersTotal:e.showSubscribersTotal}),isEligible:e=>!(!e.hasOwnProperty("subscribeButton")||!(0,i.isEmpty)(e.subscribeButton)),save
_n("%s subscriber","%s subscribers",Z,"jetpack"),(0,o.Z)(Z))),{span:(0,r.createElement)("span",{className:"jetpack-subscribe-reader-count"})})),(0,v.cJ)()&&(0,r.createElement)(b.Hx,{setPostMeta:R,accessLevel:I,withModal:!1,socialFollowers:C,emailSubscribers:t,paidSubscribers:w}),!x&&!L&&(0,r.createElement)(y,null,(0,r.createElement)(s.Button,{disabled:x||T,isBusy:T,onClick:()=>(j.recordEvent("jetpack_editor_subscriptions_enable"),P(!0)),variant:"secondary"},T?__("Activating Subscriptions","jetpack"):__("Activate Subscriptions","jetpack",0)))),(0,r.createElement)(u.PluginPostPublishPanel,{className:"jetpack-subscribe-post-publish-panel",initialOpen:!0},D&&(0,r.createElement)(h.Z,null,(0,p.createInterpolateElement)(0!==C?(0,m.sprintf)(/* translators: 1$s will be subscribers, %2$s will be social followers */
_n("%s subscriber","%s subscribers",Z,"jetpack"),(0,o.Z)(Z))),{span:(0,r.createElement)("span",{className:"jetpack-subscribe-reader-count"})}))))}},84177:function(e,t,n){"use strict";n.d(t,{$P:function(){returnf},Hx:function(){returnb},So:function(){returnh}});varr=n(51806),a=n(6895),o=n(52175),i=n(55609),s=n(94333),l=n(9818),c=n(12238),u=n(69307),d=n(65736),p=n(34904),m=n(58841);const__=d.__,h={everybody:{string:"everybody",label:__("Everybody","jetpack"),info:__("Visible to everyone.","jetpack")},subscribers:{string:"subscribers",label:__("All subscribers","jetpack"),info:__("Visible to everyone that subscribes to your site.","jetpack")},paid_subscribers:{string:"paid_subscribers",label:__("Paid subscribers","jetpack"),info:__("Visible to everyone that purchases a paid plan on your site.","jetpack")}};functionf(e){let{accessLevel:t}=e;return(0,r.createElement)("div",{className:"jetpack-subscribe-notice-misconfiguration warning"},(0,d.sprintf)(/* translators: %1$s: visibility label for the newsletter, %2$s: label for setting "everybody". this is a warning in the newsletter when posts have a private or password-protected visibility */
__('Private or password-protected posts cannot be assigned a newsletter setting of "%1$s". Please update the setting to "%2$s", or update the post visibility setting.',"jetpack"),h[t].label,h.everybody.label))}functiong(e){let{accessLevel:t,onChange:n,socialFollowers:a,emailSubscribers:o,paidSubscribers:l}=e;constc=(0,s.useInstanceId)(g);return(0,r.createElement)("fieldset",{className:"editor-post-visibility__fieldset"},(0,r.createElement)(i.VisuallyHidden,{as:"legend"},__("Audience","jetpack")," "),Object.keys(h).map((e=>(0,r.createElement)("div",{className:"editor-post-visibility__choice",key:e},(0,r.createElement)("input",{type:"radio",checked:e===t,name:`editor-post-visibility__setting-${c}`,value:e,id:`editor-post-${e}-${c}`,"aria-describedby":`editor-post-${e}-${c}-description`,className:"editor-post-visibility__radio",onChange:e=>{constt={};returnt[m.lx]=e?.target?.value,n&&n(t)}}),(0,r.createElement)("label",{htmlFor:`editor-post-${e}-${c}`,className:"editor-post-visibility__label"},h[e].label," ",function(e,t,n,r){if(null===t||null===n||null===r)return"";switch(h[e]){caseh.everybody:return"("+(t+r)+"+)";caseh.subscribers:return"("+t+")";caseh.paid_subscribers:return"("+n+")"}}(e,o,l,a)),(0,r.createElement)("p",{id:`editor-post-${e}-${c}-description`,className:"editor-post-visibility__info"},h[e].info)))))}functionb(e){let{accessLevel:t,setPostMeta:n,socialFollowers:s,emailSubscribers:m,paidSubscribers:b,withModal:v=!0}=e;t&&Object.keys(h).includes(t)||(t=Object.keys(h)[0]);constk=h[t]?.label,y="public"===(0,l.useSelect)((e=>e("core/editor").getEditedPostVisibility())),E=!y&&t===h.everybody.string,w=!y&&t!==h.everybody.string;return(0,r.createElement)(c.PostVisibilityCheck,{render:e=>{let{canEdit:l}=e;return(0,r.createElement)(i.PanelRow,{className:"edit-post-post-visibility"},(0,r.createElement)(i.Flex,{direction:"column"},l&&v&&E&&(0,r.createElement)(i.FlexBlock,null,(0,r.createElement)(p.Z,{spanClass:"jetpack-subscribe-notice-visibility"},/* translators: this is a warning in the newsletter when posts have a private or password-protected visibility */
__("Private or password-protected posts cannot be assigned as Subscribers-only.","jetpack"))),l&&v&&w&&(0,r.createElement)(i.FlexBlock,null,(0,r.createElement)(f,{accessLevel:t})),(0,r.createElement)(i.Flex,{direction:v?"row":"column"},(0,r.createElement)(i.FlexBlock,null,(0,r.createElement)("span",null,__("Access","jetpack"))),(!l||E)&&(0,r.createElement)("span",null,k),!E&&v&&l&&(0,r.createElement)(i.FlexBlock,null,(0,r.createElement)(i.Dropdown,{placement:"bottom-end",contentClassName:"edit-post-post-visibility__dialog",focusOnMount:!0,renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,r.createElement)(i.Button,{variant:"tertiary",onClick:n,"aria-expanded":t,"aria-label":(0,d.sprintf)(
__("Select audience: %s","jetpack"),k)},k)},renderContent:e=>{let{onClose:a}=e;return(0,r.createElement)("div",{className:"editor-post-visibility"},(0,r.createElement)(o.__experimentalInspectorPopoverHeader,{title:__("Audience","jetpack"),help:__("Control how this newsletter is viewed.","jetpack"),onClose:a}),(0,r.createElement)(g,{accessLevel:t,socialFollowers:s,emailSubscribers:m,paidSubscribers:b,onChange:n}))}})),!E&&!v&&l&&(0,r.createElement)(i.FlexBlock,null,(0,r.createElement)(g,{accessLevel:t,socialFollowers:s,emailSubscribers:m,paidSubscribers:b,onChange:n}))),v&&(0,r.createElement)(i.FlexBlock,null,(0,r.createElement)("small",{spanClass:"jetpack-subscribe-info"},(0,u.createInterpolateElement)(/* translators: basic information about the newsletter visibility */
__("Restrict your post to subscribers. <a>Learn more</a>.","jetpack"),{a:(0,r.createElement)("a",{href:(0,a.Z)("paid-newsletter-info",{anchor:"memberships-and-subscriptions"}),rel:"noopener noreferrer",target:"_blank"})})))))}})}},68269:function(e,t,n){"use strict";n.d(t,{f:function(){returnc}});varr=n(51806),a=n(13419),o=n(55609),i=n(69307),s=n(65736),l=n(30217);const__=s.__,c=e=>{let{changeStatus:t,isLoading:n,isModuleActive:s}=e;const{tracks:c}=(0,a.z$)();return(0,i.useEffect)((()=>{c.recordEvent("jetpack_editor_subscriptions_placeholder_view")}),[c]),(0,r.createElement)(o.Placeholder,{icon:l.qv,instructions:__("You'll need to activate the Subscriptions feature to use the Subcribe block.","jetpack"),label:l.Xd.title},(0,r.createElement)(o.Button,{disabled:s||n,isBusy:n,onClick:()=>(c.recordEvent("jetpack_editor_subscriptions_enable"),t(!0)),variant:"secondary"},n?__("Activating Subscriptions","jetpack"):__("Activate Subscriptions","jetpack",0)),(0,r.createElement)("div",{className:"membership-button__disclaimer"},(0,r.createElement)(o.ExternalLink,{href:"https://jetpack.com/support/subscriptions/"},__("Learn more about the Subscriptions feature.","jetpack"))))}},22750:function(e,t,n){"use strict";varr=n(51806),a=n(22636),o=n(55609);t.Z=function(){return(0,r.createElement)(o.Placeholder,null,(0,r.createElement)(o.Flex,{gap:2,direction:"column",style:{width:"100%"}},(0,r.createElement)(o.Flex,{gap:4},(0,r.createElement)(o.FlexItem,null,(0,r.createElement)(a.Z,{width:30,height:30})),(0,r.createElement)(o.FlexBlock,null,(0,r.createElement)(a.Z,{width:"90%",height:30}))),(0,r.createElement)(o.Flex,{style:{marginTop:12}},(0,r.createElement)(o.FlexBlock,null,(0,r.createElement)(a.Z,{height:30,width:"60%"}))),(0,r.createElement)(o.Flex,{style:{marginTop:12}},(0,r.createElement)(o.FlexBlock,null,(0,r.createElement)(a.Z,{width:150,height:50}))),(0,r.createElement)(o.Flex,{style:{marginTop:18}},(0,r.createElement)(o.FlexBlock,null,(0,r.createElement)(a.Z,{width:"90%",height:16})))))}},36557:function(e,t,n){"use strict";n.d(t,{MP:function(){returnl},ZP:function(){returnu},cJ:function(){returnc}});varr=n(51806),a=n(13419),o=n(55609),i=n(65736);const_x=i._x,__=i.__,s=e=>{constt="https://wordpress.com/earn/payments-plans/"+location.hostname;returne?t:t+"#add-newsletter-payment-plan"},l=()=>{vare;returnnull!==(e=(0,a.Pb)()?.jetpack?.is_newsletter_feature_enabled)&&void0!==e&&e},c=()=>{vare;returnnull!==(e=(0,a.Pb)()?.jetpack?.is_newsletter_configured)&&void0!==e&&e};functionu(e){let{context:t="other",hasNewsletterPlans:n}=e;consta=n?_x("Manage plans","unused context to distinguish translations","jetpack"):__("Add Payments","jetpack");return"toolbar"===t?(0,r.createElement)(o.ToolbarButton,{href:s(n),target:"_blank"},a):(0,r.createElement)(o.Button,{variant:"primary",href:s(n),target:"_blank"},a)}},3740:function(e,t,n){"use strict";n.d(t,{EU:function(){returnu},GP:function(){returns},P0:function(){returnp},RA:function(){returnr},Z5:function(){returni},hI:function(){returno},q3:function(){returna},sw:function(){returnc},xJ:function(){returnl},yw:function(){returnd}});constr=["image"],a=4,o=20,i=20,s=2e3,l="circle",c="columns",u="rectangular",d="square",p=[{isDefault:!0,name:u},{name:l},{name:d},{name:c}]},73463:function(e,t,n){"use strict";varr=n(76476),a=n(43125),o=n(67525),i=n(99504);t.Z=[i,o,a,r]},1377:function(e,t,n){"use strict";n.d(t,{EU:function(){returni},GP:function(){returno},P0:function(){returns},hI:function(){returna},q3:function(){returnr}});constr=4,a=20,o=2e3,i="rectangular",s=[{isDefault:!0,name:i},{name:"circle"},{name:"square"},{name:"columns"}]},56005:function(e,t,n){"use strict";n.d(t,{Z:function(){returno}});varr=n(51806),a=n(11313);functiono(e){const{"aria-label":t,alt:n,height:o,id:i,link:s,linkTo:l,origUrl:c,url:u,width:d}=e;if((0,a.isBlobURL)(c))returnnull;letp;switch(l){case"media":p=u;break;case"attachment":p=s}constm=(0,r.createElement)("img",{alt:n,"aria-label":t,"data-height":o,"data-id":i,"data-link":s,"data-url":c,"data-width":d,src:u});return(0,r.createElemen
__("image %1$d of %2$d in gallery","jetpack"),t+1,n.length);return(0,r.createElement)(c.Z,{alt:e.alt,"aria-label":s,height:e.height,id:e.id,origUrl:e.url,isSelected:o===t,key:t,link:e.link,linkTo:a,url:this.photonize(e),width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:o,layoutStyle:i}=this.props,s=m(i)?d.Z:u.Z,l=this.props.images.map(this.renderImage,this);return(0,r.createElement)("div",{className:n},(0,r.createElement)(s,{align:e,columns:a,images:o,layoutStyle:i,renderedImages:l}),t)}}functionm(e){return["circle","square"].includes(e)}functionh(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};constn={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(newURL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]ofObject.entries(t))r.searchParams.set(n.hasOwnProperty(e)?n[e]:e,a);returnr.toString()}},30791:function(e,t,n){"use strict";n.d(t,{Z:function(){returnm}});varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(6209),l=n(52235),c=n(89754),u=n(36472),d=n(6817),p=n(6648);classmextendsi.Component{constructor(){super(...arguments),a()(this,"gallery",(0,i.createRef)()),a()(this,"pendingRaf",null),a()(this,"ro",null),a()(this,"handleGalleryResize",(e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}ofe){const{width:e}=t;(0,p.W)(n).forEach((t=>(0,p.i)(t,e)))}}))}))}componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=news.Z(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a}=this.props,i=(0,d.h9)(n),s="columns"===r?(0,d.sv)(i,t):(0,d.T9)(i,{isWide:["full","wide"].includes(e)});letp=0;return(0,o.createElement)(c.Z,{galleryRef:this.gallery},s.map(((e,t)=>(0,o.createElement)(u.Z,{key:t},e.map(((e,t)=>{constn=a.slice(p,p+e);returnp+=e,(0,o.createElement)(l.Z,{key:t},n)}))))))}}},6817:function(e,t,n){"use strict";n.d(t,{T9:function(){returnS},h9:function(){returna},sv:function(){returni}});varr=n(92819);functiona(e){return(0,r.map)(e,o)}functiono(e){let{height:t,width:n}=e;returnt&&n?n/t:1}functioni(e,t){if(e.length<=t)return[Array(e.length).fill(1)];constn=(0,r.sum)(e)/t,a=[];leto=e,i=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,(t=>{constr=i<=(e+1)*n;returnr&&(i+=t),r})).length;a.push(t),o=(0,r.drop)(o,t)}returna.push(o.length),[a]}consts=j([2,1,2],5),l=x([P,P,L,P,P]),c=x([P,P,P,L,P,P,P]),u=j([3,1,3],5),d=x([L,P,P,L]),p=j([1,2,1],5),m=x([L,P,P,P]),h=j([1,3],3),f=x([P,P,P,L]),g=j([3,1],3),b=x([N(1.6),(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2))]),v=j([1,2],3),k=j([1,1,1,1,1],1),y=j([1,1,1,1],1),E=j([1,1,1],3),w=x([(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2)),N(1.6)]),_=j([2,1],3),C=x([function(e){returne>=2}]);functionS(e){let{isWide:t}=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};constn=(e,a)=>{if(!a.length)returne;leto;o=a.length>15&&l(a)&&s(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:f(a)&&g(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){constn=(0,r.sum)((0,r.take)(t,4));returny(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){consta=(0,r.sum)((0,r.take)(t,3));returnt.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),{src:m,srcSet:h}=(0,u.z)(e,{layoutStyle:l});return(0,r.createElement)(c.Z,{alt:e.alt,"aria-label":p,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:d===t,key:t,link:e.link,linkTo:s,origUrl:e.url,showMovers:i.length>1,srcSet:h,url:m,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:o,layoutStyle:i,roundedCorners:c}=this.props,m=(0,u.v)(i)?p.Z:d.Z,h=this.props.images.map(this.renderImage,this),f=i!==l.xJ?Math.min(c,l.Z5):0;return(0,r.createElement)("div",{className:s()(n,{[`has-rounded-corners-${f}`]:f>0})},(0,r.createElement)(m,{align:e,columns:a,images:o,layoutStyle:i,renderedImages:h}),t)}}},84420:function(e,t,n){"use strict";n.d(t,{Z:function(){returnd}});varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(85407),l=n(40195),c=n(56243),u=n(12126);classdextendsi.Component{constructor(){super(...arguments),a()(this,"gallery",(0,i.createRef)()),a()(this,"pendingRaf",null)}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a}=this.props,i=(0,u.h9)(n),d="columns"===r?(0,u.sv)(i,t):(0,u.T9)(i,{isWide:["full","wide"].includes(e)});letp=0;return(0,o.createElement)(l.Z,{galleryRef:this.gallery},d.map(((e,t)=>(0,o.createElement)(c.Z,{key:t},e.map(((e,t)=>{constn=a.slice(p,p+e);returnp+=e,(0,o.createElement)(s.Z,{key:t},n)}))))))}}},12126:function(e,t,n){"use strict";n.d(t,{T9:function(){returnS},h9:function(){returna},sv:function(){returni}});varr=n(92819);functiona(e){return(0,r.map)(e,o)}functiono(e){let{height:t,width:n}=e;returnt&&n?n/t:1}functioni(e,t){if(e.length<=t)return[Array(e.length).fill(1)];constn=(0,r.sum)(e)/t,a=[];leto=e,i=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,(t=>{constr=i<=(e+1)*n;returnr&&(i+=t),r})).length;a.push(t),o=(0,r.drop)(o,t)}returna.push(o.length),[a]}consts=j([2,1,2],5),l=x([P,P,L,P,P]),c=x([P,P,P,L,P,P,P]),u=j([3,1,3],5),d=x([L,P,P,L]),p=j([1,2,1],5),m=x([L,P,P,P]),h=j([1,3],3),f=x([P,P,P,L]),g=j([3,1],3),b=x([N(1.6),(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2))]),v=j([1,2],3),k=j([1,1,1,1,1],1),y=j([1,1,1,1],1),E=j([1,1,1],3),w=x([(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2)),N(1.6)]),_=j([2,1],3),C=x([function(e){returne>=2}]);functionS(e){let{isWide:t}=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};constn=(e,a)=>{if(!a.length)returne;leto;o=a.length>15&&l(a)&&s(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:f(a)&&g(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){constn=(0,r.sum)((0,r.take)(t,4));returny(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){consta=(0,r.sum)((0,r.take)(t,3));returnt.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);consti=e.concat([o]),S=(0,r.sum)(o),j=a.slice(S);returnn(i,j)};returnn([],e)}functionj(e,t){returnn=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}functionx(e){returnt=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}functionP(e){returne>=1&&e<2}functionL(e){returne<1}functionT(e){returnt=>t>=e}functionN(e){returnt=>t<e}},56243:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(51806),a=n(65235),o=n.n(a);functioni(e){let{children:t,className:n}=e;return(0,r.createElement)("div",{className:o()("tiled-gallery__row",n)},t)}},87178:function(e,t,n){"use strict";n.d(t,{Z:function(){returnc}});varr=n(51806),a=n(92819),o=n(86738),i=n(85407),s=n(40195),l=n(56243);functionc(e){let{columns:t,renderedImages:n}=e;constc=Math.min(o.hI,t),u=n.length%c;return(0,r.createElement)(s.Z,null,[...u?[(0,a.take)(n,u)]:[],...(0,a.chunk)((0,a.drop)(n,u),c)].map(((e,t)=>(0,r.createElement)(l.Z,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(i.Z,{key:t},e)))))))}},68405:func
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),{src:k,srcSet:y}=(0,u.z)(e,{layoutStyle:d});return(0,r.createElement)(c.Z,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:g===t,key:t,link:e.link,linkTo:l,onMoveBackward:s?void0:p(t),onMoveForward:s?void0:m(t),onRemove:s?void0:h(t),onSelect:s?void0:f(t),origUrl:e.url,setAttributes:s?void0:b(t),showMovers:i.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:o,layoutStyle:i,roundedCorners:c,onResize:m,isSave:h,columnWidths:f}=this.props,g=(0,u.v)(i)?p.Z:d.Z,b=this.props.images.map(this.renderImage,this),v=i!==l.xJ?Math.min(c,l.Z5):0;return(0,r.createElement)("div",{className:s()(n,{[`has-rounded-corners-${v}`]:v>0})},(0,r.createElement)(g,{align:e,columns:a,columnWidths:h?f:void0,images:o,layoutStyle:i,renderedImages:b,onResize:h?void0:m}),t)}}},47510:function(e,t,n){"use strict";n.d(t,{Z:function(){returnd}});varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(17410),l=n(46349),c=n(78922),u=n(3453);classdextendsi.Component{constructor(){super(...arguments),a()(this,"gallery",(0,i.createRef)()),a()(this,"pendingRaf",null)}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a,columnWidths:i}=this.props,d=(0,u.h9)(n),p="columns"===r?(0,u.sv)(d,t):(0,u.T9)(d,{isWide:["full","wide"].includes(e)});letm=0;return(0,o.createElement)(l.Z,{galleryRef:this.gallery},p.map(((e,t)=>(0,o.createElement)(c.Z,{key:t},e.map(((e,n)=>{constr=a.slice(m,m+e);returnm+=e,(0,o.createElement)(s.Z,{key:n,width:i?.[t]?.[n]},r)}))))))}}},3453:function(e,t,n){"use strict";n.d(t,{T9:function(){returnS},h9:function(){returna},sv:function(){returni}});varr=n(92819);functiona(e){return(0,r.map)(e,o)}functiono(e){let{height:t,width:n}=e;returnt&&n?n/t:1}functioni(e,t){if(e.length<=t)return[Array(e.length).fill(1)];constn=(0,r.sum)(e)/t,a=[];leto=e,i=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,(t=>{constr=i<=(e+1)*n;returnr&&(i+=t),r})).length;a.push(t),o=(0,r.drop)(o,t)}returna.push(o.length),[a]}consts=j([2,1,2],5),l=x([P,P,L,P,P]),c=x([P,P,P,L,P,P,P]),u=j([3,1,3],5),d=x([L,P,P,L]),p=j([1,2,1],5),m=x([L,P,P,P]),h=j([1,3],3),f=x([P,P,P,L]),g=j([3,1],3),b=x([N(1.6),(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2))]),v=j([1,2],3),k=j([1,1,1,1,1],1),y=j([1,1,1,1],1),E=j([1,1,1],3),w=x([(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2)),N(1.6)]),_=j([2,1],3),C=x([function(e){returne>=2}]);functionS(e){let{isWide:t}=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};constn=(e,a)=>{if(!a.length)returne;leto;o=a.length>15&&l(a)&&s(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:f(a)&&g(e)?[3,1]:b(a)&&v(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){constn=(0,r.sum)((0,r.take)(t,4));returny(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){consta=(0,r.sum)((0,r.take)(t,3));returnt.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);consti=e.concat([o]),S=(0,r.sum)(o),j=a.slice(S);returnn(i,j)};returnn([],e)}functionj(e,t){returnn=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}functionx(e){returnt=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}functionP(e){returne>=1&&e<2}functionL(e){returne<1}functionT(e){returnt=>t>=e}functionN(e){returnt=>t<e}},78922:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(51806),a=n(65235),o=n.n(a);functioni(e){let{children:t,className:n}=e;return(0,r.createElement)("div",{className:o()("tiled-gallery__row",n)},t)}},65662:function(e,t,n){"use strict";n.d(t,{Z:function(){returnc}});varr=n(51806),a=n(92819),o=n(13993),i=n(17410),s=n(46349),l=n(78922);functionc(e){let{columns:t,renderedImages:n}=e;constc=Math.min(o.hI,t),u=n.length%c
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),{src:k,srcSet:y}=(0,u.z)(e,{layoutStyle:d});return(0,r.createElement)(c.Z,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:g===t,key:t,link:e.link,linkTo:l,onMoveBackward:s?void0:p(t),onMoveForward:s?void0:m(t),onRemove:s?void0:h(t),onSelect:s?void0:f(t),origUrl:e.url,setAttributes:s?void0:b(t),showMovers:i.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:o,layoutStyle:i,roundedCorners:c,onResize:m,style:h,isSave:f,columnWidths:g}=this.props,b=(0,u.v)(i)?p.Z:d.Z,v=this.props.images.map(this.renderImage,this),k=i!==l.xJ?Math.min(c,l.Z5):0;return(0,r.createElement)("div",{style:h,className:s()(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(b,{align:e,columns:a,columnWidths:f?g:void0,images:o,layoutStyle:i,renderedImages:v,onResize:f?void0:m}),t)}}},82265:function(e,t,n){"use strict";n.d(t,{Z:function(){returnm}});varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(6209),l=n(63866),c=n(750),u=n(2911),d=n(76981),p=n(76187);classmextendsi.Component{constructor(){super(...arguments),a()(this,"gallery",(0,i.createRef)()),a()(this,"pendingRaf",null),a()(this,"ro",null),a()(this,"handleGalleryResize",(e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}ofe){const{width:e}=t,r=[];(0,p.W)(n).forEach((t=>{r.push((0,p.i)(t,e))})),void0!==this.props.onResize&&this.props.onResize(r)}}))}))}componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=news.Z(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){letr=0;returne.map((e=>e.map((e=>{constn=t.slice(r,r+e);returnr+=e,n})))).map((e=>(0,p.i)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a}=this.props,s=(0,d.h9)(n),p="columns"===r?(0,d.sv)(s,t):(0,d.T9)(s,{isWide:["full","wide"].includes(e)}),m=i.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,a,1e3)})();leth=0;return(0,o.createElement)(c.Z,{galleryRef:this.gallery},p.map(((e,t)=>(0,o.createElement)(u.Z,{key:t},e.map(((e,n)=>{constr=a.slice(h,h+e);returnh+=e,(0,o.createElement)(l.Z,{key:n,width:m?.[t]?.[n]},r)}))))))}}},76981:function(e,t,n){"use strict";n.d(t,{T9:function(){returnS},h9:function(){returna},sv:function(){returni}});varr=n(92819);functiona(e){return(0,r.map)(e,o)}functiono(e){let{height:t,width:n}=e;returnt&&n?n/t:1}functioni(e,t){if(e.length<=t)return[Array(e.length).fill(1)];constn=(0,r.sum)(e)/t,a=[];leto=e,i=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,(t=>{constr=i<=(e+1)*n;returnr&&(i+=t),r})).length;a.push(t),o=(0,r.drop)(o,t)}returna.push(o.length),[a]}consts=j([2,1,2],5),l=x([P,P,L,P,P]),c=x([P,P,P,L,P,P,P]),u=j([3,1,3],5),d=x([L,P,P,L]),p=j([1,2,1],5),m=x([L,P,P,P]),h=j([1,3],3),f=x([P,P,P,L]),g=j([3,1],3),b=x([N(1.6),(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2))]),v=j([1,2],3),k=j([1,1,1,1,1],1),y=j([1,1,1,1],1),E=j([1,1,1],3),w=x([(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2)),N(1.6)]),_=j([2,1],3),C=x([function(e){returne>=2}]);functionS(e){let{isWide:t}=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};constn=(e,a)=>{if(!a.length)returne;leto;o=a.length>15&&l(a)&&s(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:f(a)&&g(e)?[3,1]:b(a)&&v(e)
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),y=s?u.Z:c.Z,{src:E,srcSet:w}=(0,d.z)(e,{layoutStyle:p});return(0,r.createElement)(y,{alt:e.alt,"aria-label":k,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:b===t,key:t,link:e.link,linkTo:l,onMoveBackward:s?void0:m(t),onMoveForward:s?void0:h(t),onRemove:s?void0:f(t),onSelect:s?void0:g(t),origUrl:e.url,setAttributes:s?void0:v(t),showMovers:i.length>1,srcSet:w,url:E,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:o,layoutStyle:i,roundedCorners:c,onResize:u,style:h,isSave:f,columnWidths:g}=this.props,b=(0,d.v)(i)?m.Z:p.Z,v=this.props.images.map(this.renderImage,this),k=i!==l.xJ?Math.min(c,l.Z5):0;return(0,r.createElement)("div",{style:h,className:s()(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(b,{align:e,columns:a,columnWidths:f?g:void0,images:o,layoutStyle:i,renderedImages:v,onResize:f?void0:u}),t)}}},46438:function(e,t,n){"use strict";n.d(t,{Z:function(){returnm}});varr=n(90017),a=n.n(r),o=n(51806),i=n(69307),s=n(6209),l=n(46936),c=n(75084),u=n(51309),d=n(96001),p=n(99856);classmextendsi.Component{constructor(){super(...arguments),a()(this,"gallery",(0,i.createRef)()),a()(this,"pendingRaf",null),a()(this,"ro",null),a()(this,"handleGalleryResize",(e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}ofe){const{width:e}=t,r=[];(0,p.W)(n).forEach((t=>{r.push((0,p.i)(t,e))})),void0!==this.props.onResize&&this.props.onResize(r)}}))}))}componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=news.Z(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){letr=0;returne.map((e=>e.map((e=>{constn=t.slice(r,r+e);returnr+=e,n})))).map((e=>(0,p.i)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a}=this.props,s=(0,d.h9)(n),p="columns"===r?(0,d.sv)(s,t):(0,d.T9)(s,{isWide:["full","wide"].includes(e)}),m=i.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,a,1e3)})();leth=0;return(0,o.createElement)(c.Z,{galleryRef:this.gallery},p.map(((e,t)=>(0,o.createElement)(u.Z,{key:t},e.map(((e,n)=>{constr=a.slice(h,h+e);returnh+=e,(0,o.createElement)(l.Z,{key:n,width:m?.[t]?.[n]},r)}))))))}}},96001:function(e,t,n){"use strict";n.d(t,{T9:function(){returnS},h9:function(){returna},sv:function(){returni}});varr=n(92819);functiona(e){return(0,r.map)(e,o)}functiono(e){let{height:t,width:n}=e;returnt&&n?n/t:1}functioni(e,t){if(e.length<=t)return[Array(e.length).fill(1)];constn=(0,r.sum)(e)/t,a=[];leto=e,i=0;for(lete=0;e<t-1;e++){constt=(0,r.takeWhile)(o,(t=>{constr=i<=(e+1)*n;returnr&&(i+=t),r})).length;a.push(t),o=(0,r.drop)(o,t)}returna.push(o.length),[a]}consts=j([2,1,2],5),l=x([P,P,L,P,P]),c=x([P,P,P,L,P,P,P]),u=j([3,1,3],5),d=x([L,P,P,L]),p=j([1,2,1],5),m=x([L,P,P,P]),h=j([1,3],3),f=x([P,P,P,L]),g=j([3,1],3),b=x([N(1.6),(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2))]),v=j([1,2],3),k=j([1,1,1,1,1],1),y=j([1,1,1,1],1),E=j([1,1,1],3),w=x([(0,r.overEvery)(T(.9),N(2)),(0,r.overEvery)(T(.9),N(2)),N(1.6)]),_=j([2,1],3),C=x([function(e){returne>=2}]);functionS(e){let{isWide:t}=arguments.length>1&&void0!==arguments[1]?arguments[1]:{};constn=(e,a)=>{if(!a.length)returne;leto;o=a.length>15&&l(a)&&s(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:f(a)&&g(e)?[3,
__("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:B,help:this.getAutoplayHelp}),(0,s.createElement)(p.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Loop","jetpack"),/* translators: Tooltip describing the "loop" option for the VideoPress player */
__("Restarts the video when it reaches the end","jetpack")),onChange:this.toggleAttribute("loop"),checked:z}),(0,s.createElement)(p.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:O}),(0,s.createElement)(p.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Playback Controls","jetpack"),/* translators: Tooltip describing the "controls" option for the VideoPress player */
__("Display the video playback controls","jetpack")),onChange:this.toggleAttribute("controls"),checked:F}),(0,s.createElement)(p.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Play Inline","jetpack"),/* translators: Tooltip describing the "playsinline" option for the VideoPress player */
__("Play the video inline instead of full-screen on mobile devices","jetpack")),onChange:this.toggleAttribute("playsinline"),checked:U}),(0,s.createElement)(p.SelectControl,{label:this.renderControlLabelWithTooltip(__("Preload","jetpack"),/* translators: Tooltip describing the "preload" option for the VideoPress player */
__("Content to dowload before the video is played","jetpack")),value:null!=$?$:"",onChange:e=>u({preload:e}),options:[{value:"auto",label:_x("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:_x("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:_x("None","VideoPress preload setting","jetpack")}],help:this.getPreloadHelp()}),(0,s.createElement)(d.MediaUploadCheck,null,(0,s.createElement)(p.BaseControl,{className:"editor-video-poster-control",label:__("Poster Image","jetpack")},(0,s.createElement)(d.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:R,render:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"secondary",onClick:t,ref:this.posterImageButton,"aria-describedby":K},X?__("Replace image","jetpack",0):__("Select Poster Image","jetpack"))}}),(0,s.createElement)("p",{id:K,hidden:!0},X?(0,b.sprintf)(/* translators: Placeholder is an image URL. */
__("The current poster image url is %s","jetpack"),null!=H?H:N):__("There is no poster image currently selected","jetpack")),X&&(0,s.createElement)(p.Button,{onClick:this.onRemovePoster,variant:"link",isDestructive:!0},__("Remove Poster Image","jetpack")))),(0,f.createInterpolateElement)(__("Send us your <a>VideoPress feedback</a>","jetpack"),{a:(0,s.createElement)(p.ExternalLink,{href:"https://automattic.survey.fm/videopress-feedback"})})),(0,s.createElement)(P.Z,{attributes:t,setAttributes:u,useAverageColor:V,toggleAttribute:this.toggleAttribute}),(0,s.createElement)(p.PanelBody,{title:__("Video File Settings","jetpack")},(0,s.createElement)(p.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:null!=E?E:"",disabled:v||k,options:[{label:_x("G",'Video rating for "General Audiences".',"jetpack"),value:"G"},{label:_x("PG-13",'Video rating for "Parental Guidance", unsuitable for children under 13.',"jetpack"),value:"PG-13"},{label:_x("R",'Video rating for "Restricted", not recommended for children under 17.',"jetpack"),value:"R-17"}],onChange:this.onChangeRating}),(0,s.createElement)(p.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Allow download","jetpack"),/* translators: Tooltip describing the "allow download" option for the VideoPress player */
__("Paused (%s%%)","jetpack"),w):(0,i.sprintf)(/* translators: Placeholder is an upload progress percenatage number, from 0-100. */
__("Uploading (%s%%)","jetpack"),w)),(0,r.createElement)("div",{className:"resumable-upload__file-size"},C)),(0,r.createElement)("div",{className:"resumable-upload__actions"},(0,r.createElement)(a.Button,{variant:"link",onClick:()=>{m&&(d?m.start():m.abort(),p(!d))}},d?"Resume":"Pause"))))}},5482:function(e,t,n){"use strict";n.d(t,{J:function(){returni},v:function(){returna}});varr=n(99537);consta=function(e){returnnewPromise((function(t,n){constr=e?{data:{key:e}}:{};wp.media.ajax("videopress-get-upload-jwt",{async:!0,...r}).done((function(e){t({token:e.upload_token,blogId:e.upload_blog_id,url:e.upload_action_url})})).fail((function(e){n(e)}))}))},o={},i=e=>{let{onUploadUuidRetrieved:t,onError:n,onProgress:i,onSuccess:s}=e;return(e,l)=>{constc=newr.gq(e,{onError:n,onProgress:i,endpoint:l.url,removeFingerprintOnSuccess:!0,withCredentials:!1,autoRetry:!0,overridePatchMethod:!1,chunkSize:1e7,allowedFileTypes:["video/*"],metadata:{filename:e.name,filetype:e.type},retryDelays:[0,1e3,3e3,5e3,1e4],onAfterResponse:function(e,n){if(n.getStatus()>=400)return;constr=n.getHeader("x-videopress-upload-guid"),a=n.getHeader("x-videopress-upload-media-id"),i=n.getHeader("x-videopress-upload-src-url");if(r&&a&&i)returnvoid(s&&s({mediaId:Number(a),guid:r,src:i}));constl={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},c={};Object.keys(l).forEach((function(e){constt=n.getHeader(e);t&&(c[l[e]]=t)})),c.key&&c.token&&(o[c.key]=c.token),c.key&&t(c.key)},onBeforeRequest:function(e){constt=e._method;if(["HEAD","OPTIONS"].indexOf(t)>=0&&(e._method="GET",e.setHeader("X-HTTP-Method-Override",t)),["DELETE","PUT","PATCH"].indexOf(t)>=0&&(e._method="POST",e.setHeader("X-HTTP-Method-Override",t)),e._xhr.open(e._method,e._url,!0),Object.keys(e._headers).map((function(t){e.setHeader(t,e._headers[t])})),"POST"===t){if(!!!l.token)throw"should never happen";e.setHeader("x-videopress-upload-token",l.token)}if(["OPTIONS","GET","HEAD","DELETE","PUT","PATCH"].indexOf(t)>=0){constn=newURL(e._url).pathname.split("/"),r=n[n.length-1];if(o[r])e.setHeader("x-videopress-upload-token",o[r]);elseif("HEAD"===t)returna(r).then((t=>(o[r]=t.token,e.setHeader("x-videopress-upload-token",t.token),e)))}returnPromise.resolve(e)}});returnc.findPreviousUploads().then((function(e){e.length&&c.resumeFromPreviousUpload(e[0]),c.start()})),c}}},23096:function(e,t,n){"use strict";varr=n(51806),a=n(52175),o=n(94333),i=n(65235),s=n.n(i),l=n(90953);t.Z=(0,o.createHigherOrderComponent)((e=>t=>{const{attributes:{autoplay:n,caption:o,controls:i,guid:c,loop:u,muted:d,playsinline:p,poster:m,preload:h,videoPressClassNames:f,className:g,align:b,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:E,maxWidth:w}={}}=t,_=a.useBlockProps.save({className:s()("wp-block-video",g,f,{[`align${b}`]:b})});if(!c)returne(t);constC=(0,l.p)(c,{autoplay:n,controls:i,loop:u,muted:d,playsinline:p,poster:m,preload:h,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:E});letS={};returnw&&w.length>0&&"100%"!==w&&(S={maxWidth:w,margin:"auto"}),(0,r.createElement)("figure",_,(0,r.createElement)("div",{className:"wp-block-embed__wrapper",style:S},`\n${C}\n`),!a.RichText.isEmpty(o)&&(0,r.createElement)(a.RichText.Content,{tagName:"figcaption",value:o}))}),"withVideoPressSave")},75880:function(e,t,n){"use strict";varr=n(90017),a=n.n(r),o=n(51806),i=n(52175),s=n(55609),l=n(69307),c=n(65736);n(99196);const__=c.__;classuextendsl.Component{constructor(){super(...arguments),a()(this,"handleChangeSeekbarColor",(e=>{this.setState({seekbarColor:e})})),a()(this,"handleChangeSeekbarLoadingColor",(e=>{this.setState({seekbarLoadingColor:e})})),a()(this,"handleChangeSeekbarPlayedColor",(e=>{this.setState({seekbarPlayedColor:e})})),a()(this,"saveColors",(()=>{const{seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:n}=this.state,{setAttributes:r}=this.props;r({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:n})}));const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:n}=this.props.attributes;this.state={seekbarColor
__("Delete %s","jetpack"),e.label),disabled:o===l},o===l?__("Deleting","jetpack"):__("Delete","jetpack",0)))))),(0,r.createElement)(s.MenuGroup,{label:__("Text tracks","jetpack"),className:"videopress-block-tracks-editor__track-list"},l)}functiony(e){let{track:t,guid:n,onChange:a,onClose:o,onCancel:d,trackExists:f}=e;const[g,v]=(0,c.useState)(),[k=!1,y]=(0,c.useState)(),{label:E="",srcLang:w="",kind:_=p}=t,C=t.tmpFile?t.tmpFile.name:"";if(!(0,l.useSelect)((e=>e(i.store).getSettings().mediaUpload),[]))returnnull;return(0,r.createElement)(s.NavigableMenu,null,(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor"},(0,r.createElement)("span",{className:"videopress-block-tracks-editor__single-track-editor-label"},__("Edit track","jetpack")),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file"},(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label"},(0,r.createElement)("span",null,__("File","jetpack"),":"),""!==C&&(0,r.createElement)("span",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label-name"},(0,r.createElement)("strong",null,C)),(0,r.createElement)(i.MediaUploadCheck,null,(0,r.createElement)(s.FormFileUpload,{onChange:e=>{constn=e.target.files;!n.length>0||(t.tmpFile=n[0],a(t))},accept:m,render:e=>{let{openFileDialog:t}=e;return(0,r.createElement)(s.Button,{variant:"link",onClick:()=>{t()}},""===C?__("Select track","jetpack"):__("Change track","jetpack",0))},disabled:k}))),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-help"},/* translators: %s: The allowed file types to be uploaded as a video text track." */
(0,u.sprintf)(__("Allowed formats: %s","jetpack"),m))),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-label-language"},(0,r.createElement)(s.TextControl,{onChange:e=>a({...t,label:e}),label:__("Label","jetpack"),value:E,help:__("Title of track","jetpack"),disabled:k}),(0,r.createElement)(s.TextControl,{onChange:e=>a({...t,srcLang:e}),label:__("Source language","jetpack"),value:w,help:__("Language tag (en, fr, etc.)","jetpack"),disabled:k})),(0,r.createElement)(s.SelectControl,{className:"videopress-block-tracks-editor__single-track-editor-kind-select",options:h,value:_,label:/* translators: %s: The kind of video text track e.g: "Subtitles, Captions" */
__("Kind","jetpack"),onChange:e=>{a({...t,kind:e})},disabled:k}),(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-buttons-container"},k?(0,r.createElement)(s.Spinner,null):(0,r.createElement)(s.Button,{variant:"secondary",disabled:!t.tmpFile,onClick:()=>{v(null),""===E&&(t.label=__("English","jetpack")),""===w&&(t.srcLang="en"),void0===t.kind&&(t.kind=p),f(t)?v(__("A track already exists for that language and kind.","jetpack")):(y(!0),b(t,n).then((()=>{a(t),v(null),o()})).catch((e=>{e.message&&v(e.message)})).finally((()=>{y(!1)})))}},__("Save","jetpack")),(0,r.createElement)(s.Button,{variant:"link",onClick:d},__("Close","jetpack"))),g&&(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-error"},/* translators: %s: An error message returned after a failed video track file upload." */
c=__("Upgrade to %s to use this premium block","jetpack"),u=(__("Upgrade your plan to use this premium block","jetpack"),_x("Upgrade","Call to action to buy a new plan","jetpack"));t.ZP=e=>{let{onRedirect:t,align:n,className:d,title:p=l,description:m=null,buttonText:h=u,visible:f=!0,requiredPlan:g,context:b}=e;const[v,k,y]=(0,s.Z)(g,t),E=(0,a.useSelect)((e=>{if(m)returnm;constt=e("wordpress-com/plans"),n=t&&t.getPlan(g);returnn?(0,o.sprintf)(c,n.product_name_short):null}),[m]);returnE&&(0,r.createElement)(i.p,{align:n,buttonText:h,checkoutUrl:v,className:d,context:b,description:E,goToCheckoutPage:k,isRedirecting:y,title:p,visible:f})}},38140:function(e,t,n){"use strict";n.d(t,{W:function(){returna},v:function(){returnr}});constr=e=>{let{plan:t,blockName:n,context:r,tracks:a}=e;a.recordEvent("jetpack_editor_block_upgrade_click",{plan:t,block:n,context:r})},a=e=>{let{plan:t,blockName:n,context:r,tracks:a}=e;a.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:t,block:n,context:r})}},27003:function(e,t,n){"use strict";varr=n(51806),a=n(13419),o=n(52175),i=n(94333),s=n(9818),l=n(69307),c=n(87950),u=n(66316),d=n(38140);t.Z=(0,i.createHigherOrderComponent)((e=>t=>{const{name:n,clientId:i,isSelected:p,attributes:m,setAttributes:h}=t||{},{hasParentBanner:f}=(0,l.useContext)(c.x)||{},{tracks:g}=(0,a.z$)(),b=(0,a.Rl)(n);if(!b)return(0,r.createElement)(e,t);constv=(0,a.HD)(n),k=(0,a.m3)(n),[y,E]=(0,l.useState)(!v),[w,_]=(0,l.useState)(!1),C="editor-canvas",S=(0,s.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(i,!0)),[]),j=(p||S)&&y&&!f,x=(0,l.useMemo)((()=>({plan:b,blockName:n,context:C,tracks:g})),[b,n,g]);(0,l.useEffect)((()=>{j&&_(!0)}),[j,_]),(0,l.useEffect)((()=>{!w&&j&&(0,d.W)(x)}),[w,x,j]),(0,l.useEffect)((()=>E(!v)),[m,E,v]),(0,l.useEffect)((()=>{h({shouldDisplayFrontendBanner:!f})}),[h,f]);constP=(0,o.useBlockProps)();return(0,r.createElement)(c.L,{onBannerVisibilityChange:E,hasParentBanner:j},(0,r.createElement)("div",{ref:P.ref},(0,r.createElement)(u.ZP,{className:`is-${n.replace(/\//,"-")}-paid-block`,title:null,align:m?.align,visible:j,description:k?.description,requiredPlan:b,context:C,onRedirect:()=>(0,d.v)(x)}),(0,r.createElement)(e,t)))}),"withUpgradeBanner")},45939:function(e,t,n){"use strict";varr=n(13419),a=n(57389);(0,r.o_)(a.u,a.X)},57389:function(e,t,n){"use strict";n.d(t,{X:function(){returnm},u:function(){returnp}});varr=n(51806),a=n(6895),o=n(13419),i=n(55609),s=n(94333),l=n(9818),c=n(12238),u=n(69307),d=n(65736);const__=d.__,p="launchpad-save-modal",m={render:function(){const{isSavingSite:e,isSavingPost:t,isPublishingPost:n,isCurrentPostPublished:d,postLink:p,postType:m}=(0,l.useSelect)((e=>({isSavingSite:e(c.store).isSavingNonPostEntityChanges(),isSavingPost:e(c.store).isSavingPost(),isPublishingPost:e(c.store).isPublishingPost(),isCurrentPostPublished:e(c.store).isCurrentPostPublished(),postLink:e(c.store).getPermalink(),postType:e(c.store).getCurrentPostType()}))),h=(0,s.usePrevious)(e),f=(0,s.usePrevious)(t),g=(0,s.usePrevious)(n),[b,v]=(0,u.useState)(!1),[k,y]=(0,u.useState)(!1),[E,w]=(0,u.useState)(!1),[_,C]=(0,u.useState)(!1),{launchpadScreenOption:S,hasNeverPublishedPostOption:j,siteIntentOption:x}=window?.Jetpack_LaunchpadSaveModal||{},P=null!==document.getElementById("site-editor"),L=null!==document.querySelector(".block-editor"),T=(0,u.useRef)(j),N=(0,o.lQ)(),A=(0,a.Z)("wpcom-launchpad-setup",{path:x,query:`siteSlug=${N}`}),{tracks:R}=(0,o.z$)(),I=e=>R.recordEvent(e,{site_intent:x,launchpad_screen:S,dont_show_again:_,editor_type:P?"site":"post"});(0,u.useEffect)((()=>{if(!0===g&&!1===n&&T.current&&"write"===x&&L)returny(!1),void(T.current="");(!0===h&&!1===e||!0===f&&!1===t)&&y(!0)}),[e,h,t,f,x,L,n,g]),(0,u.useEffect)((()=>{!1===d&&v(!0)}),[d]);const{title:M,body:B,actionButtonHref:Z,actionButtonTracksEvent:F,actionButtonText:D}=function(){conste={title:__("Great progress!","jetpack"),body:__("You are one step away from bringing your site to life. Check out the next steps that will help you to launch your site.","jetpack"),actionButtonHref:A,action
__("To re-share a post, you need to upgrade to the %s plan","jetpack"),w)),(0,r.createElement)(i.Button,{href:g?null:h,onClick:f,target:"_top",icon:u.Z,className:p()("jetpack-publicize__upsell-button is-primary",{"jetpack-upgrade-plan__hidden":!h}),isBusy:g},g?__("Redirecting…","jetpack"):j)):(0,r.createElement)("div",{className:"jetpack-publicize__upsell"},(0,r.createElement)("strong",null,C),(0,r.createElement)("br",null),(0,c.sprintf)(/* translators: placeholder is the product name of the plan. */
__("This feature is for sites with a %s plan.","jetpack"),w),(0,r.createElement)("br",null),(0,r.createElement)(i.ExternalLink,{href:S},__("More information.","jetpack")))}},55802:function(e,t,n){"use strict";varr=n(13419),a=n(71259);(0,r.o_)(a.u,a.X)},71259:function(e,t,n){"use strict";n.d(t,{X:function(){returnp},u:function(){returnd}});varr=n(51806),a=n(78868),o=n(74356),i=n(72067),s=n(12238),l=n(65736),c=n(34613),u=n(18374);const__=l.__,d="publicize",p={render:()=>{const{hasEnabledConnections:e}=(0,o.oL)(),{isSocialImageGeneratorAvailable:t}=(0,o.Nh)();return(0,r.createElement)(s.PostTypeSupportCheck,{supportKeys:"publicize"},(0,r.createElement)(o.iS,null),(0,r.createElement)(c.Z,null,(0,r.createElement)(o.$S,{enableTweetStorm:!0},(0,r.createElement)(u.Z,null)),t&&(0,r.createElement)(o.i$,null)),(0,r.createElement)(i.PluginPrePublishPanel,{initialOpen:e,id:"publicize-title",title:(0,r.createElement)("span",{id:"publicize-defaults",key:"publicize-title-span"},__("Share this post","jetpack")),icon:(0,r.createElement)(a.Z,{showText:!1,height:16,logoColor:"#1E1E1E"})},(0,r.createElement)(o.$S,{prePublish:!0,enableTweetStorm:!0},(0,r.createElement)(u.Z,null))),t&&(0,r.createElement)(i.PluginPrePublishPanel,{initialOpen:!0,title:__("Social Image Generator","jetpack"),icon:(0,r.createElement)(a.Z,{showText:!1,height:16,logoColor:"#1E1E1E"})},(0,r.createElement)(o.i$,{prePublish:!0})))}}},14166:function(e,t,n){"use strict";n.d(t,{Z:function(){returnu}});varr=n(51806),a=n(55609),o=n(9818),i=n(12238),s=n(65736),l=n(8264);const__=s.__;functionc(e){let{checked:t,onChange:n}=e;return(0,r.createElement)(a.CheckboxControl,{label:__("Show sharing buttons.","jetpack"),checked:t,onChange:e=>{n({jetpack_sharing_enabled:e})}})}functionu(){conste=(0,o.useSelect)((e=>e(i.store).getEditedPostAttribute("jetpack_sharing_enabled")),[]),{editPost:t}=(0,o.useDispatch)(i.store);return(0,r.createElement)(i.PostTypeSupportCheck,{supportKeys:"jetpack-sharing-buttons"},(0,r.createElement)(l.Z,null,(0,r.createElement)(c,{checked:e,onChange:t})))}},27425:function(e,t,n){"use strict";varr=n(13419),a=n(3378);(0,r.o_)(a.u,a.X)},3378:function(e,t,n){"use strict";n.d(t,{X:function(){returno},u:function(){returna}});varr=n(14166);consta="sharing",o={render:r.Z}},21964:function(e,t,n){"use strict";varr=n(13419),a=n(9460);(0,r.o_)(a.u,a.X)},9460:function(e,t,n){"use strict";n.d(t,{X:function(){returns},u:function(){returni}});varr=n(9818),a=n(69307),o=n(65736);const__=o.__,i="site-editor-snackbars",s={render:()=>{const[e,t]=(0,a.useState)(),{createInfoNotice:n,removeNotice:i}=(0,r.useDispatch)("core/notices"),{entityTitle:s,entityType:l,isSiteEditor:c}=(0,r.useSelect)((e=>{vart,n;if(!e("core/edit-site"))return{isSiteEditor:!1};const{getEditedPostType:r,getEditedPostId:a}=e("core/edit-site"),{getEntityRecord:o,getPostType:i}=e("core"),s=o("postType",r(),a()),l=i(r());return{isSiteEditor:!0,entityTitle:null!==(t=s?.title?.raw)&&void0!==t?t:"",entityType:null!==(n=l?.labels?.singular_name)&&void0!==n?n:""}}));return(0,a.useEffect)((()=>{if(!c)return;conste=(0,r.subscribe)((()=>{setTimeout((()=>{constn=newURLSearchParams(window.location.search);if(!n.has("canvas"))returne();t(n.get("canvas"))}),0)}),"core/edit-site");return()=>e()}),[c]),(0,a.useEffect)((()=>{constt="jetpack/site-editor/snackbars";if(i(t),!c||"edit"!==e||!s||!l)return;constr=(0,o.sprintf)(/* translators: %1$s and %2$s are the title and type, respectively, of the entity being edited (e.g. "Editing the Index template", or "Editing the Header template part").*/
__("%1$s / %2$s","jetpack"),o,n)}functionv(e){let{onClose:t,product:n}=e;const{selectedProductId:a,setSelectedProductId:o}=(0,h.Q)(),{id:s,title:l}=n,u=a&&a===s,d=u?c.Z:void0,p=n?" "+b(n):null;return(0,r.createElement)(i.MenuItem,{icon:d,onClick:e=>{e.preventDefault(),o(s),t()},selected:u,value:s},l," : ",p)}functionk(e){let{onClose:t}=e;const{clientId:n,productType:a}=(0,h.Q)(),o=(0,s.useSelect)((e=>e(p.h).getSiteSlug())),l=(0,f.Z)(n);if(m.BM===(0,m.j3)())return(0,r.createElement)(i.MenuItem,null,o&&(0,r.createElement)(i.ExternalLink,{href:`https://wordpress.com/earn/payments-plans/${o}#add-new-payment-plan`},(0,g.l)("add a new product",a)));return(0,r.createElement)(i.MenuItem,{onClick:e=>{e.preventDefault(),l(),setTimeout((()=>{conste=document.getElementById("new-product-title");null!==e&&e.focus()}),100),t()}},(0,g.l)("add a new product",a))}functiony(){const{products:e,productType:t,selectedProductId:n}=(0,h.Q)(),{selectedProduct:a,shouldUpgrade:l}=(0,s.useSelect)((e=>{const{getProduct:t,getShouldUpgrade:r}=e(p.h);return{selectedProduct:t(n),shouldUpgrade:r()}}));letc=null,m=u.Z;returna&&(c=b(a)),n&&!a&&(c=(0,g.l)("product not found",t),m=d.Z),(0,r.createElement)(o.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block"},(0,r.createElement)(i.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:m,label:(0,g.l)("select a product",t),text:c},(t=>{let{onClose:n}=t;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(i.MenuGroup,null,e.map((e=>(0,r.createElement)(v,{key:e.id,onClose:n,product:e})))),!l&&(0,r.createElement)(i.MenuGroup,null,(0,r.createElement)(k,{onClose:n})))})))}},60510:function(e,t,n){"use strict";n.d(t,{Z:function(){returns}});varr=n(52175),a=n(9818),o=n(72067),i=n(99307);functions(e){constt=(0,i.j3)(),{selectBlock:n}=(0,a.useDispatch)(r.store),{enableComplementaryArea:s}=(0,a.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,a.useDispatch)(o.store);return()=>{switch(e&&n(e),t){casei.fH:returns("core/edit-site","edit-site/block-inspector");casei.CG:returns("core/edit-widgets","edit-widgets/block-inspector");default:l(),s("core/edit-post","edit-post/block")}}}},51585:function(e,t,n){"use strict";n.d(t,{_:function(){returnl},l:function(){returni}});varr=n(65736),a=n(14436);const__=r.__,o={"add a new product":{[a.Bn]:__("Add a new payment plan","jetpack"),[a.DM]:__("Add a new subscription","jetpack")},"product not found":{[a.Bn]:__("Payment plan not found","jetpack"),[a.DM]:__("Subscription not found","jetpack")},"select a product":{[a.Bn]:__("Select a payment plan","jetpack"),[a.DM]:__("Select a subscription","jetpack")},"default new product title":{[a.Bn]:__("Monthly Subscription","jetpack"),[a.DM]:__("Monthly Subscription","jetpack")},"manage your products":{[a.Bn]:__("Manage your payment plans.","jetpack"),[a.DM]:__("Manage your subscriptions.","jetpack")},"saving product":{[a.Bn]:__("Saving payment plan…","jetpack"),[a.DM]:__("Saving subscription…","jetpack")},"add product":{[a.Bn]:__("Add payment plan","jetpack"),[a.DM]:__("Add subscription","jetpack")},"product requires a name":{[a.Bn]:__("Payment plan requires a name","jetpack"),[a.DM]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[a.Bn]:__("Payment plan requires a valid price","jetpack"),[a.DM]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[a.Bn]:__("Successfully created payment plan","jetpack"),[a.DM]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[a.Bn]:__("There was an error when adding the payment plan.","jetpack"),[a.DM]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[a.Bn]:__("Invalid payment plan configured for this block.","jetpack"),[a.DM]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[a.Bn]:__("Thebuttonwillbehiddenfromyourvisitorsuntilyouselectavalidpa
__("Congratulations! Your site is now on the %s plan.","jetpack"),e):__("Congratulations! Your site is now on a paid plan.","jetpack"),{isDismissible:!0,...t&&{actions:[{url:l(),label:__("View my plan","jetpack")}]}})}}}})()},45092:function(e,t,n){"use strict";n.d(t,{bu:function(){returnl},uM:function(){returni},yX:function(){returns}});varr=n(13419),a=n(86989),o=n.n(a);asyncfunctioni(){if((0,r.Wp)())returnPromise.reject();try{returnawaito()({path:"/jetpack/v4/plugins"})}catch(e){returnPromise.reject(e.message)}}asyncfunctions(e){if((0,r.Wp)())returnPromise.reject();try{returnawaito()({path:"/jetpack/v4/plugins",method:"POST",data:{slug:e,status:"active",source:"block-editor"}})}catch(e){returnPromise.reject(e.message)}}asyncfunctionl(e){if((0,r.Wp)())returnPromise.reject();try{returnawaito()({path:`/jetpack/v4/plugins/${e}`,method:"POST",data:{status:"active",source:"block-editor"}})}catch(e){returnPromise.reject(e.message)}}},80425:function(e,t,n){"object"==typeofwindow&&window.Jetpack_Block_Assets_Base_Url&&window.Jetpack_Block_Assets_Base_Url.url&&(n.p=window.Jetpack_Block_Assets_Base_Url.url)},31985:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(13419),a=n(4981),o=n(92694);functioni(e,t){letn=arguments.length>2&&void0!==arguments[2]?arguments[2]:[],i=!(arguments.length>3&&void0!==arguments[3])||arguments[3];const{available:s,details:l,unavailableReason:c}=(0,r.OZ)(e),u=(0,r._D)(c,l),d=i?"jetpack/":"";if(!s&&!u)return!1;constp=(0,a.registerBlockType)(d+e,t);returnu&&(0,o.addFilter)("editor.BlockListBlock",`${d+e}-with-has-warning-is-interactive-class-names`,(0,r.T)(d+e)),n.forEach((e=>(0,a.registerBlockType)(d+e.name,e.settings))),p}},36598:function(e,t,n){"use strict";varr=n(51806),a=n(70444);t.Z=function(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:24,n=arguments.length>2&&void0!==arguments[2]?arguments[2]:24,o=arguments.length>3&&void0!==arguments[3]?arguments[3]:"0 0 24 24";return(0,r.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:o},(0,r.createElement)(a.Path,{fill:"none",d:"M0 0h24v24H0V0z",className:"icon-filler"}),e)}},66425:function(e,t,n){"use strict";varr=n(51806),a=n(52175);t.Z=(e,t,n,o,i)=>{const{isSelected:s}=t,l=t.attributes[e];return(0,r.createElement)("div",{className:s?`jetpack-${e}-block is-selected`:`jetpack-${e}-block`},!s&&""!==l&&o(t),(s||""===l)&&(0,r.createElement)(a.PlainText,{value:l,placeholder:n,"aria-label":n,onChange:i}))}},92713:function(e,t,n){"use strict";varr=n(9818),a=n(65736);n(53961);const__=a.__;if("undefined"!=typeofwindow&&window.location){conste=newURLSearchParams(window.location.search);e.get("stripe_connect_success")?(0,r.dispatch)("core/notices").createNotice("success",__("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):e.get("stripe_connect_cancelled")&&(0,r.dispatch)("core/notices").createNotice("error",__("You cancelled connecting your site to Stripe.","jetpack"))}},23621:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(86989),a=n.n(r),o=n(92819);functioni(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:o.noop;returnt(!0),newPromise(((n,r)=>{a()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then((a=>{t(!1);consto=a.status?parseInt(a.status,10):null;o&&o>=400?r():n(a.url||e)}),(()=>{t(!1),r()}))}))}},46867:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(9818),a=n(69307),o=n(92819);functioni(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:o.noop;const[n,i]=(0,a.useState)(!1),{isAutosaveablePost:s,isDirtyPost:l,currentPost:c}=(0,r.useSelect)((e=>{constt=e("core/editor");return{isAutosaveablePost:t.isEditedPostAutosaveable(),isDirtyPost:t.isEditedPostDirty(),currentPost:t.getCurrentPost()}}),[]),u=Object.keys(c).length>0,d=(0,r.useSelect)((e=>!!window.wp?.customize||!!e("core/edit-widgets"))),p=(0,r.dispatch)("core/editor").savePost,m=(0,r.useSelect)((e=>e("core").__experimentalGetDirtyEntityRecords())),h=asynce=>{
__("Minimum allowed price is %s.","jetpack"),(0,r.ZP)(k,b)),h),voida(!1);if(!(0,c.vs)(b,v))return(0,d.q)((0,l.l)("product requires a valid price",t),h),voida(!1);try{constr=awaito()({path:"/wpcom/v2/memberships/product",method:"POST",data:e}),i={id:r.id,title:r.title,interval:r.interval,price:r.price,currency:r.currency},s=h.select(u.G4).getProducts();m(p(s.concat([i]))),n(i.id),(0,d.w)((0,l.l)("successfully created product",t),h),a(!0)}catch(e){(0,d.q)((0,l.l)("there was an error when adding the product",t),h),a(!1)}}}},23267:function(e,t,n){"use strict";n.d(t,{G4:function(){returnr},P:function(){returni},cH:function(){returno},lp:function(){returna}});constr="jetpack/membership-products",a=0,o=1,i=2},7652:function(e,t,n){"use strict";n.d(t,{h:function(){returnc}});varr=n(9818),a=n(6247),o=n(23267),i=n(93100),s=n(20360),l=n(93245);constc=(0,r.createReduxStore)(o.G4,{actions:a,reducer:i.Z,resolvers:s,selectors:l,__experimentalUseThunks:!0});(0,r.register)(c)},93100:function(e,t,n){"use strict";n.d(t,{Z:function(){returna}});constr={products:[],apiState:n(23267).lp,connectUrl:null,shouldUpgrade:!1,siteSlug:"",upgradeUrl:null};functiona(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:r,t=arguments.length>1?arguments[1]:void0;switch(t.type){case"SET_PRODUCTS":return{...e,products:t.products};case"SET_CONNECT_URL":return{...e,connectUrl:t.connectUrl};case"SET_API_STATE":return{...e,apiState:t.apiState};case"SET_SHOULD_UPGRADE":return{...e,shouldUpgrade:t.shouldUpgrade};case"SET_SITE_SLUG":return{...e,siteSlug:t.siteSlug};case"SET_UPGRADE_URL":return{...e,upgradeUrl:t.upgradeUrl}}returne}},20360:function(e,t,n){"use strict";n.r(t),n.d(t,{getProducts:function(){returnb}});varr=n(86989),a=n.n(r),o=n(12238),i=n(96483),s=n(14436),l=n(51585),c=n(73905),u=n(74251),d=n(6247),p=n(23267),m=n(46529);consth="membership-products-resolver-getProducts";letf=!1;constg=(e,t,n)=>{if(e)return;constr=n.getProductsNoResolver()[0]?.id;r&&t(r)},b=function(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:s.Bn,t=arguments.length>1&&void0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void0!==arguments[2]?arguments[2]:()=>{};returnasyncr=>{let{dispatch:s,registry:b,select:v}=r;if(awaitc.Z.blockExecution(h),f)returnvoidg(t,n,v);constk=c.Z.acquire(h);try{constr=await(async()=>{conste=(0,i.getQueryArg)(window.location.href,"origin"),t=(0,i.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===e?"gutenberg-wpcom":"gutenberg",type:"all",is_editable:!0}),n=awaita()({path:t,method:"GET"});if(!n&&"object"!=typeofn)thrownewError("Unexpected API response");constr=n?.errors&&Object.values(n.errors)?.[0]?.[0];if(r)thrownewError(r);returnn})();((e,t,n)=>{constr=t.select(o.store).getCurrentPostId();n((0,d.setConnectUrl)((0,u.Z)(r,e.connect_url))),n((0,d.setShouldUpgrade)(e.should_upgrade_to_access_memberships)),n((0,d.setSiteSlug)(e.site_slug)),n((0,d.setUpgradeUrl)(e.upgrade_url)),n((0,d.setProducts)(e.products)),n((0,d.setApiState)(e.connected_account_id?p.cH:p.P))})(r,b,s),(e=>!e.products.length&&!e.should_upgrade_to_access_memberships&&e.connected_account_id)(r)&&await(async(e,t,n)=>{awaitn((0,d.saveProduct)({title:(0,l.l)("default new product title",e),currency:"USD",price:5,interval:"1 month"},e,t))})(e,n,s),g(t,n,v),f=!0}catch(e){s((0,d.setConnectUrl)(null)),s((0,d.setApiState)(p.P)),(0,m.q)(e.message,b)}c.Z.release(k)}}},93245:function(e,t,n){"use strict";n.r(t),n.d(t,{getApiState:function(){returna},getConnectUrl:function(){returno},getProduct:function(){returnl},getProducts:function(){returni},getProductsNoResolver:function(){returns},getShouldUpgrade:function(){returnc},getSiteSlug:function(){returnu},getUpgradeUrl:function(){returnd},isApiStateConnected:function(){returnp},isApiStateLoading:function(){returnm},isInvalidProduct:function(){returnh}});varr=n(23267);consta=e=>e.apiState,o=e=>e.connectUrl,i=e=>e.products,s=e=>i(e),l=(e,t)=>i(e).find((e=>e.id===t)),c=e=>e.shouldUpgrade,u=e=>e.siteSlug,d=e=>!!c(e)&&e.upgradeUrl,p=e=>e.apiState==