kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/editor-experimental.js

135 lines
1.4 MiB
JavaScript
Raw Normal View History

2022-04-02 10:26:41 +02:00
/*! For license information please see editor-experimental.js.LICENSE.txt */
2025-07-27 19:58:08 +02:00
(()=>{var e,t,r,n,s={7675:(e,t,r)=>{"use strict";r.d(t,{y:()=>l});var n=r(76416),s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r};const o="text/event-stream",a=1e3,i="last-event-id";function l(e,t){var{signal:r,headers:l,onopen:u,onmessage:d,onclose:p,onerror:h,openWhenHidden:m,fetch:g}=t,f=s(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,s)=>{const b=Object.assign({},l);let v;function k(){v.abort(),document.hidden||C()}b.accept||(b.accept=o),m||document.addEventListener("visibilitychange",k);let y=a,x=0;function j(){document.removeEventListener("visibilitychange",k),window.clearTimeout(x),v.abort()}null==r||r.addEventListener("abort",(()=>{j(),t()}));const w=null!=g?g:window.fetch,_=null!=u?u:c;async function C(){var r;v=new AbortController;try{const r=await w(e,Object.assign(Object.assign({},f),{headers:b,signal:v.signal}));await _(r),await(0,n.q5)(r.body,(0,n.iv)((0,n.VL)((e=>{e?b[i]=e:delete b[i]}),(e=>{y=e}),d))),null==p||p(),j(),t()}catch(e){if(!v.signal.aborted)try{const t=null!==(r=null==h?void 0:h(e))&&void 0!==r?r:y;window.clearTimeout(x),x=window.setTimeout(C,t)}catch(e){j(),s(e)}}}C()}))}function c(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(o)))throw new Error(`Expected content-type to be ${o}, Actual: ${t}`)}},76416:(e,t,r)=>{"use strict";async function n(e,t){const r=e.getReader();let n;for(;!(n=await r.read()).done;)t(n.value)}function s(e){let t,r,n,s=!1;return function(o){void 0===t?(t=o,r=0,n=-1):t=function(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(t,o);const a=t.length;let i=0;for(;r<a;){s&&(10===t[r]&&(i=++r),s=!1);let o=-1;for(;r<a&&-1===o;++r)switch(t[r]){case 58:-1===n&&(n=r-i);break;case 13:s=!0;case 10:o=r}if(-1===o)break;e(t.subarray(i,o),n),i=r,n=-1}i===a?t=void 0:0!==i&&(t=t.subarray(i),r-=i)}}function o(e,t,r){let n=a();const s=new TextDecoder;return function(o,i){if(0===o.length)null==r||r(n),n=a();else if(i>0){const r=s.decode(o.subarray(0,i)),a=i+(32===o[i+1]?2:1),l=s.decode(o.subarray(a));switch(r){case"data":n.data=n.data?n.data+"\n"+l:l;break;case"event":n.event=l;break;case"id":e(n.id=l);break;case"retry":const r=parseInt(l,10);isNaN(r)||t(n.retry=r)}}}}function a(){return{data:"",event:"",id:"",retry:void 0}}r.d(t,{VL:()=>o,iv:()=>s,q5:()=>n})},51113:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(86087);const s=(0,n.forwardRef)((function({icon:e,size:t=24,...r},s){return(0,n.cloneElement)(e,{width:t,height:t,...r,ref:s})}))},66955:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(5573),s=r(10790);const o=(0,s.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(n.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})})},62510:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(5573),s=r(10790);const o=(0,s.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(n.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})})},62599:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(5573),s=r(10790);const o=(0,s.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)(n.Path,{d:"M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467
2025-04-25 12:30:07 +02:00
// Translators: %d is the cost of one image.
// Translators: %d is the cost of one image.
2025-07-27 19:58:08 +02:00
(0,s.sprintf)(__("Requests needed: <counter>%d</counter>","jetpack"),r),{counter:(0,o.jsx)("span",{})}),l=(0,n.createInterpolateElement)((0,s.sprintf)(
2025-04-25 12:30:07 +02:00
// Translators: %d is the current requests balance.
2025-07-27 19:58:08 +02:00
__("Requests available: <counter>%d</counter>","jetpack"),a),{counter:a<r?(0,o.jsx)("span",{className:"ai-assistant-featured-image__usage-counter-no-limit"}):(0,o.jsx)("strong",{})});return(0,o.jsxs)("div",{className:"ai-assistant-featured-image__usage-counter",children:[(0,o.jsx)("span",{children:i}),(0,o.jsx)("span",{children:l})]})}},89289:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var n=r(85985),s=r(56427),o=r(47143),a=r(43656),i=r(86087),l=r(27723),c=r(10067),u=r.n(c),d=r(43984),p=r(72448),h=r(71508),m=r(62038),g=r(96390),f=r(3620),b=r(35918),v=r(75988),k=r(10790);const __=l.__,y=u()("jetpack-ai-client:featured-image");function x({busy:e,disabled:t,placement:r,onClose:c=()=>{}}){const[u,x]=(0,i.useState)(r===v.hB),j=(0,b.A)(),{getPostContent:w,isEditedPostEmpty:_}=(0,h.A)(),{postTitle:C,postFeaturedMediaId:A,isEditorPanelOpened:S}=(0,o.useSelect)((e=>({postTitle:e(a.store).getEditedPostAttribute("title"),postFeaturedMediaId:e(a.store).getEditedPostAttribute("featured_media"),isEditorPanelOpened:e(a.store).isEditorPanelOpened??e("core/edit-post").isEditorPanelOpened})),[]),{saveToMediaLibrary:E}=(0,m.A)(),{tracks:N}=(0,n.st)(),{recordEvent:T}=N,[P,B]=(0,i.useState)(null),[I,M]=(0,i.useState)(""),{enableComplementaryArea:L}=(0,o.useDispatch)("core/interface"),{clearSelectedBlock:R}=(0,o.useDispatch)("core/block-editor"),{toggleEditorPanelOpened:D}=(0,o.useDispatch)("core/edit-post"),{editPost:F,toggleEditorPanelOpened:O}=(0,o.useDispatch)(a.store),{requireUpgrade:z,requestsCount:U,requestsLimit:H,currentTier:V,costs:q}=(0,p.A)(),$=(0,n.Bd)(V),G=q?.[v.oW]?.activeModel??10,W=G===q?.[v.oW]?.stableDiffusion?v.Dk:v.bb,Z=$===n.Ti,J=H-U<G,K=O??D,{pointer:Y,current:Q,setCurrent:X,processImageGeneration:ee,handlePreviousImage:te,handleNextImage:re,currentImage:ne,currentPointer:se,images:oe,imageStyles:ae,guessStyle:ie}=(0,f.A)({autoStart:!1,cost:G,type:"featured-image-generation",feature:v.oW,previousMediaId:A}),le=(0,i.useCallback)((()=>{x(!1),c?.()}),[c]),ce=(0,i.useCallback)((()=>{x(!0)}),[]),ue=(0,i.useCallback)((e=>{const t=C+"\n\n"+w();return ie(e,"featured-image-guess-style",t)}),[C,w,ie]),de=(0,i.useCallback)((({userPrompt:e,style:t})=>(T("jetpack_ai_featured_image_generation_generate_image",{placement:r,model:W,site_type:j,style:t,userPrompt:e}),x(!0),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch((e=>{T("jetpack_ai_featured_image_generation_error",{placement:r,error:e?.message,model:W,site_type:j,style:t})})))),[T,r,W,j,ee,w,J,C]),pe=(0,i.useCallback)((async()=>{se.generating=!0;const e=await ue("");B(e);const t=await de({userPrompt:"",style:e});t&&(y("handleFirstGenerate",t.revisedPrompt),M(t.revisedPrompt||""))}),[se,de,ue]),he=(0,i.useCallback)((({userPrompt:e,style:t})=>{T("jetpack_ai_featured_image_generation_generate_another_image",{placement:r,model:W,site_type:j,style:t}),X((()=>oe.length)),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch((n=>{T("jetpack_ai_featured_image_generation_error",{placement:r,error:n?.message,model:W,site_type:j,style:t,userPrompt:e})}))}),[T,r,W,j,X,ee,C,w,J,oe]),me=(0,i.useCallback)((({userPrompt:e,style:t})=>{T("jetpack_ai_featured_image_generation_try_again",{placement:r,model:W,site_type:j,style:t}),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch((e=>{T("jetpack_ai_featured_image_generation_error",{placement:r,error:e?.message,model:W,site_type:j,style:t})}))}),[T,r,W,j,ee,w,J,C]),ge=(0,i.useCallback)((()=>(R(),L("core/edit-post","edit-post/document"))),[R,L]),fe=(0,i.useCallback)((()=>{T("jetpack_ai_featured_image_generation_use_image",{placement:r,model:W,site_type:j});const e=e=>{F({featured_media:e}),le(),setTimeout((()=>{const e=S("featured-image"),t=S("post-status");ge().then((()=>{e||K("featured-image"),t||K("post-status")}))}),500)};ne?.libraryId?e(ne?.libraryId):E(ne?.image).then((t=>{e(t?.id)})).catch((e=>{T("jetpack_ai_featured_image_saving_error",{placement:r,error:e?.message,model:W,site_type:j})}))}),[T,r,W,j,ne?.libraryId,ne?.image,F,le,S,ge,K,E]),be=__("Generate another imag
2025-04-25 12:30:07 +02:00
// Translators: %d is the cost of generating a featured image.
2025-07-27 19:58:08 +02:00
__("Featured image generation costs %d requests per image. You don't have enough requests to generate another image.","jetpack"),G):null,_e=(0,k.jsx)(s.Button,{onClick:fe,variant:"primary",disabled:!ne?.image||ne?.generating||ne?.libraryId===A,children:__("Set as featured image","jetpack")});return(0,k.jsxs)(k.Fragment,{children:[(r===d.s6||r===d.wb)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("p",{className:"jetpack-ai-assistant__help-text",children:__("Based on your post content.","jetpack")}),(0,k.jsx)(s.Button,{onClick:ce,isBusy:e,disabled:t||J,variant:"secondary",__next40pxDefaultSize:!0,children:__("Generate image","jetpack")})]}),(0,k.jsx)(g.A,{autoStart:ke&&!A,autoStartAction:pe,images:oe,currentIndex:Q,title:__("Generate a featured image with AI","jetpack"),cost:G,open:u,placement:r,onClose:le,onTryAgain:me,onGenerate:Y?.current>0||A?he:de,generating:se?.generating,notEnoughRequests:J,requireUpgrade:z,upgradeDescription:we,currentLimit:H,currentUsage:U,isUnlimited:Z,hasError:Boolean(se?.error),handlePreviousImage:te,handleNextImage:re,acceptButton:_e,generateButtonLabel:Y?.current>0?be:ve,instructionsPlaceholder:__("Describe the featured image you'd like to create and select a style.","jetpack"),imageStyles:ae,onGuessStyle:ue,prompt:I,setPrompt:M,initialStyle:P,inputDisabled:xe,actionDisabled:je})]})}},83158:(e,t,r)=>{"use strict";r(85985),r(56427),r(86087),r(27723);var n=r(10067),s=r.n(n);r(72448),r(71508),r(62038),r(96390),r(3620),r(35918),r(10790);s()("jetpack-ai:general-purpose-image")},3620:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});var n=r(47143),s=r(86087),o=r(27723),a=r(93832),i=r(31439),l=r(72448),c=r(62614),u=r(62038),d=r(75988);const __=o.__;function p({feature:e,type:t,cost:r,autoStart:o=!0,previousMediaId:p}){const{generateImageWithParameters:h}=(0,c.Ay)(),{increaseRequestsCount:m,featuresControl:g}=(0,l.A)(),{saveToMediaLibrary:f}=(0,u.A)(),{createNotice:b}=(0,n.useDispatch)("core/notices"),v=(0,s.useRef)(0),[k,y]=(0,s.useState)(0),[x,j]=(0,s.useState)([{generating:o}]),w=e===d.oW?"featured-image":"image",_=g?.[w],C=_?.styles,A=(0,s.useCallback)(((e,t)=>{j((r=>{const n=[...r];return n[t]={...n[t],...e},n}))}),[]),S=(0,n.useSelect)((e=>e("core")?.getMedia?.(p)),[p]);(0,s.useEffect)((()=>{S&&A({image:S.source_url,libraryId:S.id,libraryUrl:S.source_url,generating:!1},v.current)}),[S,A]);const E=(0,s.useCallback)((e=>{b("success",e,{type:"snackbar",isDismissible:!0})}),[b]),N=(0,s.useCallback)((()=>{m(r)}),[m,r]),T=(0,s.useCallback)((e=>{if(!e)return"image.png";const t=e.split(" ").slice(0,10).join(" ");return(0,a.cleanForSlug)(t)+".png"}),[]),P=(0,s.useCallback)((({userPrompt:r,postContent:n,notEnoughRequests:s,style:o=null})=>new Promise(((a,i)=>{if(p&&0===v.current&&v.current++,A({generating:!0,error:null},v.current),s)return A({generating:!1,error:new Error(__("You don't have enough requests to generate another image.","jetpack"))},v.current),void a({});const l=h({feature:e,size:"1792x1024",responseFormat:"b64_json",messages:[{role:"jetpack-ai",context:{type:t,request:r||null,content:n,style:o}}],style:o||""}),c=T(r);l.then((e=>{if(e.data.length>0){const t="data:image/png;base64,"+e.data[0].b64_json,n=r||null,s=e.data[0].revised_prompt||null;A({image:t,prompt:n,revisedPrompt:s},v.current),N(),f(t,c).then((e=>{E(__("Image saved to media library.","jetpack")),A({libraryId:e?.id,libraryUrl:e?.url,generating:!1},v.current),v.current+=1,a({image:t,libraryId:e?.id,libraryUrl:e?.url,revisedPrompt:s})})).catch((()=>{A({generating:!1},v.current),v.current+=1,a({image:t})}))}})).catch((e=>{A({generating:!1,error:e},v.current),i(e)}))}))),[A,h,e,t,N,f,E,T,p]),B=(0,s.useCallback)((()=>{y(Math.max(k-1,0))}),[k]),I=(0,s.useCallback)((()=>{y(Math.min(k+1,x.length-1))}),[k,x.length]),M=(0,s.useCallback)((async function(e,t="",r=""){if(!C||!C.length)return null;const n=[{role:"jetpack-ai",context:{type:t||"general-image-guess-style",request:e,content:r}}];try{const e=await(0,i.A)(n,{feature:"jetpack-ai-image-generator"});if(!e)return null;const t=C.find((({value:t})=>t===e));return t?t.value:null}catch(e){Promise.rej
2024-04-17 11:32:24 +02:00
// translators: %1$d: number of requests remaining
2025-07-27 19:58:08 +02:00
__("You have %1$d requests remaining.","jetpack"),e)}),(0,p.jsx)(n.Button,{variant:"link",onClick:r,href:s,target:s?"_blank":null,children:__("Upgrade now","jetpack")})]})}function w({error:e,code:t,onTryAgainClick:r,onUpgradeClick:s,upgradeUrl:a}){const i=e||__("Something went wrong","jetpack");return(0,p.jsxs)(v,{severity:m,children:[(0,p.jsx)("span",{children:(0,o.sprintf)(
2025-02-28 08:42:11 +01:00
// translators: %1$d: A dynamic error message
2025-07-27 19:58:08 +02:00
__("Error: %1$s","jetpack"),i)}),t===u.Or?(0,p.jsx)(n.Button,{variant:"link",onClick:s,href:a,target:a?"_blank":null,children:__("Upgrade now","jetpack")}):(0,p.jsx)(n.Button,{variant:"link",onClick:r,children:__("Try again","jetpack")})]})}},14016:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(56427),s=r(27723),o=r(10991),a=r(6754),i=r(10790);const __=s.__,l=({requestingState:e,onClose:t,title:r})=>(0,i.jsxs)("div",{className:"ai-assistant-modal__header",children:[(0,i.jsxs)("div",{className:"ai-assistant-modal__title-wrapper",children:[(0,i.jsx)(a.A,{state:e}),(0,i.jsx)("h1",{className:"ai-assistant-modal__title",children:r})]}),(0,i.jsx)(n.Button,{icon:o.A,label:__("Close","jetpack"),onClick:t})]});function c({children:e,handleClose:t,hideHeader:r=!0,requestingState:s="init",title:o=__("AI Assistant","jetpack"),maxWidth:a=720}){return(0,i.jsx)(n.Modal,{__experimentalHideHeader:r,className:"ai-assistant-modal",shouldCloseOnClickOutside:!1,onRequestClose:t,children:(0,i.jsxs)("div",{className:"ai-assistant-modal__content",style:{maxWidth:a},children:[(0,i.jsx)(l,{requestingState:s,onClose:t,title:o}),(0,i.jsx)("hr",{className:"ai-assistant-modal__divider"}),e]})})}},57853:(e,t,r)=>{"use strict";r.d(t,{A:()=>b,Q:()=>f});var n=r(3924),s=r(85985),o=r(82201),a=r(56427),i=r(86087),l=r(27723),c=r(10067),u=r.n(c),d=r(42694),p=r(72448),h=r(71567),m=r(10790);const __=l.__,g=u()("jetpack-ai-client:upgrade-prompt"),f=({variant:e="error"})=>{const t=(()=>{const{usagePeriod:e}=(0,p.A)(),t=(e=>{const t=__("You've reached this month's request limit, per our <link>fair usage policy</link>.","jetpack");if(!e)return t;
2025-02-28 08:42:11 +01:00
// Translators: %s is the date when the requests will reset.
2025-07-27 19:58:08 +02:00
const r=__("Requests will reset on %s.","jetpack");return`${t} ${(0,l.sprintf)(r,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e));return(0,i.createInterpolateElement)(t,{link:(0,m.jsx)("a",{href:"https://jetpack.com/redirect/?source=ai-assistant-fair-usage-policy",target:"_blank",rel:"noreferrer"})})})();return"muted"===e?(0,m.jsx)("span",{className:"jetpack-ai-fair-usage-notice-muted-variant",children:t}):"error"===e?(0,m.jsx)(a.Notice,{status:"error",isDismissible:!1,className:"jetpack-ai-fair-usage-notice",children:t}):null},b=e=>{const{upgradeType:t,currentTier:r}=(0,p.A)();return 1===r?.value?(0,m.jsx)(f,{}):"vip"===t?(({description:e=null,useLightNudge:t=!1})=>{const r=t?h.U:o.cb,n=(0,i.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. <strong>Please reach out to your VIP account team.</strong>","jetpack"),{strong:(0,m.jsx)("strong",{})});return(0,m.jsx)(r,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:e||n,goToCheckoutPage:null,isRedirecting:null,visible:!0,align:null,title:null,context:null})})({description:e.description,useLightNudge:e?.useLightNudge}):(({placement:e=null,description:t=null,useLightNudge:r=!1})=>{const a=r?h.U:o.cb,{checkoutUrl:c}=(0,d.A)(),u=(0,s.CP)(),{nextTier:f,tierPlansEnabled:b,currentTier:v,requestsCount:k}=(0,p.A)(),{tracks:y}=(0,s.st)(),x=(0,i.useCallback)((()=>{g("upgrade",e),y.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:v?.slug,requests_count:k,placement:e})}),[v,k,y,e]),j=(0,i.useCallback)((()=>{g("contact us",e),y.recordEvent("jetpack_ai_upgrade_contact_us",{placement:e})}),[y,e]);if(!u){const e=(0,i.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Reach out to the site administrator to upgrade and keep using Jetpack AI.</strong>","jetpack"),{strong:(0,m.jsx)("strong",{})});return(0,m.jsx)(a,{showButton:!1,className:"jetpack-ai-upgrade-banner",description:t||e,visible:!0,align:null,title:null,context:null})}if(b){if(!f){const e=(0,n.A)("jetpack-ai-tiers-more-requests-contact"),r=__("You have reached the request limit for your current plan.","jetpack");return(0,m.jsx)(a,{buttonText:__("Contact Us","jetpack"),description:t||r,className:"jetpack-ai-upgrade-banner",checkoutUrl:e,visible:!0,align:null,title:null,context:null,goToCheckoutPage:j,target:"_blank"})}const e=(0,i.createInterpolateElement)((0,l.sprintf)(/* Translators: number of requests */
__("You have reached the requests limit for your current plan. <strong>Upgrade now to increase your requests limit to %d.</strong>","jetpack"),f.limit),{strong:(0,m.jsx)("strong",{})});return(0,m.jsx)(a,{buttonText:(0,l.sprintf)(/* Translators: number of requests */
__("Upgrade to %d requests","jetpack"),f.limit),checkoutUrl:c,className:"jetpack-ai-upgrade-banner",description:t||e,goToCheckoutPage:x,visible:!0,align:"center",title:null,context:null,target:"_blank"})}return(0,m.jsx)(a,{buttonText:__("Upgrade","jetpack"),checkoutUrl:c,className:"jetpack-ai-upgrade-banner",description:(0,i.createInterpolateElement)(__("Congratulations on exploring Jetpack AI and reaching the free requests limit! <strong>Upgrade now to keep using it.</strong>","jetpack"),{strong:(0,m.jsx)("strong",{})}),goToCheckoutPage:x,visible:!0,align:null,title:null,context:null,target:"_blank"})})(e)}},71567:(e,t,r)=>{"use strict";r.d(t,{U:()=>a});var n=r(56427),s=r(27723),o=r(10790);const __=s.__,a=({title:e,description:t,buttonText:r=null,checkoutUrl:s=null,goToCheckoutPage:a=null,isRedirecting:i=!1,showButton:l=!0,target:c="_top"})=>{const u=__("Redirecting…","jetpack");return(0,o.jsx)("div",{className:"jetpack-upgrade-plan-banner-light",children:(0,o.jsx)(n.Notice,{status:"error",isDismissible:!1,children:(0,o.jsxs)("p",{children:[e&&(0,o.jsx)("strong",{children:e}),t," ",l&&(0,o.jsx)(n.Button,{href:i?null:s,onClick:a,variant:"link",target:c,children:i?u:r})]})})})}},43984:(e,t,r)=>{"use strict";r.d(t,{A4:()=>l,DD:()=>j,DT:()=>P,Gm:()=>g,HM:()=>w,JR:()=>_,K2:()=>A,Rq:()=>T,UA:()=>m,UD:()=>C,br:()=>d,d5:()=>v,eJ:()=>h,fD:()=>p,fv:()=>k,im:()=>a,mI:()=>S,mT:()=>N,oZ:()=>o,pE:()=>f,s6:()=>B,sn:()=>i,so:()=>s,u0:()=>y,uQ:()=>x,vE:()=>u,wb:()=>I,yQ:()=>E,yy:()=>c,z5:()=>b});var n=r(27723);const __=n.__,s={en:{label:__("English","jetpack")},es:{label:__("Spanish","jetpack")},fr:{label:__("French","jetpack")},de:{label:__("German","jetpack")},it:{label:__("Italian","jetpack")},pt:{label:__("Portuguese","jetpack")},ru:{label:__("Russian","jetpack")},zh:{label:__("Chinese","jetpack")},ja:{label:__("Japanese","jetpack")},ar:{label:__("Arabic","jetpack")},hi:{label:__("Hindi","jetpack")},ko:{label:__("Korean","jetpack")}},o={formal:{label:__("Formal","jetpack"),emoji:"🎩"},informal:{label:__("Informal","jetpack"),emoji:"😊"},optimistic:{label:__("Optimistic","jetpack"),emoji:"😃"},humorous:{label:__("Humorous","jetpack"),emoji:"😂"},serious:{label:__("Serious","jetpack"),emoji:"😐"},skeptical:{label:__("Skeptical","jetpack"),emoji:"🤨"},empathetic:{label:__("Empathetic","jetpack"),emoji:"💗"},confident:{label:__("Confident","jetpack"),emoji:"😎"},passionate:{label:__("Passionate","jetpack"),emoji:"❤️"},provocative:{label:__("Provocative","jetpack"),emoji:"🔥"}},a="titleSummary",i="continue",l="simplify",c="correctSpelling",u="generateTitle",d="makeLonger",p="makeShorter",h="changeTone",m="summarize",g="changeLanguage",f="userPrompt",b="jetpackFormCustomPrompt",v="transformListToTable",k="writePostFromList",y=__("Translate","jetpack"),x=__("Change tone","jetpack"),j=__("Correct spelling and grammar","jetpack"),w=__("Simplify","jetpack"),_=__("Summarize","jetpack"),C=__("Make shorter","jetpack"),A=__("Expand","jetpack"),S=__("Turn list into a table","jetpack"),E=__("Write a post from this list","jetpack"),N=__("Generate a post title","jetpack"),T=__("Summary based on title","jetpack"),P=__("Continue writing","jetpack"),B="jetpack-sidebar",I="document-settings"},2166:(e,t,r)=>{"use strict";r.d(t,{R:()=>a});var n=r(51609),s=r(10790);const o=(0,n.createContext)({}),a=({value:e,children:t})=>(0,s.jsx)(o.Provider,{value:e,children:t})},13965:(e,t,r)=>{"use strict";r.d(t,{Rb:()=>n.R});var n=r(2166);r(59886),r(53471)},53471:(e,t,r)=>{"use strict";r(51609),r(78836),r(13965)},59886:(e,t,r)=>{"use strict";var n=r(29491),s=r(86087),o=(r(51609),r(46219)),a=r(13965),i=r(10790);(0,n.createHigherOrderComponent)((e=>t=>{const{suggestion:r,error:n,requestingState:l,request:c,stopSuggestion:u,eventSource:d}=(0,o.Ay)(),p=(0,s.useMemo)((()=>({suggestion:r,requestingError:n,requestingState:l,eventSource:d,requestSuggestion:c,stopSuggestion:u})),[r,n,l,d,c,u]);return(0,i.jsx)(a.Rb,{value:p,children:(0,i.jsx)(e,{...t})})}),"withAiDataProvider")},42694:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(3924),s=r(97999),o=r(8
2025-04-25 12:30:07 +02:00
// translators: %u is the number of requests
2025-07-27 19:58:08 +02:00
__("%u requests remaining.","jetpack"),j)}),S&&(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(s.Button,{variant:"link",href:A,target:"_blank",onClick:()=>{r(h.AN,{context:V,placement:h.Cn})},children:__("Upgrade","jetpack")})]})," ",(0,k.jsx)(s.Tooltip,{text:__("Logo generation costs 10 requests; prompt enhancement costs 1 request each","jetpack"),placement:"bottom",children:(0,k.jsx)(a.A,{className:"prompt-footer__icon",icon:i.A})})]}),H&&q&&(0,k.jsx)(v.G,{}),H&&!q&&(0,k.jsx)(b.Q,{}),_&&(0,k.jsx)("div",{className:"jetpack-ai-logo-generator__prompt-error",children:__("Error enhancing prompt. Please try again.","jetpack")}),C&&(0,k.jsx)("div",{className:"jetpack-ai-logo-generator__prompt-error",children:__("Error generating logo. Please try again.","jetpack")})]})]})}},64024:(e,t,r)=>{"use strict";r.d(t,{G:()=>h});var n=r(85985),s=r(56427),o=r(86087),a=r(27723),i=r(51113),l=r(23751),c=r(61356),u=r(60674),d=r(88725),p=r(10790);const __=a.__,h=()=>{const{tracks:e}=(0,n.st)(),{recordEvent:t}=e,r=__("Upgrade","jetpack"),a=(0,o.createInterpolateElement)(__("Not enough requests left to generate a logo. <strong>Upgrade now to increase it.</strong>","jetpack"),{strong:(0,p.jsx)("strong",{})}),{nextTierCheckoutURL:h}=(0,u.Q)(),{context:m}=(0,d.A)();return(0,p.jsx)("div",{className:"jetpack-upgrade-plan-banner",children:(0,p.jsxs)("div",{className:"jetpack-upgrade-plan-banner__wrapper",children:[(0,p.jsxs)("div",{children:[(0,p.jsx)(i.A,{className:"jetpack-upgrade-plan-banner__icon",icon:l.A}),(0,p.jsx)("span",{className:"jetpack-upgrade-plan-banner__banner-description",children:a})]}),(0,p.jsx)(s.Button,{href:h,target:"_blank",className:"is-primary",onClick:()=>{t(c.AN,{context:m,placement:c.tF})},children:r})]})})}},35421:(e,t,r)=>{"use strict";r.d(t,{R:()=>u});var n=r(3924),s=r(85985),o=r(56427),a=r(27723),i=r(61356),l=r(88725),c=r(10790);const __=a.__,u=({onCancel:e,upgradeURL:t,reason:r})=>{const{tracks:a}=(0,s.st)(),{recordEvent:u}=a,d=__("Upgrade your Jetpack AI for access to logo generation. This upgrade will also increase the amount of monthly requests you can use in for all AI-powered features.","jetpack"),p=__("Not enough requests left to generate a logo. Upgrade your Jetpack AI to increase the amount of requests you can use in all AI-powered features.","jetpack"),h=(0,n.A)("ai-logo-generator-fair-usage-policy",{anchor:"usage-limitations-and-upgrades"}),{context:m}=(0,l.A)();return(0,c.jsxs)("div",{className:"jetpack-ai-logo-generator-modal__notice-message-wrapper",children:[(0,c.jsxs)("div",{className:"jetpack-ai-logo-generator-modal__notice-message",children:[(0,c.jsx)("span",{className:"jetpack-ai-logo-generator-modal__loading-message",children:"feature"===r?d:p})," ",(0,c.jsx)(o.Button,{variant:"link",href:h,target:"_blank",children:__("Learn more about Jetpack AI.","jetpack")})]}),(0,c.jsxs)("div",{className:"jetpack-ai-logo-generator-modal__notice-actions",children:[(0,c.jsx)(o.Button,{variant:"tertiary",onClick:e,children:__("Cancel","jetpack")}),(0,c.jsx)(o.Button,{variant:"primary",href:t,target:"_blank",onClick:()=>{u(i.AN,{context:m,placement:i.Tz}),e()},children:__("Upgrade","jetpack")})]})]})}},48204:(e,t,r)=>{"use strict";r.d(t,{H:()=>c});var n=r(56427),s=r(27723),o=r(53512),a=r(13022),i=r(36791),l=r(10790);const __=s.__,c=({className:e=null,onVisitBlankTarget:t})=>(0,l.jsxs)("div",{className:(0,a.A)("jetpack-ai-logo-generator-modal-visit-site-banner",e),children:[(0,l.jsx)("div",{className:"jetpack-ai-logo-generator-modal-visit-site-banner__jetpack-logo",children:(0,l.jsx)("img",{src:i,alt:"Jetpack"})}),(0,l.jsxs)("div",{className:"jetpack-ai-logo-generator-modal-visit-site-banner__content",children:[(0,l.jsx)("strong",{children:__("Do you want to know all the amazing things you can do with Jetpack AI?","jetpack")}),(0,l.jsx)("span",{children:__("Generate and tweak content, create forms, get feedback and much more.","jetpack")}),(0,l.jsx)("div",{children:(0,l.jsxs)(n.Button,{variant:"link",href:"https://jetpack.com/redirect/?source=logo_generator_learn_more_about_jetpack_ai",target:"_blank",onClick:t||
2025-02-28 08:42:11 +01:00
// Translators: %s is the date when the requests will reset.
2025-07-27 19:58:08 +02:00
const r=__("Requests will reset on %s.","jetpack");return`${t} ${(0,a.sprintf)(r,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e)),r=(0,n.A)("ai-logo-generator-fair-usage-policy",{anchor:"jetpack-ai-usage-limit"});return(0,o.createInterpolateElement)(t,{link:(0,l.jsx)("a",{href:r,target:"_blank",rel:"noreferrer"})})}},88725:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(47143),s=r(10067),o=r.n(s),a=r(51609),i=r(31439),l=r(62614),c=r(93869),u=r(51391),d=r(19362),p=r(28229),h=r(74423),m=r(44461);const g=o()("jetpack-ai-calypso:use-logo-generator"),f=()=>{const{setSelectedLogoIndex:e,setIsSavingLogoToLibrary:t,setIsApplyingLogo:r,setIsRequestingImage:s,setIsEnhancingPrompt:o,increaseAiAssistantRequestsCount:f,addLogoToHistory:b,setContext:v,setIsLoadingHistory:k}=(0,n.useDispatch)(h.E),{logos:y,selectedLogoIndex:x,selectedLogo:j,siteDetails:w,isSavingLogoToLibrary:_,isApplyingLogo:C,isEnhancingPrompt:A,isBusy:S,isRequestingImage:E,getAiAssistantFeature:N,requireUpgrade:T,context:P,tierPlansEnabled:B,isLoadingHistory:I}=(0,n.useSelect)((e=>{const t=e(h.E);return{logos:t.getLogos(),selectedLogoIndex:t.getSelectedLogoIndex(),selectedLogo:t.getSelectedLogo(),siteDetails:t.getSiteDetails(),isSavingLogoToLibrary:t.getIsSavingLogoToLibrary(),isApplyingLogo:t.getIsApplyingLogo(),isRequestingImage:t.getIsRequestingImage(),isEnhancingPrompt:t.getIsEnhancingPrompt(),isBusy:t.getIsBusy(),getAiAssistantFeature:t.getAiAssistantFeature,requireUpgrade:t.getRequireUpgrade(),context:t.getContext(),tierPlansEnabled:t.getTierPlansEnabled(),isLoadingHistory:t.getIsLoadingHistory()}}),[]),{setFirstLogoPromptFetchError:M,setEnhancePromptFetchError:L,setLogoFetchError:R,setSaveToLibraryError:D,setLogoUpdateError:F}=(0,m.A)(),{generateImageWithParameters:O}=(0,l.Ay)(),{saveToMediaLibrary:z}=(0,c.A)(),{ID:U=null,name:H=null,description:V=null}=w||{},q=U?String(U):null,$=N(q),G=$?.costs?.["jetpack-ai-logo-generator"]?.logo,W=$?.featuresControl?.["logo-generator"],Z=W?.styles||[],J=(0,a.useCallback)((async function(){M(null),f();try{const e=await(0,u.A)();if(!e||!e.token)throw new Error("No token provided");g("Generating first prompt for site");const t={question:`Generate a simple and short prompt asking for a logo based on the site's name and description, keeping the same language.\nExample for a site named "The minimalist fashion blog", described as "Daily inspiration for all things fashion": A logo for a minimalist fashion site focused on daily sartorial inspiration with a clean and modern aesthetic that is sleek and sophisticated.\nAnother example, now for a site called "El observatorio de aves", described as "Un sitio dedicado a nuestros compañeros y compañeras entusiastas de la observación de aves.": Un logo para un sitio web dedicado a la observación de aves, capturando la esencia de la naturaleza y la pasión por la avifauna en un diseño elegante y representativo, reflejando una estética natural y apasionada por la vida silvestre.\n\nSite name: ${H}\nSite description: ${V}`,feature:"jetpack-ai-logo-generator",stream:!1},r="https://public-api.wordpress.com/wpcom/v2/jetpack-ai-query",n={Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},s=await fetch(r,{method:"POST",headers:n,body:JSON.stringify(t)}).then((e=>e.json()));return s?.choices?.[0]?.message?.content}catch(e){throw f(-1),M(e),e}}),[M,f,H,V]),K=(0,a.useCallback)((async function(e){if(R(null),!Z||!Z.length)return null;const t=[{role:"jetpack-ai",context:{type:"ai-assistant-guess-logo-style",request:e,name:H,description:V}}];try{const e=await(0,i.A)(t,{feature:"jetpack-ai-logo-generator"});if(!e)return null;const r=Z.find((({value:t})=>t===e));return r?r.value:null}catch(e){g("Error guessing style",e),Promise.reject(e)}}),[Z,H,V]),Y=(0,a.useCallback)((async function({prompt:e,style:t=null}){R(null);try{const r=await(0,u.A)();if(!r||!r.token)throw new Error("No token provided");if("auto"===t)throw new Error("Auto style is not supported");g("Generating image with prompt",
__("(opens in a new tab)","jetpack")})]}),C=b?"_blank":void 0,A=r?.[0]&&null!==r[0]&&"components-tooltip"!==r?.[0]?.props?.className;return(0,u.jsxs)(n.Button,{target:C,variant:s,className:(0,i.A)(j,{"has-text":!!p&&A}),icon:b?void 0:p,iconSize:h,disabled:m,"aria-disabled":m,isDestructive:g,text:k,...x,children:[f&&(0,u.jsx)(n.Spinner,{}),(0,u.jsx)("span",{children:r}),_]})}));d.displayName="Button";const p=d},69222:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(29491),s=r(86087),o=r(27723),a=r(51112),i=r(78478),l=r(10790);const __=o.__,c=({buttonStyle:e="icon",textToCopy:t,onCopy:r,...o})=>{const[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(),p=(0,n.useCopyToClipboard)(t,(()=>{d.current&&clearTimeout(d.current),u(!0),r?.(),d.current=setTimeout((()=>{u(!1),d.current=void 0}),3e3)}));(0,s.useEffect)((()=>()=>{d.current&&clearTimeout(d.current)}),[]);let h=null,m=null;"text"!==e&&(h=c?(0,l.jsx)(i.Nr,{}):(0,l.jsx)(i.ui,{}));const g=__("Copy to clipboard","jetpack");return"icon"!==e&&(m=c?__("Copied!","jetpack"):g),(0,l.jsx)(a.A,{"aria-label":g,icon:h,children:m,ref:p,...o})}},78478:(e,t,r)=>{"use strict";r.d(t,{Nr:()=>l,ui:()=>c});var n=r(56427),s=r(13022),o=(r(84705),r(56058)),a=r(10790);const i=({className:e,size:t=24,viewBox:r="0 0 24 24",opacity:i=1,color:l="#2C3338",children:c})=>{const u={className:(0,s.A)(o.A.iconWrapper,e),width:t,height:t,viewBox:r,opacity:i,fill:void 0};return l&&(u.fill=l),(0,a.jsx)(n.SVG,{...u,fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(n.G,{opacity:i,children:c})})},l=({size:e,className:t=o.A["checkmark-icon"],color:r})=>(0,a.jsx)(i,{className:t,size:e,color:r,children:(0,a.jsx)(n.Path,{d:"M11 17.768l-4.884-4.884 1.768-1.768L11 14.232l8.658-8.658C17.823 3.39 15.075 2 12 2 6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.528-.353-2.97-.966-4.266L11 17.768z"})}),c=({size:e,className:t=o.A["clipboard-icon"],color:r})=>(0,a.jsx)(i,{className:t,size:e,color:r,children:(0,a.jsx)(n.Path,{d:"M5.625 5.5H15.375C15.444 5.5 15.5 5.55596 15.5 5.625V15.375C15.5 15.444 15.444 15.5 15.375 15.5H5.625C5.55596 15.5 5.5 15.444 5.5 15.375V5.625C5.5 5.55596 5.55596 5.5 5.625 5.5ZM4 5.625C4 4.72754 4.72754 4 5.625 4H15.375C16.2725 4 17 4.72754 17 5.625V10V15.375C17 16.2725 16.2725 17 15.375 17C15.375 17 6.52246 17 5.625 17C4.72754 17 4 16.2725 4 15.375V5.625ZM18.5 17.2812V8.28125H20V17.2812C20 18.7995 18.7704 20 17.2511 20H6.25V18.5H17.2511C17.9409 18.5 18.5 17.9721 18.5 17.2812Z"})})},67142:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(27723),s=r(13022),o=(r(51609),r(10790));const __=n.__,a=({logoColor:e="#069e08",showText:t=!0,className:r,height:n=32,...a})=>{const i=t?"0 0 118 32":"0 0 32 32";return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:i,className:(0,s.A)("jetpack-logo",r),"aria-labelledby":"jetpack-logo-title",height:n,...a,role:"img",children:[(0,o.jsx)("title",{id:"jetpack-logo-title",children:__("Jetpack Logo","jetpack")}),(0,o.jsx)("path",{fill:e,d:"M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z"}),t&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("path",{d:"M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z"}),(0,o.jsx)("path",{d:"M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z"}),(0,o.jsx)("path",{d:"M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z"}),(0,o.jsx)("path",{d:"M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z"}),(0,o.jsx)("path",{d:"M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5
_n("visitor","visitors",parseInt(A),"jetpack",0),N=/* Translators: Number of views */
_n("hit","hits",parseInt(A),"jetpack",0);return(0,h.jsxs)("div",{...C,children:[(0,h.jsx)(i.InspectorControls,{children:(0,h.jsx)(d.z,{attributes:e,setAttributes:r})}),(0,h.jsx)("div",{className:t,children:o||null===k?(0,h.jsx)("p",{className:"jetpack-blog-stats__loading",children:__("Loading stats…","jetpack")}):(0,h.jsxs)("p",{children:[(0,h.jsxs)("span",{children:[(0,s.ZV)(A)," "]}),(0,h.jsx)(i.RichText,{tagName:"span",placeholder:"visitors"===b?E:N,value:f,allowedFormats:["core/bold","core/italic","core/link"],onChange:e=>r({label:e})})]})})]})}},95184:(e,t,r)=>{"use strict";var n=r(74997),s=r(94375),o=r(35116),a=r(20201);(0,s.M)(o,{edit:a.A,save:()=>null,transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"blog-stats"===e,transform:({instance:e})=>{const t=e.raw.title?(0,n.createBlock)("core/heading",{content:e.raw.title,level:3}):null,r=(0,n.createBlock)("jetpack/blog-stats",{label:e.raw.hits});return t?[t,r]:r}}]}})},51744:(e,t,r)=>{"use strict";r.d(t,{k:()=>c});var n=r(97999),s=r(85985),o=r(56427),a=r(27723),i=r(35116),l=r(10790);const __=a.__,c=({className:e,isLoading:t,changeStatus:r})=>{const a=(0,n.isWoASite)()?"https://wordpress.com/support/stats/":"https://jetpack.com/support/jetpack-stats/";return(0,l.jsx)("div",{className:e,children:(0,l.jsxs)(o.Placeholder,{icon:(0,s.sh)(i),instructions:__("You'll need to activate the Stats module to use this block. Please note that hits are only counted while this module is active.","jetpack"),label:i.title,children:[(0,l.jsx)(o.Button,{disabled:t,isBusy:t,onClick:()=>r(!0),variant:"secondary",children:t?__("Activating Stats","jetpack"):__("Activate Stats","jetpack",0)}),(0,l.jsx)("div",{children:(0,l.jsx)(o.ExternalLink,{href:a,children:__("Learn more about the Stats module.","jetpack")})})]})})}},12169:(e,t,r)=>{"use strict";r.d(t,{A:()=>g});var n=r(1455),s=r.n(n),o=r(94715),a=r(56427),i=r(47143),l=r(86087),c=r(27723),u=r(93832),d=r(13022),p=r(54919),h=r(9075),m=r(10790);const __=c.__,_x=c._x;const g=(0,a.withNotices)((function({attributes:e,noticeOperations:t,noticeUI:r,setAttributes:n}){const g=(0,l.useRef)(!1),{answersLink:f,answersLinkText:b,gravatars:v,promptFetched:k,promptId:y,promptLabel:x,promptText:j,showLabel:w,showResponses:_,tagsAdded:C,isBloganuary:A}=e,S=(0,o.useBlockProps)({className:"jetpack-blogging-prompt"});(0,h.J)(y,C,(e=>n({tagsAdded:e})));const E=(0,i.useSelect)((e=>{const{getEntityRecord:t,hasFinishedResolution:r}=e("core"),n=t("root","site")?.language||"en_US";return r("getEntityRecord",["root","site"])?n:null}),[]);(0,l.useEffect)((()=>{if(!E||g.current||k)return;const e=()=>{n({promptFetched:!1,promptId:null,tagsAdded:!1}),g.current=!1,t.removeAllNotices()};let r="/wpcom/v3/blogging-prompts";if(y)r+="/"+encodeURIComponent(y);else{const e=new Date;r+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}r=(0,u.addQueryArgs)(r,{_locale:E,force_year:(new Date)?.getFullYear()}),g.current=!0,s()({path:r}).then((e=>{const t=y?e:e[0],r=(0,p.i)(E);n({answersLink:t.answered_link+`?locale=${r}`,answersLinkText:t.answered_link_text,gravatars:t.answered_users_sample.map((({avatar:e})=>({url:e}))),promptFetched:!0,promptLabel:t.label,promptText:t.text,promptId:t.id,isBloganuary:!!t.bloganuary_id})})).catch((r=>{n({promptFetched:!0});const s="rest_post_invalid_id"===r.code&&y?(o=y,(0,m.jsxs)(m.Fragment,{children:[(0,c.sprintf)(/* translators: %d is the prompt id. */
__("Prompt with id %d not found.","jetpack"),o)," ",(0,m.jsx)(a.Button,{variant:"link",onClick:e,children:__("Reset prompt","jetpack")})]})):(t=>(0,m.jsxs)(m.Fragment,{children:[(0,c.sprintf)(/* translators: %s is the error message. */
__("Error while fetching prompt: %s","jetpack"),t)," ",(0,m.jsx)(a.Button,{variant:"link",onClick:e,children:__("Retry","jetpack")})]}))(r.message);var o;t.removeAllNotices(),t.createErrorNotice(s)}))}),[g,t,k,y,n,E]);const N=e=>{n({showLabel:e})},T=e=>{n({showResponses:e})},P=(0,d.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":A});return(0,m.jsxs)("div",{...S,children:[r,(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(o.InspectorControls,{children:(0,m.jsxs)(a.PanelBody,{title:_x("Settings","title of block settings sidebar section","jetpack"),children:[(0,m.jsx)(a.ToggleControl,{label:__("Show prompt label","jetpack"),checked:w,onChange:N,__nextHasNoMarginBottom:!0}),(0,m.jsx)(a.ToggleControl,{label:__("Show other responses","jetpack"),checked:_,onChange:T,__nextHasNoMarginBottom:!0})]})})}),k?(0,m.jsxs)(m.Fragment,{children:[w&&(0,m.jsx)("div",{className:P,children:x}),(0,m.jsx)("div",{className:"jetpack-blogging-prompt__text",children:j}),_&&y&&(0,m.jsxs)("div",{className:"jetpack-blogging-prompt__answers",children:[v&&v.slice(0,3).map((({url:e})=>e&&(0,m.jsx)("img",{className:"jetpack-blogging-prompt__answers-gravatar",src:e},e))),(0,m.jsx)("a",{className:"jetpack-blogging-prompt__answers-link",href:f,target:"_blank",rel:"external noreferrer noopener",children:b})]})]}):(0,m.jsx)("div",{className:"jetpack-blogging-prompt__spinner",children:(0,m.jsx)(a.Spinner,{})})]})}))},87888:(e,t,r)=>{"use strict";var n=r(74997),s=r(47143),o=r(27723),a=r(94375),i=r(27734),l=r(32442),c=r(12169),u=r(63757),d=r(94530),p=r(86239),h=r(57028);const __=o.__,m=new URL(document.location.href),g=m.pathname.endsWith("/wp-admin/post-new.php"),f=g?m.searchParams.get("answer_prompt")??"0":"0",b=parseInt(f),v={edit:c.A,save:h.A,example:{attributes:{answersLink:"https://wordpress.com/tag/dailyprompt",answersLinkText:__("View all responses","jetpack"),gravatars:[{url:u},{url:d},{url:p}],promptLabel:__("Daily writing prompt","jetpack"),promptText:__("What's your favorite place to visit?","jetpack"),promptFetched:!0,promptId:1234,showResponses:!0,showLabel:!0,tagsAdded:!0,isBloganuary:!1}}};b||(0,a.M)(l,v);async function k(e){await(0,i.O)();(0,n.getBlockType)("jetpack/blogging-prompt")||await new Promise((e=>{(0,a.M)(l,v),setTimeout(e,0)}));const{insertBlocks:t}=(0,s.dispatch)("core/block-editor");t([(0,n.createBlock)("jetpack/blogging-prompt",{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,n.createBlock)("core/paragraph")],0,void 0,!1)}g&&b&&k(b)},57028:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(94715),s=r(13022),o=r(10790);const a=function({attributes:e}){const{answersLink:t,answersLinkText:r,gravatars:a,promptId:i,promptLabel:l,promptText:c,showLabel:u,showResponses:d,isBloganuary:p}=e,h=n.useBlockProps.save({className:"jetpack-blogging-prompt"}),m=(0,s.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":p});return(0,o.jsxs)("div",{...h,children:[u&&(0,o.jsx)("div",{className:m,children:l}),(0,o.jsx)("div",{className:"jetpack-blogging-prompt__text",children:c}),d&&i&&(0,o.jsxs)("div",{className:"jetpack-blogging-prompt__answers",children:[a.map((({url:e})=>e&&(0,o.jsx)("img",{className:"jetpack-blogging-prompt__answers-gravatar","aria-hidden":"true",src:e},e))),(0,o.jsx)("a",{className:"jetpack-blogging-prompt__answers-link",href:t,target:"_blank",rel:"external noreferrer noopener",children:r})]})]})}},9075:(e,t,r)=>{"use strict";r.d(t,{J:()=>c});var n=r(1455),s=r.n(n),o=r(47143),a=r(86087),i=r(89877);function l(e){const t=(0,i.escapeHTML)(e);return s()({path:"/wp/v2/tags",method:"POST",data:{name:t}}).catch((t=>"term_exists"!==t.code?Promise.reject(t):Promise.resolve({id:t.data.term_id,name:e})))}function c(e,t,r){const{editPost:n}=(0,o.useDispatch)("core/editor"),s=(0,a.useRef)("not-started"),{getEditedPostAttribute:i}=(0,o.useSelect)((e=>e("core/editor")),[]),c=(0,o.useSelect)((e=>e("core/editor").getEditedPostAttribute("type")),[]),u=(0,o.useSelect)((e=>e("core/editor").getEditedPostAttribute("tags")||[]),[]),d=(0,o.useSelect)((e=>e("core").getPostType("post")?.taxonomies?.includes("post_tag")),[]),p=(0,a.useMemo)((()=>0===
__("No sites found for %s.","jetpack"),r)})]}),e.length>0&&(0,o.jsx)("ul",{"aria-live":"polite",children:e.map(((e,r)=>{const n=i?.some?.((t=>t?.id===e?.blog_id))||!1;return(0,o.jsx)("li",{className:"jetpack-blogroll__appender-result-container",children:(0,o.jsxs)("button",{className:"jetpack-blogroll__appender-result-title",disabled:n,onClick:()=>t(e),children:[(0,o.jsx)("div",{className:"jetpack-blogroll__appender-result-image",children:e.site_icon&&(0,o.jsx)("img",{src:e.site_icon,alt:e.name,onError:e=>{e.target.parentNode.classList.add("empty-site-icon")}})}),(0,o.jsxs)("div",{className:"jetpack-blogroll__appender-result-text",children:[(0,o.jsx)("span",{className:"jetpack-blogroll__appender-result-title",children:e.name}),(0,o.jsx)("span",{className:"jetpack-blogroll__appender-result-description",children:e.description})]})]})},`${e.blog_id}-${r}`)}))})]})}},17454:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(56427),s=r(27723),o=r(10790);const __=s.__;function a({value:e,onChange:t}){return(0,o.jsx)("div",{className:"jetpack-blogroll__appender-search",children:(0,o.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Search for sites to add","jetpack"),hideLabelFromVision:!0,placeholder:__("Search…","jetpack"),value:e,onChange:e=>t(e)})})}},37127:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(56427),s=r(47143),o=r(86087),a=r(27723),i=r(45459),l=r(92507),c=r(85101),u=r(40536),d=r(17454),p=r(10790);const __=a.__;function h({isLoading:e,subscriptions:t,clientId:r}){const[a,h]=(0,o.useState)(!1),[m,g]=(0,o.useState)(),[f,b]=(0,o.useState)(""),{insertBlock:v}=(0,s.dispatch)("core/block-editor"),{siteDetails:k,isLoading:y}=(0,l.A)({siteURL:f,subscriptions:t,enabled:f});return e?(0,p.jsx)(n.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(n.Button,{className:"block-editor-button-blogroll-block-appender",ref:g,icon:i.A,label:__("Add Blogroll Item","jetpack"),onClick:()=>{h((e=>!e))}}),a&&(0,p.jsxs)(n.Popover,{anchor:m,className:"jetpack-blogroll__appender",children:[(0,p.jsx)(d.A,{value:f,onChange:b}),(0,p.jsx)(u.A,{results:k,onSelect:e=>{v((0,c.FN)(e),void 0,r),h(!1)},searchInput:f,isLoading:y})]})]})}},63166:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(94715),s=r(74997),o=r(56427),a=r(47143),i=r(86087),l=r(27723),c=r(13022),u=r(2274),d=r(26247),p=r(37127),h=r(32130),m=r(46542),g=r(25688),f=r(85101),b=r(10790);const __=l.__;const v=function({className:e,attributes:t,setAttributes:r,clientId:l}){const{show_avatar:v,show_description:k,open_links_new_window:y,ignore_user_blogs:x,load_placeholders:j}=t,w=(0,d.A)(),{isLoading:_,recommendations:C,errorMessage:A}=(0,h.A)(j),{isLoading:S,subscriptions:E,errorMessage:N}=(0,g.A)({ignore_user_blogs:x});(0,m.b)({clientId:l});const{replaceInnerBlocks:T}=(0,a.dispatch)("core/block-editor");(0,i.useEffect)((()=>{if(j&&C.length){r({load_placeholders:!1});const e=[(0,s.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...C.map(f.dy)];T(l,e)}}),[C,j,r,l,T]);const P=(0,n.useBlockProps)({className:(0,c.A)(e,{"hide-avatar":!v,"hide-description":!k})});if(!w)return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(u.A,{block:"Blogroll",explanation:__("Connect your WordPress.com account to use the Blogroll block.","jetpack")})});const B=A||N;return(0,b.jsxs)("div",{...P,children:[(0,b.jsx)(n.InnerBlocks,{template:[["core/heading",{content:__("Blogroll","jetpack"),level:3}]],allowedBlocks:["jetpack/blogroll-item"],renderAppender:()=>!_&&(0,b.jsx)(p.A,{isLoading:S,subscriptions:E,clientId:l})}),B&&(0,b.jsx)(o.Notice,{status:"error",isDismissible:!1,children:(0,b.jsx)("p",{children:B})}),j&&_&&(0,b.jsx)(o.FlexBlock,{style:{padding:"30px",textAlign:"center"},children:(0,b.jsx)(o.Spinner,{})}),(0,b.jsx)(n.InspectorControls,{children:(0,b.jsxs)(o.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(o.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>r({show_avatar:!v}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(o.ToggleControl,{label:__("Show description","jetpack"),checke
2025-02-28 08:42:11 +01:00
// translators: %s is a link to the cookie policy.
2025-07-27 19:58:08 +02:00
__("Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use. To find out more, including how to control cookies, see here: %s.","jetpack"),`<a href="https://automattic.com/cookies/">${__("Cookie Policy","jetpack")}</a>`)},15216:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(94715),s=r(56427),o=r(27723),a=r(68071),i=r(34839),l=r(10790);const __=o.__;const c=function({clientId:e,attributes:t,setAttributes:r}){const{consentExpiryDays:c,align:u,text:d=a.a}=t;(0,i.w)(e);const p=(0,n.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${u}`});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.InspectorControls,{children:(0,l.jsxs)(s.PanelBody,{title:__("Block Settings","jetpack"),children:[(0,l.jsx)(s.SelectControl,{label:__("Alignment","jetpack"),value:u,options:[{label:(0,o.isRTL)()?__("Right","jetpack"):__("Left","jetpack"),value:"left"},{label:__("Full","jetpack"),value:"full"},{label:__("Wide","jetpack"),value:"wide"},{label:(0,o.isRTL)()?__("Left","jetpack"):__("Right","jetpack"),value:"right"}],onChange:e=>function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};r({...t,align:e})}(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(s.TextControl,{label:__("Consent Expiry Time (in days)","jetpack"),value:c,type:"number",min:"1",max:"365",onChange:e=>r({consentExpiryDays:parseInt(e)}),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)("p",{children:__("Note: The block position in the editor is not indicative of the position on the front end. The block will always be positioned at the bottom of the page.","jetpack")})]})}),(0,l.jsxs)("div",{...p,style:p.style,children:[(0,l.jsx)(n.RichText,{tagName:"p",value:d,onChange:e=>r({text:e})}),(0,l.jsx)(n.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})]})]})}},78165:(e,t,r)=>{"use strict";var n=r(94375),s=r(74095),o=r(15216),a=r(75757);(0,n.M)(s,{edit:o.A,save:a.A})},75757:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(94715),s=r(68071),o=r(10790);function a({attributes:e}){const t=n.useBlockProps.save(),{text:r=s.a,consentExpiryDays:a}=e;return(0,o.jsxs)("div",{...t,style:t.style,role:"dialog","aria-modal":"true",children:[(0,o.jsx)(n.RichText.Content,{tagName:"p",value:r}),(0,o.jsx)(n.InnerBlocks.Content,{}),(0,o.jsx)("span",{children:a})]})}},34839:(e,t,r)=>{"use strict";r.d(t,{w:()=>l});var n=r(74997),s=r(29491),o=r(3582),a=r(47143),i=r(86087);function l(e){const t=(0,a.useSelect)((e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:r}=e("core/editor");return t()||r()}),[]),r=!(!(0,s.usePrevious)(t)||t),[,l]=(0,o.useEntityProp)("root","site","cookie_consent_template"),{saveEditedEntityRecord:c}=(0,a.useDispatch)(o.store),[u,d]=(0,i.useState)(!1),p=(0,a.useSelect)((e=>{const{getBlock:t}=e("core/block-editor");return t})),h=(0,i.useCallback)((e=>{d(!0),l(e),c("root","site",void 0,{cookie_consent_template:e}).finally((()=>{d(!1)}))}),[d,l,c]);(0,i.useEffect)((()=>()=>{p(e)||h(null)}),[]),(0,i.useEffect)((()=>{r&&!u&&h((0,n.serialize)([p(e)]))}),[r,u,h,p,e])}},75800:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(4567),s=r(3975),o=r(94715),a=r(86087),i=r(13022),l=r(72730),c=r(10790);const u=({className:e=null,currency:t=null,defaultValue:r=null,disabled:u=!1,label:d="",onChange:p=null,value:h=""})=>{const[m,g]=(0,a.useState)((0,n.Ay)(h,t,{symbol:""})),[f,b]=(0,a.useState)(!1),[v,k]=(0,a.useState)(!1),y=(0,a.useRef)(null),x=(0,a.useCallback)(((e,r)=>{g((n=>{if(e!==n){const n=(0,l.C_)(e,t);n&&n>=(0,l.dv)(t)?(k(!1),r&&p?.(n)):k(!0)}return e}))}),[t,p]),j=()=>{y.current&&(y.current.focus(),b(!0))};return(0,a.useEffect)((()=>{if(!y.current)return;const e=y.current,s=()=>{b(!1),m||x((0,n.Ay)(r,t,{symbol:""}))};return e.addEventListener("blur",s),()=>{e.removeEventListener("blur",s)}}),[t,r,m,y,x]),(0,a.useEffect)((()=>{f||v||g((0,n.Ay)(h,t,{symbol:""}))}),[t,f,v,h]),(0,a.useEffect)((()=>{x((0,n.Ay)(h,t,{symbol:""}))}),[t,h]),(0,c.jsxs)("div",{className:(0,i.A)("donations__amount",e,{"has-focus":f,"has-er
2022-12-15 17:41:53 +01:00
// translators: %d: Tier level e.g: "1", "2", "3"
2025-07-27 19:58:08 +02:00
__("Tier %d","jetpack"),t+1),onChange:e=>((e,t)=>{const r=[...x];r[t]=e,k("amounts",r)})(e,t),value:e},`jetpack-donations-amount-${t}`)))}),m&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(n.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:f,onChange:e=>r({customAmountText:e})}),(0,c.jsx)(i.A,{currency:l,label:__("Custom amount","jetpack"),defaultValue:100*(0,a.dv)(l),className:"donations__custom-amount",disabled:!0})]}),(0,c.jsx)("hr",{className:"donations__separator"}),(0,c.jsx)(n.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:v("extraText")??u.extraText,onChange:e=>k("extraText",e)}),(0,c.jsx)("div",{className:"wp-block-button donations__donate-button-wrapper",children:(0,c.jsx)(n.RichText,{className:"wp-block-button__link donations__donate-button",placeholder:__("Write a message…","jetpack"),value:v("buttonText")||u[b]?.buttonText,onChange:e=>{return t=e,void r({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...h,buttonText:t}});var t},allowedFormats:j})})]})}},36580:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(86087),s=r(27723),o=r(13022),a=r(57018),i=r(62225),l=r(10790);const __=s.__,c=e=>{const{attributes:t,products:r,setAttributes:s}=e,{oneTimeDonation:c,monthlyDonation:u,annualDonation:d}=t,[p,h]=(0,n.useState)("one-time"),m=(0,n.useCallback)((e=>p===e),[p]),g={"one-time":{title:__("One-Time","jetpack")},...u.show&&{"1 month":{title:__("Monthly","jetpack")}},...d.show&&{"1 year":{title:__("Yearly","jetpack")}}};return(0,n.useEffect)((()=>{c.planId===r["one-time"]&&u.planId===r["1 month"]&&d.planId===r["1 year"]||s({...r["one-time"]&&{oneTimeDonation:{...c,planId:r["one-time"]}},...r["1 month"]&&{monthlyDonation:{...u,planId:r["1 month"]}},...r["1 year"]&&{annualDonation:{...d,planId:r["1 year"]}}})}),[c,u,d,s,r]),(0,n.useEffect)((()=>{!u.show&&m("1 month")&&h("one-time"),!d.show&&m("1 year")&&h("one-time")}),[u,d,h,m]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"donations__container",children:[Object.keys(g).length>1&&(0,l.jsx)("div",{className:"donations__nav",children:Object.entries(g).map((([e,{title:t}])=>(0,l.jsx)("div",{role:"button",tabIndex:0,className:(0,o.A)("donations__nav-item",{"is-active":m(e)}),onClick:()=>h(e),onKeyDown:()=>h(e),children:t},`jetpack-donations-nav-item-${e} `)))}),(0,l.jsx)("div",{className:"donations__content",children:(0,l.jsx)(i.A,{activeTab:p,attributes:t,setAttributes:s})})]}),(0,l.jsx)(a.A,{...e})]})}},75703:(e,t,r)=>{"use strict";function n(){if("undefined"==typeof window)return{};const e=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeof e?{}:e}r.d(t,{O:()=>n})},36850:(e,t,r)=>{"use strict";r.d(t,{GY:()=>s,_t:()=>n,gQ:()=>o});const n=/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^/]*?(\d+)\/?(?:\?[^/]*)?\s*$/i,s=/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^/]*)?\s*$/i,o="https://www.eventbrite.com/e/test-event-tickets-123456789"},38449:(e,t,r)=>{"use strict";r.d(t,{o:()=>c,s:()=>u});var n=r(56427),s=r(27723),o=r(5873),a=r(72660),i=r(10790);const __=s.__,_x=s._x,l=[{value:"inline",label:__("In-page Embed","jetpack"),preview:(0,i.jsx)("div",{className:"block-editor-block-preview__container",children:(0,i.jsx)("img",{src:a,alt:__("In page Eventbrite checkout example","jetpack")})})},{value:"modal",label:__("Button & Modal","jetpack")}],c=({setEditingUrl:e})=>(0,i.jsx)(n.ToolbarGroup,{children:(0,i.jsx)(n.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})}),u=({attributes:e,clientId:t,setAttributes:r})=>(0,i.jsx)(o.A,{title:_x("Embed Type","option for how the embed displays on a page, e.g. inline or as a modal","jetpack"),clientId:t,styleOptions:l,onSelectStyle:r,activeStyle:e.style,attributes:e,viewportWidth:130})},77629:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=[r(87879).A]},87879:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(94715),s=r(74997),o=r(27723),a=r(13022),i=r(66087),l=r(10790);const _x=o._x,c=["text","backgroundColor","textColor","customBac
_n("There is currently only %s post in your Instagram account.","There are currently only %s posts in your Instagram account.",e,"jetpack"),e):__("There are currently no posts in your Instagram account.","jetpack");return(0,a.jsx)("div",{className:"wp-block-jetpack-instagram-gallery__count-notice",children:(0,a.jsx)(n.Notice,{isDismissible:!1,status:"info",children:t})})})():null,(0,a.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Posts","jetpack"),value:p,onChange:e=>c({count:e}),min:1,max:o.V}),(0,a.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Columns","jetpack"),value:d,onChange:e=>c({columns:e}),min:1,max:6}),(0,a.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>c({spacing:e}),min:0,max:50}),(0,a.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Stack on mobile","jetpack"),checked:m,onChange:()=>c({isStackedOnMobile:!m})})]})]})}},11148:(e,t,r)=>{"use strict";r.d(t,{A:()=>k});var n=r(85985),s=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(78218),d=r(89525),p=r(80427),h=r(57926),m=r(86975),g=r(49783),f=r(53495),b=r(80619),v=r(10790);const __=i.__,k=(0,o.withNotices)((e=>{const t=(0,s.useBlockProps)(),{attributes:r,isSelected:i,noticeOperations:k,noticeUI:y,setAttributes:x}=e,{accessToken:j,align:w,columns:_,count:C,isStackedOnMobile:A,spacing:S}=r;(0,a.useEffect)((()=>{const e=(0,u.y)(d.attributes,r);(0,c.isEqual)(e,r)||x(e)}),[r,x]);const[E,N]=(0,a.useState)(j),{isRequestingWpcomConnectUrl:T,wpcomConnectUrl:P}=(0,f.A)(),{images:B,isLoadingGallery:I,setImages:M}=(0,b.A)({accessToken:j,noticeOperations:k,setAttributes:x,setSelectedAccount:N}),{connectToService:L,disconnectFromService:R,isConnecting:D,isRequestingUserConnections:F,userConnections:O}=(0,g.A)({accessToken:j,noticeOperations:k,selectedAccount:E,setAttributes:x,setImages:M,setSelectedAccount:N}),z=(0,n.gB)(),U=C>B.length?B.length:C,H=!I&&(!j||(0,c.isEmpty)(B)),V=!H,q=j&&I&&(0,c.isEmpty)(B),$=!H&&!q,G=(0,l.A)(t.className,{[`align${w}`]:w}),W=(0,l.A)("wp-block-jetpack-instagram-gallery__grid",`wp-block-jetpack-instagram-gallery__grid-columns-${_}`,{"is-stacked-on-mobile":A}),Z={gridGap:S,"--latest-instagram-posts-spacing":S?`${S}px`:void 0},J={padding:S},K=e=>{if(B[e]){const t=B[e];return(0,v.jsx)(m.A,{alt:t.title||t.url,src:t.url,attributes:r,spacing:S})}return(0,v.jsx)("img",{alt:__("Latest Instagram Posts placeholder","jetpack"),src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNMyc2tBwAEOgG/c94mJwAAAABJRU5ErkJggg=="})},Y=()=>{E&&p.B!==E?x({accessToken:E,instagramUser:(0,c.find)(O,{token:E}).username}):L()};return(0,v.jsxs)("div",{...t,className:G,children:[H&&(0,v.jsx)(o.Placeholder,{icon:"instagram",instructions:z?F||O.length?void 0:__("Connect to Instagram to start sharing your images.","jetpack"):__("First, you'll need to connect your WordPress.com account.","jetpack"),label:__("Latest Instagram Posts","jetpack"),notices:y,children:z?(()=>{const e=O.length>0,t=[...(0,c.map)(O,(e=>({label:`@${e.username}`,value:e.token}))),{label:__("Add a new account","jetpack"),value:p.B}],r=D||F||e&&!E;return(0,v.jsxs)("div",{children:[e&&(0,v.jsx)(o.RadioControl,{label:__("Select your Instagram account:","jetpack"),onChange:e=>N(e),options:t,selected:E}),p.B===E&&(0,v.jsx)("p",{className:"wp-block-jetpack-instagram-gallery__new-account-instructions",children:__("If you are currently logged in to Instagram on this device, you might need to log out of it first.","jetpack")}),(0,v.jsxs)(o.Button,{disabled:r,variant:"primary",onClick:Y,children:[D&&__("Connecting…","jetpack"),F&&__("Loading your connections…","jetpack"),!D&&!F&&__("Connect to Instagram","jetpack")]})]})})():(0,v.jsx)(o.Button,{disabled:T||!P,href:P,variant:"secondary",children:__("Connect to WordPress.com","jetpack")})}),q&&(0,v.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,v.jsx)(o.Spinner,{}),(0,v.jsx)("p",{children:__("Embedding…","jetp
2024-02-16 11:03:01 +01:00
// translators: %$1s: Number of likes
2025-07-27 19:58:08 +02:00
__("<span>%1$d</span> likes","jetpack"),v.length),{span:(0,h.jsx)("span",{className:"wpl-count-number"})})})})})]})]})}},67511:(e,t,r)=>{"use strict";var n=r(94375),s=r(71969),o=r(434);(0,n.M)(s,{edit:o.A,save:()=>null})},40483:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(94715),s=r(56427),o=r(27723),a=r(13022),i=r(54790),l=r(10790);const __=o.__,c={name:"jetpack/button",attributes:{element:"button",text:__("Join my Mailchimp audience","jetpack"),uniqueId:"mailchimp-widget-id"}},u=({attributes:e,setAttributes:t,audition:r})=>{const{emailPlaceholder:o=i.Bd,consentText:u=i.Do,processingLabel:d=i.HD,successLabel:p=i.XO,errorLabel:h=i.Ys}=e,m={[i.k1]:d,[i.EM]:p,[i.Dc]:h}[r];return(0,l.jsxs)("div",{className:(0,a.A)({[`${i.j7}_notication-audition`]:r}),children:[(0,l.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-label":o,className:`${i.j7}_text-input`,disabled:!0,onChange:()=>!1,placeholder:o,title:__("You can edit the email placeholder in the sidebar.","jetpack"),type:"email"}),(0,l.jsx)(n.InnerBlocks,{template:[[c.name,c.attributes]],templateLock:"all"}),(0,l.jsx)(n.RichText,{tagName:"p",placeholder:__("Write consent text","jetpack"),value:u,onChange:e=>t({consentText:e}),inlineToolbar:!0}),r&&(0,l.jsx)("div",{className:`${i.j7}_notification ${i.j7}_${r}`,role:r===i.Dc?"alert":"status",children:m})]})}},54790:(e,t,r)=>{"use strict";r.d(t,{Bd:()=>d,Dc:()=>a,Do:()=>p,EM:()=>o,HD:()=>h,JA:()=>c,XO:()=>m,Ys:()=>g,an:()=>l,gI:()=>u,j7:()=>i,k1:()=>s});var n=r(27723);const __=n.__,s="processing",o="success",a="error",i="wp-block-jetpack-mailchimp",l=0,c=1,u=2,d=__("Enter your email","jetpack"),p=__("By clicking submit, you agree to share your email address with the site owner and Mailchimp to receive marketing, updates, and other emails from the site owner. Use the unsubscribe link in those emails to opt out at any time.","jetpack"),h=__("Processing…","jetpack"),m=__("Success! You're on the list.","jetpack"),g=__("Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.","jetpack")},20093:(e,t,r)=>{"use strict";r.d(t,{o:()=>d});var n=r(94715),s=r(56427),o=r(86087),a=r(27723),i=r(54790),l=r(60462),c=r(10790);const __=a.__,u=({auditionNotification:e,clearAudition:t,setAttributes:r,emailPlaceholder:n=i.Bd,processingLabel:o=i.HD,successLabel:a=i.XO,errorLabel:u=i.Ys,interests:d,signupFieldTag:p,signupFieldValue:h,connectURL:m})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(s.PanelBody,{title:__("Text Elements","jetpack"),children:(0,c.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Email Placeholder","jetpack"),value:n,onChange:e=>{r({emailPlaceholder:e}),t()}})}),(0,c.jsxs)(s.PanelBody,{title:__("Notifications","jetpack"),children:[(0,c.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Processing text","jetpack"),value:o,onChange:t=>{r({processingLabel:t}),e(i.k1)}}),(0,c.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Success text","jetpack"),value:a,onChange:t=>{r({successLabel:t}),e(i.EM)}}),(0,c.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Error text","jetpack"),value:u,onChange:t=>{r({errorLabel:t}),e(i.Dc)}})]}),(0,c.jsxs)(s.PanelBody,{title:__("Mailchimp Groups","jetpack"),children:[(0,c.jsx)(l.A,{interests:d,onChange:(e,t)=>{const n=[...new Set([...d,e])].filter((r=>!(r===e&&!t)&&r));r({interests:n})}}),(0,c.jsx)(s.ExternalLink,{href:"https://mailchimp.com/help/send-groups-audience/",children:__("Learn about groups","jetpack")})]}),(0,c.jsxs)(s.PanelBody,{title:__("Signup Location Tracking","jetpack"),children:[(0,c.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Tag","jetpack"),placeholder:__("SIGNUP","jetpack"),value:p,onChange:e=>r({signupFieldTag:e})}),(0,c.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Value","jetpack"),placeholder:__("website","jetpack"),value:h,onChange:e=>r({signupFieldValue:e})}),(0,c.j
_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:r,instanceId:s,completer:o}=this.props,{selectedIndex:a,filteredOptions:i}=this.state,{key:d=""}=i[a]||{},{className:p}=o,h=i.length>0,m=h?`components-autocomplete-listbox-${s}`:null,g=h?`components-autocomplete-item-${s}-${d}`:null;return(0,u.jsxs)("div",{className:"components-autocomplete",children:[r({isExpanded:h,listBoxId:m,activeId:g,onChange:e,onKeyDown:t}),h&&(0,u.jsx)(n.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0,children:(0,u.jsx)("div",{id:m,role:"listbox",className:"components-autocomplete__results",children:(0,c.map)(i,((e,t)=>(0,u.jsx)(n.Button,{id:`components-autocomplete-item-${s}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:(0,l.A)("components-autocomplete__result",p,{"is-selected":t===a}),onClick:()=>this.select(e),children:e.label},e.key)))})})]})}}const h=(0,s.compose)([n.withSpokenMessages,s.withInstanceId,n.withFocusOutside])(p)},82063:(e,t,r)=>{"use strict";function n(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"]}r.d(t,{o:()=>n})},16815:(e,t,r)=>{"use strict";r.d(t,{BY:()=>i,ES:()=>s,_t:()=>o,iU:()=>a,jF:()=>n});const n=e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0};function s(e,t){const r=new e.LngLatBounds;return t.forEach((e=>{r.extend([e.coordinates.longitude,e.coordinates.latitude])})),r}function o(e,t){e.fitBounds(t,{padding:{top:80,bottom:80,left:40,right:40}})}function a(e,t){e.innerHTML=`\n\t\t<?xml version="1.0" encoding="UTF-8"?>\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t<g fill-rule="evenodd">\n\t\t\t\t<path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="${t}"/>\n\t\t\t</g>\n\t\t</svg>\n\t`}function i(e){return new e.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},42470:(e,t,r)=>{"use strict";r.d(t,{IR:()=>d,K5:()=>c,Sm:()=>i,Yc:()=>u,c6:()=>a,nQ:()=>l});var n=r(34377);const s=6371e3;function o(e){return Math.abs(s*Math.cos(e*Math.PI/180)*2*Math.PI/256)}function a(e,t){return 512/Math.pow(2,e)*.5*o(t)}function i(e,t){const r=e/o(t);return Math.log2(512/(r/.5))}function l(e,t){if(0===t.length)return null;const r=new e.Coordinate(-90,180),n=new e.Coordinate(90,-180);t.forEach((e=>{r.latitude=Math.max(r.latitude,e.coordinates.latitude),r.longitude=Math.min(r.longitude,e.coordinates.longitude),n.latitude=Math.min(n.latitude,e.coordinates.latitude),n.longitude=Math.max(n.longitude,e.coordinates.longitude)}));const s=new e.Coordinate(r.latitude-.5*(r.latitude-n.latitude),r.longitude+.5*(n.longitude-r.longitude)),o=new e.CoordinateSpan(1.3*Math.abs(r.latitude-n.latitude),1.3*Math.abs(n.longitude-r.longitude));return new e.CoordinateRegion(s,o)}function c(e,t){return()=>{const r=e.createElement("div");return r.classList.add("mapkit-popup-content"),t(r),r}}function u(e,t){return new Promise((r=>{if(t.mapkitScriptIsLoading)(0,n.Cu)(t,"mapkit").then((e=>{r(e)}));else{t.mapkitScriptIsLoading=!0;const s=e.createElement("script");s.addEventListener("load",(async()=>{const e=await(0,n.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,r(e)}),{once:!0}),s.src="https://cdn.apple-mapkit.com/
__("Open Table Preview %s","jetpack"),t),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${(0,d.join)(N,"%2C")}&type=${r}&theme=${n}&overlay=false&domain=${P}&lang=${B&&g.L.includes(B)?B:"en-US"}&newtab=${I}&disablega=true`})]})})()]})]})}))},82144:(e,t,r)=>{"use strict";var n=r(94715),s=r(74997),o=r(94375),a=r(79018),i=r(34157),l=r(8100),c=r(71833),u=r(50387),d=r(84260),p=r(10790);(0,o.M)(a,{edit:c.A,save:({attributes:{rid:e}})=>{const t=n.useBlockProps.save();return(0,p.jsx)("div",{...t,children:e?.map(((e,t)=>(0,p.jsx)("a",{href:`https://www.opentable.com/restref/client/?rid=${e}`,children:`https://www.opentable.com/restref/client/?rid=${e}`},`${e}-${t}`)))})},attributes:a.attributes,styles:(0,u.Iy)(),transforms:{from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&0===e.textContent.indexOf("http")&&(d.XA.test(e.textContent)||d.JJ.test(e.textContent)),transform:e=>{const t=(0,d.a9)(e.textContent);return(0,s.createBlock)("jetpack/opentable",t)}}]},deprecated:[i.A,l.A]})},82101:(e,t,r)=>{"use strict";r.d(t,{L:()=>s,P:()=>n});const n=[{value:"en-US",label:"English"},{value:"fr-CA",label:"Français"},{value:"de-DE",label:"Deutsch"},{value:"es-MX",label:"Español"},{value:"ja-JP",label:"日本語"},{value:"nl-NL",label:"Nederlands"},{value:"it-IT",label:"Italiano"}],s=n.map((e=>e.value))},98233:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(56427),s=r(86087),o=r(27723),a=r(66087),i=r(10790);const __=o.__,_n=o._n,l=/^\s*(http[s]?:\/\/|<script)/;function c(e){const[t,r]=(0,s.useState)(""),[o,c]=(0,s.useState)(e.rids||[]),u=/^(\d+)$|\(#(\d+)\)$/,d=(0,i.jsx)(n.FormTokenField,{value:o,saveTransform:e=>l.test(e)?"":e.trim(),onInputChange:r,label:_n("Restaurant ID","Restaurant IDs",o.length,"jetpack"),...e,onChange:t=>{const r=t.map((e=>{const t=u.exec(e);if(t){return t[1]||t[2]}return e}));c(r),e.onChange&&e.onChange(r)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0});return(0,i.jsx)("div",{className:"wp-block-jetpack-opentable-restaurant-picker",children:e.onSubmit?(0,i.jsxs)("form",{onSubmit:r=>{r.preventDefault(),e.onSubmit((0,a.isEmpty)(o)?t:o)},children:[d,(0,i.jsx)(n.Button,{variant:"secondary",type:"submit",children:__("Embed","jetpack")})]}):d})}},50387:(e,t,r)=>{"use strict";r.d(t,{Iy:()=>a,K5:()=>i,i9:()=>o});var n=r(27723),s=r(66087);const __=n.__,o={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},a=e=>(0,s.compact)([{name:"standard",label:__("Standard (224 x 301 pixels)","jetpack"),isDefault:!0},{name:"tall",label:__("Tall (288 x 490 pixels)","jetpack")},{name:"wide",label:__("Wide (840 x 150 pixels)","jetpack")},(!e||1===e.length)&&o]),i=e=>a(e).map((e=>e.name))},59038:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(86087);function s(e){const t=(0,n.useRef)(void 0);return(0,n.useEffect)((()=>{t.current=e}),[e]),t.current}},84260:(e,t,r)=>{"use strict";r.d(t,{JJ:()=>s,XA:()=>o,a9:()=>a});const n=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,s=/restref=([0-9]+)&/,o=/rid=([0-9]+)&/,a=e=>{if(e)return(e=>{if(!e)return;let t="";if(t=0===e.indexOf("http")?new URL(e):new URL("http:"+e),!t.host||-1===t.host.indexOf("opentable")||!t.search)return;const r=new URLSearchParams(t.search);let n=r.get("theme");"button"===r.get("type")&&(n=r.get("type"));let s=r.getAll("rid");if(s&&0!==s.length||(s=r.getAll("restref")),!s||0===s.length)return;const o={};s&&(o.rid=s);const a=r.get("domain");a&&(o.domain=a);const i=r.get("iframe");i&&(o.iframe=i);const l=r.get("lang");l&&(o.lang=l);const c=r.get("newtab");return c&&(o.newtab=c),n&&(o.style=n),o})((e=>{const t=e.match(n);return t&&t[1]?t[1]:s.test(e)||o.test(e)?e:void 0})(e))}},72347:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(94715),s=r(47143),o=r(86087),a=r(52619),i=r(27723),l=r(13022),c=r(2274),u=r(72462),d=r(53796),p=r(26247),h=r(16521),m=r(10790);const __=i.__,g=["jetpack/recurring-payments"];const f=function({clientId:e,attributes:t}){const{layout:r,fontSize:i}=t,{connectUrl:f,isApiConnected:b}=(0,s.useSelect)((e=>{const{getConnectUrl:t,isApiStateConnected:r}=e(h.M);return{connectUrl:t(),isApiConnected:r()}})),v=(0,p.A)(),k=(0,s.useSel
`${(0,i.sprintf)(__("Loading: %s","jetpack"),r)} ${o}`,"assertive"),!0};loadAndPlay=e=>{this.recordUserInteraction(),this.loadTrack(e)&&this.props.playMediaSource(this.props.playerId)};getTrack=e=>this.props.tracks[e];handleError=e=>{if(!this.state.hasUserInteraction){const t=window.navigator.userAgent.match(/Trident\/7\./)?"IE11: Playing sounds in webpages setting is not checked":e;this.setState((()=>{throw new Error(t)}))}this.props.errorMediaSource(this.props.playerId),(0,n.speak)(`${__("Error: Episode unavailable - Open in a new tab","jetpack")}`,"assertive")};handlePlay=()=>{this.props.playMediaSource(this.props.playerId),this.setState({hasUserInteraction:!0})};handlePause=()=>{this.props.pauseMediaSource(this.props.playerId),this.props.playerState!==u.pF&&this.props.pauseMediaSource(this.props.playerId)};handleTimeChange=e=>{this.props.setMediaSourceCurrentTime(this.props.playerId,e)};handleJump=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime-5)};handleSkip=()=>{this.props.setMediaSourceCurrentTime(this.props.playerId,this.props.currentTime+30)};updateMediaData=e=>{this.props.updateMediaSourceData(this.props.playerId,{duration:e.target?.duration,domId:e.target?.id})};registerPlayer(){const e=this.getTrack(this.state.currentTrack)||{},{playerId:t}=this.props;this.props.registerMediaSource(t,{title:e.title,link:e.link,state:u.vh}),this.props.setDefaultMediaSource(t)}componentDidMount(){this.props.playerId&&this.registerPlayer()}componentWillUnmount(){this.props.playerId&&this.props.unregisterMediaSource(this.props.playerId)}componentDidUpdate(e){const t=e=>e?.length?e.map((e=>e.guid)):[],r=t(this.props.tracks),n=new Set(t(e.tracks));r.length===n.size&&r.every((e=>n.has(e)))||this.loadTrack(0)}static getDerivedStateFromProps(e,t){return e.tracks.length<=t.currentTrack?{...t,currentTrack:0}:null}render(){const{playerId:e,title:t,link:r,cover:n,tracks:s,attributes:o,currentTime:a,playerState:u}=this.props,{itemsToShow:m,primaryColor:f,customPrimaryColor:b,hexPrimaryColor:v,secondaryColor:k,customSecondaryColor:y,hexSecondaryColor:x,backgroundColor:j,customBackgroundColor:w,hexBackgroundColor:_,showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S}=o,{currentTrack:E}=this.state,N=s.slice(0,m),T=this.getTrack(E),P=(0,d.GU)({primaryColor:f,customPrimaryColor:b,secondaryColor:k,customSecondaryColor:y,backgroundColor:j,customBackgroundColor:w}),B={color:y,backgroundColor:w,"--jetpack-podcast-player-primary":v,"--jetpack-podcast-player-secondary":x,"--jetpack-podcast-player-background":_},I=(0,l.A)("jetpack-podcast-player",u,P.secondary.classes,P.background.classes);return(0,g.jsxs)("section",{className:I,style:B,"aria-labelledby":t||T&&T.title?`${e}__title`:void 0,"aria-describedby":T&&T.description?`${e}__track-description`:void 0,"data-jetpack-iframe-ignore":!0,children:[(0,g.jsx)(p.A,{playerId:e,title:t,link:r,cover:n,track:this.getTrack(E),showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S,colors:P,children:(0,g.jsx)(c.A,{onJumpBack:this.handleJump,onSkipForward:this.handleSkip,trackSource:this.getTrack(E).src,onPlay:this.handlePlay,onPause:this.handlePause,onError:this.handleError,playStatus:u,currentTime:a,onTimeChange:this.handleTimeChange,onMetadataLoaded:this.updateMediaData})}),N.length>1&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("h4",{id:`jetpack-podcast-player__tracklist-title--${e}`,className:"jetpack-podcast-player--visually-hidden",children:(0,i.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s is the track title.
2025-07-27 19:58:08 +02:00
__("Playlist: %s","jetpack"),t)}),(0,g.jsx)("p",{id:`jetpack-podcast-player__tracklist-description--${e}`,className:"jetpack-podcast-player--visually-hidden",children:__("Select an episode to play it in the audio player.","jetpack")}),(0,g.jsx)(h.A,{playerId:e,playerState:u,currentTrack:E,tracks:N,selectTrack:this.selectTrack,colors:P})]})]})}}f.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]};const b=(0,s.compose)([m.A,(0,o.withSelect)(((e,t)=>{const{playerId:r}=t,{getMediaSourceCurrentTime:n,getMediaPlayerState:s}=e(u.ax);return{currentTime:n(r),playerState:s(r)}})),(0,o.withDispatch)((e=>{const{registerMediaSource:t,updateMediaSourceData:r,unregisterMediaSource:n,setDefaultMediaSource:s,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(u.ax);return{registerMediaSource:t,updateMediaSourceData:r,unregisterMediaSource:n,setDefaultMediaSource:s,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}}))])(f)},74050:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(86087),s=r(27723),o=r(10790);const __=s.__,a=(0,n.memo)((({link:e,title:t,colors:r})=>(0,o.jsxs)("div",{className:"jetpack-podcast-player__track-error",children:[__("Episode unavailable.","jetpack")," ",e&&(0,o.jsx)("span",{className:r.secondary.classes,style:{color:r.secondary.custom},children:(0,o.jsxs)("a",{className:"jetpack-podcast-player__link",href:e,rel:"noopener noreferrer nofollow",target:"_blank",children:[(0,o.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:`${(0,s.sprintf)(/* translators: %s is the title of the track. This text is visually hidden from the screen, but available to screen readers. */
__("%s:","jetpack"),t)} `}),__("Open in a new tab","jetpack")]})})]})))},35311:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(86087),s=r(27723),o=r(62796),a=r(10790);const __=s.__,i=(0,n.memo)((({isPlaying:e,isError:t,className:r})=>{let n,s;t?(s="error",
2022-04-02 10:26:41 +02:00
/* translators: This is text to describe the current state. This will go
before the track title, such as "Error: [The title of the track]". */
2025-07-27 19:58:08 +02:00
n=__("Error:","jetpack")):e&&(s="playing",
2022-04-02 10:26:41 +02:00
/* translators: Text to describe the current state. This will go before the
track title, such as "Playing: [The title of the track]". */
2025-07-27 19:58:08 +02:00
n=__("Playing:","jetpack"));const i=o[s];return i?(0,a.jsxs)("span",{className:`${r} ${r}--${s}`,children:[(0,a.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:`${n} `}),i]}):(0,a.jsx)("span",{className:r})}))},91677:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(86087),s=r(27723),o=r(13022),a=r(19812),i=r(74050),l=r(35311),c=r(10790);const __=s.__,u=(0,n.memo)((({track:e,isActive:t,isPlaying:r,isError:n,selectTrack:s,index:u,colors:d={primary:{},secondary:{}}})=>{const p=(0,a.tQ)("color",d.primary.name),h=(0,a.tQ)("color",d.secondary.name),m=(0,o.A)("jetpack-podcast-player__track",{"is-active":t,"has-primary":t&&(d.primary.name||d.primary.custom),[p]:t&&!!p,"has-secondary":!t&&(d.secondary.name||d.secondary.custom),[h]:!t&&!!h}),g={};t&&d.primary.custom&&!p?g.color=d.primary.custom:t||!d.secondary.custom||h||(g.color=d.secondary.custom);const
2022-04-02 10:26:41 +02:00
/* translators: This needs to be a single word with no spaces. It describes
the current item in the group. A screen reader will announce it as "[title],
current track". */
2025-07-27 19:58:08 +02:00
f=t?__("track","jetpack"):void 0;return(0,c.jsxs)("li",{className:m,style:Object.keys(g).length?g:null,children:[(0,c.jsxs)("a",{className:"jetpack-podcast-player__link jetpack-podcast-player__track-link",href:e.link||e.src,role:"button","aria-current":f,onClick:e=>{e.shiftKey||e.metaKey||e.altKey||(e.preventDefault(),s(u))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),s(u))},children:[(0,c.jsx)(l.A,{className:"jetpack-podcast-player__track-status-icon",isPlaying:r,isError:n}),(0,c.jsx)("span",{className:"jetpack-podcast-player__track-title",children:e.title}),e.duration&&(0,c.jsx)("time",{className:"jetpack-podcast-player__track-duration",dateTime:e.duration,children:e.duration})]}),t&&n&&(0,c.jsx)(i.A,{link:e.link,title:e.title,colors:d})]})}))},81166:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(86087),s=r(27723),o=r(10790);const __=s.__;function a(e){class t extends n.Component{state={didError:!1,isIE11AudioIssue:!1};componentDidCatch=(e,t)=>{this.props.onError(e,t)};static getDerivedStateFromError=e=>({didError:!0,isIE11AudioIssue:!!e.message.match(/IE11/)});render(){const{didError:t,isIE11AudioIssue:r}=this.state;return t?(0,o.jsx)("section",{className:"jetpack-podcast-player",children:(0,o.jsx)("p",{className:"jetpack-podcast-player__error",children:r?__('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 browsers "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.jsx)(e,{...this.props})}}return t.defaultProps={onError:()=>{}},t}},38288:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s,g:()=>n});const n="podcast-feed",s="embed-block"},18029:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(93832),s=r(98329);const o={attributes:{url:{type:"string",validator:n.isUrl},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:s.A},hexPrimaryColor:{type:"string",validator:s.A},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:s.A},hexSecondaryColor:{type:"string",validator:s.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:s.A},hexBackgroundColor:{type:"string",validator:s.A},exampleFeedData:{type:"object"}},supports:{align:!1,alignWide:!0,anchor:!1,customClassName:!0,className:!0,html:!1,multiple:!0,reusable:!0},save:()=>null}},60025:(e,t,r)=>{"use strict";r.d(t,{A:()=>E});var n=r(97999),s=r(94715),o=r(74997),a=r(56427),i=r(29491),l=r(47143),c=r(86087),u=r(27723),d=r(93832),p=r(10067),h=r.n(p),m=r(66087),g=r(49487),f=r(34377),b=r(78218),v=r(50961),k=r(1624),y=r(57162),x=r(38288),j=r(90388),w=r(90764),_=r(19812),C=r(10790);const __=u.__,A=h()("jetpack:podcast-player:edit"),S=(0,n.isWpcomPlatformSite)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/",E=(0,i.compose)([(0,l.withDispatch)(((e,{clientId:t,attributes:r})=>({replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(t,(0,o.createBlock)("core/embed",{url:r.url}))}}))),(0,s.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),a.withNotices,i.withInstanceId,g.T])((({instanceId:e,attributes:t,setAttributes:r,noticeOperations:{createErrorNotice:n,removeAllNotices:o},noticeUI:i,primaryColor:l,setPrimaryColor:u,secondaryColor:p,setSecondaryColor:h,fallbackTextColor:g,backgroundColor:E,setBackgroundColor:N,fallbackBackgroundColor:T,isSelected:P,replaceWithEmbedBlock:B})=>{const I=(0,b.y)(k.attributes,t),{url:M,selectedEpisodes:L,itemsToShow:R,showCoverArt:D,showEpisodeTitle:F,showEpisodeDescription:O,exampleFeedData:z}=I,U=`jetpack-
_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.",+a,"jetpack"),a):1===a?__("This block will only appear to people who are visiting this page for the first time.","jetpack"):(0,l.sprintf)(/* translators: placeholder is a number. */
_n("This block will only appear to people who are visiting this page for %d time.","This block will only appear to people who have visited this page at most %d times.",+a,"jetpack"),a)}),(0,p.jsx)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container",children:(0,p.jsx)(s.InnerBlocks,{})})]})}))},53183:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(94715),s=r(10790);const o=()=>{const e=n.useBlockProps.save();return(0,s.jsx)("div",{...e,children:(0,s.jsx)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container",children:(0,s.jsx)(n.InnerBlocks.Content,{})})})}},84730:(e,t,r)=>{"use strict";r.d(t,{DF:()=>n,aV:()=>o,et:()=>s});const n="after-visits",s="before-visits",o=3},31566:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(94715),s=r(84730),o=r(10790);const a={attributes:{criteria:{type:"string",default:s.DF},threshold:{type:"number",default:s.aV}},supports:{html:!1},save:({className:e})=>(0,o.jsx)("div",{className:e,children:(0,o.jsx)(n.InnerBlocks.Content,{})})}},79238:(e,t,r)=>{"use strict";var n=r(94375),s=r(20242),o=r(34570),a=r(53183),i=r(31566);(0,n.M)(s,{edit:o.A,save:a.A,deprecated:[i.A]})},24097:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(94715),s=r(10790);function o(){const e=(0,n.useBlockProps)();return(0,s.jsx)("div",{...e,children:(0,s.jsx)(n.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]})})}},38136:(e,t,r)=>{"use strict";var n=r(94375),s=r(58180),o=r(24097),a=r(92908),i=r(92335),l=r(7651);(0,n.M)(s,{edit:o.A,save:a.A,variations:i.A},[{name:l.UU,settings:l.W0}])},92908:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(94715),s=r(10790);const o=()=>{const e=n.useBlockProps.save();return(0,s.jsx)("div",{...e,children:(0,s.jsx)(n.InnerBlocks.Content,{})})}},57699:(e,t,r)=>{"use strict";r.d(t,{N:()=>n});const n=[{code:"US",label:"🇺🇸 +1",value:"1US"},{code:"CA",label:"🇨🇦 +1",value:"1CA"},{code:"BS",label:"🇧🇸 +1242",value:"1242BS"},{code:"BB",label:"🇧🇧 +1246",value:"1246BB"},{code:"AI",label:"🇦🇮 +1264",value:"1264AI"},{code:"AG",label:"🇦🇬 +1268",value:"1268AG"},{code:"VG",label:"🇻🇬 +1284",value:"1284VG"},{code:"VI",label:"🇻🇮 +1340",value:"1340VI"},{code:"BM",label:"🇧🇲 +1441",value:"1441BM"},{code:"GD",label:"🇬🇩 +1473",value:"1473GD"},{code:"TC",label:"🇹🇨 +1649",value:"1649TC"},{code:"MS",label:"🇲🇸 +1664",value:"1664MS"},{code:"MP",label:"🇲🇵 +1670",value:"1670MP"},{code:"GU",label:"🇬🇺 +1671",value:"1671GU"},{code:"AS",label:"🇦🇸 +1684",value:"1684AS"},{code:"LC",label:"🇱🇨 +1758",value:"1758LC"},{code:"DM",label:"🇩🇲 +1767",value:"1767DM"},{code:"VC",label:"🇻🇨 +1784",value:"1784VC"},{code:"DO",label:"🇩🇴 +1849",value:"1849DO"},{code:"TT",label:"🇹🇹 +1868",value:"1868TT"},{code:"KN",label:"🇰🇳 +1869",value:"1869KN"},{code:"JM",label:"🇯🇲 +1876",value:"1876JM"},{code:"PR",label:"🇵🇷 +1939",value:"1939PR"},{code:"EG",label:"🇪🇬 +20",value:"20EG"},{code:"MA",label:"🇲🇦 +212",value:"212MA"},{code:"DZ",label:"🇩🇿 +213",value:"213DZ"},{code:"TN",label:"🇹🇳 +216",value:"216TN"},{code:"LY",label:"🇱🇾 +218",value:"218LY"},{code:"GM",label:"🇬🇲 +220",value:"220GM"},{code:"SN",label:"🇸🇳 +221",value:"221SN"},{code:"MR",label:"🇲🇷 +222",value:"222MR"},{code:"ML",label:"🇲🇱 +223",value:"223ML"},{code:"GN",label:"🇬🇳 +224",value:"224GN"},{code:"CI",label:"🇨🇮 +225",value:"225CI"},{code:"BF",label:"🇧🇫 +226",value:"226BF"},{code:"NE",label:"🇳🇪 +227",value:"227NE"},{code:"TG",label:"🇹🇬 +228",value:"228TG"},{code:"BJ",label:"🇧🇯 +229",value:"229BJ"},{code:"MU",label:"🇲🇺 +230",value:"230MU"},{code:"LR",label:"🇱🇷 +231",value:"231LR"},{code:"SL",label:"🇸🇱 +232",value:"232SL"},{code:"GH",label:"🇬🇭 +233",value:"233GH"},{code:"NG",label:"🇳🇬 +234",value:"234NG"},{code:"TD",label:"🇹🇩 +235",value:"235TD"},{code:"CF",label:"🇨🇫 +236",value:"236CF"},{code:"CM",label:"🇨🇲 +237",value:"237CM"},{code:"CV",label:"🇨<EFBFBD><EFBFBD><EFBFBD>
2025-02-28 08:42:11 +01:00
// translators: option to print the content - a verb.
label:__("Print","jetpack")},
// translators: option to print the content - a verb labelling a button.
2025-07-27 19:58:08 +02:00
title:__("Print","jetpack"),icon:(0,o.jsx)(s.d6,{icon:"print",size:24})},{name:"facebook",attributes:{service:"facebook",label:"Facebook"},title:"Facebook",icon:(0,o.jsx)(s.d6,{icon:"facebook",size:24})},{name:"linkedin",attributes:{service:"linkedin",label:"LinkedIn"},title:"LinkedIn",isDefault:!0,icon:(0,o.jsx)(s.d6,{icon:"linkedin",size:24})},{name:"mail",attributes:{service:"mail",
2025-02-28 08:42:11 +01:00
// translators: option to share the content by email - a verb.
label:__("Mail","jetpack")},
// translators: option to share the content by email - a verb labelling a button.
2025-07-27 19:58:08 +02:00
title:__("Mail","jetpack"),keywords:["email","e-mail"],icon:(0,o.jsx)(s.d6,{icon:"mail",size:24})},{name:"mastodon",attributes:{service:"mastodon",label:"Mastodon"},title:"Mastodon",icon:(0,o.jsx)(s.d6,{icon:"mastodon",size:24})},{name:"pinterest",attributes:{service:"pinterest",label:"Pinterest"},title:"Pinterest",icon:(0,o.jsx)(s.d6,{icon:"pinterest",size:24})},{name:"pocket",attributes:{service:"pocket",label:"Pocket"},title:"Pocket",icon:(0,o.jsx)(s.d6,{icon:"pocket",size:24})},{name:"reddit",attributes:{service:"reddit",label:"Reddit"},title:"Reddit",icon:(0,o.jsx)(s.d6,{icon:"reddit",size:24})},{name:"telegram",attributes:{service:"telegram",label:"Telegram"},title:"Telegram",icon:(0,o.jsx)(s.d6,{icon:"telegram",size:24})},{name:"threads",attributes:{service:"threads",label:"Threads"},title:"Threads",icon:(0,o.jsx)(s.d6,{icon:"threads",size:24})},{name:"tumblr",attributes:{service:"tumblr",label:"Tumblr"},title:"Tumblr",icon:(0,o.jsx)(s.d6,{icon:"tumblr",size:24})},{name:"whatsapp",attributes:{service:"whatsapp",label:"WhatsApp"},title:"WhatsApp",icon:(0,o.jsx)(s.d6,{icon:"whatsapp",size:24})},{name:"x",attributes:{service:"x",label:"X"},keywords:["twitter","x"],title:"X",icon:(0,o.jsx)(s.d6,{icon:"x",size:24})},{name:"nextdoor",attributes:{service:"nextdoor",label:"Nextdoor"},title:"Nextdoor",icon:(0,o.jsx)(s.d6,{icon:"nextdoor",size:24})},{name:"native-share",attributes:{service:"share",
2025-02-28 08:42:11 +01:00
// translators: option to share the content - a verb.
label:__("Share","jetpack")},
// translators: option to share the content - a verb labelling a button.
2025-07-27 19:58:08 +02:00
title:__("Native Share","jetpack"),icon:(0,o.jsx)(s.d6,{icon:"share",size:24}),description:__("Share the post using your phones built-in sharing menu, or copy the link to the clipboard on desktop.","jetpack")}];a.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)}));const i=a},11906:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(94715),s=r(56427),o=r(27723),a=r(83883),i=r(10790);const __=o.__,l=[{name:__("Small","jetpack"),value:"has-small-icon-size"},{name:__("Normal","jetpack"),value:"has-normal-icon-size"},{name:__("Large","jetpack"),value:"has-large-icon-size"},{name:__("Huge","jetpack"),value:"has-huge-icon-size"}],c=e=>{const{attributes:t,setAttributes:r}=e,{size:o}=t,c=e=>o===e||!o&&"has-normal-icon-size"===e;return(0,i.jsx)(n.BlockControls,{group:"other",children:(0,i.jsx)(s.ToolbarDropdownMenu,{label:__("Size","jetpack"),text:__("Size","jetpack"),icon:null,popoverProps:{position:"bottom right"},children:()=>(0,i.jsx)(s.MenuGroup,{children:l.map((({name:e,value:t})=>(0,i.jsx)(s.MenuItem,{icon:c(t)&&a.A,isSelected:c(t),role:"menuitemradio",onClick:()=>{r({size:t})},children:e},t)))})})})}},67650:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(94715),s=r(56427),o=r(27723),a=r(10790);const __=o.__,i=(0,n.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((e=>{const{clientId:t,attributes:r,iconBackgroundColor:o,iconColor:i,setAttributes:l,setIconBackgroundColor:c,setIconColor:u}=e,{iconBackgroundColorValue:d,iconColorValue:p}=r,{styleType:h}=r,m=(0,n.__experimentalUseMultipleOriginColorsAndGradients)(),g=[{value:i.color||p,onChange:e=>{u(e),l({iconColorValue:e})},label:__("Icon color","jetpack"),resetAllFilter:()=>{u(void 0),l({iconColorValue:void 0})}},{value:o.color||d,gradients:"",onChange:e=>{c(e),l({iconBackgroundColorValue:e})},onGradientChange:()=>{},label:__("Icon background","jetpack"),resetAllFilter:()=>{c(void 0),l({iconBackgroundColorValue:void 0})}}];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.InspectorControls,{children:(0,a.jsx)(s.PanelBody,{title:__("Settings","jetpack"),children:(0,a.jsx)(s.MenuItemsChoice,{choices:[/* translators: Sharing: Sharing button option label. */
2024-02-16 11:03:01 +01:00
{value:"icon-text",label:__("Icon & Text","jetpack")},/* translators: Sharing: Sharing button option label. */
{value:"icon",label:__("Icon Only","jetpack")},/* translators: Sharing: Sharing button option label. */
2025-07-27 19:58:08 +02:00
{value:"text",label:__("Text Only","jetpack")}],value:h,onSelect:e=>l({styleType:e})})})}),(0,a.jsxs)(n.InspectorControls,{group:"color",children:[g.map((({onChange:e,label:r,value:s,resetAllFilter:o})=>(0,a.jsx)(n.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:s,label:r,onColorChange:e,isShownByDefault:!0,resetAllFilter:o,enableAlpha:!0,clearable:!0}],panelId:t,gradients:"",...m},`social-links-color-${r}`))),(0,a.jsx)(n.ContrastChecker,{textColor:p,backgroundColor:d,isLargeText:!1})]})]})}))},83597:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(94715),s=r(27723),o=r(13022),a=r(11906),i=r(67650),l=r(10790);const __=s.__,c=["jetpack/sharing-button"];const u=function(e){const{attributes:t}=e,{size:r}=t,s=(0,l.jsx)("li",{children:__("Click plus to add a Sharing Button","jetpack")}),u=(0,o.A)(r,"jetpack-sharing-buttons__services-list"),d=(0,n.useBlockProps)({className:u}),p=(0,n.useInnerBlocksProps)(d,{allowedBlocks:c,placeholder:s,templateLock:!1,orientation:t.layout?.orientation??"horizontal",sharingEventsAdded:!0,__experimentalAppenderTagName:"li"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.A,{...e}),(0,l.jsx)(i.A,{...e}),(0,l.jsx)("ul",{...p})]})}},74956:(e,t,r)=>{"use strict";var n=r(94375),s=r(32870),o=r(83597),a=r(53840);(0,n.M)(s,{edit:o.A,save:a.A})},53840:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(94715),s=r(13022),o=r(10790);function a({attributes:e}){const{size:t}=e,r=(0,s.A)(t,"jetpack-sharing-buttons__services-list"),a=n.useBlockProps.save({className:r}),i=n.useInnerBlocksProps.save(a);return(0,o.jsx)("ul",{...i,id:"jetpack-sharing-serivces-list"})}},48715:(e,t,r)=>{"use strict";var n=r(85985),s=r(18692);(0,n.vp)(s.U,s.W)},18692:(e,t,r)=>{"use strict";r.d(t,{U:()=>d,W:()=>p});var n=r(56427),s=r(47143),o=r(86087),a=r(27723),i=r(66087),l=r(71046),c=r(90062),u=r(10790);const __=a.__,d="shortlinks",p={render:()=>(0,u.jsx)(m,{})};class h extends o.Component{render(){const{shortlink:e}=this.props;return e?(0,u.jsx)(c.A,{children:(0,u.jsx)(n.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel",initialOpen:!1,children:(0,u.jsx)(l.A,{link:e})})}):null}}const m=(0,s.withSelect)((e=>{const t=e("core/editor").getCurrentPost();return{shortlink:(0,i.get)(t,"jetpack_shortlink","")}}))(h)},52362:(e,t,r)=>{"use strict";r.d(t,{OS:()=>s,Z3:()=>n,oU:()=>o});const n="jp_pay_product",s="USD",o=[s,"EUR","AUD","BRL","CAD","CZK","DKK","HKD","HUF","ILS","JPY","MYR","MXN","TWD","NZD","NOK","PHP","PLN","GBP","RUB","SGD","SEK","CHF","THB"]},77513:(e,t,r)=>{"use strict";r.d(t,{H:()=>a});var n=r(56427),s=r(27723),o=r(10790);const __=s.__;function a({setAttributes:e,postLinkText:t}){return(0,o.jsx)(n.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,children:(0,o.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,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",placeholder:__("Click here to purchase","jetpack"),onChange:t=>e({postLinkText:t}),value:t})})}},54719:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(86087),s=r(10790);const o={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:({attributes:e})=>{const{productId:t}=e;return t?(0,s.jsx)(n.RawHTML,{children:`[simple-payment id="${t}"]`}):null}}},14604:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var n=r(94715),s=r(56427),o=r(29491),a=r(47143),i=r(86087),l=r(27723),c=r(13022),u=r(39904),d=r(66087),p=r(72730),h=r(90840),m=r(52362),g=r(96632),f=r(95964),b=r(56658),v=r(10790);const __=l
__("%s is not a valid email address.","jetpack"),r):null,fieldPriceError:"spay_price"===t?__("Invalid price.","jetpack"):null})})).finally((()=>{this.setState({isSavingProduct:!1})}))}))}validateAttributes=()=>{const e=this.validatePrice(),t=this.validateTitle(),r=this.validateEmail(),n=this.validateCurrency();return e&&t&&r&&n};validateCurrency=()=>{const{currency:e}=this.props.attributes;return m.oU.includes(e)};validatePrice=()=>{const{currency:e,price:t}=this.props.attributes;if(!t||0===parseFloat(t))return this.setState({fieldPriceError:__("If youre selling something, you need a price tag. Add yours here.","jetpack")}),!1;if(Number.isNaN(parseFloat(t)))return this.setState({fieldPriceError:__("Invalid price","jetpack")}),!1;if(parseFloat(t)<0)return this.setState({fieldPriceError:__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")}),!1;const{precision:r}=(0,p.iV)(e);return(0,b.w1)(t)>r?0===r?(this.setState({fieldPriceError:__("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")}),!1):(this.setState({fieldPriceError:(0,l.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.",r,"jetpack"),r)}),!1):(this.state.fieldPriceError&&this.setState({fieldPriceError:null}),!0)};validateEmail=()=>{const{email:e}=this.props.attributes;return e?u.validate(e)?(this.state.fieldEmailError&&this.setState({fieldEmailError:null}),!0):(this.setState({fieldEmailError:(0,l.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)};validateTitle=()=>{const{title:e}=this.props.attributes;return e?(this.state.fieldTitleError&&this.setState({fieldTitleError:null}),!0):(this.setState({fieldTitleError:__("Please add a brief title so that people know what theyre paying for.","jetpack")}),!1)};handleEmailChange=e=>{this.props.setAttributes({email:e}),this.setState({fieldEmailError:null})};handleContentChange=e=>{this.props.setAttributes({content:e})};handlePriceChange=e=>{e=parseFloat(e),isNaN(e)?this.props.setAttributes({price:void 0}):this.props.setAttributes({price:e}),this.setState({fieldPriceError:null})};handleCurrencyChange=e=>{this.props.setAttributes({currency:e})};handleMultipleChange=e=>{this.props.setAttributes({multiple:!!e})};handleTitleChange=e=>{this.props.setAttributes({title:e}),this.setState({fieldTitleError:null})};getCurrencyList=m.oU.map((e=>{const{symbol:t}=(0,p.iV)(e);return{value:e,label:t===e?e:`${e} ${(0,d.trimEnd)(t,".")}`}}));renderSettings=()=>(0,v.jsx)(n.InspectorControls,{children:(0,v.jsx)(s.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,children:(0,v.jsx)(s.TextControl,{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",placeholder:__("Click here to purchase","jetpack"),onChange:e=>this.props.setAttributes({postLinkText:e}),value:this.props.attributes.postLinkText})})});render(){const{fieldEmailError:e,fieldPriceError:t,fieldTitleError:r}=this.state,{attributes:n,instanceId:o,isSelected:a,setAttributes:i,simplePayment:l}=this.props,{content:u,currency:p,email:m,featuredMediaId:k,featuredMediaUrl:y,featuredMediaTitle:x,multiple:j,price:w,productId:_,title:C}=n,A=_&&(0,d.isEmpty)(l);if(!a&&A)return(0,v.jsx)("div",{className:"simple-payments__loading",children:(0,v.jsx)(f.A,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"})});if(!a&&m&&w&&C&&!e&&!t&&!r)return(0,v.jsx)(f.A,{"aria-busy":"false",content:u,featuredMediaUrl:y,featuredMediaTitle:x,formattedPrice:(0,b.N_)(w,p),multiple:j,title:C});const S=A?s.Disabled:"div";return(0,v.jsxs)(S,{className:"wp-block-jetpack-simple-payments",children:[this.renderSettings(),(0,v.jsx)(g.A,{featuredMediaId:k,featuredMediaUrl:y,featuredMediaTitle:x,setAttributes:i}),(0,v.jsxs)("div",{children:[(0,v.jsx)(s.TextControl,{"aria-describedby":`${o}-title-error`,className:(0,c.A)("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":r}),label:__("Item name","jetpack"),onChange:this.handleTitleChange,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:C}),(0,v.jsx)(h.A,{id:`${o}-title-error`,isError:!0,children:r}),(0,v.jsx)(s.TextareaControl,{className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:this.handleContentChange,placeholder:__("Describe your item in a few words","jetpack"),value:u}),(0,v.jsxs)("div",{className:"simple-payments__price-container",children:[(0,v.jsx)(s.SelectControl,{__next40pxDefaultSize:!0,className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:this.handleCurrencyChange,options:this.getCurrencyList,value:p}),(0,v.jsx)(s.TextControl,{"aria-describedby":`${o}-price-error`,className:(0,c.A)("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":t}),label:__("Price","jetpack"),onChange:this.handlePriceChange,placeholder:(0,b.N_)(0,p,!1),required:!0,step:"1",type:"number",value:w||""}),(0,v.jsx)(h.A,{id:`${o}-price-error`,isError:!0,children:t})]}),(0,v.jsx)("div",{className:"simple-payments__field-multiple",children:(0,v.jsx)(s.ToggleControl,{checked:Boolean(j),label:__("Allow people to buy more than one item at a t
__("%s is not a valid email address.","jetpack"),T):null),V("spay_price"===t?__("Invalid price.","jetpack"):null)})).finally((()=>{W(!1)}))},K=()=>{const e=Q(),t=ee(),r=X(),n=Y();return e&&t&&r&&n},Y=()=>g.oU.includes(N),Q=()=>{if(!L||0===parseFloat(L))return V(__("If youre selling something, you need a price tag. Add yours here.","jetpack")),!1;if(Number.isNaN(parseFloat(L)))return V(__("Invalid price","jetpack")),!1;if(parseFloat(L)<0)return V(__("Your price is negative — enter a positive number so people can pay the right amount.","jetpack")),!1;const{precision:e}=(0,h.iV)(N);return(0,k.w1)(L)>e?0===e?(V(__("We know every penny counts, but prices in this currency cant contain decimal values.","jetpack")),!1):(V((0,l.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.",e,"jetpack"),e)),!1):(H&&V(null),!0)},X=()=>T?d.validate(T)?(z&&U(null),!0):(U((0,l.sprintf)(/* translators: Placeholder is an email address. */
__("%s is not a valid email address.","jetpack"),T)),!1):(U(__("We want to make sure payments reach you, so please add an email address.","jetpack")),!1),ee=()=>D?(q&&$(null),!0):($(__("Please add a brief title so that people know what theyre paying for.","jetpack")),!1),te=e=>{o({email:e}),U(null)},re=e=>{o({content:e})},ne=e=>{const t=parseFloat(e);isNaN(t)?o({price:void 0}):o({price:t}),V(null)},se=e=>{o({currency:e})},oe=e=>{o({multiple:!!e})},ae=e=>{o({title:e}),$(null)},ie=g.oU.map((e=>{const{symbol:t}=(0,h.iV)(e);return{value:e,label:t===e?e:`${e} ${(0,p.trimEnd)(t,".")}`}}));let le;if((0,i.useEffect)((()=>{(!R&&w||!C)&&J(),window.wp?.customize?.bind("change",(e=>{let t;const r=e.id.match(/^widget_(.+)(?:\[(\d+)\])$/);if(r){t=`${r[1]}-${parseInt(r[2],10)}`}else t=e.id;t===(0,c.getWidgetIdFromBlock)(A)&&K()&&J()}))}),[]),(0,i.useEffect)((()=>{x&&Z.current&&!(0,p.isEmpty)(x)&&(o({content:(0,p.get)(x,["content","raw"],E),currency:(0,p.get)(x,["meta","spay_currency"],N),email:(0,p.get)(x,["meta","spay_email"],T),featuredMediaId:(0,p.get)(x,["featured_media"],P),featuredMediaUrl:(0,p.get)(j,"url",B),featuredMediaTitle:(0,p.get)(j,"title",I),multiple:Boolean((0,p.get)(x,["meta","spay_multiple"],Boolean(M))),price:(0,p.get)(x,["meta","spay_price"],L||void 0),title:(0,p.get)(x,["title","raw"],D)}),Z.current=!1)}),[x]),(0,i.useEffect)((()=>{S&&(w||!C)&&K()?J():r||K()}),[S,r]),(0,i.useEffect)((()=>{const t=_&&_!==e.postLinkUrl,r=!e.postLinkText;(t||r)&&o({...t&&{postLinkUrl:_},...r&&{postLinkText:__("Click here to purchase.","jetpack")}})}),[_,e]),!r&&F)le=(0,y.jsx)("div",{className:"simple-payments__loading",children:(0,y.jsx)(v.A,{"aria-busy":"true",content:"█████",formattedPrice:"█████",title:"█████"})});else if(r||!T||!L||!D||z||H||q){const r=F?s.Disabled:"div";le=(0,y.jsxs)(r,{className:"simple-payments__wrapper",children:[(0,y.jsx)(n.InspectorControls,{children:(0,y.jsx)(f.H,{postLinkText:e.postLinkText,setAttributes:o})}),(0,y.jsx)(b.A,{featuredMediaId:P,featuredMediaUrl:B,featuredMediaTitle:I,setAttributes:o}),(0,y.jsxs)("div",{children:[(0,y.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-title-error`,className:(0,u.A)("simple-payments__field","simple-payments__field-title",{"simple-payments__field-has-error":q}),label:__("Item name","jetpack"),onChange:ae,placeholder:__("Item name","jetpack"),required:!0,type:"text",value:D}),(0,y.jsx)(m.A,{id:`${t}-title-error`,isError:!0,children:q}),(0,y.jsx)(s.TextareaControl,{__nextHasNoMarginBottom:!0,className:"simple-payments__field simple-payments__field-content",label:__("Describe your item in a few words","jetpack"),onChange:re,placeholder:__("Describe your item in a few words","jetpack"),"aria-label":__("Describe your item in a few words","jetpack"),value:E}),(0,y.jsxs)("div",{className:"simple-payments__price-container",children:[(0,y.jsx)(s.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"simple-payments__field simple-payments__field-currency",label:__("Currency","jetpack"),onChange:se,options:ie,value:N}),(0,y.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-price-error`,className:(0,u.A)("simple-payments__field","simple-payments__field-price",{"simple-payments__field-has-error":H}),label:__("Price","jetpack"),onChange:ne,placeholder:(0,k.$g)(0,N,!1),required:!0,step:"1",type:"number",value:L||""}),(0,y.jsx)(m.A,{id:`${t}-price-error`,isError:!0,children:H})]}),(0,y.jsx)("div",{className:"simple-payments__field-multiple",children:(0,y.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,checked:Boolean(M),label:__("Allow people to buy more than one item at a time","jetpack"),onChange:oe})}),(0,y.jsx)(s.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,"aria-describedby":`${t}-email-${z?"error":"help"}`,className:(0,u.A)("simple-payments__field","simple-payments__field-email",{"simple-payments__field-has-error":z}),label:__("Email","jetpack"),onChange:te,placeholder:__("Email","jetpack"),required:!0
__("Go to slide %s","jetpack"),e)+'"></button>'}else s+=`<div class="swiper-pagination-simple">${t} / ${r}</div>`;return s}},16445:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(63162),s=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(94107),d=r(39126),p=r(31837),h=r(57464),m=r(10790);const __=i.__;class g extends a.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,a.createRef)(),this.btnNextRef=(0,a.createRef)(),this.btnPrevRef=(0,a.createRef)(),this.paginationRef=(0,a.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:r,delay:n,effect:s,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),s!==e.effect||r!==e.autoplay||n!==e.delay||o!==e.images){let t;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{a(__("The Swiper library could not be loaded.","jetpack"))}))}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=new u.A((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,h.bz)(e),e.update()}))})),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)return null;const{autoplay:e,className:t,delay:r,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?r:null,"data-effect":a,children:(0,m.jsxs)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef,children:[(0,m.jsx)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper",children:i.map((({alt:e,caption:t,id:r,url:a})=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,n.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,src:a}),(0,n.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},r||a)))}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,m.jsx)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,m.jsx)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})]})})}prefersReducedMotion=()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,d.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion())&&{delay:1e3*this.props.delay,disableOnInteraction:!1},effect:this.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:this.btnNextRef.current,prevEl:this.btnPrevRef.current},pagination:{clickable:!0,el:this.paginationRef.current,type:"custom",renderCustom:p.y}},{init:h.rQ,imagesReady:h.bz,paginationRender:h.n7,transitionEnd:h.WF})}const f=g},82233:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n={h
__("Go to slide %s","jetpack"),e)+'"></button>'}else s+=`<div class="swiper-pagination-simple">${t} / ${r}</div>`;return s}},71576:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(63162),s=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(94107),d=r(13895),p=r(74194),h=r(25080),m=r(10790);const __=i.__;class g extends a.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,a.createRef)(),this.btnNextRef=(0,a.createRef)(),this.btnPrevRef=(0,a.createRef)(),this.paginationRef=(0,a.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:r,delay:n,effect:s,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),s!==e.effect||r!==e.autoplay||n!==e.delay||o!==e.images){let t;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{a(__("The Swiper library could not be loaded.","jetpack"))}))}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=new u.A((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,h.bz)(e),e.update()}))})),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)return null;const{autoplay:e,delay:t,effect:r,images:a}=this.props;return(0,m.jsx)("div",{"data-autoplay":e||null,"data-delay":e?t:null,"data-effect":r,children:(0,m.jsxs)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef,children:[(0,m.jsx)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper",children:a.map((({alt:e,caption:t,id:r,url:a})=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,n.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,src:a}),(0,n.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},r||a)))}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,m.jsx)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,m.jsx)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})]})})}prefersReducedMotion=()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,d.A)(this.slideshowRef.current,{autoplay:!(!this.props.autoplay||this.prefersReducedMotion())&&{delay:1e3*this.props.delay,disableOnInteraction:!1},effect:this.props.effect,loop:!0,initialSlide:e,navigation:{nextEl:this.btnNextRef.current,prevEl:this.btnPrevRef.current},pagination:{clickable:!0,el:this.paginationRef.current,type:"custom",renderCustom:p.y}},{init:h.rQ,imagesReady:h.bz,paginationRender:h.n7,transitionEnd:h.WF})}const f=g},89693:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n={html:!1,align:["center","
__("Go to slide %s","jetpack"),e)+'"></button>'}else s+=`<div class="swiper-pagination-simple">${t} / ${r}</div>`;return s}},41952:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(94715),s=r(241),o=r(10790);const a=({attributes:{align:e,autoplay:t,delay:r,effect:a,images:i},className:l})=>{const c=n.useBlockProps.save({className:l});return(0,o.jsx)(s.A,{align:e,autoplay:t,className:c.className,delay:r,effect:a,images:i})}},241:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(63162),s=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(13022),c=r(66087),u=r(94107),d=r(33170),p=r(30889),h=r(34308),m=r(10790);const __=i.__;class g extends a.Component{pendingRequestAnimationFrame=null;resizeObserver=null;static defaultProps={effect:"slide"};constructor(e){super(e),this.slideshowRef=(0,a.createRef)(),this.btnNextRef=(0,a.createRef)(),this.btnPrevRef=(0,a.createRef)(),this.paginationRef=(0,a.createRef)()}componentDidMount(){const{onError:e}=this.props;this.buildSwiper().then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{e(__("The Swiper library could not be loaded.","jetpack"))}))}componentWillUnmount(){this.clearResizeObserver(),this.clearPendingRequestAnimationFrame()}componentDidUpdate(e){const{align:t,autoplay:r,delay:n,effect:s,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),s!==e.effect||r!==e.autoplay||n!==e.delay||o!==e.images){let t;t=this.swiperIndex?o.length===e.images.length?this.swiperInstance.realIndex:e.images.length:0,this.swiperInstance&&this.swiperInstance.destroy(!0,!0),this.buildSwiper(t).then((e=>{this.swiperInstance=e,this.initializeResizeObserver(e)})).catch((()=>{a(__("The Swiper library could not be loaded.","jetpack"))}))}}initializeResizeObserver=e=>{this.clearResizeObserver(),this.resizeObserver=new u.A((()=>{this.clearPendingRequestAnimationFrame(),this.pendingRequestAnimationFrame=requestAnimationFrame((()=>{(0,h.bz)(e),e.update()}))})),this.resizeObserver.observe(e.el)};clearPendingRequestAnimationFrame=()=>{this.pendingRequestAnimationFrame&&(cancelAnimationFrame(this.pendingRequestAnimationFrame),this.pendingRequestAnimationFrame=null)};clearResizeObserver=()=>{this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)};render(){if(!this.props?.images?.length)return null;const{autoplay:e,className:t,delay:r,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?r:null,"data-effect":a,style:{"--aspect-ratio":i[0]?.aspectRatio?`calc(${i[0].aspectRatio})`:void 0},children:(0,m.jsxs)("div",{className:"wp-block-jetpack-slideshow_container swiper-container",ref:this.slideshowRef,children:[(0,m.jsx)("ul",{className:"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper",children:i.map((({alt:e,caption:t,id:r,url:a,aspectRatio:i},c)=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,n.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${r}`,"data-id":r,"data-aspect-ratio":i,src:a}),(0,n.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(s.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},r?`${r}-${c}`:`${a}-${c}`)))}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white",ref:this.btnPrevRef,role:"button"}),(0,m.jsx)("a",{className:"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white",ref:this.btnNextRef,role:"button"}),(0,m.jsx)("a",{"aria-label":"Pause Slideshow",className:"wp-block-jetpack-slideshow_button-pause",role:"button"}),(0,m.jsx)("div",{className:"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white",ref:this.paginationRef})]})})}prefersReducedMotion=()=>"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;buildSwiper=(e=0)=>(0,d.A)(this.slideshowRef.current,{autoplay:!(!this.props.autopl
__("Slide %d, currently selected","jetpack"),r+1):(0,n.sprintf)(/* translators: %d: Slide number. */
__("Go to slide %d","jetpack"),r+1)),(0,o.jsx)("button",{role:c?"presentation":"tab",className:(0,s.A)("wp-story-pagination-bullet",{"wp-story-pagination-ellipsis":e}),"aria-label":u,"aria-disabled":c||a,onClick:c||a?void 0:l,disabled:c,children:(0,o.jsx)("div",{className:"wp-story-pagination-bullet-bar",children:(0,o.jsx)("div",{className:"wp-story-pagination-bullet-bar-progress",style:{width:`${i}%`}})})},r)}},35941:(e,t,r)=>{"use strict";r.d(t,{d:()=>a,k:()=>o});var n=r(13022),s=r(10790);const o=({className:e,size:t,label:r,isPressed:o,...a})=>(0,s.jsx)("button",{type:"button","aria-label":r,"aria-pressed":o,className:(0,n.A)("jetpack-mdc-icon-button","circle-icon","outlined","bordered",e),style:{width:`${t}px`,height:`${t}px`},...a}),a=({className:e,size:t=24,label:r,isPressed:o,...a})=>(0,s.jsx)("button",{type:"button","aria-label":r,"aria-pressed":o,className:(0,n.A)("jetpack-mdc-icon-button",e),style:{width:`${t}px`,height:`${t}px`},...a})},20058:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(10790);const s=()=>(0,n.jsx)("div",{className:"wp-story-loading-spinner",children:(0,n.jsx)("div",{className:"wp-story-loading-spinner__outer",children:(0,n.jsx)("div",{className:"wp-story-loading-spinner__inner"})})})},48907:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(27723),s=r(35941),o=r(44227),a=r(10790);const _x=n._x;function i({playing:e,muted:t,onPlayPressed:r,onMutePressed:n,showMute:i}){return(0,a.jsxs)("div",{className:"wp-story-controls",children:[(0,a.jsx)(s.d,{isPressed:e,label:e?_x("pause","Button tooltip text","jetpack"):_x("play","Button tooltip text","jetpack",0),onClick:r,children:e?(0,a.jsx)(o.E$,{}):(0,a.jsx)(o.ud,{})}),i&&(0,a.jsx)(s.d,{isPressed:t,label:t?_x("unmute","Button tooltip text","jetpack"):_x("mute","Button tooltip text","jetpack",0),onClick:n,children:t?(0,a.jsx)(o.lQ,{}):(0,a.jsx)(o.Fz,{})})]})}},41256:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(27723),s=r(35941),o=r(44227),a=r(10790);const __=n.__;function i({fullscreen:e,onExitFullscreen:t,siteIconUrl:r,storyTitle:n}){return e?(0,a.jsxs)("div",{className:"wp-story-meta",children:[(0,a.jsx)("div",{className:"wp-story-icon",children:(0,a.jsx)("img",{alt:__("Site icon","jetpack"),src:r,width:"40",height:"40"})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"wp-story-title",children:n})}),(0,a.jsx)(s.d,{className:"wp-story-exit-fullscreen",label:__("Exit Fullscreen","jetpack"),onClick:t,children:(0,a.jsx)(o.US,{})})]}):null}},44227:(e,t,r)=>{"use strict";r.d(t,{E$:()=>l,Ej:()=>p,Fz:()=>u,US:()=>c,af:()=>h,lQ:()=>d,ud:()=>i});var n=r(5573),s=r(62289),o=r(10790);const a=({children:e,size:t})=>(0,s.A)(e,t,t),i=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M8 5v14l11-7z"})}),l=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}),c=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}),u=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"})}),d=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z"})}),p=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}),h=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(n.Path,{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})},84545:(e,t,r)=>{"use strict";r.d(t,{$U:()=>c.$U,Dv:()=>n.A,H2:()=>s.A,VS:()=>i.A,Y9:()=>o.A,hJ:()=>a.A,xu:()=>l.A});var n=r(79809),s=r(48907),o=r(41256),a=r(38925),i=r(71645),l=r(20058
_n("<span>%s reader</span> is subscribed.","<span>%s readers</span> are subscribed.",M,"jetpack"),(0,o.qe)(M,{numberFormatOptions:{maximumFractionDigits:1}})),{span:(0,h.jsx)("span",{style:{fontWeight:"bold"}})})}),_&&(0,h.jsx)(a.__experimentalPanelColorGradientSettings,{title:__("Color","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",settings:[{colorValue:r.color,onColorChange:T,gradientValue:g.gradientValue,onGradientChange:g.setGradient,label:__("Button Background","jetpack")},{colorValue:L.color,onColorChange:P,label:__("Button Text","jetpack")},{colorValue:m.color,onColorChange:N,label:__("Border","jetpack")}],initialOpen:!0,children:(0,h.jsx)(a.ContrastChecker,{fontSize:j.size,textColor:L.color,backgroundColor:k.color,fallbackButtonBackgroundColor:y,fallbackTextColor:x})}),!_&&(0,h.jsx)(a.PanelColorSettings,{title:__("Background Colors","jetpack"),className:"wp-block-jetpack-subscriptions__backgroundpanel",colorSettings:[{value:r.color,onChange:T,label:__("Button Background Color","jetpack")},{value:L.color,onChange:P,label:__("Button Text Color","jetpack")},{value:m.color,onColorChange:N,label:__("Border Color","jetpack")}],initialOpen:!1,children:(0,h.jsx)(a.ContrastChecker,{fontSize:j.size,textColor:L.color,backgroundColor:k.color,fallbackButtonBackgroundColor:y,fallbackTextColor:x})}),(0,h.jsx)(i.PanelBody,{title:__("Typography","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__textpanel",children:(0,h.jsx)(a.FontSizePicker,{withSlider:!0,value:j.size,onChange:e=>{const t=e||p.Fm;E({fontSize:t,customFontSize:t})},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,h.jsxs)(i.PanelBody,{title:__("Border","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__borderpanel",children:[(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:f,label:__("Border Radius","jetpack"),min:p.rG,max:p.Bs,initialPosition:p.Kn,allowReset:!0,onChange:e=>E({borderRadius:e})}),(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:b,label:__("Border Weight","jetpack"),min:p.ZS,max:p.JD,initialPosition:p.aS,allowReset:!0,onChange:e=>E({borderWeight:e})})]}),(0,h.jsxs)(i.PanelBody,{title:__("Spacing","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__spacingpanel",children:[(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:C,label:__("Space Inside","jetpack"),min:p.rE,max:p.Vy,initialPosition:p.oi,allowReset:!0,onChange:e=>E({padding:e})}),(0,h.jsx)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:I,label:__("Space Between","jetpack"),min:p.Hq,max:p.Zi,initialPosition:p.E,allowReset:!0,onChange:e=>E({spacing:e})}),(0,h.jsx)(d.s,{width:R,onChange:e=>{E({buttonWidth:e,buttonOnNewLine:v||"100%"===e})}})]}),(0,h.jsxs)(i.PanelBody,{title:__("Settings","jetpack"),initialOpen:!1,className:"wp-block-jetpack-subscriptions__displaypanel",children:[(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Show subscriber count","jetpack"),checked:B,onChange:()=>{E({showSubscribersTotal:!B,includeSocialFollowers:void 0!==w&&w})},help:()=>{if(!M||M<1)return __("This will remain hidden until there is at least one subscriber.","jetpack")}}),O&&(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,disabled:!B,label:__("Include social followers in count","jetpack"),checked:void 0===w||w,onChange:()=>{E({includeSocialFollowers:void 0!==w&&!w})}}),(0,h.jsx)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Place button on new line","jetpack"),checked:v,onChange:()=>{E({buttonOnNewLine:!v})}}),(0,h.jsx)(i.TextareaControl,{__nextHasNoMarginBottom:!0,value:D,label:__("Input placeholder text","jetpack"),help:__("Edit the placeholder text of the email address input.","jetpack"),onChange:e=>E({subscribePlaceholder:e})}),!(0,n.isSimpleSite)()&&(0,h.jsx)(i.TextareaControl,{__nextHasNoMarginBottom:!0,value:F,label:__("Success message","jetpack"),help:__("Edit the message displayed when a user subscribes.","jetpack"),onChange:e=>E({successMessage:e})}),t&&
_n("Join %s other subscriber","Join %s other subscribers",n,"jetpack"),(0,s.qe)(n,{numberFormatOptions:{maximumFractionDigits:1}}))}})),{availableNewsletterCategories:Q,areNewsletterCategoriesEnabled:X}=(0,l.useSelect)((e=>{const t=e(f.M);return{availableNewsletterCategories:t.getNewsletterCategories(),areNewsletterCategoriesEnabled:t.getNewsletterCategoriesEnabled()}})),ee=w({gradientAttribute:"emailFieldGradient",customGradientAttribute:"customEmailFieldGradient"}),te=w({gradientAttribute:"buttonGradient",customGradientAttribute:"customButtonGradient"}),re={"no-border-radius":0===L,[P.class]:P.class,"has-text-color":A.color,[A.class]:A.class},ne={...re,"has-background":n.color||ee.gradientValue,[n.class]:!ee.gradientValue&&n.class,[ee.gradientClass]:ee.gradientClass},se={...re,"has-background":x.color||te.gradientValue,[x.class]:!te.gradientValue&&x.class,[te.gradientClass]:te.gradientClass},oe=e=>e||v.E,ae={color:A.color,borderColor:N.color,borderRadius:L?L+"px":v.Kn+"px",borderWidth:R?R+"px":v.aS+"px",fontSize:P.size?P.size:v.Fm,padding:(e=>{const t=e||v.oi;return t+"px "+Math.round(1.5*t)+"px "+t+"px "+Math.round(1.5*t)+"px"})(z)},ie={"--subscribe-block-border-radius":L?L+"px":v.Kn+"px"},le={...ae,...!n.color&&ee.gradientValue?{background:ee.gradientValue}:{backgroundColor:n.color}},ce={...ae,...!x.color&&te.gradientValue?{background:te.gradientValue}:{backgroundColor:x.color},width:D?.length?D:"auto"};"button"!==J&&(W?ce.marginTop=oe(V)+"px":ce.marginLeft=oe(V)+"px");const ue=(0,i.usePrevious)(x);return(0,c.useEffect)((()=>{ue?.color===N?.color&&N?.color!==x?.color&&T(x.color)}),[x,ue,N,T]),(0,y.jsxs)("div",{...I,className:(0,d.A)(I.className,"wp-block-jetpack-subscriptions__container","wp-block-jetpack-subscriptions__supports-newline",W?"wp-block-jetpack-subscriptions__use-newline":void 0,G?"wp-block-jetpack-subscriptions__show-subs":void 0),children:[(0,y.jsx)(o.InspectorControls,{children:(0,y.jsx)(k.A,{areNewsletterCategoriesEnabled:X,availableNewsletterCategories:Q,buttonBackgroundColor:x,borderColor:N,buttonGradient:te,borderRadius:L,borderWeight:R,buttonOnNewLine:W,emailFieldBackgroundColor:n,fallbackButtonBackgroundColor:C,fallbackTextColor:S,fontSize:P,includeSocialFollowers:O,isGradientAvailable:j,padding:z,preselectNewsletterCategories:U,setAttributes:r,setBorderColor:T,setButtonBackgroundColor:_,setTextColor:E,showSubscribersTotal:G,spacing:V,subscriberCount:K,textColor:A,buttonWidth:D,selectedNewsletterCategoryIds:H,subscribePlaceholder:$,submitButtonText:q,successMessage:Z})}),(0,y.jsx)(o.BlockControls,{children:(0,y.jsx)(a.ToolbarGroup,{children:(0,y.jsx)(a.ToolbarButton,{href:(0,g.Qu)(B),target:"_blank",children:B?_x("Manage plans","unused context to distinguish translations","jetpack"):__("Set up a paid plan","jetpack")})})}),(0,y.jsxs)("div",{style:ie,children:[(0,y.jsx)("div",{className:"wp-block-jetpack-subscriptions__container is-not-subscriber",children:(0,y.jsx)("div",{className:"wp-block-jetpack-subscriptions__form",role:"form",children:(0,y.jsxs)("div",{className:"wp-block-jetpack-subscriptions__form-elements",children:["button"!==J&&(0,y.jsx)(a.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,placeholder:$,disabled:!0,className:(0,d.A)(ne,"wp-block-jetpack-subscriptions__textfield"),style:le}),(0,y.jsx)(o.RichText,{className:(0,d.A)(se,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:e=>r({submitButtonText:e}),style:ce,value:q,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/strikethrough"]})]})})}),G&&(0,y.jsx)("div",{className:"wp-block-jetpack-subscriptions__subscount",children:Y})]})]})}))},13554:(e,t,r)=>{"use strict";var n=r(85985),s=r(74997),o=r(47143),a=r(43656),i=r(86087),l=r(52619),c=r(27723),u=r(67709),d=r(62599),p=r(94375),h=r(99876),m=r(63200),g=r(39025),f=r(38387),b=r(3722),v=r(74500),k=r(48313),y=r(10790);const __=c.__,x=h.name.replace("jetpack/","");(0,p.M)(h,{edit:f.h,transforms:{from:[{type:"block",isMultiBlock:!1,blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t?.raw&&"blog_subscri
__("image %1$d of %2$d in gallery","jetpack"),t+1,r.length);return(0,d.jsx)(l.A,{alt:e.alt,"aria-label":a,height:e.height,id:e.id,origUrl:e.url,isSelected:s===t,link:e.link,linkTo:n,url:this.photonize(e),width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:o}=this.props,a=h(o)?u.A:c.A,i=this.props.images.map(this.renderImage,this);return(0,d.jsxs)("div",{className:r,children:[(0,d.jsx)(a,{align:e,columns:n,images:s,layoutStyle:o,renderedImages:i}),t]})}}function h(e){return["circle","square"].includes(e)}function m(e,t={}){const r={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},n=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,s]of Object.entries(t))n.searchParams.set(Object.hasOwn(r,e)?r[e]:e,s);return n.toString()}},58070:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(86087),s=r(94107),o=r(29971),a=r(75303),i=r(56237),l=r(34896),c=r(5236),u=r(10790);class d extends n.Component{gallery=(0,n.createRef)();pendingRaf=null;ro=null;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()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:r}of e){const{width:e}=t;(0,c.S)(r).forEach((t=>(0,c.r)(t,e)))}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(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:r,layoutStyle:n,renderedImages:s}=this.props,c=(0,l.mJ)(r),d="columns"===n?(0,l.FL)(c,t):(0,l.VU)(c,{isWide:["full","wide"].includes(e)});let p=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:d.map(((e,t)=>(0,u.jsx)(i.A,{children:e.map(((e,t)=>{const r=s.slice(p,p+e);return p+=e,(0,u.jsx)(o.A,{children:r},t)}))},t)))})}}},34896:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>s});var n=r(66087);function s(e){return(0,n.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,n.sum)(e)/t,s=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,n.takeWhile)(o,(t=>{const n=a<=(e+1)*r;return n&&(a+=t),n})).length;s.push(t),o=(0,n.drop)(o,t)}return s.push(o.length),[s]}const i=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([P(1.6),(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,s)=>{if(!s.length)return e;let o;o=s.length>15&&l(s)&&i(e)?[2,1,2]:s.length>15&&c(s)&&u(e)?[3,1,3]:5!==s.length&&d(s)&&p(e)?[1,2,1]:h(s)&&m(e)?[1,3]:g(s)&&f(e)?[3,1]:b(s)&&v(e)?[1,2]:t&&(5===s.length||10!==s.length&&s.length>6)&&k(e)&&(0,n.sum)((0,n.take)(s,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,n.sum)((0,n.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,s)?[1,1,1,1]:function(e,t,r){const s=(0,n.sum)((0,n.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(s<2.5||s<5&&t.length>=3&&t[0]===t[2]||r)}(e,s,t)?[1,1,1]:j(s)&&w(e)?[2,1]:_(s)?[1]:s.length>3?[1,1]:Array(s.length).fill(1);const a=e.concat([o]),C=(0,n.sum)(o),A=s.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,n.some)((0,n.takeRight)(r,t),(t=>(0,n.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,n.every)((0,n.zipWit
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:h,srcSet:m}=(0,l.A)(e,{layoutStyle:c});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":p,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:u===t,link:e.link,linkTo:a,origUrl:e.url,showMovers:o.length>1,srcSet:m,url:h,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:i,roundedCorners:p}=this.props,h=(0,l.s)(i)?u.A:c.A,m=this.props.images.map(this.renderImage,this),g=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{className:(0,o.A)(r,{[`has-rounded-corners-${g}`]:g>0}),children:[(0,d.jsx)(h,{align:e,columns:n,images:s,layoutStyle:i,renderedImages:m}),t]})}}},84255:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(86087),s=r(84394),o=r(38548),a=r(70954),i=r(89195),l=r(10790);class c extends n.Component{gallery=(0,n.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:c}=this.props,u=(0,i.mJ)(r),d="columns"===n?(0,i.FL)(u,t):(0,i.VU)(u,{isWide:["full","wide"].includes(e)});let p=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:d.map(((e,t)=>(0,l.jsx)(a.A,{children:e.map(((e,t)=>{const r=c.slice(p,p+e);return p+=e,(0,l.jsx)(s.A,{children:r},t)}))},t)))})}}},89195:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>s});var n=r(66087);function s(e){return(0,n.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,n.sum)(e)/t,s=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,n.takeWhile)(o,(t=>{const n=a<=(e+1)*r;return n&&(a+=t),n})).length;s.push(t),o=(0,n.drop)(o,t)}return s.push(o.length),[s]}const i=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([P(1.6),(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,s)=>{if(!s.length)return e;let o;o=s.length>15&&l(s)&&i(e)?[2,1,2]:s.length>15&&c(s)&&u(e)?[3,1,3]:5!==s.length&&d(s)&&p(e)?[1,2,1]:h(s)&&m(e)?[1,3]:g(s)&&f(e)?[3,1]:b(s)&&v(e)?[1,2]:t&&(5===s.length||10!==s.length&&s.length>6)&&k(e)&&(0,n.sum)((0,n.take)(s,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,n.sum)((0,n.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,s)?[1,1,1,1]:function(e,t,r){const s=(0,n.sum)((0,n.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(s<2.5||s<5&&t.length>=3&&t[0]===t[2]||r)}(e,s,t)?[1,1,1]:j(s)&&w(e)?[2,1]:_(s)?[1]:s.length>3?[1,1]:Array(s.length).fill(1);const a=e.concat([o]),C=(0,n.sum)(o),A=s.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,n.some)((0,n.takeRight)(r,t),(t=>(0,n.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,n.every)((0,n.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function P(e){return t=>t<e}},70954:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(13022),s=r(10790);function o({children:e,className:t}){return(0,s.jsx)("div",{className:(0,n.A)("tiled-gallery__row",t),children:e})}},51475:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(66087),s=r(43566),o=r(84394),a=r(38548),i=r(70954),l=r(10790);function c({columns:e,renderedImages:t}){const r=Math.min(s.ZS,e),c=t.length%r;return(0,l.jsx)(a.A,{children:[...c?[(0,n.take)(t,c)]:[],...(0,n.chunk)((0,n.drop)(t,c),r)].map(((e,t)=>(0,l.jsx)(i.A,{className:`columns-${e.length}`,children:e.map(((e,t)=>(0,l.jsx)(o.A,{children:e},t)))},t)))})}},14294:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(90907),s=r(43566),o=r(65378),a=r(10790);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:l,className:c,columns:u=i(e),linkTo:d,roundedCorners:p}=e;return(0,a.jsx)(o.A,{align:l,clas
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,l.A)(e,{layoutStyle:u});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:i,roundedCorners:p,onResize:h,isSave:m,columnWidths:g}=this.props,f=(0,l.s)(i)?u.A:c.A,b=this.props.images.map(this.renderImage,this),v=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{className:(0,o.A)(r,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:n,columnWidths:m?g:void 0,images:s,layoutStyle:i,renderedImages:b,onResize:m?void 0:h}),t]})}}},56420:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(86087),s=r(54001),o=r(99309),a=r(46479),i=r(70394),l=r(10790);class c extends n.Component{gallery=(0,n.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(r),p="columns"===n?(0,i.FL)(d,t):(0,i.VU)(d,{isWide:["full","wide"].includes(e)});let h=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,l.jsx)(a.A,{children:e.map(((e,r)=>{const n=c.slice(h,h+e);return h+=e,(0,l.jsx)(s.A,{width:u?.[t]?.[r],children:n},r)}))},t)))})}}},70394:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>s});var n=r(66087);function s(e){return(0,n.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,n.sum)(e)/t,s=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,n.takeWhile)(o,(t=>{const n=a<=(e+1)*r;return n&&(a+=t),n})).length;s.push(t),o=(0,n.drop)(o,t)}return s.push(o.length),[s]}const i=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([P(1.6),(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,s)=>{if(!s.length)return e;let o;o=s.length>15&&l(s)&&i(e)?[2,1,2]:s.length>15&&c(s)&&u(e)?[3,1,3]:5!==s.length&&d(s)&&p(e)?[1,2,1]:h(s)&&m(e)?[1,3]:g(s)&&f(e)?[3,1]:b(s)&&v(e)?[1,2]:t&&(5===s.length||10!==s.length&&s.length>6)&&k(e)&&(0,n.sum)((0,n.take)(s,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,n.sum)((0,n.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,s)?[1,1,1,1]:function(e,t,r){const s=(0,n.sum)((0,n.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(s<2.5||s<5&&t.length>=3&&t[0]===t[2]||r)}(e,s,t)?[1,1,1]:j(s)&&w(e)?[2,1]:_(s)?[1]:s.length>3?[1,1]:Array(s.length).fill(1);const a=e.concat([o]),C=(0,n.sum)(o),A=s.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,n.some)((0,n.takeRight)(r,t),(t=>(0,n.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,n.every)((0,n.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function P(e){return t=>t<e}},46479:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(13022),s=r(10790);function o({children:e,className:t}){return(0,s.jsx)("div",{className:(0,n.A)("tiled-gallery__row",t),children:e})}},65216:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(66087),s=r(60041),o=r(54001),a=r(99309),i=r(46479),l=r(10790);function c({columns:e,renderedImages:t}){const r=Math.min(s.ZS,e),c=t.length%r;return(0,l.jsx)(a.A,{children:[...c?[(0,n.take)(t,c)]:[],...(0,n.chunk)((0,n.drop)(t,c),r)].map(((e,t)=>(0,l.jsx)(i.A,{className:`columns-${e.length}`,children:e.map(((e,t)=>(0,l.jsx)(o.A,{children:e},t)))},t)))})}},28635:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(90907),s=r(60041),o=r(77511),a=r(
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,l.A)(e,{layoutStyle:u});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:i,roundedCorners:p,onResize:h,style:m,isSave:g,columnWidths:f}=this.props,b=(0,l.s)(i)?u.A:c.A,v=this.props.images.map(this.renderImage,this),k=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{style:m,className:(0,o.A)(r,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:n,columnWidths:g?f:void 0,images:s,layoutStyle:i,renderedImages:v,onResize:g?void 0:h}),t]})}}},91341:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(86087),s=r(94107),o=r(78608),a=r(52042),i=r(9276),l=r(71245),c=r(86461),u=r(10790);class d extends n.Component{gallery=(0,n.createRef)();pendingRaf=null;ro=null;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()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:r}of e){const{width:e}=t,n=[];(0,c.S)(r).forEach((t=>{n.push((0,c.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(n)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(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,r){let n=0;return e.map((e=>e.map((e=>{const r=t.slice(n,n+e);return n+=e,r})))).map((e=>(0,c.r)(e,r)))}render(){const{align:e,columns:t,images:r,layoutStyle:s,renderedImages:c}=this.props,d=(0,l.mJ)(r),p="columns"===s?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=n.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,c,1e3)})();let m=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,u.jsx)(i.A,{children:e.map(((e,r)=>{const n=c.slice(m,m+e);return m+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[r],children:n},r)}))},t)))})}}},71245:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>s});var n=r(66087);function s(e){return(0,n.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,n.sum)(e)/t,s=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,n.takeWhile)(o,(t=>{const n=a<=(e+1)*r;return n&&(a+=t),n})).length;s.push(t),o=(0,n.drop)(o,t)}return s.push(o.length),[s]}const i=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([P(1.6),(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,s)=>{if(!s.length)return e;let o;o=s.length>15&&l(s)&&i(e)?[2,1,2]:s.length>15&&c(s)&&u(e)?[3,1,3]:5!==s.length&&d(s)&&p(e)?[1,2,1]:h(s)&&m(e)?[1,3]:g(s)&&f(e)?[3,1]:b(s)&&v(e)?[1,2]:t&&(5===s.length||10!==s.length&&s.length>6)&&k(e)&&(0,n.sum)((0,n.take)(s,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,n.sum)((0,n.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,s)?[1,1,1,1]:function(e,t,r){const s=(0,n.sum)((0,n.take)(t,3));r
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,l.A)(e,{layoutStyle:u});return(0,d.jsx)(i.A,{alt:e.alt,"aria-label":v,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:c,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:i,roundedCorners:p,onResize:h,isSave:m,columnWidths:g}=this.props,f=(0,l.s)(i)?u.A:c.A,b=this.props.images.map(this.renderImage,this),v=i!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{className:(0,o.A)(r,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:n,columnWidths:m?g:void 0,images:s,layoutStyle:i,renderedImages:b,onResize:m?void 0:h}),t]})}}},62579:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(86087),s=r(89798),o=r(38448),a=r(26054),i=r(79167),l=r(10790);class c extends n.Component{gallery=(0,n.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:r,layoutStyle:n,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(r),p="columns"===n?(0,i.FL)(d,t):(0,i.VU)(d,{isWide:["full","wide"].includes(e)});let h=0;return(0,l.jsx)(o.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,l.jsx)(a.A,{children:e.map(((e,r)=>{const n=c.slice(h,h+e);return h+=e,(0,l.jsx)(s.A,{width:u?.[t]?.[r],children:n},r)}))},t)))})}}},79167:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>s});var n=r(66087);function s(e){return(0,n.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,n.sum)(e)/t,s=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,n.takeWhile)(o,(t=>{const n=a<=(e+1)*r;return n&&(a+=t),n})).length;s.push(t),o=(0,n.drop)(o,t)}return s.push(o.length),[s]}const i=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([P(1.6),(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,s)=>{if(!s.length)return e;let o;o=s.length>15&&l(s)&&i(e)?[2,1,2]:s.length>15&&c(s)&&u(e)?[3,1,3]:5!==s.length&&d(s)&&p(e)?[1,2,1]:h(s)&&m(e)?[1,3]:g(s)&&f(e)?[3,1]:b(s)&&v(e)?[1,2]:t&&(5===s.length||10!==s.length&&s.length>6)&&k(e)&&(0,n.sum)((0,n.take)(s,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,n.sum)((0,n.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,s)?[1,1,1,1]:function(e,t,r){const s=(0,n.sum)((0,n.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(s<2.5||s<5&&t.length>=3&&t[0]===t[2]||r)}(e,s,t)?[1,1,1]:j(s)&&w(e)?[2,1]:_(s)?[1]:s.length>3?[1,1]:Array(s.length).fill(1);const a=e.concat([o]),C=(0,n.sum)(o),A=s.slice(C);return r(a,A)};return r([],e)}function A(e,t){return r=>!(0,n.some)((0,n.takeRight)(r,t),(t=>(0,n.isEqual)(t,e)))}function S(e){return t=>t.length>=e.length&&(0,n.every)((0,n.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function P(e){return t=>t<e}},26054:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(13022),s=r(10790);function o({children:e,className:t}){return(0,s.jsx)("div",{className:(0,n.A)("tiled-gallery__row",t),children:e})}},58711:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(66087),s=r(41314),o=r(89798),a=r(38448),i=r(26054),l=r(10790);function c({columns:e,renderedImages:t}){const r=Math.min(s.ZS,e),c=t.length%r;return(0,l.jsx)(a.A,{children:[...c?[(0,n.take)(t,c)]:[],...(0,n.chunk)((0,n.drop)(t,c),r)].map(((e,t)=>(0,l.jsx)(i.A,{className:`columns-${e.length}`,children:e.map(((e,t)=>(0,l.jsx)(o.A,{children:e},t)))},t)))})}},91162:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(94715),s=r(13022),o=r(90907),a=r(
__("Open image %1$d of %2$d in full-screen","jetpack"),t+1,o.length),k=u.A,{src:y,srcSet:x}=(0,c.A)(e,{layoutStyle:l});return(0,d.jsx)(k,{alt:e.alt,"aria-label":v,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,link:e.link,linkTo:i,customLink:e.customLink,onMoveBackward:a?void 0:p(t),onMoveForward:a?void 0:h(t),onRemove:a?void 0:m(t),onSelect:a?void 0:g(t),origUrl:e.url,setAttributes:a?void 0:b(t),showMovers:o.length>1,srcSet:x,url:y,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:u,roundedCorners:p,onResize:h,style:m,isSave:g,columnWidths:f}=this.props,b=(0,c.s)(u)?l.A:i.A,v=this.props.images.map(this.renderImage,this),k=u!==a.aQ?Math.min(p,a.WN):0;return(0,d.jsxs)("div",{style:m,className:(0,o.A)(r,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:n,columnWidths:g?f:void 0,images:s,layoutStyle:u,renderedImages:v,onResize:g?void 0:h}),t]})}}},80720:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var n=r(94715),s=r(13022),o=r(90907),a=r(35463),i=r(29520),l=r(1456),c=r(10790);function u({attributes:e}){const{imageFilter:t,images:r}=e;if(!r.length)return null;const{align:u,className:d,columns:p=(0,i.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=n.useBlockProps.save();return(0,c.jsxs)("div",{...f,className:(0,s.A)(f.className,d),children:[" ",(0,c.jsx)(l.A,{align:u,columns:p,imageFilter:t,images:r,isSave:!0,layoutStyle:(0,o.D)(a.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},69813:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},29520:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>k,EB:()=>b});var n=r(85985),s=r(94715),o=r(56427),a=r(43656),i=r(86087),l=r(27723),c=r(66087),u=r(90907),d=r(76585),p=r(35463),h=r(77530),m=r(10309),g=r(10790);const __=l.__,f=3;function b(e){return e.images.length>0?Math.min(f,e.images.length):f}const v=e=>{const t=(0,c.pick)(e,[["alt"],["id"],["link"]]);return t.url=(0,c.get)(e,["sizes","large","url"])||(0,c.get)(e,["media_details","sizes","large","source_url"])||e.url,t},k=(0,o.withNotices)((({attributes:e,isSelected:t,noticeOperations:r,noticeUI:l,setAttributes:f})=>{const{align:k,columns:y=b(e),imageFilter:x,images:j,linkTo:w,roundedCorners:_,columnWidths:C}=e,A=(0,u.D)(p.kc,e.className),S=(0,s.useBlockProps)(),[E,N]=(0,i.useState)(null),[T,P]=(0,i.useState)(void 0===C||0===C?.length),B=e=>{f({images:e,ids:e.map((({id:e})=>parseInt(e,10)))})},I=e=>{(0,a.mediaUpload)({allowedTypes:p.eN,filesList:e,onFileChange:e=>B((j||[]).concat(e.map(v))),onError:r.createErrorNotice}),P(!0)},M=e=>()=>{const t=(0,c.filter)(j,((t,r)=>e!==r));N(null),P(!0),B(t),f({columns:y?Math.min(t.length,y):y})},L=e=>()=>{E!==e&&N(e)},R=e=>{const t=e.map((e=>{const t=j.find((t=>parseInt(t.id,10)===parseInt(e.id,10)));return t?.customLink?{...v(e),customLink:t.customLink}:v(e)}));B(t),f({columns:y?Math.min(e.length,y):y}),P(!0)},D=(e,t)=>{const r=[...j];r.splice(t,1,j[e]),r.splice(e,1,j[t]),N(t),P(!0),B(r)},F=e=>()=>{e!==j.length-1&&D(e,e+1)},O=e=>()=>{0!==e&&D(e,e-1)},z=e=>{T&&f({columnWidths:e})},U=e=>I(e.target.files),H=e=>t=>{j[e]&&B([...j.slice(0,e),{...j[e],...t},...j.slice(e+1)])};let V;return(0,i.useEffect)((()=>{t||null===E||N(null)}),[t,E,N]),V=0===j.length?(0,g.jsx)(s.MediaPlaceholder,{icon:(0,n.sh)(d),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:R,accept:"image/*",allowedTypes:p.eN,multiple:!0,notices:l,onError:r.createErrorNotice}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.M,{layoutStyle:A,images:j,columns:y,selectedImage:E,setImageAttributes:H,onColumnsChange:e=>f({columns:e}),roundedCorners:_,onRoundedCornersChange:e=>f({roundedCorners:e}),linkTo:w,onLinkToChange:e=>f({linkTo:e})}),l,(0,g.jsxs)(m.A,{className:"tiled-gallery__wrapper",align:k,columns:y,imageFilter:x,images:j,layoutStyle:A,linkTo:w,onMoveBackward:O,onMoveForward:F,onRemoveImage:M,onSelectImage:L,onResize:z,roundedCorners:
__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),y=a?l.A:i.A,{src:x,srcSet:j}=(0,c.A)(e,{layoutStyle:d});return(0,p.jsx)(y,{alt:e.alt,"aria-label":k,columns:r,height:e.height,id:e.id,imageFilter:n,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:b===t,link:e.link,linkTo:u,customLink:e.customLink,onMoveBackward:a?void 0:h(t),onMoveForward:a?void 0:m(t),onRemove:a?void 0:g(t),onSelect:a?void 0:f(t),origUrl:e.url,setAttributes:a?void 0:v(t),showMovers:o.length>1,srcSet:j,url:x,width:e.width},t)}render(){const{align:e,children:t,className:r,columns:n,images:s,layoutStyle:i,roundedCorners:l,onResize:h,style:m,isSave:g,columnWidths:f}=this.props,b=(0,c.s)(i)?d.A:u.A,v=this.props.images.map(this.renderImage,this),k=i!==a.aQ?Math.min(l,a.WN):0;return(0,p.jsxs)("div",{style:m,className:(0,o.A)(r,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,p.jsx)(b,{align:e,columns:n,columnWidths:g?f:void 0,images:s,layoutStyle:i,renderedImages:v,onResize:g?void 0:h}),t]})}}},31238:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(86087),s=r(94107),o=r(98627),a=r(54359),i=r(43645),l=r(74176),c=r(18980),u=r(10790);class d extends n.Component{gallery=(0,n.createRef)();pendingRaf=null;ro=null;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()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:r}of e){const{width:e}=t,n=[];(0,c.S)(r).forEach((t=>{n.push((0,c.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(n)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(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,r){let n=0;return e.map((e=>e.map((e=>{const r=t.slice(n,n+e);return n+=e,r})))).map((e=>(0,c.r)(e,r)))}render(){const{align:e,columns:t,images:r,layoutStyle:s,renderedImages:c}=this.props,d=(0,l.mJ)(r),p="columns"===s?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=n.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,c,1e3)})();let m=0;return(0,u.jsx)(a.A,{galleryRef:this.gallery,children:p.map(((e,t)=>(0,u.jsx)(i.A,{children:e.map(((e,r)=>{const n=c.slice(m,m+e);return m+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[r],children:n},r)}))},t)))})}}},74176:(e,t,r)=>{"use strict";r.d(t,{FL:()=>a,VU:()=>C,mJ:()=>s});var n=r(66087);function s(e){return(0,n.map)(e,o)}function o({height:e,width:t}){return e&&t?t/e:1}function a(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const r=(0,n.sum)(e)/t,s=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,n.takeWhile)(o,(t=>{const n=a<=(e+1)*r;return n&&(a+=t),n})).length;s.push(t),o=(0,n.drop)(o,t)}return s.push(o.length),[s]}const i=A([2,1,2],5),l=S([E,E,N,E,E]),c=S([E,E,E,N,E,E,E]),u=A([3,1,3],5),d=S([N,E,E,N]),p=A([1,2,1],5),h=S([N,E,E,E]),m=A([1,3],3),g=S([E,E,E,N]),f=A([3,1],3),b=S([P(1.6),(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2))]),v=A([1,2],3),k=A([1,1,1,1,1],1),y=A([1,1,1,1],1),x=A([1,1,1],3),j=S([(0,n.overEvery)(T(.9),P(2)),(0,n.overEvery)(T(.9),P(2)),P(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const r=(e,s)=>{if(!s.length)return e;let o;o=s.length>15&&l(s)&&i(e)?[2,1,2]:s.length>15&&c(s)&&u(e)?[3,1,3]:5!==s.length&&d(s)&&p(e)?[1,2,1]:h(s)&&m(e)?[1,3]:g(s)&&f(e)?[3,1]:b(s)&&v(e)?[1,2]:t&&(5===s.length||10!==s.length&&s.length>6)&&k(e)&&(0,n.sum)((0,n.take)(s,5))<5?[1,1,1,1,1]:function(e,t){const r=(0,n.sum)((0,n.take)(t,4));return y(e)&&r<3.5&&t.length>5||r<7&&4===t.length}(e,s)?[1,1,1,1]:function(e,t,r){c
__("Display %s","jetpack"),e.label.toLowerCase()),checked:i[e.id]||!1,onChange:(r=e.id,e=>{const n={...i,[r]:e};if(Object.values(n).every((e=>!1===e)))return f(!0);l(n),t({postTypes:n}),f(!1)})},e.id);var r})),g&&(0,a.jsx)(n.Notice,{className:"jetpack-top-posts__error",status:"error",isDismissible:!1,children:__("At least one item must be selected.","jetpack")})]}),(0,a.jsxs)(n.PanelBody,{title:__("Metadata settings","jetpack"),children:[(0,a.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display date","jetpack"),checked:d,onChange:e=>t({displayDate:e})}),(0,a.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display author","jetpack"),checked:c,onChange:e=>t({displayAuthor:e})}),(0,a.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display context","jetpack"),checked:u,onChange:e=>t({displayContext:e})}),(0,a.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display thumbnail","jetpack"),checked:p,onChange:e=>t({displayThumbnail:e})})]})]})}function l({attributes:e,setAttributes:t}){const{layout:r}=e,s=[{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({layout:"grid"}),isActive:"grid"===r},{icon:"list-view",title:__("List view","jetpack"),onClick:()=>t({layout:"list"}),isActive:"list"===r}];return(0,a.jsx)(n.ToolbarGroup,{controls:s})}},96894:(e,t,r)=>{"use strict";r.d(t,{A:()=>m});var n=r(85985),s=r(1455),o=r.n(s),a=r(94715),i=r(86087),l=r(13022),c=r(9522),u=r(20600),d=r(8031),p=r(10790);function h(e){return(0,p.jsxs)("div",{className:"jetpack-top-posts-item",children:[e.displayThumbnail&&e.thumbnail&&(0,p.jsx)("a",{className:"jetpack-top-posts-thumbnail-link",children:(0,p.jsx)("img",{className:"jetpack-top-posts-thumbnail",src:e.thumbnail,alt:e.title,rel:"nofollow noopener noreferrer",target:"_blank"})}),e.displayThumbnail&&!e.thumbnail&&(0,p.jsx)("a",{className:"jetpack-top-posts-thumbnail-link",children:(0,p.jsx)("div",{className:"jetpack-top-posts-mock-thumbnail"})}),(0,p.jsx)("span",{className:"jetpack-top-posts-title",children:(0,p.jsx)("a",{children:e.title})}),e.displayDate&&(0,p.jsx)("span",{className:"jetpack-top-posts-date has-small-font-size",children:e.date}),e.displayAuthor&&(0,p.jsx)("span",{className:"jetpack-top-posts-author has-small-font-size",children:e.author}),e.displayContext&&e.context&&(0,p.jsx)("span",{className:"jetpack-top-posts-context has-small-font-size",children:(0,p.jsx)("a",{children:e.context[0].cat_name})})]})}const m=function({attributes:e,setAttributes:t}){const{isLoadingModules:r,isChangingStatus:s,isModuleActive:m,changeStatus:g}=(0,n.q7)("stats"),f=(0,a.useBlockProps)(),{className:b}=f,[v,k]=(0,i.useState)(),[y,x]=(0,i.useState)(),[j,w]=(0,i.useState)(),[_,C]=(0,i.useState)({}),{displayAuthor:A,displayContext:S,displayDate:E,displayThumbnail:N,layout:T,period:P,postsToShow:B,postTypes:I}=e;let M;return(0,i.useEffect)((()=>{o()({path:"/wpcom/v2/post-types"}).then((e=>{w(e),e.forEach((e=>{I&&I[e.id]&&C((t=>({...t,[e.id]:!0})))}))}))}),[I]),(0,i.useEffect)((()=>{m&&o()({path:`/wpcom/v2/top-posts?period=${P}`}).then((e=>{k(e)}))}),[P,m]),(0,i.useEffect)((()=>{const e=v;if(!e)return;const t=[];for(let r=0;t.length!==B&&(e[r]&&I[e[r].type]&&t.push((0,p.jsx)(h,{title:e[r].title,date:e[r].date,author:e[r].author,thumbnail:e[r].thumbnail,context:e[r].context,displayDate:E,displayAuthor:A,displayThumbnail:N,displayContext:S},"jetpack-top-posts-"+e[r].id)),e[r]);r++);x(t)}),[A,S,E,N,v,I,B,x]),M=m||r?y?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(a.InspectorControls,{children:(0,p.jsx)(u.O,{attributes:e,setAttributes:t,toggleAttributes:_,setToggleAttributes:C,postTypesData:j})}),(0,p.jsx)(a.BlockControls,{children:(0,p.jsx)(u.G,{attributes:e,setAttributes:t})}),(0,p.jsx)("div",{"data-item-count":y.length,children:(0,p.jsx)("div",{className:"jetpack-top-posts-wrapper",children:y})})]}):(0,p.jsx)(c.G,{}):(0,p.jsx)(d.k,{className:b,changeStatus:g,isLoading:s}),(0,p.jsx)("div",{...f,className:(0,l.A)(b,`is-${T}-layout`),children:M})}},99883:(e,t,r)=>{"use strict";var n=r(74997),s=r(94375),o=r(35075),a=r(96894);(0,s.M)(o,{edit:a.A,save:()=>nu
__("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:L,help:this.getAutoplayHelp,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Loop","jetpack"),/* translators: Tooltip describing the "loop" option for the VideoPress player */
__("Restarts the video when it reaches the end","jetpack")),onChange:this.toggleAttribute("loop"),checked:O,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:z,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Playback Controls","jetpack"),/* translators: Tooltip describing the "controls" option for the VideoPress player */
__("Display the video playback controls","jetpack")),onChange:this.toggleAttribute("controls"),checked:D,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Play Inline","jetpack"),/* translators: Tooltip describing the "playsinline" option for the VideoPress player */
__("Play the video inline instead of full-screen on mobile devices","jetpack")),onChange:this.toggleAttribute("playsinline"),checked:U,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.SelectControl,{label:this.renderControlLabelWithTooltip(__("Preload","jetpack"),/* translators: Tooltip describing the "preload" option for the VideoPress player */
__("Content to dowload before the video is played","jetpack")),value:V??"",onChange:e=>u({preload:e}),options:[{value:"auto",label:_x("Auto","VideoPress preload setting","jetpack")},{value:"metadata",label:_x("Metadata","VideoPress preload setting","jetpack")},{value:"none",label:_x("None","VideoPress preload setting","jetpack")}],help:this.getPreloadHelp(),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,A.jsx)(i.MediaUploadCheck,{children:(0,A.jsxs)(l.BaseControl,{className:"editor-video-poster-control",children:[(0,A.jsx)(l.BaseControl.VisualLabel,{children:__("Poster Image","jetpack")}),(0,A.jsx)(i.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:S,render:({open:e})=>(0,A.jsx)(l.Button,{variant:"secondary",onClick:e,ref:this.posterImageButton,"aria-describedby":Z,children:J?__("Replace image","jetpack",0):__("Select Poster Image","jetpack")})}),(0,A.jsx)("p",{id:Z,hidden:!0,children:J?(0,h.sprintf)(/* translators: Placeholder is an image URL. */
__("The current poster image url is %s","jetpack"),H??M):__("There is no poster image currently selected","jetpack")}),J&&(0,A.jsx)(l.Button,{onClick:this.onRemovePoster,variant:"link",isDestructive:!0,children:__("Remove Poster Image","jetpack")})]})}),(0,d.createInterpolateElement)(__("Send us your <a>VideoPress feedback</a>","jetpack"),{a:(0,A.jsx)(l.ExternalLink,{href:"https://automattic.survey.fm/videopress-feedback"})})]}),(0,A.jsx)(x.A,{attributes:t,setAttributes:u,useAverageColor:q,toggleAttribute:this.toggleAttribute}),(0,A.jsxs)(l.PanelBody,{title:__("Video File Settings","jetpack"),children:[(0,A.jsx)(l.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:_??"",disabled:f||y,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,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,A.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Allow download","jetpack"),/* translators: Tooltip describing the "allow download" option for the VideoPress player */
__("Display download option and allow viewers to download this video","jetpack")),onChange:this.onChangeAllowDownload,checked:T,disabled:f||B,__nextHasNoMarginBottom:!0}),(0,A.jsx)(l.SelectControl,{label:__("Video Privacy","jetpack"),help:this.getPrivacySettingHelp(P),onChange:this.onChangePrivacySetting,value:P??"",options:[{value:v.NF.SITE_DEFAULT,label:_x("Site Default","VideoPress privacy setting","jetpack")},{value:v.NF.PUBLIC,label:_x("Public","VideoPress privacy setting","jetpack")},{value:v.NF.PRIVATE,label:_x("Private","VideoPress privacy setting","jetpack")}],disabled:f||I,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]})]})]}),Y=e=>{this.setState({fileForUpload:e[0]})},Q=e=>{e&&e.url?(this.props.setAttributes({src:e.url,id:e.id,poster:e.image?.src!==e.icon?e.image?.src:void 0}),e.videopress_guid&&this.props.setAttributes({guid:e.videopress_guid})):u({src:void 0,id:void 0,poster:void 0})},X=()=>"videoPressUploadPoster"in window,ee=(0,p.escapeHTML)(g?(0,C.T3)(g.name):""),te=({mediaId:e,guid:t,src:r})=>{this.setState({title:this.state.title??ee,fileForUpload:null,isUploadComplete:!!e,isEditingWhileUploading:!!e&&this.state.isEditingWhileUploading,pendingVideoAttributes:e&&t&&r?{id:e,guid:t,src:r}:null})},re=e=>{this.setState({title:e})},ne=e=>{this.setState({videoFrameSelectedInMillis:e,videoPosterImageData:null})},se=()=>{const e=this.state.title;this.updateMetaApiCall({title:e},(()=>this.setState({isUpdatingTitle:!0,title:e})),(()=>this.setState({title:e})),(()=>this.setState({isUpdatingTitle:!1})))},oe=()=>ue({at_time:this.state.videoFrameSelectedInMillis,is_millisec:!0}),ae=()=>ue({poster_attachment_id:this.state.videoPosterImageData.id}),ie=e=>{e.generating?le():ce(e.poster)},le=()=>{setTimeout((()=>{(X()?window.videoPressGetPoster(F):o()({path:`/videos/${F}/poster`,apiNamespace:"rest/v1.1",global:!0,method:"GET"})).then((e=>ie(e)))}),2e3)},ce=e=>{e&&u({poster:e})},ue=e=>{if(X())return window.videoPressUploadPoster(F,e).then((e=>ie(e)));o()({path:`/videos/${F}/poster`,apiNamespace:"rest/v1.1",method:"POST",global:!0,data:e}).catch((e=>e))},de=()=>{const{title:e,videoFrameSelectedInMillis:t}=this.state;e&&se(),M?ae():null!=t&&oe()},pe=()=>{this.state.pendingVideoAttributes&&u(this.state.pendingVideoAttributes),this.setState({isEditingWhileUploading:!1,pendingVideoAttributes:null}),de()};if(null!=g&&g.name||this.state.isEditingWhileUploading){const e=this.state.title??ee;return(0,A.jsx)(E,{fileForUpload:g,filename:ee,uploadFinished:te,blockSettings:K,onDismissEditor:pe,isUploadComplete:this.state.isUploadComplete,onSelectPoster:this.onSelectPoster,onRemovePoster:this.onRemovePoster,onChangeTitle:re,title:e,videoPosterImageData:this.state.videoPosterImageData,onVideoFrameSelected:ne,onSave:de})}const he=f||n,me=m||s||!F,ge=me&&!s&&!he,fe=(0,A.jsxs)(d.Fragment,{children:[(0,A.jsx)("div",{className:s||he?"":"videopress-block-hide",children:(0,A.jsx)(k.A,{text:s?__("Uploading…","jetpack"):__("Generating preview…","jetpack",0)})}),(0,A.jsx)("div",{className:ge?"":"videopress-block-hide",children:(0,A.jsx)(e,{...this.props})})]});if(me)return c?(0,A.jsx)(b.f,{onFilesSelected:Y,onMediaItemSelected:Q,children:fe}):(0,A.jsx)(d.Fragment,{children:fe});const{html:be,scripts:ve}=a||{html:null,scripts:null},ke=he||!a;return(0,A.jsxs)(d.Fragment,{children:[K,(0,A.jsx)(N,{...this.props,hideOverlay:this.hideOverlay,html:be,scripts:ve,interactive:w,caption:R,shouldRenderLoadingBlock:ke})]})}}]),"withVideoPressEdit")},27156:(e,t,r)=>{"use strict";var n=r(90372),s=r(97999),o=r(85985),a=r(63162),i=r(94715),l=r(75994),c=r(74997),u=r(56427),d=r(29491),p=r(47143),h=r(43656),m=r(86087),g=r(52619),f=r(27723),b=r(66087),v=r(81837),k=r(59257),y=r(21440),x=r(54727),j=r(65390),w=r(77189),_=r(41560),C=r(47960),A=r(51983),S=r(7345),E=r(40932),N=r(10790);const __=f.__,T=(0,d.createHigherOrderComponent)((e=>t=>{const{name:r}=(0,i.useBlockEditContext)();return"core/video"!==r?(0,N.jsx)(e,{...t}):(0,N.jsxs)(e,{...t,disableDropZone:!0,className:"no-videopress-media-placeholder",children:[(0,N.jsx)(u.Button,{disabled:!0,className:"com
__("Paused (%s%%)","jetpack"),x):(0,o.sprintf)(/* translators: Placeholder is an upload progress percenatage number, from 0-100. */
__("Uploading (%s%%)","jetpack"),x)}),(0,c.jsx)("div",{className:"resumable-upload__file-size",children:w})]}),(0,c.jsx)("div",{className:"resumable-upload__actions",children:(0,c.jsx)(n.Button,{variant:"link",onClick:()=>{p&&(u?p.start():p.abort(),d(!u))},children:u?"Resume":"Pause"})})]})})}},80534:(e,t,r)=>{"use strict";r.d(t,{Q:()=>s,l:()=>a});var n=r(10781);const s=function(e){return new Promise((function(t,r){const n=e?{data:{key:e}}:{};wp.media.ajax("videopress-get-upload-jwt",{async:!0,...n}).done((function(e){t({token:e.upload_token,blogId:e.upload_blog_id,url:e.upload_action_url})})).fail((function(e){r(e)}))}))},o={},a=({onUploadUuidRetrieved:e,onError:t,onProgress:r,onSuccess:a})=>(i,l)=>{const c=new n._O(i,{onError:t,onProgress:r,endpoint:l.url,removeFingerprintOnSuccess:!0,withCredentials:!1,autoRetry:!0,overridePatchMethod:!1,chunkSize:1e7,allowedFileTypes:["video/*"],metadata:{filename:i.name,filetype:i.type},retryDelays:[0,1e3,3e3,5e3,1e4],onAfterResponse:function(t,r){if(r.getStatus()>=400)return;const n=r.getHeader("x-videopress-upload-guid"),s=r.getHeader("x-videopress-upload-media-id"),i=r.getHeader("x-videopress-upload-src-url");if(n&&s&&i)return void(a&&a({mediaId:Number(s),guid:n,src:i}));const l={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},c={};Object.keys(l).forEach((function(e){const t=r.getHeader(e);t&&(c[l[e]]=t)})),c.key&&c.token&&(o[c.key]=c.token),c.key&&e(c.key)},onBeforeRequest:function(e){const t=e._method;["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);for(const t of Object.keys(e._headers))e.setHeader(t,e._headers[t]);if("POST"===t){if(!!!l.token)throw"should never happen";e.setHeader("x-videopress-upload-token",l.token)}if(["OPTIONS","GET","HEAD","DELETE","PUT","PATCH"].indexOf(t)>=0){const r=new URL(e._url).pathname.split("/"),n=r[r.length-1];if(o[n])e.setHeader("x-videopress-upload-token",o[n]);else if("HEAD"===t)return s(n).then((t=>(o[n]=t.token,e.setHeader("x-videopress-upload-token",t.token),e)))}return Promise.resolve(e)}});return c.findPreviousUploads().then((function(e){e.length&&c.resumeFromPreviousUpload(e[0]),c.start()})),c}},41560:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(94715),s=r(29491),o=r(13022),a=r(17900),i=r(10790);const l=(0,s.createHigherOrderComponent)((e=>t=>{const{attributes:{autoplay:r,caption:s,controls:l,guid:c,loop:u,muted:d,playsinline:p,poster:h,preload:m,videoPressClassNames:g,className:f,align:b,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:x,maxWidth:j}={}}=t;if(!c)return e(t);const w=n.useBlockProps.save({className:(0,o.A)("wp-block-video",f,g,{[`align${b}`]:b})}),_=(0,a.e)(c,{autoplay:r,controls:l,loop:u,muted:d,playsinline:p,poster:h,preload:m,seekbarColor:v,seekbarPlayedColor:k,seekbarLoadingColor:y,useAverageColor:x});let C={};return j&&j.length>0&&"100%"!==j&&(C={maxWidth:j,margin:"auto"}),(0,i.jsxs)("figure",{...w,children:[(0,i.jsx)("div",{className:"wp-block-embed__wrapper",style:C,children:`\n${_}\n`}),!n.RichText.isEmpty(s)&&(0,i.jsx)(n.RichText.Content,{tagName:"figcaption",value:s})]})}),"withVideoPressSave")},57954:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(94715),s=r(56427),o=r(86087),a=r(27723),i=r(10790);const __=a.__;class l extends o.Component{constructor(){super(...arguments);const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}=this.props.attributes;this.state={seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:r}}handleChangeSeekbarColor=e=>{this.setState({seekbarColor:e})};handleChangeSeekbarLoadingColor=e=>{this.setState({seekbarLoadingColor:e})};handleChangeSeekbarPlayedColor=e=>{this.setState({seekbarPlayedColor:e})};saveColors=()=>{const{seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:r}=this.state,{setAttributes:n}=this.props;n({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:r})};render(){const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:
__("Delete %s","jetpack"),o.label),disabled:n===i,children:n===i?__("Deleting","jetpack"):__("Delete","jetpack",0)})})]},i))),(0,d.jsx)(a.MenuGroup,{label:__("Text tracks","jetpack"),className:"videopress-block-tracks-editor__track-list",children:o})}function y({track:e,guid:t,onChange:r,onClose:n,onCancel:s,trackExists:u}){const[g,f]=(0,l.useState)(),[v=!1,k]=(0,l.useState)(),{label:y="",srcLang:x="",kind:j=p}=e,w=e.tmpFile?e.tmpFile.name:"";if(!(0,i.useSelect)((e=>e(o.store).getSettings().mediaUpload),[]))return null;return(0,d.jsx)(a.NavigableMenu,{children:(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor",children:[(0,d.jsx)("span",{className:"videopress-block-tracks-editor__single-track-editor-label",children:__("Edit track","jetpack")}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file",children:[(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label",children:[(0,d.jsxs)("span",{children:[__("File","jetpack"),":"]}),""!==w&&(0,d.jsx)("span",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-label-name",children:(0,d.jsx)("strong",{children:w})}),(0,d.jsx)(o.MediaUploadCheck,{children:(0,d.jsx)(a.FormFileUpload,{onChange:t=>{const n=t.target.files;!n.length>0||(e.tmpFile=n[0],r(e))},accept:h,render:({openFileDialog:e})=>(0,d.jsx)(a.Button,{variant:"link",onClick:()=>{e()},children:""===w?__("Select track","jetpack"):__("Change track","jetpack",0)}),disabled:v})})]}),(0,d.jsx)("div",{className:"videopress-block-tracks-editor__single-track-editor-upload-file-help",children:/* translators: %s: The allowed file types to be uploaded as a video text track." */ /* translators: %s: The allowed file types to be uploaded as a video text track." */
(0,c.sprintf)(__("Allowed formats: %s","jetpack"),h)})]}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-label-language",children:[(0,d.jsx)(a.TextControl,{onChange:t=>r({...e,label:t}),label:__("Label","jetpack"),value:y,help:__("Title of track","jetpack"),disabled:v,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,d.jsx)(a.TextControl,{onChange:t=>r({...e,srcLang:t}),label:__("Source language","jetpack"),value:x,help:__("Language tag (en, fr, etc.)","jetpack"),disabled:v,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]}),(0,d.jsx)(a.SelectControl,{className:"videopress-block-tracks-editor__single-track-editor-kind-select",options:m,value:j,label:/* translators: %s: The kind of video text track e.g: "Subtitles, Captions" */
__("Kind","jetpack"),onChange:t=>{r({...e,kind:t})},disabled:v,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-buttons-container",children:[v?(0,d.jsx)(a.Spinner,{}):(0,d.jsx)(a.Button,{variant:"secondary",disabled:!e.tmpFile,onClick:()=>{f(null),""===y&&(e.label=__("English","jetpack")),""===x&&(e.srcLang="en"),void 0===e.kind&&(e.kind=p),u(e)?f(__("A track already exists for that language and kind.","jetpack")):(k(!0),b(e,t).then((()=>{r(e),f(null),n()})).catch((e=>{e.message&&f(e.message)})).finally((()=>{k(!1)})))},children:__("Save","jetpack")}),(0,d.jsx)(a.Button,{variant:"link",onClick:s,children:__("Close","jetpack")})]}),g&&(0,d.jsx)("div",{className:"videopress-block-tracks-editor__single-track-editor-error",children:/* translators: %s: An error message returned after a failed video track file upload." */ /* translators: %s: An error message returned after a failed video track file upload." */
(0,c.sprintf)(__("Error: %s","jetpack"),g)})]})})}function x({tracks:e=[],onChange:t,guid:r}){const[n,s]=(0,l.useState)(null);return(0,d.jsx)(a.Dropdown,{contentClassName:"videopress-block-tracks-editor",renderToggle:({isOpen:e,onToggle:t})=>(0,d.jsx)(a.ToolbarButton,{label:__("Text tracks","jetpack"),showTooltip:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:t,icon:g}),renderContent:()=>null!==n?(0,d.jsx)(y,{track:e[n],guid:r,onChange:r=>{const s=[...e];s[n]=r,t(s)},onClose:()=>s(null),onCancel:()=>{t(e.filter(((e,t)=>t!==n))),s(null)},trackExists:t=>-1!==e.filter(((e,t)=>t!==n)).findIndex((e=>e.kind===t.kind&&e.srcLang===t.srcLang)),__next40pxDefaultSize:!0}):(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(a.NavigableMenu,{children:[(0,d.jsx)(k,{tracks:e,onChange:t,guid:r}),(0,d.jsx)(a.MenuGroup,{className:"videopress-block-tracks-editor__add-tracks-container",label:__("Add tracks","jetpack"),children:(0,d.jsx)(a.MenuItem,{icon:u.A,onClick:()=>{(()=>{const r=e.length,n=[...e];n[r]||(n[r]={}),n[r]={...e[r]},t(n),s(r)})()},children:__("Upload track","jetpack")})})]})})})}},22857:(e,t,r)=>{"use strict";r.d(t,{d:()=>m});var n=r(62410),s=r(94715),o=r(56427),a=r(86087),i=r(27723),l=r(51113),c=r(13022),u=r(10790);const __=i.__,d=["image"],p=e=>{const{videoPosterImageUrl:t}=e;return(0,u.jsx)("div",{className:"resumable-upload__editor-thumb-placeholder",children:t?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("img",{src:t,alt:"Poster"}),(0,u.jsx)(l.A,{className:"uploading-editor__play-icon",icon:n.ud})]}):(0,u.jsx)("span",{children:"No Poster Selected"})})},h=e=>{const{onSelectPoster:t,onRemovePoster:r}=e;return(0,u.jsxs)(o.BaseControl,{className:(0,c.A)(e.className,"editor-video-poster-control"),children:[(0,u.jsx)(p,{...e}),(0,u.jsx)(s.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:t,allowedTypes:d,render:({open:e})=>(0,u.jsxs)("div",{className:"poster-selector__buttons",children:[(0,u.jsx)(o.Button,{onClick:r,variant:"link",isDestructive:!0,children:__("Remove Poster Image","jetpack")}),(0,u.jsx)(o.Button,{variant:"secondary",onClick:e,children:__("Select Poster Image","jetpack")})]})})]})},m=e=>{const{file:t,onSelectPoster:r,onRemovePoster:i,videoPosterImageData:c,title:p,onChangeTitle:m,onVideoFrameSelected:g}=e,[f,b]=(0,a.useState)(0),[v,k]=(0,a.useState)(!0),y=(0,a.useRef)(null),x=(0,a.useRef)(null),j=()=>{k(!1)};(0,a.useEffect)((()=>{null!==t&&y&&(y.current.src=URL.createObjectURL(t))}),[t,y]);const w={};return c&&(w.display="none"),(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"uploading-editor",children:[(0,u.jsx)("div",{className:"uploading-editor__summary"}),(0,u.jsxs)("div",{className:"uploading-editor__fields",children:[(0,u.jsx)(o.TextControl,{label:__("Video title","jetpack"),className:"uploading-editor__title",onChange:m,value:p,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,u.jsx)("div",{className:"uploading-editor__content",children:(0,u.jsxs)(o.BaseControl,{__nextHasNoMarginBottom:!0,children:[(0,u.jsx)(o.BaseControl.VisualLabel,{children:__("Video poster (optional)","jetpack")}),v?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"uploading-editor__video-container",children:[(0,u.jsxs)("div",{className:"uploading-editor__video-poster-wrapper",children:[c&&(0,u.jsx)(h,{onSelectPoster:r,onRemovePoster:i,videoPosterImageUrl:c.url}),(0,u.jsx)("video",{ref:y,muted:!0,className:"uploading-editor__video",onDurationChange:e=>{const t=e.target.duration;b(t),y.current&&(y.current.currentTime=t/2)},onError:j,onLoadedMetadata:e=>{e.target.videoHeight||j()},style:w})]}),!c&&(0,u.jsx)(l.A,{className:"uploading-editor__play-icon",icon:n.ud})]}),(0,u.jsx)("span",{style:w,children:(0,u.jsx)(o.RangeControl,{className:"uploading-editor__range",min:"0",step:"0.1",max:f,showTooltip:!1,withInputField:!1,onChange:e=>{g(1e3*e),y.current&&(y.current.currentTime=e)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,u.jsx)("span",{className:"uploading-editor__scrubber-help",style:w,children:(0,a.createInterpolateElement)(__("This is how the video will look. Use the slider to ch
c=__("Upgrade to %s to use this premium block","jetpack"),u=(__("Upgrade your plan to use this premium block","jetpack"),_x("Upgrade","Call to action to buy a new plan","jetpack")),d=({onRedirect:e,align:t,className:r,title:d=l,description:p=null,buttonText:h=u,visible:m=!0,requiredPlan:g,context:f})=>{const[b,v,k]=(0,n._6)(g,e),y=(0,o.useSelect)((e=>{if(p)return p;const t=e("wordpress-com/plans"),r=t&&t.getPlan(g);return r?(0,a.sprintf)(c,r.product_name_short):null}),[p,g]);return y&&(0,i.jsx)(s.cb,{align:t,buttonText:h,checkoutUrl:b,className:r,context:f,description:y,goToCheckoutPage:v,isRedirecting:k,title:d,visible:m})}},23887:(e,t,r)=>{"use strict";r.d(t,{W:()=>n,r:()=>s});const n=({plan:e,blockName:t,context:r,tracks:n})=>{n.recordEvent("jetpack_editor_block_upgrade_click",{plan:e,block:t,context:r})},s=({plan:e,blockName:t,context:r,tracks:n})=>{n.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:e,block:t,context:r})}},3120:(e,t,r)=>{"use strict";r.d(t,{e:()=>h});var n=r(85985),s=r(94715),o=r(29491),a=r(47143),i=r(86087),l=r(95104),c=r(26845),u=r(23887),d=r(10790);const p=(0,o.createHigherOrderComponent)((e=>t=>{const{name:r,clientId:o,isSelected:p,attributes:h,setAttributes:m}=t||{},g=(0,n.tu)(r);if(!g)return(0,d.jsx)(e,{...t});const f=(0,n.sH)(r),b=(0,n.GT)(r),[v,k]=(0,i.useState)(!f),[y,x]=(0,i.useState)(!1),j="editor-canvas",w=(0,a.useSelect)((e=>e("core/block-editor").hasSelectedInnerBlock(o,!0)),[o]),{hasParentBanner:_}=(0,i.useContext)(l.j)||{},C=(p||w)&&v&&!_,{tracks:A}=(0,n.st)(),S=(0,i.useMemo)((()=>({plan:g,blockName:r,context:j,tracks:A})),[g,r,A]);(0,i.useEffect)((()=>{C&&x(!0)}),[C,x]),(0,i.useEffect)((()=>{!y&&C&&(0,u.r)(S)}),[y,S,C]),(0,i.useEffect)((()=>k(!f)),[h,k,f]),(0,i.useEffect)((()=>{m({shouldDisplayFrontendBanner:!_})}),[m,_]);const E=(0,s.useBlockProps)();return(0,d.jsx)(l.b,{onBannerVisibilityChange:k,hasParentBanner:C,children:(0,d.jsxs)("div",{ref:E.ref,style:{maxWidth:"unset"},children:[(0,d.jsx)(c.Ay,{className:`is-${r.replace(/\//,"-")}-paid-block`,title:null,align:h?.align,visible:C,description:b?.description,requiredPlan:g,context:j,onRedirect:()=>(0,u.W)(S)}),(0,d.jsx)(e,{...t})]})})}),"withUpgradeBanner");function h(e,t){return(0,n.tu)(t)?{...e,edit:p(e.edit)}:e}},76047:(e,t,r)=>{"use strict";r.d(t,{k6:()=>o,s6:()=>n,wb:()=>s});const n="jetpack-sidebar",s="document-settings",o="pre-publish"},23162:(e,t,r)=>{"use strict";r.d(t,{A:()=>L});var n=r(96865),s=r(85985),o=r(82201),a=r(56427),i=r(3582),l=r(47143),c=r(14309),u=r(43656),d=r(27723),p=r(10067),h=r.n(p),m=r(44732),g=r(48499),f=r(90062),b=r(50976),v=r(81932),k=r(37215),y=r(76318),x=r(27970),j=r(76047),w=r(45606),_=r(10790);const __=d.__,C=u.PluginPrePublishPanel||c.PluginPrePublishPanel,A=u.PluginDocumentSettingPanel||c.PluginDocumentSettingPanel,S=C,E=A,N=h()("jetpack-ai-assistant-plugin:sidebar"),T=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-usage-panel"]?.available||!1,P=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-featured-image-generator"]?.available||!1,B=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-title-optimization"]?.available||!1,I=(0,g.C)("ai-title-optimization-keywords-support"),M=({placement:e,requireUpgrade:t,upgradeType:r,showUsagePanel:s,showFairUsageNotice:o})=>{const{checkoutUrl:i}=(0,n.ON)(),{productPageUrl:c}=(0,m.A)(),d=(0,v.Ul)(),p=(0,l.useSelect)((e=>e(u.store).isEditedPostEmpty()),[]),h=__("Optimize Publishing","jetpack"),g=__("Optimize Title","jetpack"),f=I?g:h;return(0,_.jsxs)(_.Fragment,{children:[o&&(0,_.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__feature-section",children:(0,_.jsx)(a.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,_.jsx)(n.QA,{variant:"muted"})})}),p&&(0,_.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__warning-content",children:(0,_.jsx)(a.Notice,{isDismissible:!1,status:"warning",children:__("The following features require content to work.","jetpack")})}),(0,v.GB)()&&d&&(0,_.jsx)(a.PanelRow,{children:(0,_.jsxs)(a.BaseControl,{__nextHasNoMarginBottom:!0,children:[(0,_.jsx)(a.BaseControl.VisualL
__("You have reached the limit of <strong>%d requests</strong>. <button>Upgrade to continue generating feedback.</button>","jetpack"),p),g=(0,o.createInterpolateElement)(__("You've reached the Jetpack AI rate limit. <strong>Please reach out to your VIP account team.</strong>","jetpack"),{strong:(0,i.jsx)("strong",{})}),f=(0,o.createInterpolateElement)(20===p?h:m,{strong:(0,i.jsx)("strong",{}),button:(0,i.jsx)(s.Button,{variant:"link",onClick:d,href:c,target:"_blank"})});return(0,i.jsx)("p",{children:"vip"===t?g:f})}},1661:(e,t,r)=>{"use strict";r.d(t,{S:()=>n});const n="jetpack-ai-breve"},27180:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var n=r(85985),s=r(56427),o=r(29491),a=r(47143),i=r(27723),l=r(51113),c=r(10748),u=r(51609),d=r(29526),p=r(80555),h=r(81932),m=r(36205),g=r(10790);const __=i.__,f=(0,o.compose)((0,a.withSelect)((e=>({blocks:e("core/block-editor").getBlocks(),disabledFeatures:e("jetpack/ai-breve").getDisabledFeatures()}))))((({blocks:e,disabledFeatures:t})=>{const[r,i]=(0,u.useState)(null),{toggleFeature:f,toggleProofread:b,setPopoverHover:v,setHighlightHover:k,setPopoverAnchor:y}=(0,a.useDispatch)("jetpack/ai-breve"),{tracks:x}=(0,n.st)(),j=(0,a.useSelect)((e=>e("jetpack/ai-breve").isProofreadEnabled()),[]),w=(0,u.useCallback)((()=>{if(!j)return;const t=(0,m.M)(e),r=(0,p.A)(t),n="number"==typeof r?r.toFixed(2):null;i(n)}),[e,j]),_=(0,o.useDebounce)(w,250),C=(0,u.useCallback)((e=>t=>{x.recordEvent("jetpack_ai_breve_feature_toggle",{type:e,on:t}),f(e,t)}),[x,f]),A=(0,u.useCallback)((()=>{x.recordEvent("jetpack_ai_breve_toggle",{on:!j}),b()}),[x,j,b]);return(0,u.useEffect)((()=>{_()}),[_]),(e=>{const[t,r]=(0,u.useState)(!1);t||(e(),r(!0))})(w),(0,u.useEffect)((()=>{v(!1),k(!1),y({target:null,virtual:null})}),[v,k,y,j,t]),(0,g.jsxs)("div",{className:"jetpack-ai-proofread",children:[(0,g.jsx)(s.PanelRow,{children:(0,g.jsx)(s.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,g.jsx)(s.ToggleControl,{checked:j,onChange:A,label:__("Show issues & suggestions","jetpack"),__nextHasNoMarginBottom:!0})})}),j&&(0,g.jsx)(s.PanelRow,{children:(0,g.jsxs)(s.Card,{size:"small",className:"jetpack-ai__write-brief-card",children:[(0,g.jsx)(s.CardBody,{size:"small",children:(0,g.jsx)(s.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,g.jsx)("div",{className:"feature-checkboxes-container",children:d.A.map((e=>(0,h.Ur)(e.config.name)&&(0,g.jsx)(s.CheckboxControl,{className:j?"":"is-disabled",disabled:!j,"data-breve-type":e.config.name,label:e.config.title,checked:!t.includes(e.config.name),onChange:C(e.config.name),__nextHasNoMarginBottom:!0},e.config.name)))})})}),(0,g.jsx)(s.CardFooter,{size:"small",className:"jetpack-ai-proofread__grade-level-container",children:null===r?(0,g.jsx)("p",{className:"jetpack-ai-proofread__help-text",children:__("Write to see your grade level.","jetpack")}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"jetpack-ai-proofread__grade-label",children:[r," ",__("Reading grade score","jetpack")]}),(0,g.jsx)(s.Tooltip,{text:__("To make it easy to read, aim for level 812","jetpack"),children:(0,g.jsx)(l.A,{icon:c.A,size:20})})]})})]})})]})}))},64949:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>c,jp:()=>i,zz:()=>a});var n=r(27723),s=r(53817),o=r(80811);const __=n.__,a=o.A,i={name:"complex-words",title:__("Complex words","jetpack"),tagName:"span",className:"jetpack-ai-breve__has-proofread-highlight--complex-words",defaultEnabled:!0},l=new RegExp(`\\b(${Object.keys(o.A).map(s.N).join("|")})\\b`,"gi");function c(e){const t=e.matchAll(l),r=[];for(const e of t){const t=e[0].trim();r.push({text:t,suggestion:o.A[t],startIndex:e.index,endIndex:e.index+t.length})}return r}},80811:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n={"a and/or b":"a or b or both","able to":"can",accompany:"go with",accomplish:"do",accorded:"given",accordingly:"so",accrue:"add",accurate:"correct",activate:"turn on",additional:"more",address:"discuss","adjacent to":"next to",administer:"manage",advantageous:"helpful","adversely impact on":"hurt",advise:"recommend","afford an opportunity":"allow",aircraft:"plane",allocate:"divide
2025-04-25 12:30:07 +02:00
// Translators: %1$d is the number of images with alt text, %2$d is the total number of images.
2025-07-27 19:58:08 +02:00
__("Alt text added to %1$d of %2$d images","jetpack"),t.length,e.length)):v(__("Alt text added to all images","jetpack")):v("")}),[]);const x=(0,i.useMemo)((()=>({"seo-title":m?null:k,"seo-meta-description":g?null:y,"images-alt-text":f?null:b})),[g,b,f,y,k,m]),j=(0,i.useMemo)((()=>Object.values(x).every((e=>!e))),[x]),w=__("Want to fine-tune this metadata further?","jetpack"),_=__("No metadata found. Add it to improve search engine visibility.","jetpack");return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(s.PanelRow,{className:"jetpack-seo-sidebar__feature-section jetpack-seo-sidebar__feature-section--toggle",children:[(0,h.jsx)(s.BaseControl,{__nextHasNoMarginBottom:!0,className:"ai-seo-enhancer-toggle",help:j?_:w,label:__("Metadata","jetpack"),id:"jetpack-seo-enhancer-generated-metadata",children:!j&&d.G.map((e=>x[e]?(0,h.jsxs)("div",{className:"jetpack-seo-enhancer-summary-feature",children:[(0,h.jsx)("div",{className:"jetpack-seo-enhancer-summary-feature__icon-container",children:(0,h.jsx)(c.A,{className:"jetpack-seo-enhancer-summary-feature__icon",icon:u.A})}),(0,h.jsx)(s.BaseControl,{className:"jetpack-seo-enhancer-summary-feature__control",label:d.z[e],id:e,help:x[e],__nextHasNoMarginBottom:!0,children:null},e)]},e):null))}),(0,h.jsx)(s.Button,{variant:"secondary",__next40pxDefaultSize:!0,className:"jetpack-seo-enhancer-summary__edit-button",onClick:e,children:__("Edit SEO metadata","jetpack")})]})})}},6363:(e,t,r)=>{"use strict";function n(e){return{type:"SET_BUSY",isBusy:e}}function s(e){return{type:"SET_TITLE_BUSY",isBusy:e}}function o(e){return{type:"SET_DESCRIPTION_BUSY",isBusy:e}}function a(e){return{type:"SET_IS_TOGGLING_AUTO_ENHANCE",isToggling:e}}function i(e){return{type:"SET_IS_AUTO_ENHANCE_ENABLED",isEnabled:e}}function l(e,t){return{type:"SET_IMAGE_BUSY",clientId:e,isBusy:t}}function c(e,t){return{type:"SET_IMAGE_FAILED",clientId:e,failed:t}}function u(e,t){return{type:"SET_FEATURE_ENABLED",feature:e,enabled:t}}r.r(t),r.d(t,{setBusy:()=>n,setDescriptionBusy:()=>o,setFeatureEnabled:()=>u,setImageBusy:()=>l,setImageFailed:()=>c,setIsAutoEnhanceEnabled:()=>i,setIsTogglingAutoEnhance:()=>a,setTitleBusy:()=>s})},16204:(e,t,r)=>{"use strict";r.d(t,{M:()=>d});var n=r(97999),s=r(85985),o=r(47143),a=r(4167),i=r(6363),l=r(49824),c=r(16886);let u=!1;try{if(!(0,n.isSimpleSite)()){const e=(0,o.select)(s.Ft).getJetpackModules()["seo-tools"],t=e&&"ai_seo_enhancer_enabled"in e.options;u=t&&e.options?.ai_seo_enhancer_enabled?.current_value}}catch{u=!1}const d=(0,o.createReduxStore)("jetpack/seo-enhancer",{reducer:l.A,selectors:c,actions:i,initialState:function(){const e=a.G.reduce(((e,t)=>(e[t]=!0,e)),{});try{const t=localStorage.getItem("jetpack-seo-enhancer-features"),r=t?JSON.parse(t):{};for(const t of a.G)e[t]=r[t]??!0}catch{}return{isBusy:!1,isTogglingAutoEnhance:!1,isAutoEnhanceEnabled:u,busyImages:{},failedImages:{},features:e}}()});(0,o.register)(d)},49824:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});const n=function(e,t){let r=e;switch(t.type){case"SET_BUSY":return{...e,isBusy:t.isBusy};case"SET_TITLE_BUSY":return{...e,isTitleBusy:t.isBusy};case"SET_DESCRIPTION_BUSY":return{...e,isDescriptionBusy:t.isBusy};case"SET_IS_TOGGLING_AUTO_ENHANCE":return{...e,isTogglingAutoEnhance:t.isToggling};case"SET_IS_AUTO_ENHANCE_ENABLED":return{...e,isAutoEnhanceEnabled:t.isEnabled};case"SET_IMAGE_BUSY":return{...e,busyImages:{...e.busyImages,[t.clientId]:t.isBusy}};case"SET_IMAGE_FAILED":return{...e,failedImages:{...e.failedImages,[t.clientId]:t.failed}};case"SET_FEATURE_ENABLED":return r={...e,features:{...e.features,[t.feature]:t.enabled}},n=r.features,localStorage.setItem("jetpack-seo-enhancer-features",JSON.stringify(n)),r;default:return e}var n}},16886:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getEnabledFeatures:()=>m,hasImageFailed:()=>d,isAnyImageBusy:()=>u,isAutoEnhanceEnabled:()=>l,isBusy:()=>s,isDescriptionBusy:()=>a,isImageAltTextFeatureEnabled:()=>g,isImageBusy:()=>c,isTitleBusy:()=>o,isTogglingAutoEnhance:()=>i});var n=r(47143);function s(e){return e.isBusy}function o(e){return e.isTitleBusy}function a(e){return e.isDescrip
2023-12-07 09:44:11 +01:00
// translators: %1$d: number of days until the next usage count reset
2025-07-27 19:58:08 +02:00
__("Requests will reset to <strong>%1$d</strong> on %2$s.","jetpack"),l,d),{strong:(0,c.jsx)("strong",{})}));const b=r/l,v=(0,c.jsxs)(c.Fragment,{children:[t===s.Ti&&(0,c.jsx)("p",{children:__("Unlimited requests.","jetpack")}),(t===s._X||t===s.ds)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"jetpack-ai-usage-panel__available-requests",children:f}),(0,c.jsx)(u,{usage:b})]})]}),k=(0,c.jsx)(n.A,{height:100,className:"jetpack-ai-usage-panel__loading-placeholder"}),y=(0,c.jsxs)(c.Fragment,{children:[!p&&g.length?g.join(" ").concat(" "):null,!p&&m]});return(0,c.jsxs)(o.BaseControl,{__nextHasNoMarginBottom:!0,help:y,children:[(0,c.jsx)(o.BaseControl.VisualLabel,{children:__("Available Requests","jetpack")}),!p&&v,p&&k]})}},27970:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(96865),s=r(3924),o=r(97999),a=r(85985),i=r(56427),l=r(38443),c=r(86087),u=r(27723),d=(r(51609),r(75956)),p=r(93471),h=r(10790);const __=u.__,m=e=>e?(0,l.gmdateI18n)("F j",e):null,g=(e,t)=>e===a._X?__("Upgrade","jetpack"):t?(0,u.sprintf)(
2023-12-07 09:44:11 +01:00
// translators: %1$d: an integer, the number of requests to upgrade to on the next tier
2025-07-27 19:58:08 +02:00
__("Get %1$d requests","jetpack"),t):__("Get more requests","jetpack"),f=()=>{const e=(0,s.A)("jetpack-ai-tiers-more-requests-contact"),{autosaveAndRedirect:t,isRedirecting:r}=(0,a.ZR)(e);return{contactUsURL:e,autosaveAndRedirectContactUs:t,isRedirectingContactUs:r}};function b({isOverLimit:e,requestsCount:t,requestsLimit:r,nextStart:n,planType:s,loading:o,canUpgrade:l,showContactUsCallToAction:c,nextLimit:u,contactUsURL:d,handleContactUsClick:f,checkoutUrl:b,handleUpgradeClick:v}){const k=g(s,u),y=m(n);return(0,h.jsx)("div",{className:"jetpack-ai-usage-panel",children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(p.A,{isOverLimit:e,requestsCount:t,requestsLimit:r,nextResetDate:y,planType:s,loading:o}),!o&&(s===a._X||s===a.ds)&&l&&(0,h.jsxs)("div",{className:"jetpack-ai-usage-panel-upgrade-button",children:[c&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("p",{children:__("Need more requests?","jetpack")}),(0,h.jsx)(i.Button,{target:"_blank",variant:"primary",label:__("Contact us for more requests","jetpack"),href:d,onClick:f,children:__("Contact Us","jetpack")})]}),!c&&(0,h.jsx)(i.Button,{target:"_blank",variant:"primary",label:__("Upgrade your Jetpack AI plan","jetpack"),href:b,onClick:v,children:k})]})]})})}function v({placement:e=null}){const{checkoutUrl:t}=(0,n.ON)(),{contactUsURL:r}=f(),{tracks:s}=(0,d.A)(),i=(0,a.CP)(),{requestsCount:l,requestsLimit:u,isOverLimit:p,usagePeriod:m,currentTier:g,nextTier:v,loading:k}=(0,n.yM)(),y=(0,a.Bd)(g),x=(0,c.useCallback)((()=>{s.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:g?.slug,requests_count:l,...e?{placement:e}:{}})}),[s,g,l,e]),j=(0,c.useCallback)((()=>{s.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:g?.slug,requests_count:l,...e?{placement:e}:{}})}),[s,g,l,e]),w=(0,o.isWpcomPlatformSite)()&&y===a.ds&&!v;return(0,h.jsx)(b,{isOverLimit:p,requestsCount:l,requestsLimit:u,nextStart:m?.nextStart,nextLimit:v?.limit,planType:y,loading:k,canUpgrade:i,showContactUsCallToAction:w,contactUsURL:r,handleContactUsClick:j,checkoutUrl:t,handleUpgradeClick:x})}},56199:(e,t,r)=>{"use strict";r.d(t,{k:()=>n});const n="block_settings_sidebar"},88797:(e,t,r)=>{"use strict";var n=r(85985),s=r(23806);(0,n.vp)(s.U,s.W)},23806:(e,t,r)=>{"use strict";r.d(t,{U:()=>s,W:()=>o});var n=r(23162);const s="ai-assistant-plugin",o={render:n.A}},1176:(e,t,r)=>{"use strict";r.d(t,{N:()=>d});var n=r(96865),s=r(56427),o=r(27723),a=r(51609),i=r.n(a),l=r(2162),c=r(62402),u=r(10790);const __=o.__;function d({minWords:e=10,maxWords:t=100,disabled:r,words:o,onWordsNumberChange:a,language:d,onLanguageChange:p,tone:h,onToneChange:m}){const[g,f]=i().useState(!1);const b=d?.split(" ")[0],v=n.so[b]?.label||__("Language","jetpack"),k=n.oZ[h]?.label||__("Tone","jetpack");return(0,u.jsxs)("div",{className:"jetpack-ai-generate-excerpt-control",children:[(0,u.jsxs)(s.BaseControl,{className:"jetpack-ai-generate-excerpt-control__header",__nextHasNoMarginBottom:!0,children:[(0,u.jsx)(s.BaseControl.VisualLabel,{children:__("Settings","jetpack")}),(0,u.jsx)(s.Button,{label:__("Advanced AI options","jetpack"),icon:n.cj,onClick:function(){f((e=>!e))},"aria-pressed":g,isSmall:!0})]}),g&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(l.HU,{disabled:r,onChange:p,value:d,label:v}),(0,u.jsx)(c.hN,{disabled:r,label:k,value:h,onChange:m})]}),(0,u.jsx)(s.RangeControl,{label:__("Desired length","jetpack"),value:o,onChange:a,min:e,max:t,help:__("Sets the desired length in words for the auto-generated excerpt. The final count may vary due to how AI works.","jetpack"),showTooltip:!1,disabled:r,__next40pxDefaultSize:!0})]})}},25101:(e,t,r)=>{"use strict";var n=r(85985),s=r(47143),o=r(43656),a=r(52619),i=r(10067),l=r.n(i),c=r(54681),u=r(10821),d=r(33792);const p=l()("jetpack-ai-content-lens:registration"),h=window?.Jetpack_Editor_Initial_State?.available_blocks["ai-content-lens"];h?.available&&((0,a.addFilter)("blocks.registerBlockType","jetpack/ai-content-lens-features",(function(e,t){return t!==c.name?e:(0,u.Bi)()?((0,n.vp)(d.s,d.$),p("Registered AI Excerpt plugin"),(0,(0,s.dispatch)(o.store).removeEditorPanel)("post-excerpt"
2023-12-07 09:44:11 +01:00
// Translators: %1$s is the number of words in the excerpt.
2025-07-27 19:58:08 +02:00
_n("%1$s word","%1$s words",L,"jetpack"),L),D="requesting"===N||"suggesting"===N||"done"===N&&!y,F="requesting"===N||"suggesting"===N,O=F||"done"===N;const{requireUpgrade:z,isOverLimit:U}=(0,n.yM)();return(0,g.jsxs)("div",{className:"jetpack-ai-post-excerpt",children:[(0,g.jsx)(i.TextareaControl,{__nextHasNoMarginBottom:!0,label:__("Write an excerpt (optional)","jetpack"),onChange:e=>h({excerpt:e}),help:L?R:null,value:M,disabled:O}),(0,s.isWpcomPlatformSite)()?(0,g.jsx)(a.k4,{supportLink:__("https://wordpress.com/support/excerpts/","jetpack"),supportPostId:1569,children:__("Learn more about manual excerpts","jetpack")}):(0,g.jsx)(i.ExternalLink,{href:__("https://jetpack.com/support/create-better-post-excerpts-with-ai/","jetpack"),children:__("Learn more about manual excerpts","jetpack")}),(0,g.jsxs)("div",{className:"jetpack-generated-excerpt__ai-container",children:[T?.code&&"error_quota_exceeded"!==T.code&&(0,g.jsx)(i.Notice,{status:T.severity,isDismissible:!1,className:"jetpack-ai-assistant__error",children:T.message}),U&&(0,g.jsx)(n.Hb,{placement:"excerpt-panel"}),(0,g.jsx)(m.N,{words:v,onWordsNumberChange:e=>{k(e),x(!0)},language:j,onLanguageChange:e=>{w(e),x(!0)},tone:_,onToneChange:e=>{C(e),x(!0)},disabled:F||z}),(0,g.jsx)(i.BaseControl,{help:I?.length?null:__("Add content to generate an excerpt.","jetpack"),__nextHasNoMarginBottom:!0,children:(0,g.jsxs)("div",{className:"jetpack-generated-excerpt__generate-buttons-container",children:[(0,g.jsx)(i.Button,{onClick:function(){h({excerpt:e}),r.recordEvent("jetpack_ai_assistant_block_discard",{feature:"jetpack-ai-content-lens",model:B}),P()},variant:"secondary",isDestructive:!0,disabled:"done"!==N||z,children:__("Discard","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){h({excerpt:E}),r.recordEvent("jetpack_ai_assistant_block_accept",{feature:"jetpack-ai-content-lens",model:B}),P()},variant:"secondary",disabled:"done"!==N||z,children:__("Accept","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){x(!1),P();const e=[{role:"jetpack-ai",context:{type:"ai-content-lens",contentType:"post-excerpt",postId:t,words:v,language:j,tone:_,content:`Post content:\n${I}\n`}}];f(),A(e,{feature:"jetpack-ai-content-lens",model:B})},variant:"secondary",isBusy:F,disabled:D||z||!I,children:__("Generate","jetpack")})]})})]})]})}const b=()=>{if((0,l.useSelect)((e=>{const{getCurrentPostType:t}=e(c.store),r=t();return"wp_template"===r||"wp_template_part"===r||"wp_block"===r}),[]))return null;const e=e=>{const t=c.PluginDocumentSettingPanel;return(0,g.jsx)(t,{...e})};return(0,g.jsx)(c.PostTypeSupportCheck,{supportKeys:"excerpt",children:(0,g.jsx)(e,{className:(0,h.m)("ai-content-lens")?"is-beta-extension inset-shadow":"",name:"ai-content-lens-plugin",title:__("Excerpt","jetpack"),children:(0,g.jsx)(f,{})})})}},33792:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,s:()=>s});var n=r(33251);const s="ai-content-lens",o={render:n.g}},31009:(e,t,r)=>{"use strict";r.d(t,{m:()=>l});var n=r(3924),s=r(85985),o=r(56427),a=r(27723),i=r(10790);const __=a.__,l=({changeStatus:e,isLoading:t,isModuleActive:r})=>{const{tracks:a}=(0,s.st)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("p",{children:__("Activate the Likes feature to allow others to like your posts.","jetpack")}),(0,i.jsx)(o.Button,{disabled:r||t,isBusy:t,onClick:()=>(a.recordEvent("jetpack_editor_likes_enable"),e(!0)),variant:"secondary",children:t?__("Activating Likes","jetpack"):__("Activate Likes","jetpack",0)}),(0,i.jsx)("div",{className:"components-likes-placeholder__learn-more",children:(0,i.jsx)(o.ExternalLink,{href:(0,n.A)("jetpack-support-likes"),children:__("Learn more about Jetpack Likes.","jetpack")})})]})}},79013:(e,t,r)=>{"use strict";r.d(t,{L:()=>i});var n=r(50723),s=r(11876),o=r(56427),a=r(10790);const i=()=>(0,a.jsx)(n.Ay,{children:(0,a.jsx)(o.Placeholder,{children:(0,a.jsxs)(o.Flex,{gap:2,direction:"column",style:{flexBasis:"100%",padding:"0 1em"},children:[(0,a.jsx)(o.FlexItem,{children:(0,a.jsx)(s.A,{width:"100%",height:30})}),(0,a.jsx)(o.FlexItem,{children:(0,a.jsx)(s.A,{width:"100%",height:90})})]})})})},24938:(e,t,r)=>{"use st
__("To use the SEO feature you need to upgrade to the %s plan","jetpack"),h)}),(0,c.jsx)("div",{className:"components-seo-upsell__learn-more",children:(0,c.jsx)(s.k4,{supportLink:"https://wordpress.com/support/seo-tools/",supportPostId:120916,children:g})}),(0,c.jsx)(o.Button,{href:u?null:t,onClick:e=>{e.preventDefault(),p.recordEvent("jetpack_seo_tools_upsell_click"),r(e)},target:"_top",icon:i.A,className:(0,l.A)("components-seo-upsell__button is-primary",{"jetpack-upgrade-plan__hidden":!t}),isBusy:u,children:u?__("Redirecting…","jetpack"):m})]})}},99463:(e,t,r)=>{"use strict";r.d(t,{P:()=>a});var n=r(56427),s=r(27723),o=(r(51609),r(10790));const __=s.__,_n=s._n,a=({suggestedLimit:e,value:t,label:r,...a})=>{const i=!e||t.length<=e?(0,s.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
_n("%d character","%d characters",t.length,"jetpack"),t.length):(0,s.sprintf)(/* translators: Placeholder is a number of characters in a sentence. */
__("Its recommended to use less than %1$d characters in this field. (%2$d/%1$d)","jetpack"),e,t.length);return(0,o.jsx)("div",{className:"jetpack-seo-message-box",children:(0,o.jsx)(n.TextareaControl,{__nextHasNoMarginBottom:!0,label:r,help:i,value:t,...a})})}},92411:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(85985),s=r(86087),o=r(27723),a=r(99463),i=r(53189),l=r(10790);const __=o.__,c=!0===(0,n.FB)("ai-seo-enhancer")?.available;class u extends s.Component{onMessageChange=e=>{this.props.updateMetaValue(e)};render(){const{metaValue:e}=this.props,t=__("Write a description…","jetpack"),r=__("Add a compelling, keyword-rich summary that appears in search results (ideally under 156 characters)","jetpack");return(0,l.jsx)(a.P,{value:e,onChange:this.onMessageChange,label:__("SEO Description","jetpack"),placeholder:c?r:t,suggestedLimit:156,rows:4})}}const d=(0,i.m)("advanced_seo_description")(u)},44921:(e,t,r)=>{"use strict";var n=r(85985),s=r(37802);(0,n.vp)(s.U,s.W)},37802:(e,t,r)=>{"use strict";r.d(t,{U:()=>S,W:()=>M});var n=r(97999),s=r(85985),o=r(82201),a=r(56427),i=r(3582),l=r(47143),c=r(14309),u=r(43656),d=r(86087),p=r(27723),h=r(13022),m=r(90062),g=r(89870),f=r(12430),b=r(77682),v=r(96012),k=r(76262),y=r(51626),x=r(24294),j=r(92411),w=r(5664),_=r(9411),C=r(80151),A=r(10790);const __=p.__,S="seo",E=u.PluginPrePublishPanel||c.PluginPrePublishPane,N=u.PluginPostPublishPanel||c.PluginPostPublishPanel,T="function"==typeof(0,l.select)(u.store).isPublishSidebarOpened,P=!0===(0,s.FB)("ai-seo-enhancer")?.available&&T,B=!(0,n.isSimpleSite)(),I=()=>{const{isLoadingModules:e,isChangingStatus:t,isModuleActive:r,changeStatus:c}=(0,s.q7)("seo-tools"),p=(0,l.useSelect)((e=>e(u.store).isPublishSidebarOpened?.()),[]),{updateSeoData:S,isBusy:I}=(0,v.X)(),M=(0,l.useSelect)((e=>{const t=e(u.store).getCurrentPostType(),r=e(i.store).getPostType(t);return r?.viewable}),[]),L=(0,d.useRef)(!1),{isEnabled:R,isToggling:D}=(0,b.S)(),{closePublishSidebar:F}=(0,l.useDispatch)(u.store);(0,d.useEffect)((()=>{P&&p&&!L.current&&!I&&R&&!D&&B&&T&&S({trigger:"auto"}),L.current=p}),[p,S,I,R,D]);if(!M)return null;const O=(0,s.tu)("advanced-seo"),z=(0,n.isWpcomPlatformSite)(),U=!(0,s.tu)("ai-seo-enhancer"),H={title:__("SEO","jetpack")};if(z&&!1!==O)return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(m.A,{children:(0,A.jsx)(a.PanelBody,{className:"jetpack-seo-panel",...H,initialOpen:!1,children:(0,A.jsx)(x.A,{requiredPlan:O})})})});if(!r)return(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(m.A,{children:(0,A.jsx)(a.PanelBody,{className:"jetpack-seo-panel",...H,initialOpen:!1,children:e?(0,A.jsx)(y.G,{}):(0,A.jsx)(k.l,{changeStatus:c,isModuleActive:r,isLoading:t})})})});const V={icon:(0,A.jsx)(o.jt,{}),title:__("SEO","jetpack"),initialOpen:P};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(m.A,{children:(0,A.jsxs)(a.PanelBody,{className:"jetpack-seo-panel",...H,children:[P&&U&&(0,A.jsx)(g.k,{placement:"jetpack-sidebar",disableAutoEnhance:!B}),(0,A.jsx)(a.PanelRow,{className:(0,h.A)({"jetpack-seo-sidebar__feature-section":P}),children:(0,A.jsx)(C.A,{})}),(0,A.jsx)(a.PanelRow,{className:(0,h.A)({"jetpack-seo-sidebar__feature-section":P}),children:(0,A.jsx)(j.A,{})}),(0,A.jsx)(a.PanelRow,{className:(0,h.A)({"jetpack-seo-sidebar__feature-section":P}),children:(0,A.jsx)(w.A,{})})]})}),(0,A.jsx)(E,{...V,children:(0,A.jsxs)("div",{className:"jetpack-seo-panel",children:[P&&U&&(0,A.jsx)(g.k,{placement:"jetpack-prepublish-sidebar",disableAutoEnhance:!B}),(0,A.jsx)(a.PanelRow,{children:(0,A.jsx)(C.A,{})}),(0,A.jsx)(a.PanelRow,{children:(0,A.jsx)(j.A,{})}),(0,A.jsx)(a.PanelRow,{children:(0,A.jsx)(w.A,{})})]})}),P&&(0,A.jsx)(N,{...V,children:(0,A.jsx)("div",{className:"jetpack-seo-panel",children:(0,A.jsx)(f.A,{onEdit:async()=>{await F(),(0,_.k)()}})})})]})},M={render:()=>(0,A.jsx)(I,{})}},5664:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(56427),s=r(27723),o=(r(51609),r(53189)),a=r(10790);const __=s.__,i=(0,o.m)("jetpack_seo_noindex")((({metaValue:e,updateMetaValue:t})=>(0,a.jsx)(n.ToggleControl,{label:__("Hide page from search engines","jetpack"),help:__("If selected, a
2022-12-15 17:41:53 +01:00
// translators: %s: amount
2025-07-27 19:58:08 +02:00
__("%s / month","jetpack"),o);case"1 year":return(0,i.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s: amount
2025-07-27 19:58:08 +02:00
__("%s / year","jetpack"),o);case"one-time":return o}return(0,i.sprintf)(
2022-12-15 17:41:53 +01:00
// translators: %s: amount, plan interval
2025-07-27 19:58:08 +02:00
__("%1$s / %2$s","jetpack"),o,r)}function v({onClose:e,product:t}){const{selectedProductIds:r,setSelectedProductIds:n}=(0,h.B)(),{id:s,title:a}=t,i=r&&r.includes(s),c=i?l.A:void 0,u=t?" "+b(t):null;return(0,f.jsxs)(o.MenuItem,{icon:c,onClick:t=>{t.preventDefault();const o=i?r.filter((e=>e!==s)):[...r,s];n(o),e()},selected:i,value:s,children:[a," : ",u]})}function k({onClose:e}){const{clientId:t,productType:r}=(0,h.B)(),n=(0,a.useSelect)((e=>e(d.M).getSiteSlug())),s=(0,m.A)(t);if(p.Wd===(0,p.AU)())return(0,f.jsx)(o.MenuItem,{children:n&&(0,f.jsx)(o.ExternalLink,{href:`https://wordpress.com/earn/payments/${n}#add-new-payment-plan`,children:(0,g.W)("add a new product",r)})});return(0,f.jsx)(o.MenuItem,{onClick:t=>{t.preventDefault(),s(),setTimeout((()=>{const e=document.getElementById("new-product-title");null!==e&&e.focus()}),100),e()},children:(0,g.W)("add a new product",r)})}function y(){const{products:e,productType:t,selectedProductIds:r}=(0,h.B)(),n=(0,a.useSelect)((e=>e(d.M).getSelectedProducts(r)),[r]);let i=null,l=c.A;return n.length>1?i=__("Multiple products selected","jetpack"):1===n.length&&(i=b(n[0])),n.length!=n.length&&(i=(0,g.W)("product not found",t),l=u.A),(0,f.jsx)(s.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,f.jsx)(o.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:l,label:(0,g.W)("select a product",t),text:i,children:({onClose:t})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.MenuGroup,{children:e.map((e=>(0,f.jsx)(v,{onClose:t,product:e},e.id)))}),(0,f.jsx)(o.MenuGroup,{children:(0,f.jsx)(k,{onClose:t})})]})})})}},21212:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(94715),s=r(47143),o=r(14309),a=r(59340);function i(e){const t=(0,a.AU)(),{selectBlock:r}=(0,s.useDispatch)(n.store),{enableComplementaryArea:i}=(0,s.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,s.useDispatch)(o.store);return()=>{switch(e&&r(e),t){case a.O3:return i("core/edit-site","edit-site/block-inspector");case a.RZ:return i("core/edit-widgets","edit-widgets/block-inspector");default:l(),i("core/edit-post","edit-post/block")}}}},1990:(e,t,r)=>{"use strict";r.d(t,{G:()=>l,W:()=>a});var n=r(27723),s=r(29726);const __=n.__,o={"add a new product":{[s._$]:__("Add a new payment plan","jetpack"),[s.h5]:__("Add a new subscription","jetpack")},"product not found":{[s._$]:__("Payment plan not found","jetpack"),[s.h5]:__("Subscription not found","jetpack")},"select a product":{[s._$]:__("Select a payment plan","jetpack"),[s.h5]:__("Select a subscription","jetpack")},"default new product title":{[s._$]:__("Monthly Subscription","jetpack"),[s.h5]:__("Monthly Subscription","jetpack")},"manage your products":{[s._$]:__("Manage your payment plans.","jetpack"),[s.h5]:__("Manage your subscriptions.","jetpack")},"saving product":{[s._$]:__("Saving payment plan…","jetpack"),[s.h5]:__("Saving subscription…","jetpack")},"add product":{[s._$]:__("Add payment plan","jetpack"),[s.h5]:__("Add subscription","jetpack")},"product requires a name":{[s._$]:__("Payment plan requires a name","jetpack"),[s.h5]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[s._$]:__("Payment plan requires a valid price","jetpack"),[s.h5]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[s._$]:__("Successfully created payment plan","jetpack"),[s.h5]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[s._$]:__("There was an error when adding the payment plan.","jetpack"),[s.h5]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[s._$]:__("Invalid payment plan configured for this block.","jetpack"),[s.h5]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[s._$]:__("The button will be hidden from your visitors until you select a valid payment plan.","jetpack"),[s.h5]:__("The subscribe button will be hidden from your visitors until
2023-12-07 09:44:11 +01:00
// translators: %1$s: first category name, %2$s: second category name
2025-07-27 19:58:08 +02:00
a=(0,c.sprintf)(__("%1$s and %2$s","jetpack"),...o);else{const e=o.slice(0,-1).join(`${__(",","jetpack")} `),t=o[o.length-1];a=(0,c.sprintf)(
2023-12-07 09:44:11 +01:00
// translators: %1$s: a comma-separated list of category names except for the last one, %2$s: the name of the last category
2025-07-27 19:58:08 +02:00
__("%1$s, and %2$s","jetpack"),e,t)}return a})(r,t),o=void 0===n?"0":n.toLocaleString();return e?(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2025-07-27 19:58:08 +02:00
_n("This post will be sent to everyone subscribed to %1$s (%2$s subscriber).","This post will be sent to everyone subscribed to %1$s (%2$s subscribers).",n??0,"jetpack"),s,o):(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2025-07-27 19:58:08 +02:00
_n("This post was sent to everyone subscribed to %1$s (<link>%2$s subscriber</link>).","This post was sent to everyone subscribed to %1$s (<link>%2$s subscribers</link>).",n??0,"jetpack"),s,o)};function f(e,t){return(0,n.getAdminUrl)(`admin.php?page=stats#!/stats/email/opens/day/${t}/${e}`)}const b=function({accessLevel:e,prePublish:t=!1}){const r=(0,a.useSelect)((e=>e("core/block-editor").getBlocks().some((e=>e.name===u.name)))),{isScheduledPost:n,isPostOlderThanADay:b,postCategories:v,postId:k,postMeta:y}=(0,a.useSelect)((e=>{const{isCurrentPostScheduled:t,getEditedPostAttribute:r,getCurrentPost:n}=e(i.store),s=n()?.status,o=new Date(n()?.date),a=new Date(Date.now()-864e5);return{isScheduledPost:t(),isPostOlderThanADay:"publish"===s&&o<a,postCategories:r("categories"),postId:n()?.id,postMeta:r("meta")}})),x=window.Jetpack_Editor_Initial_State?.wpcomBlogId,{emailSubscribersCount:j,hasFinishedLoading:w,newsletterCategories:_,newsletterCategoriesEnabled:C,newsletterCategorySubscriberCount:A,paidSubscribersCount:S,totalEmailsSentCount:E}=(0,a.useSelect)((e=>{const{getNewsletterCategories:t,getNewsletterCategoriesEnabled:r,getNewsletterCategoriesSubscriptionsCount:n,getSubscriberCounts:s,getTotalEmailsSentCount:o,hasFinishedResolution:a}=e(h.M),{emailSubscribers:i,paidSubscribers:l}=s();return{hasFinishedLoading:[a("getSubscriberCounts"),a("getNewsletterCategories"),a("getNewsletterCategoriesSubscriptionsCount")].every(Boolean),emailSubscribersCount:i,newsletterCategories:t(),newsletterCategoriesEnabled:r(),newsletterCategorySubscriberCount:n(),paidSubscribersCount:l,totalEmailsSentCount:b?o(x,k):null}}));if(!w)return(0,m.jsx)(o.Animate,{type:"loading",children:({className:e})=>(0,m.jsx)("p",{className:`jetpack-subscribe-affirmation-loading ${e}`,children:__("Loading…","jetpack")})});const N=e===d.P2.paid_subscribers.key,T=t||n,P=(0,p.Yc)({accessLevel:e,subscribers:b?E:j,paidSubscribers:S,postHasPaywallBlock:r});let B;return B=y?.[d.KG]?__("Not sent via email.","jetpack"):(0,s.lk)()?__("Your site is in Coming Soon mode. Emails are sent only when your site is public.","jetpack"):C&&_.length>0&&!N?g({futureTense:T,isPaidPost:N,newsletterCategories:_,postCategories:v,reachCount:b?E:A}):(({futureTense:e,isPaidPost:t,postHasPaywallBlock:r,reachCount:n})=>{const s=n.toLocaleString();return e?t&&!r?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post will be sent to <strong>%s paid subscriber</strong>.","This post will be sent to <strong>%s paid subscribers</strong>.",n,"jetpack"),s):(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post will be sent to <strong>%s subscriber</strong>.","This post will be sent to <strong>%s subscribers</strong>.",n,"jetpack"),s):t&&!r?(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <link>%s paid subscriber</link>.","This post was sent to <link>%s paid subscribers</link>.",n,"jetpack"),s):(0,c.sprintf)(/* translators: %s is the number of subscribers */
_n("This post was sent to <link>%s subscriber</link>.","This post was sent to <link>%s subscribers</link>.",n,"jetpack"),s)})({futureTense:T,isPaidPost:N,postHasPaywallBlock:r,reachCount:P}),(0,m.jsx)("p",{children:(0,l.createInterpolateElement)(B,{strong:(0,m.jsx)("strong",{}),link:(0,m.jsx)("a",{href:f(x,k)})})})}},64234:(e,t,r)=>{"use strict";r.d(t,{Qu:()=>l,fI:()=>c,mf:()=>u});var n=r(56427),s=r(86087),o=r(27723),a=r(37906),i=r(10790);const __=o.__,l=e=>{const t="https://wordpress.com/earn/payments/"+location.hostname;return e?t:t+"#add-tier-plan"},c=(e,t)=>"public"!==e&&t!==a.P2.everybody.key,u=()=>(0,i.jsx)(n.Notice,{status:"warning",isDismissible:!1,className:"edit-post-post-misconfiguration__warning",children:(0,s.createInterpolateElement)(__("Youll need to change the posts access to Everybody or visibility to Public.<br/><br/>Subscribers arent able to view private or password-protected posts.","jetpack"),{br:(0,i.jsx)("br",{})})})},14435:(e,t,r)=>{"use strict";var n=r(97999),s=r(85985),o=r(1455),a=r.n(o),i=r(47143),l=r(27723);r(692);const __=l.__;function c(){const e=(0,s.GE)();return window?.location&&e?(0,n.isWpcomPlatformSite)()?`https://wordpress.com/plans/my-plan/${e}`:`${window.location.protocol}//${e.replace("::","/")}/wp-admin/admin.php?page=jetpack#/my-plan`:null}(async()=>{if(window?.location){if(new URLSearchParams(window.location.search).get("plan_upgraded")){let e=null;e:try{if((0,n.isSimpleSite)())break e;const t=await a()({path:"/jetpack/v4/site"});e=JSON.parse(t.data).plan.product_name}finally{const t=c();(0,i.dispatch)("core/notices").createNotice("success",e?(0,l.sprintf)(/* translators: %s is the plan name, such as Jetpack Premium. */
__("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:c(),label:__("View my plan","jetpack")}]}})}}}})()},79366:(e,t,r)=>{"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&(r.p=window.Jetpack_Block_Assets_Base_Url)},59740:(e,t,r)=>{"use strict";var n=r(74997),s=r(47143),o=r(93832),a=r(27734);const{url:i,title:l,text:c,comment_content:u,comment_author:d}=(0,o.getQueryArgs)(window.location.href);i&&(async()=>{await(0,a.O)();const e=[];if(c&&c!==l){const t=`<a href="${i}">${l}</a>`;e.push((0,n.createBlock)("core/quote",{value:`<p>${c}</p>`,citation:t}))}u&&e.push((0,n.createBlock)("core/quote",{value:u,citation:d})),e.push((0,n.createBlock)("core/embed",{url:i,type:"wp-embed"})),(0,s.dispatch)("core/editor").resetEditorBlocks(e)})()},94375:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,M:()=>l});var n=r(85985),s=r(74997),o=r(52619);const a="jetpack/";function i(e,t,r=[],i=!0){const l="string"==typeof e?e:e.name,c=l.startsWith(a),u=c?l.slice(a.length):l,{available:d,details:p,unavailableReason:h}=(0,n.FB)(u),m=(0,n.aq)(h,p),g=i||c?a:"";if(!d&&!m)return!1;const f=g+u,b=(0,s.registerBlockType)("object"==typeof e?e:f,t);return m&&(0,o.addFilter)("editor.BlockListBlock",`${f}-with-has-warning-is-interactive-class-names`,(0,n.BT)(f)),r.forEach((e=>(0,s.registerBlockType)(g+e.name,e.settings))),b}function l(e,t,r,s){return i(e,{...t,icon:(0,n.Cq)(e),attributes:e.attributes||{}},r,s)}},62289:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(5573),s=r(10790);const o=(e,t=24,r=24,o="0 0 24 24")=>(0,s.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:r,viewBox:o,children:[(0,s.jsx)(n.Path,{fill:"none",d:"M0 0h24v24H0V0z",className:"icon-filler"}),e]})},64882:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(94715),s=r(13022),o=r(10790);const a=(e,t,r,a,i,l={})=>{const{isSelected:c}=t,u=t.attributes[e];return l.className=(0,s.A)(l.className,`jetpack-${e}-block`,{"is-selected":c}),(0,o.jsxs)("div",{...l,children:[!c&&""!==u&&a(t),(c||""===u)&&(0,o.jsx)(n.PlainText,{value:u,placeholder:r,"aria-label":r,onChange:i})]})}},21929:(e,t,r)=>{"use strict";var n=r(47143),s=r(27723);r(692);const __=s.__;if("undefined"!=typeof window&&window.location){const e=new URLSearchParams(window.location.search);e.get("stripe_connect_success")?(0,n.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,n.dispatch)("core/notices").createNotice("error",__("You cancelled connecting your site to Stripe.","jetpack"))}},56145:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(1455),s=r.n(n),o=r(66087);function a(e,t=o.noop){return t(!0),new Promise(((r,n)=>{s()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then((s=>{t(!1);const o=s.status?parseInt(s.status,10):null;o&&o>=400?n():r(s.url||e)}),(()=>{t(!1),n()}))}))}},26247:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(39384),s=r(97999);const o=()=>{const{isUserConnected:e}=(0,n.useConnection)();return(0,s.isSimpleSite)()||e}},89303:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(86087);const s=e=>{const t=(0,n.useRef)(void 0);return(0,n.useEffect)((()=>{t.current=e}),[e]),t.current};function o({attributes:e,disableEffects:t=!1,setAttributes:r}){const{align:o,width:a}=e,i=s(o);(0,n.useEffect)((()=>{if(t)return;i!==o&&("left"===o||"right"===o)&&a?.includes("%")&&r({width:void 0})}),[o,t,i,r,a])}},27734:(e,t,r)=>{"use strict";r.d(t,{O:()=>s});var n=r(47143);const s=async()=>new Promise((e=>{if((0,n.select)("core/editor").isCleanNewPost()||(0,n.select)("core/block-editor").getBlocks().length>0)return void e();const t=setTimeout((()=>{r(),e()}),2e3),r=(0,n.subscribe)((()=>{(0,n.select)("core/block-editor").getBlocks().length>0&&(clearTimeout(t),r(),e())}))}))},38062:(e,t,r)=>{"use strict";r.d(t,{D:()=>d,s:()=>p});var n=r(56427),s=r(86087),o=r(27723),a=r(13022),i=r(10790);const __=o.__,l=[{value:"%",label:"%",default:100},{value:"px",label
2022-12-15 17:41:53 +01:00
// translators: %s: Price
2025-07-27 19:58:08 +02:00
__("Minimum allowed price is %s.","jetpack"),(0,n.vv)(k,b)),m),void s(!1);if(!(0,c.kF)(b,v))return(0,d.S)((0,l.W)("product requires a valid price",t),m),void s(!1);try{const n=await o()({path:"/wpcom/v2/memberships/product",method:"POST",data:e}),a={id:n.id,title:n.title,interval:n.interval,price:n.price,currency:n.currency},c=m.select(u.EF).getProducts();i(p(c.concat([a]))),r([a.id]),h&&(0,d.L)((0,l.W)("successfully created product",t),m),s(!0)}catch{(0,d.S)((0,l.W)("there was an error when adding the product",t),m),s(!1)}},v=e=>({type:"SET_SUBSCRIBER_COUNTS",subscriberCounts:e}),k=e=>({type:"SET_TOTAL_EMAILS_SENT_COUNT",totalEmailsSentCount:e}),y=e=>({type:"SET_NEWSLETTER_CATEGORIES",newsletterCategories:e}),x=e=>({type:"SET_NEWSLETTER_CATEGORIES_SUBSCRIPTIONS_COUNT",newsletterCategoriesSubscriptionsCount:e})},3696:(e,t,r)=>{"use strict";r.d(t,{EF:()=>n,JA:()=>o,an:()=>s,gI:()=>a,ky:()=>i});const n="jetpack/membership-products",s=0,o=1,a=2,i="tier"},16521:(e,t,r)=>{"use strict";r.d(t,{M:()=>c});var n=r(47143),s=r(66314),o=r(3696),a=r(91497),i=r(18410),l=r(92955);const c=(0,n.createReduxStore)(o.EF,{actions:s,reducer:a.A,resolvers:i,selectors:l,__experimentalUseThunks:!0});(0,n.register)(c)},91497:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});const n={products:[],apiState:r(3696).an,connectUrl:null,siteSlug:"",connectedAccountDefaultCurrency:"",subscriberCounts:{totalSubscribers:null,socialFollowers:null,emailSubscribers:null,paidSubscribers:null},newsletterCategories:{enabled:!1,categories:[]}};function s(e=n,t){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_SITE_SLUG":return{...e,siteSlug:t.siteSlug};case"SET_CONNECTED_ACCOUNT_DEFAULT_CURRENCY":return{...e,connectedAccountDefaultCurrency:t.connectedAccountDefaultCurrency};case"SET_SUBSCRIBER_COUNTS":return{...e,subscriberCounts:t.subscriberCounts};case"SET_TOTAL_EMAILS_SENT_COUNT":return{...e,totalEmailsSentCount:t.totalEmailsSentCount};case"SET_NEWSLETTER_CATEGORIES":return{...e,newsletterCategories:t.newsletterCategories};case"SET_NEWSLETTER_CATEGORIES_SUBSCRIPTIONS_COUNT":return{...e,newsletterCategoriesSubscriptionsCount:t.newsletterCategoriesSubscriptionsCount}}return e}},18410:(e,t,r)=>{"use strict";r.r(t),r.d(t,{fetchNewsletterCategoriesSubscriptionsCount:()=>x,getNewsletterCategories:()=>S,getNewsletterCategoriesSubscriptionsCount:()=>E,getNewsletterTierProducts:()=>w,getProducts:()=>_,getSubscriberCounts:()=>C,getTotalEmailsSentCount:()=>A});var n=r(97999),s=r(1455),o=r.n(s),a=r(43656),i=r(93832),l=r(29726),c=r(1990),u=r(56539),d=r(27574),p=r(66314),h=r(3696),m=r(34884);const g="membership-products-resolver-getProducts",f="membership-products-resolver-getSubscriberCounts",b="membership-products-resolver-getTotalEmailsSentCount",v="membership-products-resolver-getNewsletterCategories",k="membership-products-resolver-getNewsletterCategoriesSubscriptionsCount";let y=!1;const x=async e=>{const t=await o()({path:`/wpcom/v2/newsletter-categories/count?term_ids=${e.join(",")}`,method:"GET"});if(!t||"object"!=typeof t)throw new Error("Unexpected API response");const r=t?.errors&&Object.values(t.errors)?.[0]?.[0];if(r)throw new Error(r);return t},j=(e,t,r)=>{if(e.length>0)return;const n=r.getProductsNoResolver()[0]?.id;n&&t([n])},w=(e=l._$,t=[],r=()=>{})=>_(e,t,r,!1),_=(e=l._$,t=[],r=()=>{},n=!0)=>async({dispatch:s,registry:l,select:f})=>{if(await u.A.blockExecution(g),y)return void j(t,r,f);const b=u.A.acquire(g);try{const u=await(async()=>{const e=(0,i.getQueryArg)(window.location.href,"origin"),t=(0,i.addQueryArgs)("/wpcom/v2/memberships/status",{source:"https://wordpress.com"===e?"gutenberg-wpcom":"gutenberg",type:"all",is_editable:!0}),r=await o()({path:t,method:"GET"});if(!r&&"object"!=typeof r)throw new Error("Unexpected API response");const n=r?.errors&&Object.values(r.errors)?.[0]?.[0];if(n)throw new Error(n);return r})();((e,t,r)=>{const n=t.select(a.store).getCurrentPostId();r((0,p.setConnectUrl)((0,d.A)(n,e.connect_url))),