_n("%d character remaining","%d characters remaining",s,"jetpack"),s)})}},69709:function(e,t,n){"use strict";n.d(t,{Z:function(){returnu}});varr=n(92819),a=n(90105),o=n(13419),i=n(65736),s=n(55609),l=n(37568),c=n(78619);const__=i.__;functionu(){vare,t;const{refresh:n}=(0,l.Z)(),i=(0,o.lQ)(),u=(0,r.debounce)((function(e){e&&n()}),2e3),p=null!==(e=null===(t=(0,o.Pb)())||void0===t?void0:t.publicizeConnectionsUrl)&&void0!==e?e:"https://wordpress.com/marketing/connections/",d=i?`${p}${i}`:"options-general.php?page=sharing&publicize_popup=true";returnReact.createElement(a.Z,{onChange:u},React.createElement("div",{className:c.Z["add-connection-wrapper"]},React.createElement(s.ExternalLink,{href:d,target:"_blank"},__("Connect an account","jetpack"))))}},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:["alt","url"]},"core/list":{contentAttributes:["values"]},"core/paragraph":{contentAttributes:["content"]},"core/quote":{contentAttributes:["value","citation"]},"core/separator":{contentAttributes:[]},"core/spacer":{contentAttributes:[]},"core/verse":{contentAttributes:["content"]},"core/video":{contentAttributes:["src"]},"core/embed":{contentAttributes:["url"]},"jetpack/gif":{contentAttributes:["giphyUrl"]}},l=["core/column","core/columns","core/group"];(0,o.addFilter)("blocks.registerBlockType","jetpack/publishing-tweetstorms",(e=>{const{edit:t}=e;return{...e,edit:e=>React.createElement(i.Z,{ChildEdit:t,childProps:e})}}));t.ZP=(0,r.compose)([(0,a.withSelect)((e=>({isTweetStorm:e("jetpack/publicize").isTweetStorm(),isTyping:e("core/block-editor").isTyping()})))])((e=>{let{isTweetStorm:t,isTyping:n}=e;returnt?document.body.classList.add("jetpack-tweetstorm"):document.body.classList.remove("jetpack-tweetstorm"),t&&n?document.body.classList.add("jetpack-tweetstorm-is-typing"):document.body.classList.remove("jetpack-tweetstorm-is-typing"),null}))},63609:function(e,t,n){"use strict";varr=n(65736),a=n(55609),o=n(69307),i=n(94333),s=n(9818);n(42998);const__=r.__;t.Z=(0,i.compose)([(0,s.withSelect)((e=>{const{isTweetStorm:t,getTweetStorm:n}=e("jetpack/publicize");return{connections:e("core/editor").getEditedPostAttribute("jetpack_publicize_connections"),isTweetStorm:t(),tweetStormLength:n().length}})),(0,s.withDispatch)((e=>({setTweetstorm:t=>{e("core/editor").editPost({meta:{jetpack_is_tweetstorm:t}}),t?e("jetpack/publicize").refreshTweets():(e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm"),e("core/annotations").__experimentalRemoveAnnotationsBySource("jetpack-tweetstorm-line-break"))}})))])((e=>{let{connections:t,isTweetStorm:n,tweetStormLength:r,setTweetstorm:i,prePublish:s}=e;constl=(0,o.useCallback)((e=>{i("tweetstorm"===e)}),[i]);if(null==t||!t.some((e=>"twitter"===e.service_name&&e.enabled)))returnnull;constc=(e,t)=>React.createElement(React.Fragment,null,React.createElement("strong",null,e),React.createElement("br",null),t),u=[];returnr>=102?u.push({id:"jetpack-publicize-twitter-tweetstorm-too-long",status:"error",content:__("Only the first 100 tweets of this post will be published in the Twitter thread.","jetpack"),isDismissible:!1}):r>=22?u.push({id:"jetpack-publicize-twitter-tweetstorm-a-bit-long",status:"warning",content:__("This post will create a Twitter thread more than 20 tweets long.","jetpack"),isDismissible:!1}):s&&r<=2&&u.push({id:"jetpack-publicize-twitter-tweetstorm-too-short",status:"warning",content:__("None of the content in this post could be transformed into tweets, it may be better to share as a single tweet.","jetpack"),isDismissible:!1}),React.createElement(a.PanelRow,null,React.createElement(a.RadioControl,{label:__("Twitter settings","jetpack"),selected:n?"tweetstorm":"single",options:[{label:c(__("Single Tweet","jetpack"),__("Share a link to this post to Twitter.","jetpack")),value:"single"},{label:c(__("Twitter Thread","jetpack"),__("
__("Add %s consent message…","jetpack"),d)}),(0,r.createElement)(i.InspectorControls,null,(0,r.createElement)(o.PanelBody,{title:__("Field Settings","jetpack")},(0,r.createElement)(c.Z,{setAttributes:f,width:p}))),(0,r.createElement)(i.InspectorAdvancedControls,null,(0,r.createElement)(u.Z,{setAttributes:f,id:n})),(0,r.createElement)(i.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:d,options:[{label:__("Mention that you can email","jetpack"),value:"implicit"},{label:__("Add a privacy checkbox","jetpack"),value:"explicit"}],onChange:e=>f({consentType:e})})))))})}))},26588:function(e,t,n){"use strict";varr=n(69307),a=n(65736),o=n(52175),i=n(55609),s=n(36598),l=n(50686),c=n(98677);const__=a.__;t.Z=e=>{let{setAttributes:t,width:n,id:a,required:u}=e;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.BlockControls,null,(0,r.createElement)(i.ToolbarGroup,null,(0,r.createElement)(i.ToolbarButton,{title:__("Required","jetpack"),icon:(0,s.Z)((0,r.createElement)(i.Path,{d:"M8.23118 8L16 16M8 16L15.7688 8 M6.5054 11.893L17.6567 11.9415M12.0585 17.6563L12 6.5",stroke:"currentColor"})),onClick:()=>{t({required:!u})},className:u?"is-pressed":void0}))),(0,r.createElement)(o.InspectorControls,null,(0,r.createElement)(i.PanelBody,{title:__("Field Settings","jetpack")},(0,r.createElement)(i.ToggleControl,{label:__("Field is required","jetpack"),className:"jetpack-field-label__required",checked:u,onChange:e=>t({required:e}),help:__("Does this field have to be completed for the form to be submitted?","jetpack")}),(0,r.createElement)(l.Z,{setAttributes:t,width:n}))),(0,r.createElement)(o.InspectorAdvancedControls,null,(0,r.createElement)(c.Z,{setAttributes:t,id:a})))}},98677:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(69307),a=n(65736),o=n(55609);const__=a.__;functioni(e){let{setAttributes:t,id:n}=e;return(0,r.createElement)(o.TextControl,{label:__("Unique CSS ID","jetpack"),value:n,onChange:e=>t({id:e}),help:__("A unique ID that can be used in CSS or as an anchor.","jetpack")})}},15642:function(e,t,n){"use strict";varr=n(69307),a=n(65736),o=n(52175);const__=a.__;t.Z=e=>{let{setAttributes:t,label:n,labelFieldName:a,placeholder:i,resetFocus:s,required:l}=e;return(0,r.createElement)("div",{className:"jetpack-field-label"},(0,r.createElement)(o.RichText,{tagName:"label",value:n,className:"jetpack-field-label__input",onChange:e=>{s&&s(),t(a?{[a]:e}:{label:e})},placeholder:null!=i?i:__("Add label…","jetpack"),withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic"]}),l&&(0,r.createElement)("span",{className:"required"},__("(required)","jetpack")))}},26838:function(e,t,n){"use strict";varr=n(69307),a=n(65736),o=n(55609),i=n(94333),s=n(15642),l=n(81713),c=n(26588);const__=a.__;t.Z=(0,i.withInstanceId)((function(e){const{id:t,type:n,instanceId:a,required:i,label:u,setAttributes:p,isSelected:d,width:m,options:h}=e,[f,g]=(0,r.useState)(null),b=function(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void0!==arguments[1]?arguments[1]:null;constn=h.slice(0);null===t?(n.splice(e,1),e>0&&g(e-1)):(n.splice(e,1,t),g(e)),p({options:n})},v=function(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:null;constt=h.slice(0);letn=0;"object"==typeofe?(t.push(""),n=t.length-1):(t.splice(e+1,0,""),n=e+1),g(n),p({options:t})};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.BaseControl,{id:`jetpack-field-multiple-${a}`,className:"jetpack-field jetpack-field-multiple",label:(0,r.createElement)(s.Z,{required:i,label:u,setAttributes:p,isSelected:d,resetFocus:()=>g(null)})},(0,r.createElement)("ol",{className:"jetpack-field-multiple__list",id:`jetpack-field-multiple-${a}`},h.map(((e,t)=>(0,r.createElement)(l.Z,{type:n,key:t,option:e,index:t,onChangeOption:b,onAddOption:v,isInFocus:t===f&&d,isSelected:d})))),d&&(0,r.createElement)(o.Button,{className:"jetpack-fi
__("%s are not a valid email address.","jetpack"),e.join(", "))}returnnull})()),(0,r.createElement)(h.TextControl,{label:__("Email subject line","jetpack"),value:t,placeholder:__("Enter a subject","jetpack"),onChange:e=>n({subject:e}),help:__("Choose a subject line that you recognize as an email from your website.","jetpack")}),(0,r.createElement)(h.SelectControl,{label:__("On Submission","jetpack"),value:B,options:[{label:__("Show a summary of submitted fields","jetpack"),value:""},{label:__("Show a custom text message","jetpack"),value:"message"},{label:__("Redirect to another webpage","jetpack"),value:"redirect"}],onChange:e=>n({customThankyou:e})}),"redirect"!==B&&(0,r.createElement)(h.TextControl,{label:__("Message Heading","jetpack"),value:M,placeholder:__("Message Sent","jetpack"),onChange:e=>n({customThankyouHeading:e})}),"message"===B&&(0,r.createElement)(h.TextareaControl,{label:__("Message Text","jetpack"),value:R,placeholder:__("Thank you for your submission!","jetpack"),onChange:e=>n({customThankyouMessage:e})}),"redirect"===B&&(0,r.createElement)(h.BaseControl,{label:__("Redirect Address","jetpack"),id:`contact-form-${S}-thankyou-url`},(0,r.createElement)(m.URLInput,{id:`contact-form-${S}-thankyou-url`,value:L,className:"jetpack-contact-form__thankyou-redirect-url",onChange:e=>n({customThankyouRedirect:e})})))};return!E&&u.registerBlockVariation?(0,r.createElement)("div",{className:z},(0,r.createElement)(m.__experimentalBlockVariationPicker,{icon:(0,a.get)(x,["icon","src"]),label:(0,a.get)(x,["title"]),instructions:__("Please select which type of form you'd like to add, or create your own using the skip option.","jetpack"),variations:P,allowSkip:!0,onSelect:function(){U(arguments.length>0&&void0!==arguments[0]?arguments[0]:T)}})):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(m.BlockControls,null,(0,r.createElement)(h.ToolbarGroup,null,(0,r.createElement)(h.ToolbarItem,null,(()=>(0,r.createElement)(h.Dropdown,{position:"bottom right",className:"jetpack-contact-form-settings-selector",contentClassName:"jetpack-contact-form__popover",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return((e,t)=>(0,r.createElement)(h.Button,{className:"components-toolbar__control jetpack-contact-form__toggle",label:__("Edit Form Settings","jetpack"),onClick:t,onKeyDown:n=>{e||n.keyCode!==d.DOWN||(n.preventDefault(),n.stopPropagation(),t())},icon:(0,r.createElement)(h.Icon,{icon:"edit"})}))(t,n)},renderContent:()=>G()}))))),(0,r.createElement)(m.InspectorControls,null,(0,r.createElement)(h.PanelBody,{title:__("Form Settings","jetpack")},G()),!(0,f.Wp)()&&(0,r.createElement)(r.Fragment,null,N&&(0,r.createElement)(v.Z,{jetpackCRM:Z,setAttributes:n}),(0,r.createElement)(k.Z,null))),(0,r.createElement)("div",{className:z},(0,r.createElement)(m.InnerBlocks,{allowedBlocks:y,templateInsertUpdatesSelection:!1})))}))},6528:function(e,t,n){"use strict";n.d(t,{Nk:function(){returnx},Xd:function(){returnw},u2:function(){returny}});varr=n(69307),a=n(65736),o=n(4981),i=n(55609),s=n(52175),l=n(8565),c=n(99837),u=n(14142),p=n(4901),d=n(62992),m=n(47081),h=n(92158),f=n(55740),g=n(26838),b=n(36598),v=n(70355),k=n(82150);const__=a.__,_x=a._x,y="contact-form",E=(0,b.Z)((0,r.createElement)(i.Path,{d:"M13 7.5h5v2h-5zm0 7h5v2h-5zM19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM11 6H6v5h5V6zm-1 4H7V7h3v3zm1 3H6v5h5v-5zm-1 4H7v-3h3v3z"})),w={title:__("Form","jetpack"),description:__("A simple way to get feedback from folks visiting your site.","jetpack"),icon:{src:E,foreground:(0,v.m)()},keywords:[_x("email","block search term","jetpack"),_x("feedback","block search term","jetpack"),_x("contact form","block search term","jetpack")],supports:{color:{link:!0,gradients:!0},html:!1,spacing:{padding:!0,margin:!0}},attributes:c.Z,edit:l.Z,save:()=>{conste=s.useBlockProps.save();return(0,r.createElement)("div",e,(0,r.createElement)(s.InnerBlocks.Content,null))},variations:u.Z,category:"grow",transforms:d.Z,deprecated:p.Z},_={category:"grow",parent:["jetpack/contact-form"],supports:{reusable:!1,html:!1}
__("Tier %d","jetpack"),t+1),key:`jetpack-donations-amount-${t}`,onChange:e=>((e,t)=>{constn=[...C];n[t]=e,k("amounts",n)})(e,t),value:e})))),h&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(a.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:g,onChange:e=>c({customAmountText:e})}),(0,r.createElement)(s.Z,{currency:u,label:__("Custom amount","jetpack"),defaultValue:100*(0,l.hj)(u),className:"donations__custom-amount",disabled:!0})),(0,r.createElement)("hr",{className:"donations__separator"}),(0,r.createElement)(a.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:v("extraText"),onChange:e=>k("extraText",e)}),(0,r.createElement)("div",{className:"wp-block-button donations__donate-button-wrapper"},(0,r.createElement)(a.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:__("Write a message…","jetpack"),value:v("buttonText"),onChange:e=>{returnt=e,voidc({oneTimeDonation:{...p,buttonText:t},monthlyDonation:{...d,buttonText:t},annualDonation:{...m,buttonText:t}});vart},allowedFormats:S})))}},72833:function(e,t,n){"use strict";varr=n(69307),a=n(65235),o=n.n(a),i=n(65736),s=n(82275),l=n(91757),c=n(16367);const__=i.__;t.Z=e=>{const{attributes:t,className:n,products:a,setAttributes:i}=e,{oneTimeDonation:u,monthlyDonation:p,annualDonation:d}=t,[m,h]=(0,r.useState)("one-time"),f=(0,r.useCallback)((e=>m===e),[m]),g={"one-time":{title:__("One-Time","jetpack")},...p.show&&{"1 month":{title:__("Monthly","jetpack")}},...d.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,r.useEffect)((()=>{u.planId===a["one-time"]&&p.planId===a["1 month"]&&d.planId===a["1 year"]||i({...a["one-time"]&&{oneTimeDonation:{...u,planId:a["one-time"]}},...a["1 month"]&&{monthlyDonation:{...p,planId:a["1 month"]}},...a["1 year"]&&{annualDonation:{...d,planId:a["1 year"]}}})}),[u,p,d,i,a]),(0,r.useEffect)((()=>{!p.show&&f("1 month")&&h("one-time"),!d.show&&f("1 year")&&h("one-time")}),[p,d,h,f]),(0,r.createElement)("div",{className:n},(0,r.createElement)(c.U,{blockName:"donations"}),(0,r.createElement)("div",{className:"donations__container"},Object.keys(g).length>1&&(0,r.createElement)("div",{className:"donations__nav"},Object.entries(g).map((e=>{let[t,{title:n}]=e;return(0,r.createElement)("div",{role:"button",tabIndex:0,className:o()("donations__nav-item",{"is-active":f(t)}),onClick:()=>h(t),onKeyDown:()=>h(t),key:`jetpack-donations-nav-item-${t}`},n)}))),(0,r.createElement)("div",{className:"donations__content"},(0,r.createElement)(l.Z,{activeTab:m,attributes:t,setAttributes:i}))),(0,r.createElement)(s.Z,e))}},2785:function(e,t){"use strict";t.Z={url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},style:{type:"string",default:"inline"}}},6949:function(e,t,n){"use strict";n.d(t,{J:function(){returni}});varr=n(69307),a=n(55609),o=n(65736);const__=o.__,i=e=>{let{setEditingUrl:t}=e;return(0,r.createElement)(a.ToolbarGroup,null,(0,r.createElement)(a.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>t(!0)}))}},1344:function(e,t,n){"use strict";varr=n(24717);t.Z=[r.Z]},24717:function(e,t,n){"use strict";varr=n(69307),a=n(65235),o=n.n(a),i=n(52175),s=n(92819),l=n(4981),c=n(65736);const_x=c._x,u=["text","backgroundColor","textColor","customBackgroundColor","customTextColor","borderRadius"];t.Z={attributes:{url:{type:"string",validator:e=>!e||e.startsWith("http")},eventId:{type:"number"},useModal:{type:"boolean"},style:{type:"string"},text:{type:"string",default:_x("Register","verb: e.g. register for an event.","jetpack")},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},borderRadius:{type:"number"}},migrate:e=>{const{className:t,style:n}=e;letr=n;r||(r=e.useModal?"modal":"inline");consta={...(0,s.omit)(e,["useModal",...u]),className:t&&t.replace("is-style-outline",""),style:r},o=(0,s.pick)(e,u);return[a,[(0,l.createBlock)("jetpack/button",{element:"a",text:o.text||_x("Register","verb:e.g.
_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:d,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(69307),a=n(65235),o=n.n(a),i=n(92819),s=n(52175),l=n(55609),c=n(65736),u=n(8979),p=n(696),d=n(4554),m=n(79236),h=n(2681),f=n(75412),g=n(44961),b=n(35089),v=n(64129);const__=c.__;t.Z=(0,l.withNotices)((e=>{const{attributes:t,className:n,isSelected:a,noticeOperations:c,noticeUI:k,setAttributes:y}=e,{accessToken:E,align:w,columns:_,count:C,isStackedOnMobile:S,spacing:j}=t;(0,r.useEffect)((()=>{conste=(0,d.S)(u.Z,t);(0,i.isEqual)(e,t)||y(e)}),[t,y]);const[x,P]=(0,r.useState)(E),{isRequestingWpcomConnectUrl:T,wpcomConnectUrl:N}=(0,h.Z)(),{images:A,isLoadingGallery:I,setImages:B}=(0,f.Z)({accessToken:E,noticeOperations:c,setAttributes:y,setSelectedAccount:P}),{connectToService:M,disconnectFromService:R,isConnecting:L,isRequestingUserConnections:Z,userConnections:D}=(0,m.Z)({accessToken:E,noticeOperations:c,selectedAccount:x,setAttributes:y,setImages:B,setSelectedAccount:P}),F=(0,b.Z)(),z=C>A.length?A.length:C,O=!I&&(!E||(0,i.isEmpty)(A)),U=!O,$=E&&I&&(0,i.isEmpty)(A),H=!O&&!$,V=o()(n,{[`align${w}`]:w}),G=o()("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${_}`,{"is-stacked-on-mobile":S}),q={gridGap:j,"--latest-instagram-posts-spacing":j?`${j}px`:void0},W={padding:j},K=()=>{x&&p.D!==x?y({accessToken:x,instagramUser:(0,i.find)(D,{token:x}).username}):M()};return(0,r.createElement)("div",{className:V},O&&(0,r.createElement)(l.Placeholder,{icon:"instagram",instructions:F?Z||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:k},F?(()=>{conste=D.length>0,t=[...(0,i.map)(D,(e=>({label:`@${e.username}`,value:e.token}))),{label:__("Add a new account","jetpack"),value:p.D}],n=L||Z||e&&!x;return(0,r.createElement)("div",null,e&&(0,r.createElement)(l.RadioControl,{label:__("Select your Instagram account:","jetpack"),onChange:e=>P(e),options:t,selected:x}),p.D===x&&(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)(l.Button,{disabled:n,variant:"primary",onClick:K},L&&__("Connecting…","jetpack"),Z&&__("Loading your connections…","jetpack"),!L&&!Z&&__("Connect to Instagram","jetpack")))})():(0,r.createElement)(l.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)(l.Spinner,null),(0,r.createElement)("p",null,__("Embedding…","jetpack"))),H&&(0,r.createElement)("div",{className:G,style:q},(0,i.times)(a?C:z,(e=>(0,r.createElement)("span",{className:o()("wp-block-jetpack-instagram-gallery__grid-post"),key:e,style:W},(e=>{if(A[e]){constn=A[e];return(0,r.createElement)(g.Z,{alt:n.title||n.url,src:n.url,attributes:t,spacing:j})}return(0,r.createElement)("img",{alt:__("Latest Instagram Posts placeholder","jetpack"),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNMyc2tBwAEOgG/c
_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:i,filteredOptions:l}=this.state,{key:p=""}=l[i]||{},{className:d}=a,m=l.length>0,h=m?`components-autocomplete-listbox-${r}`:null,f=m?`components-autocomplete-item-${r}-${p}`:null;return(0,o.createElement)("div",{className:"components-autocomplete"},n({isExpanded:m,listBoxId:h,activeId:f,onChange:e,onKeyDown:t}),m&&(0,o.createElement)(c.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,u.map)(l,((e,t)=>(0,o.createElement)(c.Button,{key:e.key,id:`components-autocomplete-item-${r}-${e.key}`,role:"option","aria-selected":t===i,disabled:e.isDisabled,className:s()("components-autocomplete__result",d,{"is-selected":t===i}),onClick:()=>this.select(e)},e.label))))))}}t.Z=(0,d.compose)([c.withSpokenMessages,d.withInstanceId,c.withFocusOutside])(h)},9262:function(e,t,n){"use strict";varr=n(18294),a=n.n(r),o=n(69307),i=n(85007);classsextendso.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,s=[t.coordinates.longitude,t.coordinates.latitude],{currentDoc:l}=(0,i.bL)(a.current),c=this.marker?this.marker.getElement():l.createElement("div");this.marker?this.marker.setLngLat(s):(c.className="wp-block-jetpack-map-marker",this.marker=newn.Marker(c).setLngLat(s).setOffset([0,-19]).addTo(e),this.marker.getElement().addEventListener("click",o)),c.innerHTML='<?xml version="1.0" encoding="UTF-8"?><svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g fill-rule="evenodd"><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="'+r+'" mask="url(#c)"/></g></svg>'}render(){returnnull}}s.defaultProps={point:{},map:null,markerColor:"#000000",mapboxgl:null,onClick:()=>{}},t.Z=s},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}})},19496:function(e,t,n){"use strict";varr=n(69307),a=n(82695),o=n(81518);classiextendsr.Component{render(){const{attributes:e}=this.props,{align:t,className:n,mapDetails:i,points:s,zoom:l,mapCenter:c,markerColor:u,scrollToZoom:p,mapHeight:d,showFullscreenButton:m}=e,h=(0,o.t)(a.X.styles,n),f=s.map(((e,t)=>{const{longitude:n,latitude:a}=e.coordinates,o="https://www.google.com/maps/search/?api=1&query="+a+","+n;return(0,r.createElement)("li",{key:t},(0,r.createElement)("a",{href:o},e.title))})),g=t?`align${t}`:null;return(0,r.createElement)("div",{className:g,"data-map-style":h,"data-map-details":i,"data-points":JSON.stringify(s),"data-zoom":l,"data-map-center":JSON.stringify(c),"data-marker-color":u,"data-scroll-to-zoom":p||null,"data-map-height":d||null,"data-show-fullscreen-button":m||null},s.length>0&&(0,r.createElement)("ul",nul
`${(0,l.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,c.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!==d.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=>{vart,n;this.props.updateMediaSourceData(this.props.playerId,{duration:null===(t=e.target)||void0===t?void0:t.duration,domId:null===(n=e.target)||void0===n?void0:n.id})}))}registerPlayer(){conste=this.getTrack(this.state.currentTrack)||{},{playerId:t}=this.props;this.props.registerMediaSource(t,{title:e.title,link:e.link,state:d._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=>null!=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:c,playerState:u}=this.props,{itemsToShow:p,primaryColor:d,customPrimaryColor:b,hexPrimaryColor:v,secondaryColor:k,customSecondaryColor:y,hexSecondaryColor:E,backgroundColor:w,customBackgroundColor:_,hexBackgroundColor:C,showCoverArt:S,showEpisodeTitle:j,showEpisodeDescription:x}=i,{currentTrack:P}=this.state,T=a.slice(0,p),N=this.getTrack(P),A=(0,g.Aq)({primaryColor:d,customPrimaryColor:b,secondaryColor:k,customSecondaryColor:y,backgroundColor:w,customBackgroundColor:_}),I={color:y,backgroundColor:_,"--jetpack-podcast-player-primary":v,"--jetpack-podcast-player-secondary":E,"--jetpack-podcast-player-background":C},B=s()("jetpack-podcast-player",u,A.secondary.classes,A.background.classes);return(0,o.createElement)("section",{className:B,style:I,"aria-labelledby":t||N&&N.title?`${e}__title`:void0,"aria-describedby":N&&N.description?`${e}__track-description`:void0,"data-jetpack-iframe-ignore":!0},(0,o.createElement)(f.Z,{playerId:e,title:t,link:n,cover:r,track:this.getTrack(P),showCoverArt:S,showEpisodeTitle:j,showEpisodeDescription:x,colors:A},(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:u,currentTime:c,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData})),T.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,l.sprintf)(// translators: %s is the track title.
__("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)(h.Z,{playerId:e,playerState:u,currentTrack:P,tracks:T,selectTrack:this.selectTrack,colors:A})))}}v.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]},t.Z=(0,u.compose)([b.Z,(0,p.withSelect)(((e,t)=>{const{playerId:n}=t,{getMediaSourceCurrentTime:r,getMediaPlayerState:a}=e(d.tT);return{currentTime:r(n),playerState:a(n)}})),(0,p.withDispatch)((e=>{const{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:a,playMediaSource:o,pauseMediaSource:i,toggleMediaSource:s,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(d.tT);return{registerMediaSource:t,updateMediaSourceData:n,unregisterMediaSource:r,setDefaultMediaSource:a,playMediaSource:o,pauseMediaSource:i,toggleMediaSource:s,errorMediaSource:l,setMediaSourceCurrentTime:c}}))])(v)},46843:function(e,t,n){"use strict";varr=n(69307),a=n(65736);const__=a.__,o=(0,r.memo)((e=>{let{link:t,title:n,colors:o}=e;return(0,r.createElement)("div",{className:"jetpack-podcast-player__track-error"},__("Episode unavailable. ","jetpack"),t&&(0,r.createElement)("span",{className:o.secondary.classes,style:{color:o.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,a.sprintf)(
__("%s:","jetpack"),n)}`),__("Open in a new tab","jetpack"))))}));t.Z=o},96817:function(e,t,n){"use strict";var r=n(69307),a=n(65736),o=n(69650);const __=a.__,i=(0,r.memo)((e=>{let t,n,{isPlaying:a,isError:i,className:s}=e;i?(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(),u(p))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),u(p))}},(0,r.createElement)(s.Z,{className:"jetpack-podcast-player__track-status-icon",isPlaying:a,isError:i}),(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&&i&&(0,r.createElement)(l.Z,{link:t.link,title:t.title,colors:d}))}));t.Z=u},71540:function(e,t,n){"use strict";n.d(t,{Z:function(){returns}});varr=n(18294),a=n.n(r),o=n(69307),i=n(65736);const__=i.__;functions(e){classtextendso.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(69307),a=n(51128),o=n.n(a),i=n(92819),s=n(13419),l=n(55609),c=n(94333),u=n(65736),p=n(52175),d=n(9818),m=n(4981),h=n(96483),f=n(4554),g=n(13331),b=n(30723),v=n(71600),k=n(66085),y=n(98075),E=n(93610),w=n(43718),_=n(63226),C=n(85007);const__=u.__,S=o()("jetpack:podcast-player:edit"),j=(0,s.Wp)()||(0,s.Ug)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/";t.Z=(0,c.compose)([(0,d.withDispatch)(((e,t)=>{let{clientId:n,attributes:r}=t;return{replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(n,(0,m.createBlock)("core/embed",{url:r.url}))}}})),(0,p.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),l.withNotices,c.withInstanceId,w.K])((e=>{vart,n;let{instanceId:a,className:o,attributes:s,setAttributes:c,noticeOperations:{createErrorNotice:u,removeAllNotices:d},noticeUI:m,primaryColor:w,setPrimaryColor:x,secondaryColor:P,setSecondaryColor:T,fallbackTextColor:N,backgroundColor:A,setBackgroundColor:I,fallbackBackgroundColor:B,isSelected:M,replaceWithEmbedBlock:R
_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,i.sprintf)(
_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:m.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:h,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)(l.InnerBlocks,null)))}}t.Z=(0,c.withSelect)(((e,t)=>{const{isBlockSelected:n,hasSelectedInnerBlock:r}=e("core/block-editor");return{isSelected:n(t.clientId)||r(t.clientId)}}))(f)},48516:function(e,t,n){"use strict";varr=n(69307),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},30314:function(e,t,n){"use strict";n.d(t,{Xd:function(){returnf},qv:function(){returnh},u2:function(){returnm}});varr=n(69307),a=n(65736),o=n(55609),i=n(52175),s=n(36598),l=n(4498),c=n(48516),u=n(51100),p=n(70355);const__=a.__,_x=a._x,d={attributes:{criteria:{type:"string",default:u.FV},threshold:{type:"number",default:u.Kv}},supports:{html:!1},save:e=>{let{className:t}=e;return(0,r.createElement)("div",{className:t},(0,r.createElement)(i.InnerBlocks.Content,null))}},m="repeat-visitor",h=(0,s.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:u.FV},threshold:{type:"number",default:u.Kv}},category:"widgets",description:__("Control block visibility based on how often a visitor has viewed the page.","jetpack"),icon:{src:h,foreground:(0,p.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:l.Z,save:c.Z,example:{attributes:{criteria:u.FV,threshold:u.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:[d]}},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(69307),a=n(92819),o=n(4981),i=n(65736);const_x=i._x,__=i.__,s=["text","backgroundColor","textColor","customBackgroundCol
_n("%d character","%d characters",e.length,"jetpack"),e.length)))}}t.Z=(0,s.compose)([(0,c.withSelect)((e=>({seoDescription:(0,l.get)(e("core/editor").getEditedPostAttribute("meta"),["advanced_seo_description"],"")}))),(0,c.withDispatch)((e=>({updateSeoDescription(t){e("core/editor").editPost({meta:{advanced_seo_description:t}})}})))])(u)},44487:function(e,t,n){"use strict";n.d(t,{X:function(){returnp},u:function(){returnu}});varr=n(69307),a=n(65736),o=n(92819),i=n(55609),s=n(9818),l=n(26788),c=n(34613);const__=a.__,u="shortlinks",p={render:()=>(0,r.createElement)(m,null)};classdextendsr.Component{render(){const{shortlink:e}=this.props;returne?(0,r.createElement)(c.Z,null,(0,r.createElement)(i.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel"},(0,r.createElement)(l.Z,{link:e}))):null}}constm=(0,s.withSelect)((e=>{constt=e("core/editor").getCurrentPost();return{shortlink:(0,o.get)(t,"jetpack_shortlink","")}}))(d)},36825:function(e,t,n){"use strict";n.d(t,{LC:function(){returnr},Rh:function(){returno},a7:function(){returna}});constr="jp_pay_product",a="USD",o=[a,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"]},65093:function(e,t,n){"use strict";n.d(t,{G:function(){returni}});varr=n(69307),a=n(55609),o=n(65736);const__=o.__;functioni(e){let{setAttributes:t,postLinkText:n}=e;return(0,r.createElement)(a.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,r.createElement)(a.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,r.createElement)(a.TextControl,{placeholder:__("Click here to purchase","jetpack"),onChange:e=>t({postLinkText:e}),value:n})))}},66763:function(e,t,n){"use strict";varr=n(69307);t.Z={attributes:{currency:{type:"string",default:"USD"},content:{type:"string",default:""},email:{type:"string",default:""},featuredMediaId:{type:"number",default:0},featuredMediaUrl:{type:"string",default:null},featuredMediaTitle:{type:"string",default:null},multiple:{type:"boolean",default:!1},price:{type:"number"},productId:{type:"number"},title:{type:"string",default:""}},supports:{className:!1,customClassName:!1,html:!1,reusable:!1},save:e=>{let{attributes:t}=e;const{productId:n}=t;returnn?(0,r.createElement)(r.RawHTML,null,`[simple-payment id="${n}"]`):null}}},21559:function(e,t,n){"use strict";varr=n(18294),a=n.n(r),o=n(69307),i=n(65235),s=n.n(i),l=n(92384),c=n(92819),u=n(43317),p=n(65736),d=n(94333),m=n(9818),h=n(55609),f=n(52175),g=n(59809),b=n(72802),v=n(39416),k=n(96059),y=n(36825);const__=p.__,_n=p._n;classEextendso.Component{constructor(){super(...arguments),a()(this,"state",{fieldEmailError:null,fieldPriceError:null,fieldTitleError:null,isSavingProduct:!1}),a()(this,"shouldInjectPaymentAttributes",!!this.props.attributes.productId),a()(this,"validateAttributes",(()=>{conste=this.validatePrice(),t=this.validateTitle(),n=this.validateEmail(),r=this.validateCurrency();returne&&t&&n&&r})),a()(this,"validateCurrency",(()=>{const{currency:e}=this.props.attributes;returny.Rh.includes(e)})),a()(this,"validatePrice",(()=>{const{currency:e,price:t}=this.props.attributes,{precision:n}=(0,u.X)(e);returnt&&0!==parseFloat(t)?Number.isNaN(parseFloat(t))?(this.setState({fieldPriceError:__("Invalid price","jetpack")}),!1):parseFloat(t)<0?(this.setState({fieldPriceError:__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1):(0,k.N3)(t)>n?0===n?(this.setState({fieldPriceError:__("We know every penny counts, but prices in this currency can’t contain decimal values.","jetpack")}),!1):(this.setState({fieldPriceError:(0,p.sprintf)(
/* translators: Placeholder is a number of decimals in a number. */
_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?l.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",y.Rh.map((e=>{const{symbol:t}=(0,u.X)(e);return{value:e,label:t===e?e:`${e}${(0,c.trimEnd)(t,".")}`}}))),a()(this,"renderSettings",(()=>(0,o.createElement)(f.InspectorControls,null,(0,o.createElement)(h.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1},(0,o.createElement)(h.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)(h.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,c.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,c.isEmpty)(e))return;const{attributes:n,setAttributes:r}=this.props,{content:a,currency:o,email:i,featuredMediaId:s,featuredMediaUrl:l,featuredMediaTitle:u,multiple:p,price:d,title:m}=n;r({content:(0,c.get)(e,["content","raw"],a),currency:(0,c.get)(e,["meta","spay_currency"],o),email:(0,c.get)(e,["meta","spay_email"],i),featuredMediaId:(0,c.get)(e,["featured_media"],s),featuredMediaUrl:(0,c.get)(t,"url",l),featuredMediaTitle:(0,c.get)(t,"title",u),multiple:Boolean((0,c.get)(e,["meta","spay_multiple"],Boolean(p))),price:(0,c.get)(e,["meta","spay_price"],d||void0),title:(0,c.get)(e,["title","raw"],m)}),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,m.dispatch)("core");this.setState({isSavingProduct:!0},(()=>{r("postType",y.LC,this.toApi()).then((e=>(e&&t({productId:e.id}),e))).catch((e=>{if(!e||!e.data)return;const{d
/* 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:l,simplePayment:u}=this.props,{content:p,currency:d,email:m,featuredMediaId:f,featuredMediaUrl:y,featuredMediaTitle:E,multiple:w,price:_,productId:C,title:S}=r,j=C&&(0,c.isEmpty)(u);if(!i&&j)return(0,o.createElement)("div",{className:"simple-payments__loading"},(0,o.createElement)(b.Z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!i&&m&&_&&S&&!e&&!t&&!n)return(0,o.createElement)(b.Z,{"aria-busy":"false",content:p,featuredMediaUrl:y,featuredMediaTitle:E,formattedPrice:(0,k.w)(_,d),multiple:w,title:S});constx=j?h.Disabled:"div";return(0,o.createElement)(x,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,o.createElement)(v.Z,{featuredMediaId:f,featuredMediaUrl:y,featuredMediaTitle:E,setAttributes:l}),(0,o.createElement)("div",null,(0,o.createElement)(h.TextControl,{"aria-describedby":`${a}-title-error`,className:s()("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)(g.Z,{id:`${a}-title-error`,isError:!0},n),(0,o.createElement)(h.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:p}),(0,o.createElement)("div",{className:"simple-payments__price-container"},(0,o.createElement)(h.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:d}),(0,o.createElement)(h.TextControl,{"aria-describedby":`${a}-price-error`,className:s()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,k.w)(0,d,!1),required:!0,step:"1",type:"number",value:_||""}),(0,o.createElement)(g.Z,{id:`${a}-price-error`,isError:!0},t)),(0,o.createElement)("div",{className:"simple-payments__field-multiple"},(0,o.createElement)(h.ToggleControl,{checked:Boolean(w),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),(0,o.createElement)(h.TextControl,{"aria-describedby":`${a}-email-${e?"error":"help"}`,className:s()("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:m}),(0,o.createElement)(g.Z,{id:`${a}-email-error`,isError:!0},e),(0,o.createElement)(g.Z,{id:`${a}-email-help`},__("Enter the email address associated with your PayPal account. Don’t have an account?","jetpack")+" ",(0,o.createElement)(h.ExternalLink,{href:"https://www.paypal.com/"},__("Create one on PayPal","jetpack")))))}}constw=(0,m.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,c.pick)(n("postType",y.LC,i),[["content"],["meta","spay_currency"],["meta","spay_email"],["meta","spay_multiple"],["meta","spay_price"],["title","raw"],["featured_media"]]):void0,u=o();return{hasPublishAction:!!(0,c.get)(u,["_links","wp:action-publish"]),isSaving:!!a(),simplePayment:l,featuredMedia:s?r(s):null,postLinkUrl:u.link}}));t.Z=(0,d.compose)(w,d.withInstanceId)(E)},24097:function(e,t,n){"use strict";varr=n(69307),a=n(65736),o=n(55609),i=n(13419),s=n(36825),l=n(70355),c=n(21559),u=n(83080);const__=a.__,_x=a._x,p=(0,r.createElement)(o.SVG,{xmlns:"ht
/* translators: Placeholder is a number of decimals in a number. */
_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?l.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",E.Rh.map((e=>{const{symbol:t}=(0,u.X)(e);return{value:e,label:t===e?e:`${e}${(0,c.trimEnd)(t,".")}`}}))),a()(this,"renderSettings",(()=>(0,o.createElement)(f.InspectorControls,null,(0,o.createElement)(w.G,{postLinkText:this.props.attributes.postLinkText,setAttributes:this.props.setAttributes}))))}componentDidMount(){vare,t;this.injectPaymentAttributes();const{attributes:n,hasPublishAction:r,postLinkUrl:a,setAttributes:o,isPostEditor:i}=this.props,{productId:s}=n;(!s&&r||!i)&&this.saveProduct();constl=a&&a!==this.props.attributes.postLinkUrl,c=!this.props.attributes.postLinkText;(l||c)&&o({...l&&{postLinkUrl:a},...c&&{postLinkText:__("Click here to purchase.","jetpack")}}),null===(e=window.wp)||void0===e||null===(t=e.customize)||void0===t||t.bind("change",(e=>{lett;constn=e.id.match(/^widget_(.+)(?:\[(\d+)\])$/);if(n){t=`${n[1]}-${parseInt(n[2],10)}`}elset=e.id;t===(0,g.getWidgetIdFromBlock)(this.props.block)&&this.validateAttributes()&&this.saveProduct()}))}componentDidUpdate(e){const{hasPublishAction:t,isSelected:n,postLinkUrl:r,setAttributes:a,isPostEditor:o}=this.props;(0,c.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,c.isEmpty)(e))return;const{attributes:n,setAttributes:r}=this.props,{content:a,currency:o,email:i,featuredMediaId:s,featuredMediaUrl:l,featuredMediaTitle:u,multiple:p,price:d,title:m}=n;r({content:(0,c.get)(e,["content","raw"],a),currency:(0,c.get)(e,["meta","spay_currency"],o),email:(0,c.get)(e,["meta","spay_email"],i),featuredMediaId:(0,c.get)(e,["featured_media"],s),featuredMediaUrl:(0,c.get)(t,"url",l),featuredMediaTitle:(0,c.get)(t,"title",u),multiple:Boolean((0,c.get)(e,["meta","spay_multiple"],Boolean(p))),price:(0,c.get)(e,["meta","spay_price"],d||void0),title:(0,c.get)(e,["title","raw"],m)}),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,m.dispatch)("core");this.setState({isSavingProduct:!0},(()=>{r("postType",E.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)(
__("%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:l,simplePayment:u}=this.props,{content:p,currency:d,email:m,featuredMediaId:f,featuredMediaUrl:g,featuredMediaTitle:E,multiple:w,price:_,productId:C,title:S}=r,j=C&&(0,c.isEmpty)(u);if(!i&&j)return(0,o.createElement)("div",{className:"simple-payments__loading"},(0,o.createElement)(v.Z,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"}));if(!i&&m&&_&&S&&!e&&!t&&!n)return(0,o.createElement)(v.Z,{"aria-busy":"false",content:p,featuredMediaUrl:g,featuredMediaTitle:E,formattedPrice:(0,y.T4)(_,d),multiple:w,title:S});constx=j?h.Disabled:"div";return(0,o.createElement)(x,{className:"wp-block-jetpack-simple-payments"},this.renderSettings(),(0,o.createElement)(k.Z,{featuredMediaId:f,featuredMediaUrl:g,featuredMediaTitle:E,setAttributes:l}),(0,o.createElement)("div",null,(0,o.createElement)(h.TextControl,{"aria-describedby":`${a}-title-error`,className:s()("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)(h.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:p}),(0,o.createElement)("div",{className:"simple-payments__price-container"},(0,o.createElement)(h.SelectControl,{className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:d}),(0,o.createElement)(h.TextControl,{"aria-describedby":`${a}-price-error`,className:s()("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,y.T4)(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)(h.ToggleControl,{checked:Boolean(w),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:this.handleMultipleChange})),(0,o.createElement)(h.TextControl,{"aria-describedby":`${a}-email-${e?"error":"help"}`,className:s()("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:m}),(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)(h.ExternalLink,{href:"https://www.paypal.com/"},__("Create one on PayPal","jetpack")))))}}constC=(0,m.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:u}=t.attributes,p=l?(0,c.pick)(n("postType",E.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,c.get)(d,["_links","wp:action-publish"]),isSaving:s().some((e=>i(e.kind,e.name,e.key))),simplePayment:p,featuredMedia:u?r(u):null,postLinkUrl:null==d?void0:d.link,isPostEdi
_n("<span>%s reader</span> issubscribed.","<span>%s readers</span> aresubscribed.",x,"jetpack"),x),{span:(0,r.createElement)("span",{style:{textDecoration:"underline"}})})),k&&(0,r.createElement)(i.__experimentalPanelColorGradientSettings,{title:__("Color","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:t.color,onColorChange:_,gradientValue:p.gradientValue,onGradientChange:p.setGradient,label:__("Button Background","jetpack")},{colorValue:P.color,onColorChange:C,label:__("Button Text","jetpack")},{colorValue:n.color,onColorChange:w,label:__("Border","jetpack")}],initialOpen:!0},(0,r.createElement)(i.ContrastChecker,{fontSize:v.size,textColor:P.color,backgroundColor:f.color,fallbackButtonBackgroundColor:g,fallbackTextColor:b})),!k&&(0,r.createElement)(i.PanelColorSettings,{title:__("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:t.color,onChange:_,label:__("Button Background Color","jetpack")},{value:P.color,onChange:C,label:__("Button Text Color","jetpack")},{value:n.color,onColorChange:w,label:__("Border Color","jetpack")}],initialOpen:!1},(0,r.createElement)(i.ContrastChecker,{fontSize:v.size,textColor:P.color,backgroundColor:f.color,fallbackButtonBackgroundColor:g,fallbackTextColor:b})),(0,r.createElement)(o.PanelBody,{title:__("Typography","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel"},(0,r.createElement)(i.FontSizePicker,{withSlider:!0,value:v.size,onChange:e=>{constt=e||u.tm;E({fontSize:t,customFontSize:t})}})),(0,r.createElement)(o.PanelBody,{title:__("Border","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel"},(0,r.createElement)(o.RangeControl,{value:d,label:__("Border Radius","jetpack"),min:u.G0,max:u.Gp,initialPosition:u.S9,allowReset:!0,onChange:e=>E({borderRadius:e})}),(0,r.createElement)(o.RangeControl,{value:m,label:__("Border Weight","jetpack"),min:u.VF,max:u.K3,initialPosition:u.XJ,allowReset:!0,onChange:e=>E({borderWeight:e})})),(0,r.createElement)(o.PanelBody,{title:__("Spacing","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel"},(0,r.createElement)(o.RangeControl,{value:y,label:__("Space Inside","jetpack"),min:u.xV,max:u.bK,initialPosition:u.HE,allowReset:!0,onChange:e=>E({padding:e})}),(0,r.createElement)(o.RangeControl,{value:j,label:__("Space Between","jetpack"),min:u.Tr,max:u.pC,initialPosition:u.FP,allowReset:!0,onChange:e=>E({spacing:e})}),(0,r.createElement)(c.h,{width:T,onChange:e=>E({buttonWidth:e})})),(0,r.createElement)(o.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel"},(0,r.createElement)(o.ToggleControl,{label:__("Show subscriber count","jetpack"),checked:S,onChange:()=>{E({showSubscribersTotal:!S})},help:()=>{if(!x||x<1)return__("This will remain hidden until there is at least one subscriber.","jetpack")}}),(0,r.createElement)(o.ToggleControl,{label:__("Place button on new line","jetpack"),checked:h,onChange:()=>{E({buttonOnNewLine:!h})}}),!(0,s.Wp)()&&(0,r.createElement)(o.TextareaControl,{value:N,label:__("Success message","jetpack"),help:__("Edit the message displayed when a user subscribes.","jetpack"),onChange:e=>E({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);t.Z=[l.Z,s.Z,i.Z,o.Z,a.Z,r.Z]},75623:function(e,t,n){"use strict";varr=n(69307),a=n(65736),o=n(92819);const__=a.__;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,o.isEmpty)(e.subscribeButton)),save:function(e){let{attributes:t}=e;return(0,r.createElement)(r.RawHTML,null,`[jetpack_subscription_form show_subscribers_total="${t.showSubscribersTotal}" show_only_email_and_button="true"]`)}}},45097:function(e,t,n){"use strict";varr=n(65736
_n("Join %s other subscriber","Join %s other subscribers",e,"jetpack"),e)),O(e)}),(()=>{F(__("Subscriber count unavailable","jetpack")),O(0)}))}),[]);constJ=(0,u.usePrevious)(v);return(0,r.useEffect)((()=>{(null==J?void0:J.color)===(null==C?void0:C.color)&&(null==C?void0:C.color)!==(null==v?void0:v.color)&&S(v.color)}),[v,J,C,S]),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(c.InspectorControls,null,(0,r.createElement)(f.Z,{buttonBackgroundColor:v,borderColor:C,buttonGradient:$,borderRadius:P,borderWeight:T,buttonOnNewLine:L,emailFieldBackgroundColor:g,fallbackButtonBackgroundColor:y,fallbackTextColor:w,fontSize:j,isGradientAvailable:b,padding:A,setAttributes:a,setBorderColor:S,setButtonBackgroundColor:k,setTextColor:_,showSubscribersTotal:R,spacing:I,subscriberCount:z,textColor:E,buttonWidth:N,successMessage:Z})),(0,r.createElement)("div",{className:o()(t,"wp-block-jetpack-subscriptions__supports-newline",L?"wp-block-jetpack-subscriptions__use-newline":void0,R?"wp-block-jetpack-subscriptions__show-subs":void0)},(0,r.createElement)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form"},(0,r.createElement)(l.TextControl,{placeholder:M,disabled:!0,className:o()(V,"wp-block-jetpack-subscriptions__textfield"),style:K}),(0,r.createElement)(c.RichText,{className:o()(G,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:e=>a({submitButtonText:e}),style:X,value:B,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})),R&&(0,r.createElement)("p",{className:"wp-block-jetpack-subscriptions__subscount"},D)))}))},30217:function(e,t,n){"use strict";n.d(t,{Xd:function(){returnf},eC:function(){returng},u2:function(){returnm}});varr=n(69307),a=n(65736),o=n(55609),i=n(4981),s=n(62924),l=n(2916),c=n(99343),u=n(27296),p=n(79914),d=n(70355);const__=a.__,_x=a._x,m="subscriptions",h=(0,r.createElement)(o.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(o.Path,{d:"M20.9997 6.96749L21 7V17C21 18.1046 20.1046 19 19 19H5C3.89543 19 3 18.1046 3 17V7L3.00026 6.96747L3 6.96092C3 5.87793 3.87793 5 4.96092 5H19.0391C20.1221 5 21 5.87793 21 6.96092L20.9997 6.96749ZM19.3044 17.3967L13.9142 12.9048L13.2804 13.433C12.5387 14.0511 11.4613 14.0511 10.7196 13.433L10.0858 12.9048L4.69555 17.3967C4.77987 17.4615 4.88543 17.5 5 17.5H19C19.1146 17.5 19.2201 17.4615 19.3044 17.3967ZM19.5 15.6071V8.25L15.0858 11.9285L19.5 15.6071ZM4.5 8.25V15.6071L8.91424 11.9285L4.5 8.25ZM4.79543 6.54363C4.85788 6.51559 4.92712 6.5 5 6.5H19C19.0729 6.5 19.1421 6.51559 19.2046 6.54363L12.3201 12.2807C12.1347 12.4352 11.8653 12.4352 11.6799 12.2807L4.79543 6.54363Z",fill:(0,d.m)(),fillRule:"evenodd",clipRule:"evenodd"})),f={title:__("Subscribe","jetpack"),description:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",null,__("Allow readers to receive a newsletter with future posts in their inbox.","jetpack")),(0,r.createElement)("p",null,(0,r.createInterpolateElement)(__("Subscribers can get notifications through email or <ExternalLink>the Reader app</ExternalLink>.","jetpack"),{ExternalLink:(0,r.createElement)(o.ExternalLink,{href:"https://wordpress.com/read"})}))),icon:{src:h,foreground:(0,d.m)()},category:"grow",keywords:[_x("newsletter","block search term","jetpack"),_x("email","block search term","jetpack"),_x("follow","block search term","jetpack")],attributes:s.Z,edit:c.Z,save:u.Z,styles:[{name:"compact",label:__("Compact","jetpack")},{name:"split",label:__("Split","jetpack"),isDefault:!0}],transforms:{from:[{type:"block",isMultiBlock:!1,blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:n}=e;return!(null==n||!n.raw)&&"blog_subscription"===t},transform:e=>{let{instance:t}=e;return(0,i.createBlock)("jetpack/subscriptions",{showSubscribersTotal:t.raw.show_subscribers_total,submitButtonText:t.raw.subscribe_button,subscribePlaceholder:t.raw.subscribe_placeholder,successMessage:t.raw.success_message})}}]},example:{attributes:{}},supports:{spacing:{margin:!0,padding:!0},align:["wide","full"]},
/* translators: %s is the number of subscribers */
_n("This post will be sent to <span>%s reader</span>","This post will be sent to <span>%s readers</span>",e,"jetpack"),(0,c.Z)(e)),{span:(0,r.createElement)("span",{className:"jetpack-subscribe-reader-count"})}))),(0,r.createElement)(a.PluginPostPublishPanel,{className:"jetpack-subscribe-post-publish-panel",initialOpen:!0},(0,r.createElement)(p.Z,null,(0,r.createInterpolateElement)((0,s.sprintf)(
/* translators: %s is the number of subscribers */
_n("This post has been sent to <span>%s reader</span>","This post has been sent to <span>%s readers</span>",e,"jetpack"),(0,c.Z)(e)),{span:(0,r.createElement)("span",{className:"jetpack-subscribe-reader-count"})}))))}},27296:function(e,t,n){"use strict";n.d(t,{Z:function(){returnu}});varr=n(69307),a=n(52175),o=n(65235),i=n.n(o),s=n(92819),l=n(62924),c=n(58841);functionu(e){let{className:t,attributes:n}=e;const{subscribePlaceholder:o,showSubscribersTotal:u,buttonOnNewLine:p,submitButtonText:d,emailFieldBackgroundColor:m,customEmailFieldBackgroundColor:h,emailFieldGradient:f,customEmailFieldGradient:g,buttonBackgroundColor:b,customButtonBackgroundColor:v,buttonGradient:k,customButtonGradient:y,textColor:E,customTextColor:w,fontSize:_,customFontSize:C,borderRadius:S,borderWeight:j,borderColor:x,customBorderColor:P,padding:T,spacing:N,buttonWidth:A,successMessage:I}=n,B=!!a.__experimentalGetGradientClass,M=(0,a.getColorClassName)("color",E),R=(0,a.getFontSizeClass)(_),L=(0,a.getColorClassName)("border-color",x),Z=(0,a.getColorClassName)("background-color",b),D=B?(0,a.__experimentalGetGradientClass)(k):void0,F=(0,a.getColorClassName)("background-color",m),z=B?(0,a.__experimentalGetGradientClass)(f):void0,O=i()(0===S?"no-border-radius":void0,R,L),U=i()(O,E?"has-text-color":void0,M,b||k?"has-background":void0,Z,D),$=i()(O,F,z),H=!F&&g?g:h,V=!Z&&y?y:v,G=A||void0,q={subscribe_placeholder:o!==l.Z.subscribePlaceholder.default?o:void0,show_subscribers_total:u,button_on_newline:p,submit_button_text:d!==l.Z.submitButtonText.default?d:void0,custom_background_emailfield_color:H,custom_background_button_color:V,custom_text_button_color:w,custom_font_size:C||c.tm,custom_border_radius:S||c.S9,custom_border_weight:j||c.XJ,custom_border_color:P,custom_button_width:G,custom_padding:T||c.HE,custom_spacing:N||c.FP,submit_button_classes:U,email_field_classes:$,show_only_email_and_button:!0,success_message:I},W=(0,s.reduce)(q,((e,t,n)=>void0===t?e:e+`${n}="${t}"`),"");return(0,r.createElement)("div",{className:i()(t,"wp-block-jetpack-subscriptions__supports-newline",p?"wp-block-jetpack-subscriptions__use-newline":void0,u?"wp-block-jetpack-subscriptions__show-subs":void0)},(0,r.createElement)(r.RawHTML,null,`[jetpack_subscription_form${W}]`))}},3740:function(e,t,n){"use strict";n.d(t,{EU:function(){returnu},GP:function(){returns},P0:function(){returnd},RA:function(){returnr},Z5:function(){returni},hI:function(){returno},q3:function(){returna},sw:function(){returnc},xJ:function(){returnl},yw:function(){returnp}});constr=["image"],a=4,o=20,i=20,s=2e3,l="circle",c="columns",u="rectangular",p="square",d=[{isDefault:!0,name:u},{name:l},{name:p},{name:c}]},73463:function(e,t,n){"use strict";varr=n(76476),a=n(43125),o=n(67525);t.Z=[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(69307),a=n(11313);functiono(e){const{"aria-label":t,alt:n,height:o,id:i,link:s,linkTo:l,origUrl:c,url:u,width:p}=e;if((0,a.isBlobURL)(c))returnnull;letd;switch(l){case"media":d=u;break;case"attachment":d=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":p,src:u});return(0,r.createElement)("figure",{className:"tiled-gallery__item"},d?(0,r.createElement)("a",{href:d},m):m)}},76476:function(e,t,n){"use strict";n.r(t),n.d(t,{attributes:function(){returna},save:function(){returnr.Z},support:function(){returno}});varr=n(91507);consta={align:{default:"center",type:"string"},className:{default:`is-style-${n(1377).EU}`,type:"string"},columns:{type:"number"},ids:{default:[],type:"array"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},caption:{selector:"figcaption",source
__("image %1$d of %2$d in gallery","jetpack"),t+1,n.length);return(0,r.createElement)(s.Z,{alt:e.alt,"aria-label":l,height:e.height,id:e.id,origUrl:e.url,isSelected:i===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=d(i)?c.Z:l.Z,u=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:u}),t)}}functiond(e){return["circle","square"].includes(e)}functionm(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(){returnd}});varr=n(18294),a=n.n(r),o=n(69307),i=n(6209),s=n(52235),l=n(89754),c=n(36472),u=n(6648),p=n(6817);classdextendso.Component{constructor(){super(...arguments),a()(this,"gallery",(0,o.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,u.W)(n).forEach((t=>(0,u.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=newi.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,p.h9)(n),u="columns"===r?(0,p.sv)(i,t):(0,p.T9)(i,{isWide:["full","wide"].includes(e)});letd=0;return(0,o.createElement)(l.Z,{galleryRef:this.gallery},u.map(((e,t)=>(0,o.createElement)(c.Z,{key:t},e.map(((e,t)=>{constn=a.slice(d,d+e);returnd+=e,(0,o.createElement)(s.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=P([2,1,2],5),l=T([N,N,A,N,N]),c=T([N,N,N,A,N,N,N]),u=P([3,1,3],5),p=T([A,N,N,A]),d=P([1,2,1],5),m=T([A,N,N,N]),h=P([1,3],3),f=T([N,N,N,A]),g=P([3,1],3),b=T([B(1.6),(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2))]),v=P([1,2],3),k=P([1,1,1,1,1],1),y=P([1,1,1,1],1),E=P([1,1,1],3),w=T([(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2)),B(1.6)]),_=P([2,1],3),C=T([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&&p(a)&&d(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]:x(e,a)?[1,1,1,1]:j(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]),y=(0,r.sum)(o),E=a.slice(y);returnn(i,E)};returnn([],e)}functionj(e,t,n){consta=(0,r.sum)((0,r.take)(t,3));returnt.length>=3&&4!
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),{src:m,srcSet:h}=(0,u.z)(e,{layoutStyle:c});return(0,r.createElement)(s.Z,{alt:e.alt,"aria-label":d,columns:n,height:e.height,id:e.id,imageFilter:o,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:p===t,key:t,link:e.link,linkTo:l,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:s,roundedCorners:d}=this.props,m=(0,u.v)(s)?c.Z:l.Z,h=this.props.images.map(this.renderImage,this),f=s!==p.xJ?Math.min(d,p.Z5):0;return(0,r.createElement)("div",{className:i()(n,{[`has-rounded-corners-${f}`]:f>0})},(0,r.createElement)(m,{align:e,columns:a,images:o,layoutStyle:s,renderedImages:h}),t)}}},84420:function(e,t,n){"use strict";n.d(t,{Z:function(){returnu}});varr=n(18294),a=n.n(r),o=n(69307),i=n(85407),s=n(40195),l=n(56243),c=n(12126);classuextendso.Component{constructor(){super(...arguments),a()(this,"gallery",(0,o.createRef)()),a()(this,"pendingRaf",null)}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a}=this.props,u=(0,c.h9)(n),p="columns"===r?(0,c.sv)(u,t):(0,c.T9)(u,{isWide:["full","wide"].includes(e)});letd=0;return(0,o.createElement)(s.Z,{galleryRef:this.gallery},p.map(((e,t)=>(0,o.createElement)(l.Z,{key:t},e.map(((e,t)=>{constn=a.slice(d,d+e);returnd+=e,(0,o.createElement)(i.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=P([2,1,2],5),l=T([N,N,A,N,N]),c=T([N,N,N,A,N,N,N]),u=P([3,1,3],5),p=T([A,N,N,A]),d=P([1,2,1],5),m=T([A,N,N,N]),h=P([1,3],3),f=T([N,N,N,A]),g=P([3,1],3),b=T([B(1.6),(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2))]),v=P([1,2],3),k=P([1,1,1,1,1],1),y=P([1,1,1,1],1),E=P([1,1,1],3),w=T([(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2)),B(1.6)]),_=P([2,1],3),C=T([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&&p(a)&&d(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]:x(e,a)?[1,1,1,1]:j(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]),y=(0,r.sum)(o),E=a.slice(y);returnn(i,E)};returnn([],e)}functionj(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)}functionx(e,t){constn=(0,r.sum)((0,r.take)(t,4));returny(e)&&n<3.5&&t.length>5||n<7&&4===t.length}functionP(e,t){returnn=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}functionT(e){returnt=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}functionN(e){returne>=1&&e<2}functionA(e){returne<1}functionI(e){returnt=>t>=e}functionB(e){returnt=>t<e}},56243:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(69307),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(69307),a=n(92819),o=n(56243),i=n(85407),s=n(40195),l=n(86738);functionc(e){let{columns:t,renderedImages:n}=e;constc=Math.min(l.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)(o.Z,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(i.Z,{key:t},e)))))))}},68405:function(
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),{src:k,srcSet:y}=(0,u.z)(e,{layoutStyle:p});return(0,r.createElement)(s.Z,{alt:e.alt,"aria-label":v,columns:n,height:e.height,id:e.id,imageFilter:o,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:g===t,key:t,link:e.link,linkTo:c,onMoveBackward:l?void0:d(t),onMoveForward:l?void0:m(t),onRemove:l?void0:h(t),onSelect:l?void0:f(t),origUrl:e.url,setAttributes:l?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:s,roundedCorners:d,onResize:m,isSave:h,columnWidths:f}=this.props,g=(0,u.v)(s)?c.Z:l.Z,b=this.props.images.map(this.renderImage,this),v=s!==p.xJ?Math.min(d,p.Z5):0;return(0,r.createElement)("div",{className:i()(n,{[`has-rounded-corners-${v}`]:v>0})},(0,r.createElement)(g,{align:e,columns:a,columnWidths:h?f:void0,images:o,layoutStyle:s,renderedImages:b,onResize:h?void0:m}),t)}}},47510:function(e,t,n){"use strict";n.d(t,{Z:function(){returnu}});varr=n(18294),a=n.n(r),o=n(69307),i=n(17410),s=n(46349),l=n(78922),c=n(3453);classuextendso.Component{constructor(){super(...arguments),a()(this,"gallery",(0,o.createRef)()),a()(this,"pendingRaf",null)}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a,columnWidths:u}=this.props,p=(0,c.h9)(n),d="columns"===r?(0,c.sv)(p,t):(0,c.T9)(p,{isWide:["full","wide"].includes(e)});letm=0;return(0,o.createElement)(s.Z,{galleryRef:this.gallery},d.map(((e,t)=>(0,o.createElement)(l.Z,{key:t},e.map(((e,n)=>{varr;consts=a.slice(m,m+e);returnm+=e,(0,o.createElement)(i.Z,{key:n,width:null==u||null===(r=u[t])||void0===r?void0:r[n]},s)}))))))}}},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=P([2,1,2],5),l=T([N,N,A,N,N]),c=T([N,N,N,A,N,N,N]),u=P([3,1,3],5),p=T([A,N,N,A]),d=P([1,2,1],5),m=T([A,N,N,N]),h=P([1,3],3),f=T([N,N,N,A]),g=P([3,1],3),b=T([B(1.6),(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2))]),v=P([1,2],3),k=P([1,1,1,1,1],1),y=P([1,1,1,1],1),E=P([1,1,1],3),w=T([(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2)),B(1.6)]),_=P([2,1],3),C=T([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&&p(a)&&d(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]:x(e,a)?[1,1,1,1]:j(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]),y=(0,r.sum)(o),E=a.slice(y);returnn(i,E)};returnn([],e)}functionj(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)}functionx(e,t){constn=(0,r.sum)((0,r.take)(t,4));returny(e)&&n<3.5&&t.length>5||n<7&&4===t.length}functionP(e,t){returnn=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}functionT(e){returnt=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}functionN(e){returne>=1&&e<2}functionA(e){returne<1}functionI(e){returnt=>t>=e}functionB(e){returnt=>t<e}},78922:function(e,t,n){"use strict";n.d(t,{Z:function(){returni}});varr=n(69307),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(69307),a=n(92819),o=n(78922),i=n(17410),s=n(46349),l=n(13993);functionc(e){let{columns:t,renderedImages:n}=e
__("image %1$d of %2$d in gallery","jetpack"),t+1,i.length),y=c?l.Z:s.Z,{src:E,srcSet:w}=(0,p.z)(e,{layoutStyle:d});return(0,r.createElement)(y,{alt:e.alt,"aria-label":k,columns:n,height:e.height,id:e.id,imageFilter:o,isFirstItem:0===t,isLastItem:t+1===i.length,isSelected:b===t,key:t,link:e.link,linkTo:u,onMoveBackward:c?void0:m(t),onMoveForward:c?void0:h(t),onRemove:c?void0:f(t),onSelect:c?void0:g(t),origUrl:e.url,setAttributes:c?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:s,roundedCorners:l,onResize:m,style:h,isSave:f,columnWidths:g}=this.props,b=(0,p.v)(s)?u.Z:c.Z,v=this.props.images.map(this.renderImage,this),k=s!==d.xJ?Math.min(l,d.Z5):0;return(0,r.createElement)("div",{style:h,className:i()(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(b,{align:e,columns:a,columnWidths:f?g:void0,images:o,layoutStyle:s,renderedImages:v,onResize:f?void0:m}),t)}}},46438:function(e,t,n){"use strict";n.d(t,{Z:function(){returnd}});varr=n(18294),a=n.n(r),o=n(69307),i=n(6209),s=n(46936),l=n(75084),c=n(51309),u=n(99856),p=n(96001);classdextendso.Component{constructor(){super(...arguments),a()(this,"gallery",(0,o.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,u.W)(n).forEach((t=>{r.push((0,u.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=newi.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,u.i)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:r,renderedImages:a}=this.props,i=(0,p.h9)(n),u="columns"===r?(0,p.sv)(i,t):(0,p.T9)(i,{isWide:["full","wide"].includes(e)}),d=o.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(u,a,1e3)})();letm=0;return(0,o.createElement)(l.Z,{galleryRef:this.gallery},u.map(((e,t)=>(0,o.createElement)(c.Z,{key:t},e.map(((e,n)=>{varr;consti=a.slice(m,m+e);returnm+=e,(0,o.createElement)(s.Z,{key:n,width:null==d||null===(r=d[t])||void0===r?void0:r[n]},i)}))))))}}},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=P([2,1,2],5),l=T([N,N,A,N,N]),c=T([N,N,N,A,N,N,N]),u=P([3,1,3],5),p=T([A,N,N,A]),d=P([1,2,1],5),m=T([A,N,N,N]),h=P([1,3],3),f=T([N,N,N,A]),g=P([3,1],3),b=T([B(1.6),(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2))]),v=P([1,2],3),k=P([1,1,1,1,1],1),y=P([1,1,1,1],1),E=P([1,1,1],3),w=T([(0,r.overEvery)(I(.9),B(2)),(0,r.overEvery)(I(.9),B(2)),B(1.6)]),_=P([2,1],3),C=T([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&&p(a)&&d(e)?[1,2,1]
__("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"),
__("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:D}),(0,s.createElement)(p.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Playback Controls","jetpack"),
__("Display the video playback controls","jetpack")),onChange:this.toggleAttribute("controls"),checked:R}),(0,s.createElement)(p.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Play Inline","jetpack"),
__("Play the video inline instead of full-screen on mobile devices","jetpack")),onChange:this.toggleAttribute("playsinline"),checked:F}),(0,s.createElement)(p.SelectControl,{label:this.renderControlLabelWithTooltip(__("Preload","jetpack"),
__("Content to dowload before the video is played","jetpack")),value:O,onChange:e=>c({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)(h.MediaUploadCheck,null,(0,s.createElement)(p.BaseControl,{className:"editor-video-poster-control",label:__("Poster Image","jetpack")},(0,s.createElement)(h.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:T,render:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"secondary",onClick:t,ref:this.posterImageButton,"aria-describedby":G},z?__("Replace image","jetpack",0):__("Select Poster Image","jetpack"))}}),(0,s.createElement)("p",{id:G,hidden:!0},z?(0,f.sprintf)(
__("The current poster image url is %s","jetpack"),z):__("There is no poster image currently selected","jetpack")),!!z&&(0,s.createElement)(p.Button,{onClick:this.onRemovePoster,variant:"link",isDestructive:!0},__("Remove Poster Image","jetpack"))))),(0,s.createElement)(S.Z,{attributes:t,setAttributes:c,useAverageColor:U,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:y,disabled:m||v,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"),
__("Display download option and allow viewers to download this video","jetpack")),onChange:this.onChangeAllowDownload,checked:w,disabled:m||A}),(0,s.createElement)(p.SelectControl,{label:__("Video Privacy","jetpack"),help:this.getPrivacySettingHelp(_),onChange:this.onChangePrivacySetting,value:_,options:[{value:P.v.SITE_DEFAULT,label:_x("Site Default","VideoPress privacy setting","jetpack")},{value:P.v.PUBLIC,label:_x("Public","VideoPress privacy setting","jetpack")},{value:P.v.PRIVATE,label:_x("Private","VideoPress privacy setting","jetpack")}],disabled:m||I})))),W=e=>{this.setState({fileForUpload:e[0]})},K=e=>{vart,n;e&&e.url?(this.props.setAttributes({src:e.url,id:e.id,poster:(null===(t=e.image)||void0===t?void0:t.src)!==e.icon?null===(n=e.image)||void0===n?void0:n.src:void0}),e.videopress_guid&&this.props.setAttributes({guid:e.videopress_guid})):c({src:void0,id:void0,poster:void0})},X=e=>{let{mediaId:t,guid:n,src:r}=e;this.setState({fileForUpload:null}),t&&n&&r&&c({id:t,guid:n,src:r})};if(null!==d&&dinstanceofFile)return(0,s.createElement)(x.Z,{onUploadFinished:X},(0,s.createElement)(s.Fragment,null,q,(0,s.createElement)(C.Z,a()({file:d},this.props))));constJ=m||r,Y=u||o||!L,Q=Y&&!o&&!J,ee=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:o||J?"":"videopress-block-hide"},(0,s.createElement)(E.Z,{text:o?__("Uploading…","jetpack"):__("Generating preview…","jetpack",0)})),(0,s.createElement)("div",{className:Q?"":"videopress-block-hide"},(0,s.createElement)(e,this.props)));if(Y)returnl?(0,s.createElement)(x.Z,{onFilesSelected:W,onMediaItemSelected:K},ee):(0,s.createElement)(s.Fragment,null,ee);const{html:te,scripts:ne}=i||{html:null,scripts:null},re=J||!i;return(0,s.createElement)(s.Fragment,null,q,re&&(0,s.createElement)(E.Z,{text:__("Generating preview…","jetpack")}),!re&&(0,s.createElement)(N,a()({},this.props,{hideOverlay:this.hideOverlay,html:te,scripts:ne,interactive:k,caption:M})))}}]),"withVideoPressEdit")},31302:function(e,t,n){"use strict";varr=n(69307),a=n(55609);t.Z=e=>{let{text:t}=e;return(0,r.createElement)("div",{className:"wp-block-embed is-loading"},(0,r.createElement)(a.Spinner,null),(0,r.createElement)("p",null,t))}},43774:function(e,t,n){"use strict";n.d(t,{Z:function(){returnm}});varr=n(69307),a=n(90861),o=n.n(a),i=n(65736),s=n(81975),l=n(5482),c=n(55609),u=n(52175),p=n(81427),d=n(10723);const__=i.__;functionm(e){let{file:t}=e;const[n,a]=(0,r.useState)(0),[m,h]=(0,r.useState)(!1),[f,g]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),{onUploadFinished:k}=(0,r.useContext)(d.H),y=(0,r.useRef)(null);y.current=f;constE=(0,u.useBlockProps)({className:"resumable-upload"}),w=(0,r.useCallback)((()=>{conste=(0,l.J)({onError:e=>{v(e)},onProgress:(e,t)=>{a(e/t*100)},onSuccess:e=>{k(e)}});(0,l.v)().then((n=>{constr=e(t,n);g(r)})).catch((e=>{v(e)}))}),[t,k]);(0,r.useEffect)((()=>(w(),()=>{null!==y.current&&y.current.abort()})),[]);const_=Math.round(n),C={width:`${_}%`},S=(0,s.escapeHTML)(t.name),j=(0,r.createInterpolateElement)((0,i.sprintf)(
/* translators: Placeholder is a video file name. */
__("Uploading <strong>%s</strong>","jetpack"),S),{strong:(0,r.createElement)("strong",null)}),x=o()(t.size);return(0,r.createElement)("div",E,(0,r.createElement)("div",{className:"resumable-upload__logo"},(0,r.createElement)(c.Icon,{icon:p.ll}),(0,r.createElement)("div",{className:"resumable-upload__logo-text"},__("VideoPress","jetpack"))),null!==b?(0,r.createElement)("div",{className:"resumable-upload__error"},(0,r.createElement)("div",{className:"resumable-upload__error-text"},__("An error was encountered during the upload. Check your network connection.","jetpack")),(0,r.createElement)(c.Button,{variant:"primary",onClick:()=>(v(null),voidw())},__("Try again","jetpack")),(0,r.createElement)(c.Button,{variant:"secondary",onClick:()=>k(),className:"resumable-upload__error-cancel"},__("Cancel","jetpack"))):(0,r.createElement)("div",{className:"resumable-upload__status"},(0,r.createElement)("div",{className:"resumable-upload__file-info"},(0,r.createElement)("div",{className:"resumable-upload__file-name"},j)," — ",(0,r.createElement)("div",{className:"resumable-upload__file-size"},x)),(0,r.createElement)("div",{className:"resumable-upload__progress"},(0,r.createElement)("div",{className:"resumable-upload__progress-loaded",style:C})),(0,r.createElement)("div",{className:"resumable-upload__actions"},(0,r.createElement)("div",{className:"videopress-upload__percent-complete"},`${_}%`),(0,r.createElement)(c.Button,{variant:"link",onClick:()=>{f&&(m?f.start():f.abort(),h(!m))}},m?"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{onError:t,onProgress:n,onSuccess:i}=e;return(e,s)=>{constl=newr.gq(e,{onError:t,onProgress:n,endpoint:s.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,t){if(t.getStatus()>=400)return;constn=t.getHeader("x-videopress-upload-guid"),r=t.getHeader("x-videopress-upload-media-id"),a=t.getHeader("x-videopress-upload-src-url");if(n&&r&&a)returnvoid(i&&i({mediaId:Number(r),guid:n,src:a}));consts={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},l={};Object.keys(s).forEach((function(e){constn=t.getHeader(e);n&&(l[s[e]]=n)})),l.key&&l.token&&(o[l.key]=l.token)},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(!!!s.token)throw"should never happen";e.setHeader("x-videopress-upload-token",s.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)}});returnl.findPreviousUploads().then((function(e){e.length&&l.resumeFromPreviousUpload(e[0]),l.start()})),l}}},23096:function(e,t,n){"use strict";varr=n(69307),a=n(94333),o=n(52175),i=n(65235),s=n.n(i),l=n(90953);t.Z=(0,a.createHigherOrderComponent)((e=>t=>{const{attributes:{autoplay:n,caption:a,controls:i,guid:c,loop:u,muted:p,playsinline:d,poster:m,preload:h,videoPressClassNames:f,className:g,align:b,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:E,maxWidth:w}={}}=t,_=o.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,m
/* translators: %s: The allowed file types to be uploaded as a video text track." */
(0,i.sprintf)(__("Allowed formats: %s","jetpack"),d))),(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:m,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),g(t)?v(__("A track already exists for that language and kind.","jetpack")):(y(!0),((e,t)=>{if(f())returnwindow.videoPressUploadTrack(t,e.kind,e.srcLang,e.label,e.tmpFile);constn={method:"POST",path:`/videos/${t}/tracks`,apiNamespace:"rest/v1.1",global:!0,parse:!1,formData:[["kind",e.kind],["srclang",e.srcLang],["label",e.label],["vtt",e.tmpFile]]};returno()(n)})(t,n).then((()=>{a(t),v(null),c()})).catch((e=>{e.message&&v(e.message)})).finally((()=>{y(!1)})))}},__("Save","jetpack")),(0,r.createElement)(s.Button,{variant:"link",onClick:h},__("Close","jetpack"))),b&&(0,r.createElement)("div",{className:"videopress-block-tracks-editor__single-track-editor-error"},
c=__("Upgrade to %s to use this premium block","jetpack"),u=(__("Upgrade your plan to use this premium block","jetpack"),__("Upgrade","jetpack"));t.ZP=e=>{let{onRedirect:t,align:n,className:p,title:d=l,description:m=null,buttonText:h=u,visible:f=!0,requiredPlan:g,context:b}=e;const[v,k,y]=(0,i.Z)(g,t),E=(0,o.useSelect)((e=>{if(m)returnm;constt=e("wordpress-com/plans"),n=t&&t.getPlan(g);returnn?(0,a.sprintf)(c,n.product_name_short):null}),[m]);returnE&&(0,r.createElement)(s.p,{align:n,buttonText:h,checkoutUrl:v,className:p,context:b,description:E,goToCheckoutPage:k,isRedirecting:y,title:d,visible:f})}},38140:function(e,t,n){"use strict";n.d(t,{W:function(){returno},v:function(){returna}});varr=n(84069);consta=e=>{let{plan:t,blockName:n,context:a}=e;r.Z.tracks.recordEvent("jetpack_editor_block_upgrade_click",{plan:t,block:n,context:a})},o=e=>{let{plan:t,blockName:n,context:a}=e;r.Z.tracks.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:t,block:n,context:a})}},27003:function(e,t,n){"use strict";varr=n(82402),a=n.n(r),o=n(69307),i=n(65235),s=n.n(i),l=n(13419),c=n(94333),u=n(9818),p=n(66316),d=n(87950),m=n(38140);t.Z=(0,c.createHigherOrderComponent)((e=>t=>{varn;const{name:r,className:i,clientId:c,isSelected:h,attributes:f,setAttributes:g}=t||{},{onChildBannerVisibilityChange:b,hasParentBanner:v}=(0,o.useContext)(d.x)||{},k=(0,l.Rl)(r);if(!k)return(0,o.createElement)(e,t);consty=(0,l.HD)(r),E=(0,l.m3)(r),[w,_]=(0,o.useState)(!y),[C,S]=(0,o.useState)(!1),[j,x]=(0,o.useState)(!1),P="editor-canvas",T=(0,u.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(c,!0)),[]),N=(h||T)&&w&&!j,A=(0,o.useMemo)((()=>({plan:k,blockName:r,context:P})),[k,r,P]);(0,o.useEffect)((()=>{N&&S(!0)}),[N,S]),(0,o.useEffect)((()=>{!C&&N&&(0,m.W)(A)}),[C,A,N]),(0,o.useEffect)((()=>_(!y)),[f,_,y]),(0,o.useEffect)((()=>{g({shouldDisplayFrontendBanner:!v})}),[g,v]),(0,o.useEffect)((()=>{b&&b(N||j)}),[N,j,b]);constI=s()(i,{"is-upgradable":N});return(0,o.createElement)(d.L,{onBannerVisibilityChange:_,onChildBannerVisibilityChange:x,hasParentBanner:!0},(0,o.createElement)(p.ZP,{className:`is-${t.name.replace(/\//,"-")}-paid-block`,title:null,align:null==t||null===(n=t.attributes)||void0===n?void0:n.align,visible:N,description:null==E?void0:E.description,requiredPlan:k,context:P,onRedirect:()=>(0,m.v)(A)}),(0,o.createElement)(e,a()({},t,{className:I})))}),"withUpgradeBanner")},29719:function(e,t,n){"use strict";n.d(t,{X:function(){returnm},u:function(){returnd}});varr=n(69307),a=n(26324),o=n(55609),i=n(72067),s=n(9818),l=n(12238),c=n(64967),u=n(65736),p=n(84069);const__=u.__,d="payments",m={render:()=>{conste=(0,a.Z)("wpcom-payments-donations");return"page"!==(0,s.useSelect)((e=>e(l.store).getCurrentPostType()),[])?null:(0,r.createElement)(i.PluginPostPublishPanel,{className:"jetpack-payments-post-publish-panel",title:__("Start accepting payments","jetpack"),initialOpen:!0,icon:c.Z},(0,r.createElement)("p",null,__("Insert the Payment Button or the Donations Form — no plugin required.","jetpack")),(0,r.createElement)("p",null,(0,r.createElement)(o.ExternalLink,{href:e,onClick:()=>{p.Z.tracks.recordEvent("jetpack_editor_payments_post_publish_click")}},__("Learn more about these blocks","jetpack"))))}}},69683:function(e,t,n){"use strict";n.d(t,{D:function(){returnm}});varr=n(69307),a=n(9818),o=n(12238),i=n(55609),s=n(65736),l=n(49777),c=n(41141),u=n(65864),p=n(81427);const__=s.__;functiond(){conste=(0,r.useRef)(),[t,n]=(0,r.useState)();(0,r.useEffect)((()=>{if(null==e||!e.current)return;constt=e.current.querySelector("svg");if(!t)return;constr=(newXMLSerializer).serializeToString(t);n(`data:image/svg+xml;base64,${window.btoa(r)}`)}),[e]);consti=(0,a.useSelect)((e=>e(o.store).getPermalink()),[]),{dataUrl:s}=(0,c.Z)({generateDataUrl:!0}),u=s||t;return(0,r.createElement)("div",{ref:e},(0,r.createElement)(l.Z,{value:i,size:300,imageSettings:u&&{src:u,width:64,height:64},renderAs:"canvas",level:"H"}),(0,r.createElement)(p.IM,{className:"qr-post-jetpack-logo",size:48,border:2}))}functionm(){conste=(0,r.useRef)
__("To re-share a post, you need to upgrade to the %s plan","jetpack"),_)),(0,r.createElement)(l.Button,{href:v?null:g,onClick:b,target:"_top",icon:c.Z,className:o()("jetpack-publicize__upsell-button is-primary",{"jetpack-upgrade-plan__hidden":!g}),isBusy:v},v?__("Redirecting…","jetpack"):x)):(0,r.createElement)("div",{className:"jetpack-publicize__upsell"},(0,r.createElement)("strong",null,S),(0,r.createElement)("br",null),(0,s.sprintf)(
__("This feature is for sites with a %s plan.","jetpack"),_),(0,r.createElement)("br",null),(0,r.createElement)(l.ExternalLink,{href:j},__("More information.","jetpack")))}},42401:function(e,t,n){"use strict";n.d(t,{Z:function(){returns}});varr=n(9818),a=n(12238),o=n(13419);consti="republicize";functions(){vare,t;const{togglePublicizeFeature:n}=(0,r.useDispatch)("jetpack/publicize"),{available:s}=(0,o.OZ)(i),l=(0,r.useSelect)((e=>e(a.store).isCurrentPostPublished()),[]),c=(0,r.useSelect)((e=>e("jetpack/publicize").getFeatureEnableState()),[]),u=!(null===(e=window)||void0===e||null===(t=e.Jetpack_Editor_Initial_State.jetpack)||void0===t||!t.republicize_enabled),p=(0,o.X1)(i);return{isPublicizeEnabledMeta:c,isRePublicizeFeatureEnabled:u,isPublicizeEnabled:l&&!(p&&u)||c,togglePublicizeFeature:n,isPublicizeDisabledBySitePlan:u&&l&&p,isRePublicizeFeatureAvailable:s,isRePublicizeUpgradableViaUpsell:p,hideRePublicizeFeature:l&&!s&&!p&&u}}},31281:function(e,t,n){"use strict";n.d(t,{Z:function(){returnp}});varr=n(86989),a=n.n(r),o=n(9818),i=n(12238),s=n(69307),l=n(65736),c=n(74356);const__=l.__;functionu(e){vart;constn=null==e?void0:e.code,r=null==e||null===(t=e.errors)||void0===t?void0:t.length;if(!n&&!r)return!1;leta="";returnn&&(a=__("Unable to share the Post","jetpack")),r&&(a=__("Unable to share the Post","jetpack")),{message:a,result:e}}functionp(e){const{message:t}=(0,c.LJ)(),{skippedConnections:n}=(0,c.oL)(),r=(0,o.useSelect)((e=>e(i.store).getCurrentPostId()),[]);e=e||r;const[l,p]=(0,s.useState)({data:[],error:{}}),d=(0,s.useCallback)((function(){constr={isFetching:!1,isError:!1,isSuccess:!1,data:[],error:{},postId:e};if(!l.isFetching)returnp({...r,isFetching:!0}),a()({path:`/wpcom/v2/posts/${e}/publicize`,method:"POST",data:{message:t,skipped_connections:n}}).then((function(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:{};constt=u(e);if(t)returnp((e=>({...e,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:t})));p((t=>({...t,isFetching:!1,isSuccess:!0,isError:!1,data:null==e?void0:e.results,error:{}})))})).catch((e=>{p((t=>({...t,isFetching:!1,isSuccess:!1,isError:!0,data:[],error:u(e)})))})),function(){p(r)}}),[e,t,n,l.isFetching]);return{...l,doPublicize:d}}},71259:function(e,t,n){"use strict";n.d(t,{X:function(){returnp},u:function(){returnu}});varr=n(69307),a=n(74356),o=n(65736),i=n(72067),s=n(12238),l=n(34613),c=n(1393);const__=o.__,u="publicize",p={render:()=>(0,r.createElement)(s.PostTypeSupportCheck,{supportKeys:"publicize"},(0,r.createElement)(a.iS,null),(0,r.createElement)(l.Z,null,(0,r.createElement)(c.Z,null)),(0,r.createElement)(i.PluginPrePublishPanel,{initialOpen:!0,id:"publicize-title",title:(0,r.createElement)("span",{id:"publicize-defaults",key:"publicize-title-span"},__("Share this post","jetpack"))},(0,r.createElement)(c.Z,{prePublish:!0})))}},14166:function(e,t,n){"use strict";n.d(t,{Z:function(){returnu}});varr=n(69307),a=n(55609),o=n(65736),i=n(12238),s=n(9818),l=n(8264);const__=o.__;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,s.useSelect)((e=>e(i.store).getEditedPostAttribute("jetpack_sharing_enabled")),[]),{editPost:t}=(0,s.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})))}},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}},43718:function(e,t,n){"use strict";n.d(t,{K:function(){returna}});varr=n(55609);consta=(0,r.withFallbackStyles)(((e,t)=>{const{textColor:n,backgroundColor:r}=t,a=r&&r.color,o=n&&n.color;return{fallbackBackgroundColor:a||!e?void0:getComputedStyle(e).backgroundColor,fallbackTextColor:o||!e?void0:getComputedStyle(e).color}}))},85921:function(e,t,n){"use strict";varr=n(69307),a=n(4981),o=n(65736),i=n(13419),s=n(81427);const__=o.__;(0,i.
__("%s / year","jetpack"),o);case"one-time":returno}return(0,l.sprintf)(// translators: %s: amount, plan interval
__("%1$s / %2$s","jetpack"),o,n)}functionv(e){let{onClose:t,product:n}=e;const{selectedProductId:a,setSelectedProductId:o}=(0,d.Q)(),{id:s,title:l}=n,u=a&&a===s,p=u?c.Z:void0,m=n?" "+b(n):null;return(0,r.createElement)(i.MenuItem,{icon:p,onClick:e=>{e.preventDefault(),o(s),t()},selected:u,value:s},l," : ",m)}functionk(e){let{onClose:t}=e;const{clientId:n,productType:a}=(0,d.Q)(),o=(0,s.useSelect)((e=>e(f.h).getSiteSlug())),l=(0,m.Z)(n);if(g.BM===(0,g.j3)())return(0,r.createElement)(i.MenuItem,null,o&&(0,r.createElement)(i.ExternalLink,{href:`https://wordpress.com/earn/payments-plans/${o}`},(0,h.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,h.l)("add a new product",a))}functiony(){const{products:e,productType:t,selectedProductId:n}=(0,d.Q)(),{selectedProduct:a,shouldUpgrade:l}=(0,s.useSelect)((e=>{const{getProduct:t,getShouldUpgrade:r}=e(f.h);return{selectedProduct:t(n),shouldUpgrade:r()}}));letc=null,m=u.Z;returna&&(c=b(a)),n&&!a&&(c=(0,h.l)("product not found",t),m=p.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,h.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(72067),o=n(9818),i=n(99307);functions(e){constt=(0,i.j3)(),{selectBlock:n}=(0,o.useDispatch)(r.store),{enableComplementaryArea:s}=(0,o.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,o.useDispatch)(a.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,{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]:__("The button will be hidden from your visitors until you select a valid payment plan.","jetpack"),[a.DM]:__("Thesubsc
__("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(86989),a=n.n(r),o=n(13419);asyncfunctioni(){if((0,o.Wp)())returnPromise.reject();try{returnawaita()({path:"/jetpack/v4/plugins"})}catch(e){returnPromise.reject(e.message)}}asyncfunctions(e){if((0,o.Wp)())returnPromise.reject();try{returnawaita()({path:"/jetpack/v4/plugins",method:"POST",data:{slug:e,status:"active",source:"block-editor"}})}catch(e){returnPromise.reject(e.message)}}asyncfunctionl(e){if((0,o.Wp)())returnPromise.reject();try{returnawaita()({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(){returnd}});varr=n(65736),a=n(92694),o=n(4981),i=n(13419),s=n(1949);const__=r.__,l={paid:(0,r._x)("paid","Short label appearing near a block requiring a paid plan","jetpack"),beta:__("beta","jetpack")},c=s.Kc||[];functionu(e){constt=[];returnc.includes(e)&&t.push(l.beta),t}functionp(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:[];returnt.length?`${e} (${t.join(", ")})`:e}functiond(e,t){letn=arguments.length>2&&void0!==arguments[2]?arguments[2]:[],r=!(arguments.length>3&&void0!==arguments[3])||arguments[3];const{available:s,details:l,unavailableReason:c}=(0,i.OZ)(e),d=(0,i._D)(c,l),m=r?"jetpack/":"";if(!s&&!d)return!1;consth=(0,o.registerBlockType)(m+e,{...t,title:p(t.title,u(e))});returnd&&(0,a.addFilter)("editor.BlockListBlock",`${m+e}-with-has-warning-is-interactive-class-names`,(0,i.T)(m+e)),n.forEach((e=>(0,o.registerBlockType)(m+e.name,e.settings))),h}},36598:function(e,t,n){"use strict";varr=n(69307),a=n(55609);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"}),e)}},66425:function(e,t,n){"use strict";varr=n(69307),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(92819),a=n(86989),o=n.n(a);functioni(e){lett=arguments.length>1&&void0!==arguments[1]?arguments[1]:r.noop;returnt(!0),newPromise(((n,r)=>{o()({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(){returns}});varr=n(92819),a=n(9818),o=n(69307);functioni(e,t){letn=arguments.length>2&&void0!==arguments[2]&&arguments[2];returnt&&t(e),n?window.open(e,"_blank"):window.top.location.href=e}functions(e){lett=arguments.length>1&&void0!==arguments[
__("Minimum allowed price is %s.","jetpack"),(0,r.ZP)(k,b)),h),voida(!1);if(!(0,c.vs)(b,v))return(0,l.q)((0,p.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},c=h.select(s.G4).getProducts();m(d(c.concat([i]))),n(i.id),(0,l.w)((0,p.l)("successfully created product",t),h),a(!0)}catch(e){(0,l.q)((0,p.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(93100),i=n(20360),s=n(93245),l=n(23267);constc=(0,r.createReduxStore)(l.G4,{actions:a,reducer:o.Z,resolvers:i,selectors:s,__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(){returnE}});varr=n(86989),a=n.n(r),o=n(12238),i=n(96483),s=n(6247),l=n(46529),c=n(23267),u=n(74251),p=n(14436),d=n(51585),m=n(73905);consth="membership-products-resolver-getProducts";letf=!1;constg=async()=>{vare,t;constn=(0,i.getQueryArg)(window.location.href,"origin"),r=(0,i.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===n?"gutenberg-wpcom":"gutenberg",type:"all",is_editable:!0}),o=awaita()({path:r,method:"GET"});if(!o&&"object"!=typeofo)thrownewError("Unexpected API response");consts=(null==o?void0:o.errors)&&(null===(e=Object.values(o.errors))||void0===e||null===(t=e[0])||void0===t?void0:t[0]);if(s)thrownewError(s);returno},b=(e,t,n)=>{constr=t.select(o.store).getCurrentPostId();n((0,s.setConnectUrl)((0,u.Z)(r,e.connect_url))),n((0,s.setShouldUpgrade)(e.should_upgrade_to_access_memberships)),n((0,s.setSiteSlug)(e.site_slug)),n((0,s.setUpgradeUrl)(e.upgrade_url)),n((0,s.setProducts)(e.products)),n((0,s.setApiState)(e.connected_account_id?c.cH:c.P))},v=async(e,t,n)=>{awaitn((0,s.saveProduct)({title:(0,d.l)("default new product title",e),currency:"USD",price:5,interval:"1 month"},e,t))},k=e=>!e.products.length&&!e.should_upgrade_to_access_memberships&&e.connected_account_id,y=(e,t,n)=>{varr;if(e)return;consta=null===(r=n.getProductsNoResolver()[0])||void0===r?void0:r.id;a&&t(a)},E=function(){lete=arguments.length>0&&void0!==arguments[0]?arguments[0]:p.Bn,t=arguments.length>1&&void0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void0!==arguments[2]?arguments[2]:()=>{};returnasyncr=>{let{dispatch:a,registry:o,select:i}=r;if(awaitm.Z.blockExecution(h),f)returnvoidy(t,n,i);constu=m.Z.acquire(h);try{constr=awaitg();b(r,o,a),k(r)&&awaitv(e,n,a),y(t,n,i),f=!0}catch(e){a((0,s.setConnectUrl)(null)),a((0,s.setApiState)(c.P)),(0,l.q)(e.message,o)}m.Z.release(u)}}},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(){returnp},isApiStateConnected:function(){returnd},isApiStateLoading:function(){returnm},isInvalidProduct:function(){returnh}});varr=n(23267);consta=e=>e.apiState,o=e=>e.connectUrl,i=e=>e.produc