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

166 lines
1.4 MiB
JavaScript
Raw Permalink Normal View History

2022-04-02 10:26:41 +02:00
/*! For license information please see editor.js.LICENSE.txt */
2026-03-31 11:30:59 +02:00
(()=>{var e={7675(e,t,s){"use strict";s.d(t,{y:()=>i});var r=s(76416),n=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(s[r[n]]=e[r[n]])}return s};const o="text/event-stream",a="last-event-id";function i(e,t){var{signal:s,headers:i,onopen:c,onmessage:u,onclose:d,onerror:p,openWhenHidden:h,fetch:m}=t,g=n(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((t,n)=>{const f=Object.assign({},i);let b;function v(){b.abort(),document.hidden||_()}f.accept||(f.accept=o),h||document.addEventListener("visibilitychange",v);let k=1e3,y=0;function x(){document.removeEventListener("visibilitychange",v),window.clearTimeout(y),b.abort()}null==s||s.addEventListener("abort",()=>{x(),t()});const j=null!=m?m:window.fetch,w=null!=c?c:l;async function _(){var s;b=new AbortController;try{const s=await j(e,Object.assign(Object.assign({},g),{headers:f,signal:b.signal}));await w(s),await(0,r.q5)(s.body,(0,r.iv)((0,r.VL)(e=>{e?f[a]=e:delete f[a]},e=>{k=e},u))),null==d||d(),x(),t()}catch(e){if(!b.signal.aborted)try{const t=null!==(s=null==p?void 0:p(e))&&void 0!==s?s:k;window.clearTimeout(y),y=window.setTimeout(_,t)}catch(e){x(),n(e)}}}_()})}function l(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,s){"use strict";async function r(e,t){const s=e.getReader();let r;for(;!(r=await s.read()).done;)t(r.value)}function n(e){let t,s,r,n=!1;return function(o){void 0===t?(t=o,s=0,r=-1):t=function(e,t){const s=new Uint8Array(e.length+t.length);return s.set(e),s.set(t,e.length),s}(t,o);const a=t.length;let i=0;for(;s<a;){n&&(10===t[s]&&(i=++s),n=!1);let o=-1;for(;s<a&&-1===o;++s)switch(t[s]){case 58:-1===r&&(r=s-i);break;case 13:n=!0;case 10:o=s}if(-1===o)break;e(t.subarray(i,o),r),i=s,r=-1}i===a?t=void 0:0!==i&&(t=t.subarray(i),s-=i)}}function o(e,t,s){let r=a();const n=new TextDecoder;return function(o,i){if(0===o.length)null==s||s(r),r=a();else if(i>0){const s=n.decode(o.subarray(0,i)),a=i+(32===o[i+1]?2:1),l=n.decode(o.subarray(a));switch(s){case"data":r.data=r.data?r.data+"\n"+l:l;break;case"event":r.event=l;break;case"id":e(r.id=l);break;case"retry":const s=parseInt(l,10);isNaN(s)||t(r.retry=s)}}}}function a(){return{data:"",event:"",id:"",retry:void 0}}s.d(t,{VL:()=>o,iv:()=>n,q5:()=>r})},87399(e){!function(){"use strict";var t=[],s=3988292384;function r(e){var t,r,n,o,a=-1;for(t=0,n=e.length;t<n;t+=1){for(o=255&(a^e[t]),r=0;r<8;r+=1)1&~o?o>>>=1:o=o>>>1^s;a=a>>>8^o}return-1^a}function n(e,s){var r,o,a;if(void 0!==n.crc&&s&&e||(n.crc=~0,e)){for(r=n.crc,o=0,a=e.length;o<a;o+=1)r=r>>>8^t[255&(r^e[o])];return n.crc=r,-1^r}}!function(){var e,r,n;for(r=0;r<256;r+=1){for(e=r,n=0;n<8;n+=1)1&e?e=s^e>>>1:e>>>=1;t[r]=e>>>0}}(),e.exports=function(e,t){var s;e="string"==typeof e?(s=e,Array.prototype.map.call(s,function(e){return e.charCodeAt(0)})):e;return((t?r(e):n(e))>>>0).toString(16)},e.exports.direct=r,e.exports.table=n}()},51601(e,t,s){var r;e.exports=(r=r||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r)try{r=s(42305)}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var s;return e.prototype=t,s=new e,e.prototype=null,s}}(),a={},i=a.
// Translators: %d is the cost of one image.
// Translators: %d is the cost of one image.
(0,n.sprintf)(__("Requests needed: <counter>%d</counter>","jetpack"),s),{counter:(0,o.jsx)("span",{})}),l=(0,r.createInterpolateElement)((0,n.sprintf)(
// Translators: %d is the current requests balance.
__("Requests available: <counter>%d</counter>","jetpack"),a),{counter:a<s?(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,s){"use strict";s.d(t,{A:()=>x});var r=s(85985),n=s(56427),o=s(47143),a=s(43656),i=s(86087),l=s(27723),c=s(10067),u=s.n(c),d=s(43984),p=s(72448),h=s(71508),m=s(62038),g=s(96390),f=s(3620),b=s(35918),v=s(75988),k=s(10790);const __=l.__,y=u()("jetpack-ai-client:featured-image");function x({busy:e,disabled:t,placement:s,onClose:c=()=>{}}){const[u,x]=(0,i.useState)(s===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,r.st)(),{recordEvent:T}=N,[B,P]=(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:q,costs:V}=(0,p.A)(),$=(0,r.Bd)(q),G=V?.[v.oW]?.activeModel??10,W=G===V?.[v.oW]?.stableDiffusion?v.Dk:v.bb,Z=$===r.Ti,J=H-U<G,K=O??D,{pointer:Y,current:Q,setCurrent:X,processImageGeneration:ee,handlePreviousImage:te,handleNextImage:se,currentImage:re,currentPointer:ne,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:s,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:s,error:e?.message,model:W,site_type:j,style:t})})),[T,s,W,j,ee,w,J,C]),pe=(0,i.useCallback)(async()=>{ne.generating=!0;const e=await ue("");P(e);const t=await de({userPrompt:"",style:e});t&&(y("handleFirstGenerate",t.revisedPrompt),M(t.revisedPrompt||""))},[ne,de,ue]),he=(0,i.useCallback)(({userPrompt:e,style:t})=>{T("jetpack_ai_featured_image_generation_generate_another_image",{placement:s,model:W,site_type:j,style:t}),X(()=>oe.length),ee({userPrompt:e,postContent:C+"\n\n"+w(),notEnoughRequests:J,style:t}).catch(r=>{T("jetpack_ai_featured_image_generation_error",{placement:s,error:r?.message,model:W,site_type:j,style:t,userPrompt:e})})},[T,s,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:s,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:s,error:e?.message,model:W,site_type:j,style:t})})},[T,s,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:s,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)};re?.libraryId?e(re?.libraryId):E(re?.image).then(t=>{e(t?.id)}).catch(e=>{T("jetpack_ai_featured_image_saving_error",{placement:s,error:e?.message,model:W,site_type:j})})},[T,s,W,j,re?.libraryId,re?.image,F,le,S,ge,K,E]),be=__("Generate another image","jetpack"),ve=__("Generate","jetpack
// Translators: %d is the cost of generating a featured image.
__("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)(n.Button,{onClick:fe,variant:"primary",disabled:!re?.image||re?.generating||re?.libraryId===A,children:__("Set as featured image","jetpack")});return(0,k.jsxs)(k.Fragment,{children:[(s===d.s6||s===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)(n.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:s,onClose:le,onTryAgain:me,onGenerate:Y?.current>0||A?he:de,generating:ne?.generating,notEnoughRequests:J,requireUpgrade:z,upgradeDescription:we,currentLimit:H,currentUsage:U,isUnlimited:Z,hasError:Boolean(ne?.error),handlePreviousImage:te,handleNextImage:se,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:B,inputDisabled:xe,actionDisabled:je})]})}},83158(e,t,s){"use strict";s(85985),s(56427),s(86087),s(27723);var r=s(10067),n=s.n(r);s(72448),s(71508),s(62038),s(96390),s(3620),s(35918),s(10790);n()("jetpack-ai:general-purpose-image")},3620(e,t,s){"use strict";s.d(t,{A:()=>p});var r=s(47143),n=s(86087),o=s(27723),a=s(93832),i=s(31439),l=s(72448),c=s(62614),u=s(62038),d=s(75988);const __=o.__;function p({feature:e,type:t,cost:s,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,r.useDispatch)("core/notices"),v=(0,n.useRef)(0),[k,y]=(0,n.useState)(0),[x,j]=(0,n.useState)([{generating:o}]),w=e===d.oW?"featured-image":"image",_=g?.[w],C=_?.styles,A=(0,n.useCallback)((e,t)=>{j(s=>{const r=[...s];return r[t]={...r[t],...e},r})},[]),S=(0,r.useSelect)(e=>e("core")?.getEntityRecord?.("postType","attachment",p),[p]);(0,n.useEffect)(()=>{S&&A({image:S.source_url,libraryId:S.id,libraryUrl:S.source_url,generating:!1},v.current)},[S,A]);const E=(0,n.useCallback)(e=>{b("success",e,{type:"snackbar",isDismissible:!0})},[b]),N=(0,n.useCallback)(()=>{m(s)},[m,s]),T=(0,n.useCallback)(e=>{if(!e)return"image.png";const t=e.split(" ").slice(0,10).join(" ");return(0,a.cleanForSlug)(t)+".png"},[]),B=(0,n.useCallback)(({userPrompt:s,postContent:r,notEnoughRequests:n,style:o=null})=>new Promise((a,i)=>{if(p&&0===v.current&&v.current++,A({generating:!0,error:null},v.current),n)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:s||null,content:r,style:o}}],style:o||""}),c=T(s);l.then(e=>{if(e.data.length>0){const t="data:image/png;base64,"+e.data[0].b64_json,r=s||null,n=e.data[0].revised_prompt||null;A({image:t,prompt:r,revisedPrompt:n},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:n})}).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]),P=(0,n.useCallback)(()=>{y(Math.max(k-1,0))},[k]),I=(0,n.useCallback)(()=>{y(Math.min(k+1,x.length-1))},[k,x.length]),M=(0,n.useCallback)(async function(e,t="",s=""){if(!C||!C.length)return null;const r=[{role:"jetpack-ai",context:{type:t||"general-image-guess-style",request:e,content:s}}];try{const e=await(0,i.A)(r,{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.reject(e)}}
// translators: %1$d: number of requests remaining
__("You have %1$d requests remaining.","jetpack"),e)}),(0,p.jsx)(r.Button,{variant:"link",onClick:s,href:n,target:n?"_blank":null,children:(0,p.jsx)("span",{children:__("Upgrade now","jetpack")})})]})}function w({error:e,code:t,onTryAgainClick:s,onUpgradeClick:n,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)(
// translators: %1$d: A dynamic error message
__("Error: %1$s","jetpack"),i)}),t===u.Or?(0,p.jsx)(r.Button,{variant:"link",onClick:n,href:a,target:a?"_blank":null,children:(0,p.jsx)("span",{children:__("Upgrade now","jetpack")})}):(0,p.jsx)(r.Button,{variant:"link",onClick:s,children:(0,p.jsx)("span",{children:__("Try again","jetpack")})})]})}},14016(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(56427),n=s(27723),o=s(51489),a=s(6754),i=s(10790);const __=n.__,l=({requestingState:e,onClose:t,title:s})=>(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:s})]}),(0,i.jsx)(r.Button,{icon:o.A,label:__("Close","jetpack"),onClick:t})]});function c({children:e,handleClose:t,hideHeader:s=!0,requestingState:n="init",title:o=__("AI Assistant","jetpack"),maxWidth:a=720}){return(0,i.jsx)(r.Modal,{__experimentalHideHeader:s,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:n,onClose:t,title:o}),(0,i.jsx)("hr",{className:"ai-assistant-modal__divider"}),e]})})}},57853(e,t,s){"use strict";s.d(t,{A:()=>b,Q:()=>f});var r=s(3924),n=s(85985),o=s(82201),a=s(56427),i=s(86087),l=s(27723),c=s(10067),u=s.n(c),d=s(42694),p=s(72448),h=s(71567),m=s(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><span>fair usage policy</span></link>.","jetpack");if(!e)return t;
// Translators: %s is the date when the requests will reset.
const s=__("Requests will reset on %s.","jetpack");return`${t} ${(0,l.sprintf)(s,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"}),span:(0,m.jsx)("span",{})})})();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:s}=(0,p.A)();return 1===s?.value?(0,m.jsx)(f,{}):"vip"===t?(({description:e=null,useLightNudge:t=!1})=>{const s=t?h.U:o.cb,r=(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)(s,{buttonText:null,checkoutUrl:null,className:"jetpack-ai-upgrade-banner",description:e||r,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:s=!1})=>{const a=s?h.U:o.cb,{checkoutUrl:c}=(0,d.A)(),u=(0,n.CP)(),{nextTier:f,tierPlansEnabled:b,currentTier:v,requestsCount:k}=(0,p.A)(),{tracks:y}=(0,n.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,r.A)("jetpack-ai-tiers-more-requests-contact"),s=__("You have reached the request limit for your current plan.","jetpack");return(0,m.jsx)(a,{buttonText:__("Contact Us","jetpack"),description:t||s,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: %d: the number of requests allowed */
__("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: %d: the 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,s){"use strict";s.d(t,{U:()=>a});var r=s(56427),n=s(27723),o=s(10790);const __=n.__,a=({title:e,description:t,buttonText:s=null,checkoutUrl:n=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)(r.Notice,{status:"error",isDismissible:!1,children:(0,o.jsxs)("p",{children:[e&&(0,o.jsx)("strong",{children:e}),t," ",l&&(0,o.jsx)(r.Button,{href:i?null:n,onClick:a,variant:"link",target:c,children:(0,o.jsx)("span",{children:i?u:s})})]})})})}},43984(e,t,s){"use strict";s.d(t,{A4:()=>l,DD:()=>j,DT:()=>B,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:()=>P,sn:()=>i,so:()=>n,u0:()=>y,uQ:()=>x,vE:()=>u,wb:()=>I,yQ:()=>E,yy:()=>c,z5:()=>b});var r=s(27723);const __=r.__,n={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"),B=__("Continue writing","jetpack"),P="jetpack-sidebar",I="document-settings"},2166(e,t,s){"use strict";s.d(t,{R:()=>a});var r=s(51609),n=s(10790);const o=(0,r.createContext)({}),a=({value:e,children:t})=>(0,n.jsx)(o.Provider,{value:e,children:t})},13965(e,t,s){"use strict";s.d(t,{Rb:()=>r.R});var r=s(2166);s(59886),s(53471)},53471(e,t,s){"use strict";s(51609),s(78836),s(13965)},59886(e,t,s){"use strict";var r=s(29491),n=s(86087),o=s(46219),a=s(13965),i=s(10790);(0,r.createHigherOrderComponent)(e=>t=>{const{suggestion:s,error:r,requestingState:l,request:c,stopSuggestion:u,eventSource:d}=(0,o.Ay)(),p=(0,n.useMemo)(()=>({suggestion:s,requestingError:r,requestingState:l,eventSource:d,requestSuggestion:c,stopSuggestion:u}),[s,r,l,d,c,u]);return(0,i.jsx)(a.Rb,{value:p,children:(0,i.jsx)(e,{...t})})},"withAiDataProvider")},42694(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(3924),n=s(97999),o=s(85985),a
// translators: %d is the number of requests
__("%d requests remaining.","jetpack"),j)}),S&&(0,k.jsxs)(k.Fragment,{children:[" ",(0,k.jsx)(n.Button,{variant:"link",href:A,target:"_blank",onClick:()=>{s(h.AN,{context:q,placement:h.Cn})},children:(0,k.jsx)("span",{children:__("Upgrade","jetpack")})})]})," ",(0,k.jsx)(n.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&&V&&(0,k.jsx)(v.G,{}),H&&!V&&(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,s){"use strict";s.d(t,{G:()=>h});var r=s(85985),n=s(56427),o=s(86087),a=s(27723),i=s(13109),l=s(84699),c=s(61356),u=s(60674),d=s(88725),p=s(10790);const __=a.__,h=()=>{const{tracks:e}=(0,r.st)(),{recordEvent:t}=e,s=__("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)(n.Button,{href:h,target:"_blank",className:"is-primary",onClick:()=>{t(c.AN,{context:m,placement:c.tF})},children:(0,p.jsx)("span",{children:s})})]})})}},35421(e,t,s){"use strict";s.d(t,{R:()=>u});var r=s(3924),n=s(85985),o=s(56427),a=s(27723),i=s(61356),l=s(88725),c=s(10790);const __=a.__,u=({onCancel:e,upgradeURL:t,reason:s})=>{const{tracks:a}=(0,n.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,r.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"===s?d:p})," ",(0,c.jsx)(o.Button,{variant:"link",href:h,target:"_blank",children:(0,c.jsx)("span",{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:(0,c.jsx)("span",{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:(0,c.jsx)("span",{children:__("Upgrade","jetpack")})})]})]})}},48204(e,t,s){"use strict";s.d(t,{H:()=>c});var r=s(56427),n=s(27723),o=s(1866),a=s(13022),i=s(36791),l=s(10790);const __=n.__,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)(r.Bu
// Translators: %s is the date when the requests will reset.
const s=__("Requests will reset on %s.","jetpack");return`${t} ${(0,a.sprintf)(s,e)}`})((e=>{if(!e?.nextStart)return null;const t=new Date(e.nextStart);return t.toLocaleString("default",{month:"long"})+" "+t.getDate()})(e)),s=(0,r.A)("ai-logo-generator-fair-usage-policy",{anchor:"jetpack-ai-usage-limit"});return(0,o.createInterpolateElement)(t,{link:(0,l.jsx)("a",{href:s,target:"_blank",rel:"noreferrer"}),span:(0,l.jsx)("span",{})})}},88725(e,t,s){"use strict";s.d(t,{A:()=>f});var r=s(47143),n=s(10067),o=s.n(n),a=s(51609),i=s(31439),l=s(62614),c=s(93869),u=s(51391),d=s(19362),p=s(28229),h=s(74423),m=s(44461);const g=o()("jetpack-ai-calypso:use-logo-generator"),f=()=>{const{setSelectedLogoIndex:e,setIsSavingLogoToLibrary:t,setIsApplyingLogo:s,setIsRequestingImage:n,setIsEnhancingPrompt:o,increaseAiAssistantRequestsCount:f,addLogoToHistory:b,setContext:v,setIsLoadingHistory:k}=(0,r.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:B,tierPlansEnabled:P,isLoadingHistory:I}=(0,r.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:q=null}=w||{},V=U?String(U):null,$=N(V),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: ${q}`,feature:"jetpack-ai-logo-generator",stream:!1},s="https://public-api.wordpress.com/wpcom/v2/jetpack-ai-query",r={Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},n=await fetch(s,{method:"POST",headers:r,body:JSON.stringify(t)}).then(e=>e.json());return n?.choices?.[0]?.message?.content}catch(e){throw f(-1),M(e),e}},[M,f,H,q]),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:q}}];try{const e=await(0,i.A)(t,{feature:"jetpack-ai-logo-generator"});if(!e)return null;const s=Z.find(({value:t})=>t===e);return s?s.value:null}catch(e){g("Error guessing style",e),Promise.reject(e)}},[Z,H,q]),Y=(0,a.useCallback)(async function({prompt:e,style:t=null}){R(null);try{const s=await(0,u.A)();if(!s||!s.token)throw new Error("No token provided");if("auto"===t)throw new Error("Auto style is not supported");g("Generating image w
__("(opens in a new tab)","jetpack")})]}),C=b?"_blank":void 0,A=s?.[0]&&null!==s[0]&&"components-tooltip"!==s?.[0]?.props?.className,S={ref:t,target:C,variant:n,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};return(0,u.jsxs)(r.Button,{...S,children:[f&&(0,u.jsx)(r.Spinner,{}),(0,u.jsx)("span",{children:s}),_]})});d.displayName="Button";const p=d},69222(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(29491),n=s(86087),o=s(27723),a=s(51112),i=s(78478),l=s(10790);const __=o.__,c=({buttonStyle:e="icon",textToCopy:t,onCopy:s,...o})=>{const[c,u]=(0,n.useState)(!1),d=(0,n.useRef)(),p=(0,r.useCopyToClipboard)(t,()=>{d.current&&clearTimeout(d.current),u(!0),s?.(),d.current=setTimeout(()=>{u(!1),d.current=void 0},3e3)});(0,n.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,s){"use strict";s.d(t,{Nr:()=>l,ui:()=>c});var r=s(56427),n=s(13022),o=(s(84705),s(56058)),a=s(10790);const i=({className:e,size:t=24,viewBox:s="0 0 24 24",opacity:i=1,color:l="#2C3338",children:c})=>{const u={className:(0,n.A)(o.A.iconWrapper,e),width:t,height:t,viewBox:s,opacity:i,fill:void 0};return l&&(u.fill=l),(0,a.jsx)(r.SVG,{...u,fillRule:"evenodd",clipRule:"evenodd",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)(r.G,{opacity:i,children:c})})},l=({size:e,className:t=o.A["checkmark-icon"],color:s})=>(0,a.jsx)(i,{className:t,size:e,color:s,children:(0,a.jsx)(r.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:s})=>(0,a.jsx)(i,{className:t,size:e,color:s,children:(0,a.jsx)(r.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,s){"use strict";s.d(t,{A:()=>a});var r=s(27723),n=s(13022),o=s(10790);const __=r.__,a=({logoColor:e="#069e08",showText:t=!0,className:s,height:r=32,title:a,...i})=>{const l=t?"0 0 118 32":"0 0 32 32",c=a??__("Jetpack Logo","jetpack");return(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:l,className:(0,n.A)("jetpack-logo",s),"aria-labelledby":"jetpack-logo-title",height:r,...i,role:"img",children:[(0,o.jsx)("title",{id:"jetpack-logo-title",children:c}),(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,
// translators: Default description for a Facebook post
__("Visit the post for more.","jetpack")]}),(0,p.jsx)("div",{className:"facebook-preview__info",children:(0,p.jsx)(d.A,{name:"info"})})]})})]})]}),(0,p.jsx)(c.A,{})]})}},44381(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(27723),n=s(98714),o=(s(84998),s(10790));const __=r.__,a=()=>(0,o.jsx)("ul",{className:"facebook-preview__post-actions",children:[{icon:"like",
// translators: Facebook "Like" action
label:__("Like","jetpack")},{icon:"comment",
// translators: Facebook "Comment" action
label:__("Comment","jetpack")},{icon:"share",
// translators: Facebook "Share" action
label:__("Share","jetpack")}].map(({icon:e,label:t})=>(0,o.jsxs)("li",{children:[(0,o.jsx)(n.A,{name:e}),(0,o.jsx)("span",{children:t})]},e))})},47176(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(27723),n=s(50513),o=s(98714),a=(s(78924),s(10790));const __=r.__,_x=r._x,i=({user:e,timeElapsed:t,hideOptions:s})=>(0,a.jsxs)("div",{className:"facebook-preview__post-header",children:[(0,a.jsxs)("div",{className:"facebook-preview__post-header-content",children:[(0,a.jsx)(n._,{className:"facebook-preview__post-header-avatar",src:e?.avatarUrl}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"facebook-preview__post-header-name",children:e?.displayName||
// translators: name of a fictional Facebook User
__("Anonymous User","jetpack")}),(0,a.jsxs)("div",{className:"facebook-preview__post-header-share",children:[(0,a.jsx)("span",{className:"facebook-preview__post-header-time",children:t?__(
// translators: short version of `1 hour`
"1h","jetpack"):_x(
// translators: temporal indication of when a post was published
"Just now","","jetpack")}),(0,a.jsx)("span",{className:"facebook-preview__post-header-dot","aria-hidden":"true",children:"·"}),(0,a.jsx)(o.A,{name:"public"})]})]})]}),!s&&(0,a.jsx)("div",{className:"facebook-preview__post-header-more"})]})},98714(e,t,s){"use strict";s.d(t,{A:()=>n});s(96929);var r=s(10790);const n=({name:e})=>(0,r.jsx)("i",{className:`facebook-preview__post-icon facebook-preview__post-icon-${e}`})},54560(e,t,s){"use strict";s.d(t,{m:()=>c});var r=s(76223),n=(s(27998),s(10790));const o=160,a=e=>{const t=e.startsWith("https://")?"https://":"http://",s=t+e.replace(t,"").split("/").join(" ");return(0,r.RA)((0,r.f5)(68),(0,r.ZT)(68))(s)},i=(0,r.RA)((0,r.f5)(63),(0,r.y5)(23,73),(0,r.ZT)(63)),l=(0,r.RA)((0,r.f5)(o),(0,r.y5)(80,170),(0,r.ZT)(o)),c=({description:e="",siteTitle:t,title:s="",url:o=""})=>{const c=(0,r.GA)(o);return(0,n.jsx)("div",{className:"search-preview",children:(0,n.jsxs)("div",{className:"search-preview__display",children:[(0,n.jsxs)("div",{className:"search-preview__header",children:[(0,n.jsxs)("div",{className:"search-preview__branding",children:[(0,n.jsx)("img",{className:"search-preview__icon",src:`https://www.google.com/s2/favicons?sz=128&domain_url=${c}`,alt:""}),(0,n.jsxs)("div",{className:"search-preview__site",children:[(0,n.jsx)("div",{className:"search-preview__site--title",children:t||c}),(0,n.jsx)("div",{className:"search-preview__url",children:a(o)})]})]}),(0,n.jsx)("div",{className:"search-preview__menu",children:(0,n.jsx)("svg",{focusable:"false",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})})})]}),(0,n.jsx)("div",{className:"search-preview__title",children:i(s)}),(0,n.jsx)("div",{className:"search-preview__description",children:l((0,r.$J)(e))})]})})}},76223(e,t,s){"use strict";s.d(t,{$J:()=>d,GA:()=>a,RA:()=>u,TR:()=>b,X2:()=>p,ZT:()=>c,f5:()=>i,hV:()=>f,tX:()=>m,ti:()=>h,vI:()=>g,x5:()=>k,y5:()=>l});var r=s(86087),n=s(27723),o=s(10790);const a=e=>{const t=e.replace(/^[^/]+:\/\//,""),s=t.indexOf("/");return-1===s?t:t.substring(0,s)},i=e=>t=>t.length<=e&&t,l=(e,t)=>s=>{const r=s.slice(0,t),n=r.lastIndexOf(" ");return n>e&&n<t&&r.slice(0,n).concat("…")},c=e=>t=>t.slice(0,e).concat("…"),u=(...e)=>t=>e.find(e=>!1!==e(t))?.(t),d=(e,t=[])=>{const s=new RegExp(`(<([^${t.join("")}>]+)>)`,"gi");return e?e.replace(s,""):""},p=e=>d(e).substring(0,50),h=(e,t)=>new RegExp(`<${t}[^>]*>`,"gi").test(e),m=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format,g=new Intl.DateTimeFormat("en-US",{day:"2-digit",month:"2-digit",year:"numeric"}).format,f=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format,b=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format,v={twitter:"https://twitter.com/hashtag/%1$s",facebook:"https://www.facebook.com/hashtag/%1$s",linkedin:"https://www.linkedin.com/feed/hashtag/?keywords=%1$s",instagram:"https://www.instagram.com/explore/tags/%1$s",mastodon:"https://%2$s/tags/%1$s",nextdoor:"https://nextdoor.com/hashtag/%1$s",threads:"https://www.threads.net/search?q=%1$s&serp_type=tags",tumblr:"https://www.tumblr.com/tagged/%1$s",bluesky:"https://bsky.app/hashtag/%1$s"};function k(e,t){const{platform:s,maxChars:a,maxLines:i,hyperlinkHashtags:l=!0,hyperlinkUrls:u="instagram"!==s}=t;let p=d(e);if(p=p.replaceAll(/(?:\s*[\n\r]){2,}/g,"\n\n"),a&&p.length>a&&(p=c(a)(p)),i){const e=p.split("\n");e.length>i&&(p=e.slice(0,i).join("\n"))}const h={};if(u){(p.match(/(https?:\/\/\S+)/g)||[]).forEach((e,t)=>{h[`Link${t}`]=(0,o.jsx)("a",{href:e,rel:"noopener noreferrer",target:"_blank",children:e}),p=p.replace(e,`<Link${t} />`)})}if(l&&v[s]){const e=p.matchAll(/(^|\s)#(\w+)/g),r=v[s];[...e].forEach(([e,s,a],i)=>{const l=(0,n.sprintf)(r,a,t.hashtagDomain);h[`Hashtag${i}`]=(0,o.jsx)("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:`#${a}`}),p=p.replace(e,`${s}<Hashtag${i} />`)})}return p=p.replace(/\n/g,"<br />"),h.br=(0,
// translators: refers to the actor level of the post being shared, e.g. "1st", "2nd", "3rd", etc.
__("1st","jetpack")})]}),s?(0,i.jsx)("div",{className:"linkedin-preview__header--profile-title",children:s}):null,(0,i.jsxs)("div",{className:"linkedin-preview__header--profile-meta",children:[(0,i.jsx)("span",{children:
// translators: refers to the time since the post was published, e.g. "1h"
__("1h","jetpack")}),(0,i.jsx)("span",{children:"•"}),(0,i.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor",width:"16",height:"16",focusable:"false",children:(0,i.jsx)("path",{d:"M8 1a7 7 0 107 7 7 7 0 00-7-7zM3 8a5 5 0 011-3l.55.55A1.5 1.5 0 015 6.62v1.07a.75.75 0 00.22.53l.56.56a.75.75 0 00.53.22H7v.69a.75.75 0 00.22.53l.56.56a.75.75 0 01.22.53V13a5 5 0 01-5-5zm6.24 4.83l2-2.46a.75.75 0 00.09-.8l-.58-1.16A.76.76 0 0010 8H7v-.19a.51.51 0 01.28-.45l.38-.19a.74.74 0 01.68 0L9 7.5l.38-.7a1 1 0 00.12-.48v-.85a.78.78 0 01.21-.53l1.07-1.09a5 5 0 01-1.54 9z"})})]})]})]}),(0,i.jsxs)("div",{className:"linkedin-preview__content",children:[u?(0,i.jsxs)("div",{className:"linkedin-preview__caption",children:[(0,i.jsx)("span",{children:(0,o.x5)(u,{platform:"linkedin",maxChars:a.v})}),m&&h&&(0,i.jsxs)(i.Fragment,{children:[" - ",(0,i.jsx)("a",{href:h,rel:"nofollow noopener noreferrer",target:"_blank",children:h})]})]}):null,m?(0,i.jsx)("div",{className:"linkedin-preview__media",children:d.map((e,t)=>(0,i.jsx)("div",{className:"linkedin-preview__media-item",children:e.type.startsWith("video/")?(0,i.jsx)("video",{controls:!0,children:(0,i.jsx)("source",{src:e.url,type:e.type})}):(0,i.jsx)("img",{alt:e.alt||"",src:e.url})},`linkedin-preview__media-item-${t}`))}):(0,i.jsxs)("article",{children:[t?(0,i.jsx)("img",{className:"linkedin-preview__image",src:t,alt:""}):null,h?(0,i.jsxs)("div",{className:"linkedin-preview__description",children:[(0,i.jsx)("h2",{className:"linkedin-preview__description--title",children:p||(0,o.X2)(u)}),(0,i.jsxs)("div",{className:"linkedin-preview__description--meta",children:[(0,i.jsx)("span",{className:"linkedin-preview__description--url",children:(0,o.GA)(h)}),(0,i.jsx)("span",{children:"•"}),(0,i.jsx)("span",{children:(0,r.sprintf)(
// translators: %d is the number of minutes it takes to read the article
__("%d min read","jetpack"),e)})]})]}):null]})]})]})})}},17562(e,t,s){"use strict";s.d(t,{w:()=>r});const r="mastodon.social"},50710(e,t,s){"use strict";s.d(t,{gD:()=>n});var r=s(76223);const n=e=>(0,r.RA)((0,r.f5)(200),(0,r.ZT)(200))((0,r.$J)(e))||""},5874(e,t,s){"use strict";s.d(t,{i:()=>i});var r=s(74822),n=s(23163),o=s(39490),a=(s(44110),s(10790));const i=e=>{const{user:t}=e;return(0,a.jsxs)("div",{className:"mastodon-preview__post",children:[(0,a.jsx)(o.A,{user:t}),(0,a.jsx)(n.A,{...e,customImage:""}),(0,a.jsx)(r.A,{})]})}},74822(e,t,s){"use strict";s.d(t,{A:()=>n});s(16341);var r=s(10790);const n=()=>(0,r.jsxs)("div",{className:"mastodon-preview__post-actions",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z"})})," ",(0,r.jsx)("span",{children:0})]}),(0,r.jsx)("div",{children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M280-80 120-240l160-160 56 58-62 62h406v-160h80v240H274l62 62-56 58Zm-80-440v-240h486l-62-62 56-58 160 160-160 160-56-58 62-62H280v160h-80Z"})})}),(0,r.jsx)("div",{children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z"})})}),(0,r.jsx)("div",{children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z"})})}),(0,r.jsx)("div",{children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z"})})})]})},23163(e,t,s){"use strict";s.d(t,{A:()=>l});var r=s(27723),n=s(13022),o=s(76223),a=s(50710),i=(s(24716),s(10790));const __=r.__,l=({siteName:e,title:t,description:s,url:r,image:l,customImage:c})=>(0,i.jsxs)("div",{className:(0,n.A)("mastodon-preview__card",{"has-image":l}),children:[(0,i.jsx)("div",{className:"mastodon-preview__card-img",children:l||c?(0,i.jsx)("img",{src:l||c,alt:__("Mastodon preview thumbnail","jetpack")}):(0,i.jsx)("div",{className:"mastodon-preview__card-img--fallback",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 -960 960 960",width:"24","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M320-240h320v-80H320v80Zm0-160h320v-80H320v80ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520h200L520-800v200Z"})})})}),(0,i.jsxs)("div",{className:"mastodon-preview__card-text",children:[(0,i.jsx)("span",{className:"mastodon-preview__card-site",children:e||(0,o.GA)(r)}),(0,i.jsx)("span",{className:"mastodon-preview__card-title",children:(0,a.gD)(t)||(0,o.X2)(s)}),(0,i.jsx)("span",{className:"mastodon-preview__card-description",children:(0,o.$J)(s)})]})]})},39490(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(27723),n=s(50513),o=s(76223),a=s(17562),i=s(12625),l=(s(16585),s(10790));const __=r.__,c=({user:e})=>{const{displayName:t,address:s,avatarUrl:r}=e||{};return(0,l.jsxs)("div",{className:"mastodon-preview__post-header",children:[(0,l.jsxs)("div",{className:"mastodon-preview__post-header-user",children:[(0,l.jsx)(n._,{className:"mastodon-preview__pos
// translators: username of a fictional Mastodon User
__("anonymous-user","jetpack")}),(0,l.jsx)("div",{className:"mastodon-preview__post-header-username",children:s?.replace(`@${a.w}`,"")||"@username"})]})]}),(0,l.jsxs)("div",{className:"mastodon-preview__post-header-audience",children:[(0,l.jsx)(i.f,{}),(0,o.TR)(new Date)]})]})}},12625(e,t,s){"use strict";s.d(t,{f:()=>n});var r=s(10790);function n(){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"15",viewBox:"0 -960 960 960",width:"15",role:"img",children:(0,r.jsx)("path",{d:"M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm-40-82v-78q-33 0-56.5-23.5T360-320v-40L168-552q-3 18-5.5 36t-2.5 36q0 121 79.5 212T440-162Zm276-102q20-22 36-47.5t26.5-53q10.5-27.5 16-56.5t5.5-59q0-98-54.5-179T600-776v16q0 33-23.5 56.5T520-680h-80v80q0 17-11.5 28.5T400-560h-80v80h240q17 0 28.5 11.5T600-440v120h40q26 0 47 15.5t29 40.5Z"})})}},73192(e,t,s){"use strict";s.d(t,{v:()=>r});const r=500},28236(e,t,s){"use strict";s.d(t,{$:()=>l});var r=s(27723),n=s(38013),o=s(30073),a=s(78607),i=s(10790);const __=r.__;function l(){return(0,i.jsxs)("div",{className:"nextdoor-preview__footer--actions",children:[(0,i.jsxs)("div",{className:"nextdoor-preview__footer--actions-item",children:[(0,i.jsx)(o.p,{}),(0,i.jsx)("span",{children:__("Like","jetpack")})]}),(0,i.jsxs)("div",{className:"nextdoor-preview__footer--actions-item",children:[(0,i.jsx)(n.T,{}),(0,i.jsx)("span",{children:__("Comment","jetpack")})]}),(0,i.jsxs)("div",{className:"nextdoor-preview__footer--actions-item",children:[(0,i.jsx)(a.l,{}),(0,i.jsx)("span",{children:__("Share","jetpack")})]})]})}},96739(e,t,s){"use strict";s.d(t,{z:()=>n});var r=s(10790);function n(){return(0,r.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":"true",children:(0,r.jsx)("path",{fill:"#dfe1e4",fillRule:"evenodd",d:"M7.127 13.876a.732.732 0 1 0 1.035 1.035l4.75-4.749a.732.732 0 0 0 0-1.035L8.123 4.34A.732.732 0 0 0 7.09 5.375l4.27 4.27-4.232 4.23Z"})})}},38013(e,t,s){"use strict";s.d(t,{T:()=>n});var r=s(10790);function n(){return(0,r.jsx)("svg",{width:"20",height:"20",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 10.031C2 5.596 5.574 2 10 2h4c4.427 0 8 3.596 8 8.031 0 4.435-3.573 8.031-8 8.031h-1.52a17.033 17.033 0 0 1-1.377 1.467c-.991.938-2.456 2.079-4.086 2.437a1.403 1.403 0 0 1-1.458-.565 1.55 1.55 0 0 1-.195-1.394c.28-.823.395-1.734.434-2.464.014-.257.018-.485.018-.672A8.017 8.017 0 0 1 2 10.031Zm5.798 6.178a7.02 7.02 0 0 1 .016.418c.005.252.004.606-.019 1.023-.03.573-.103 1.285-.266 2.024.775-.377 1.54-.974 2.202-1.598a15.066 15.066 0 0 0 1.448-1.586l.017-.022.003-.004a1 1 0 0 1 .801-.402h2c3.314 0 6-2.692 6-6.03C20 6.691 17.314 4 14 4h-4c-3.314 0-6 2.692-6 6.031 0 2.336 1.32 4.36 3.258 5.359.308.159.515.474.54.82Z",clipRule:"evenodd"})})}},84247(e,t,s){"use strict";s.d(t,{z:()=>n});var r=s(10790);function n(){return(0,r.jsx)("div",{className:"nextdoor-preview__default-image",children:(0,r.jsxs)("svg",{width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",color:"#055c00",children:[(0,r.jsx)("path",{fill:"currentColor",d:"M13.207 5.207c1.51-1.51 4.076-1.51 5.586 0 1.51 1.51 1.51 4.076 0 5.586l-2.1 2.1c-1.51 1.51-4.077 1.51-5.586 0a1 1 0 1 0-1.414 1.414c2.29 2.29 6.123 2.29 8.414 0l2.1-2.1c2.29-2.29 2.29-6.124 0-8.414s-6.124-2.29-8.414 0l-.7.7a1 1 0 0 0 1.414 1.414l.7-.7Z"}),(0,r.jsx)("path",{fill:"currentColor",d:"M7.307 11.107c1.51-1.51 4.076-1.51 5.586 0a1 1 0 0 0 1.414-1.414c-2.29-2.29-6.124-2.29-8.414 0l-2.1 2.1c-2.29 2.29-2.29 6.123 0 8.414 2.29 2.29 6.124 2.29 8.414 0l.7-.7a1 1 0 0 0-1.414-1.414l-.7.7c-1.51 1.51-4.076 1.51-5.586 0-1.51-1.51-1.51-4.076 0-5.586l2.1-2.1Z"})]})})}},10569(e,t,s){"use strict";s.d(t,{f:()=>n});var r=s(10790);function n(){return(0,r.jsx)("svg",{width:"14",height:"14",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,r.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 12C2 6.477 6.4
// translators: "Delete" action on a Tumblr post
label:__("Delete","jetpack")},{icon:"edit",
// translators: "Edit" action on a Tumblr post
label:__("Edit","jetpack")}].map(({icon:e,label:t})=>(0,o.jsx)("li",{"aria-label":t,children:(0,o.jsx)(n.A,{name:e})},e))})]}),(0,o.jsxs)("div",{className:"tumblr-preview__post-social-actions",children:[(0,o.jsx)("div",{children:
// translators: count of notes on a Tumblr post
__("0 notes","jetpack")}),(0,o.jsx)("ul",{children:[{icon:"share",
// translators: "Share" action on a Tumblr post
label:__("Share","jetpack")},{icon:"reply",
// translators: "Reply" action on a Tumblr post
label:__("Reply","jetpack")},{icon:"reblog",
// translators: "Reblog" action on a Tumblr post
label:__("Reblog","jetpack")},{icon:"like",
// translators: "Like" action on a Tumblr post
label:__("Like","jetpack")}].map(({icon:e,label:t})=>(0,o.jsx)("li",{"aria-label":t,children:(0,o.jsx)(n.A,{name:e})},e))})]})]})},70793(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(27723),n=s(17712),o=(s(95178),s(10790));const __=r.__,a=({user:e})=>(0,o.jsxs)("div",{className:"tumblr-preview__post-header",children:[(0,o.jsx)("div",{className:"tumblr-preview__post-header-username",children:e?.displayName||
// translators: username of a fictional Tumblr User
__("anonymous-user","jetpack")}),(0,o.jsx)(n.A,{name:"ellipsis"})]})},17712(e,t,s){"use strict";s.d(t,{A:()=>n});s(13951);var r=s(10790);const n=({name:e})=>{let t;switch(e){case"blaze":t=(0,r.jsx)("svg",{viewBox:"0 0 25 22",children:(0,r.jsx)("path",{d:"m7.5059-0.24414c-0.79843 0.057223-1.2169 0.88587-1.1635 1.6128-0.2266 2.0449-1.4898 3.8696-3.1975 4.9778-3.0182 2.414-4.2201 6.8066-2.8033 10.411 0.92417 2.4679 2.9589 4.5674 5.4768 5.3928 0.95914 0.16102 1.7233-0.94358 1.3074-1.8059-0.11578-0.51062-0.17482-0.96516-0.17845-1.487 1.0413 1.5607 2.5484 2.8986 4.341 3.4975 1.0396-0.0154 1.98-0.64458 2.8516-1.1608 3.3821-2.1786 4.9604-6.7097 3.6597-10.518-0.49144-1.4599-1.2948-2.8935-2.5028-3.8698-0.7512-0.45498-1.661 0.09677-1.9202 0.86038-0.12274 0.16822-0.70352 1.1955-0.6191 0.61976 0.25488-3.4397-1.6789-7.0066-4.8123-8.4958-0.14322-0.037843-0.292-0.049464-0.43945-0.035156zm1.0586 3.5605c1.8947 2.0016 2.2326 5.1984 0.89062 7.5879-0.38498 0.96148 0.71762 2.0063 1.6567 1.5681 1.4159-0.4624 2.6998-1.3259 3.6577-2.4665 1.6442 2.5888 1.1465 6.2819-1.0629 8.3379-0.62378 0.60782-1.3666 1.0945-2.1754 1.4179-1.9543-0.989-3.3534-3.0966-3.5625-5.3125-0.25636-1.0253-1.81-1.2013-2.2852-0.25781-0.75058 1.3054-1.1846 2.7948-1.2305 4.3008-2.2396-1.9852-2.8468-5.4435-1.4609-8.0527 0.58926-1.239 1.651-2.13 2.724-2.9329 1.2958-1.1271 2.2791-2.62 2.7682-4.2683l0.071578 0.069832z"})});break;case"delete":t=(0,r.jsxs)("svg",{viewBox:"0 0 14 17",children:[(0,r.jsx)("path",{d:"M12 5v9c.1.7-.3 1-1 1H3c-.5 0-.9-.3-1-1V5c0-.6-.4-1-1-1-.5 0-1 .4-1 1v9.5C0 16.1 1.4 17 3 17h8c1.8 0 3-.8 3-2.5V5c0-.6-.5-1-1-1-.6 0-1 .5-1 1z"}),(0,r.jsx)("path",{d:"M4 12s0 1 1 1 1-1 1-1V5c0-.5-.4-1-1-1-.5 0-1 .5-1 1v7zm4 0s0 1 1 1 1-1 1-1V5c0-.5-.4-1-1-1-.5 0-1 .5-1 1v7zm5-10c.5 0 1-.4 1-1 0-.5-.4-.9-1-1H1C.5.1 0 .5 0 1c0 .6.6 1 1.1 1H13z"})]});break;case"edit":t=(0,r.jsx)("svg",{viewBox:"0 0 17.6 17.6",children:(0,r.jsx)("path",{d:"M5.3 13.8l-2.1.7.7-2.1L10.3 6l1.4 1.4-6.4 6.4zm6.4-9.3l-1.4-1.4-1.4 1.4-6.7 6.7-.2.5-2 5.9 3.8-1.3 2.1-.7.4-.1.3-.3 7.8-7.8c.1 0-2.7-2.9-2.7-2.9zm5.6-1.4L14.5.3c-.4-.4-1-.4-1.4 0l-1.4 1.4L15.9 6l1.4-1.4c.4-.5.4-1.1 0-1.5"})});break;case"share":t=(0,r.jsx)("svg",{viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12.6173 1.07612C12.991 0.921338 13.4211 1.00689 13.7071 1.29289L22.7071 10.2929C23.0832 10.669 23.0991 11.2736 22.7433 11.669L13.7433 21.669C13.4663 21.9767 13.0283 22.082 12.6417 21.9336C12.2552 21.7853 12 21.414 12 21V16H11.5C7.31775 16 3.92896 18.2486 2.95256 21.3044C2.80256 21.7738 2.33292 22.064 1.84598 21.9881C1.35904 21.9122 1 21.4928 1 21V18.5C1 12.3162 5.88069 7.27245 12 7.01067V2C12 1.59554 12.2436 1.2309 12.6173 1.07612ZM14 4.41421V8C14 8.55228 13.5523 9 13 9H12.5C7.64534 9 3.64117 12.6414 3.06988 17.3419C5.09636 15.2366 8.18218 14 11.5 14H13C13.5523 14 14 14.4477 14 15V18.394L20.622 11.0362L14 4.41421Z"})});break;case"reply":t=(0,r.jsx)("svg",{viewBox:"0 0 17 17",children:(0,r.jsx)("path",{d:"M8.7 0C4.1 0 .4 3.7.4 8.3c0 1.2.2 2.3.7 3.4-.2.6-.4 1.5-.7 2.5L0 15.8c-.2.7.5 1.4 1.2 1.2l1.6-.4 2.4-.7c1.1.5 2.2.7 3.4.7 4.6 0 8.3-3.7 8.3-8.3C17 3.7 13.3 0 8.7 0zM15 8.3c0 3.5-2.8 6.3-6.4 6.3-1.2 0-2.3-.3-3.2-.9l-3.2.9.9-3.2c-.5-.9-.9-2-.9-3.2.1-3.4 3-6.2 6.5-6.2S15 4.8 15 8.3z"})});break;case"reblog":t=(0,r.jsx)("svg",{viewBox:"0 0 17 18.1",children:(0,r.jsx)("path",{d:"M12.8.2c-.4-.4-.8-.2-.8.4v2H2c-2 0-2 2-2 2v5s0 1 1 1 1-1 1-1v-4c0-1 .5-1 1-1h9v2c0 .6.3.7.8.4L17 3.6 12.8.2zM4.2 17.9c.5.4.8.2.8-.3v-2h10c2 0 2-2 2-2v-5s0-1-1-1-1 1-1 1v4c0 1-.5 1-1 1H5v-2c0-.6-.3-.7-.8-.4L0 14.6l4.2 3.3z"})});break;case"like":t=(0,r.jsx)("svg",{viewBox:"0 0 20 18",children:(0,r.jsx)("path",{d:"M14.658 0c-1.625 0-3.21.767-4.463 2.156-.06.064-.127.138-.197.225-.074-.085-.137-.159-.196-.225C8.547.766 6.966 0 5.35 0 4.215 0 3.114.387 2.162 1.117c-2.773 2.13-2.611 5.89-1.017 8.5 2.158 3.535 6.556 7.18 7.416 7.875A2.3 2.3 0 0 0 9.998 18c.519 0 1.028-.18 1.436-.508.859-.695 5.257-4.34 7.416-7.875 1.595-2.616 1.765-6.376-1-8.5C16.895.387 15.792 0 14.657 0h.001zm0 2.124c.645 0 1.298.208 1.916.683 1.903 1.461 1.457 4.099.484 5.695-1.973 3.23-6.16 6.7-6.94 7.
_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:s})}),(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,n.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=>s({label:e})})]})})]})}},95184(e,t,s){"use strict";var r=s(74997),n=s(94375),o=s(35116),a=s(20201);(0,n.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,r.createBlock)("core/heading",{content:e.raw.title,level:3}):null,s=(0,r.createBlock)("jetpack/blog-stats",{label:e.raw.hits});return t?[t,s]:s}}]}})},51744(e,t,s){"use strict";s.d(t,{k:()=>c});var r=s(97999),n=s(85985),o=s(56427),a=s(27723),i=s(35116),l=s(10790);const __=a.__,c=({className:e,isLoading:t,changeStatus:s})=>{const a=(0,r.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,n.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:()=>s(!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,s){"use strict";s.d(t,{A:()=>g});var r=s(1455),n=s.n(r),o=s(94715),a=s(56427),i=s(47143),l=s(86087),c=s(27723),u=s(93832),d=s(13022),p=s(54919),h=s(9075),m=s(10790);const __=c.__,_x=c._x;const g=(0,a.withNotices)(function({attributes:e,noticeOperations:t,noticeUI:s,setAttributes:r}){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=>r({tagsAdded:e}));const E=(0,i.useSelect)(e=>{const{getEntityRecord:t,hasFinishedResolution:s}=e("core"),r=t("root","site")?.language||"en_US";return s("getEntityRecord",["root","site"])?r:null},[]);(0,l.useEffect)(()=>{if(!E||g.current||k)return;const e=()=>{r({promptFetched:!1,promptId:null,tagsAdded:!1}),g.current=!1,t.removeAllNotices()};let s="/wpcom/v3/blogging-prompts";if(y)s+="/"+encodeURIComponent(y);else{const e=new Date;s+=`?after=--${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}&order=desc`}s=(0,u.addQueryArgs)(s,{_locale:E,force_year:(new Date)?.getFullYear()}),g.current=!0,n()({path:s}).then(e=>{const t=y?e:e[0],s=(0,p.i)(E);r({answersLink:t.answered_link+`?locale=${s}`,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(s=>{r({promptFetched:!0});const n="rest_post_invalid_id"===s.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")})]}))(s.message);var o;t.removeAllNotices(),t.createErrorNotice(n)})},[g,t,k,y,r,E]);const N=e=>{r({showLabel:e})},T=e=>{r({showResponses:e})},B=(0,d.A)(["jetpack-blogging-prompt__label"],{"is-bloganuary-icon":A});return(0,m.jsxs)("div",{...S,children:[s,(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:B,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,s){"use strict";var r=s(74997),n=s(47143),o=s(27723),a=s(94375),i=s(30552),l=s(32442),c=s(12169),u=s(63757),d=s(94530),p=s(86239),h=s(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,r.getBlockType)("jetpack/blogging-prompt")||await new Promise(e=>{(0,a.M)(l,v),setTimeout(e,0)});const{insertBlocks:t}=(0,n.dispatch)("core/block-editor");t([(0,r.createBlock)("jetpack/blogging-prompt",{promptFetched:!1,promptId:e,tagsAdded:!0}),(0,r.createBlock)("core/paragraph")],0,void 0,!1)}g&&b&&k(b)},57028(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(94715),n=s(13022),o=s(10790);const a=function({attributes:e}){const{answersLink:t,answersLinkText:s,gravatars:a,promptId:i,promptLabel:l,promptText:c,showLabel:u,showResponses:d,isBloganuary:p}=e,h=r.useBlockProps.save({className:"jetpack-blogging-prompt"}),m=(0,n.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:s})]})]})}},9075(e,t,s){"use strict";s.d(t,{J:()=>c});var r=s(1455),n=s.n(r),o=s(47143),a=s(86087),i=s(89877);function l(e){const t=(0,i.escapeHTML)(e);return n()({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,s){const{editPost:r}=(0,o.useDispatch)("core/editor"),n=(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===u.length?null:{_fields:"id,na
__("No sites found for %s.","jetpack"),s)})]}),e.length>0&&(0,o.jsx)("ul",{"aria-live":"polite",children:e.map((e,s)=>{const r=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:r,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}-${s}`)})})]})}},17454(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(56427),n=s(27723),o=s(10790);const __=n.__;function a({value:e,onChange:t}){return(0,o.jsx)("div",{className:"jetpack-blogroll__appender-search",children:(0,o.jsx)(r.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,s){"use strict";s.d(t,{A:()=>h});var r=s(56427),n=s(47143),o=s(86087),a=s(27723),i=s(60167),l=s(92507),c=s(85101),u=s(40536),d=s(17454),p=s(10790);const __=a.__;function h({isLoading:e,subscriptions:t,clientId:s}){const[a,h]=(0,o.useState)(!1),[m,g]=(0,o.useState)(),[f,b]=(0,o.useState)(""),{insertBlock:v}=(0,n.dispatch)("core/block-editor"),{siteDetails:k,isLoading:y}=(0,l.A)({siteURL:f,subscriptions:t,enabled:f});return e?(0,p.jsx)(r.Spinner,{className:"jetpack-blogroll__appender-spinner"}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.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)(r.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,s),h(!1)},searchInput:f,isLoading:y})]})]})}},63166(e,t,s){"use strict";s.d(t,{A:()=>v});var r=s(94715),n=s(74997),o=s(56427),a=s(47143),i=s(86087),l=s(27723),c=s(13022),u=s(2274),d=s(26247),p=s(37127),h=s(32130),m=s(46542),g=s(25688),f=s(85101),b=s(10790);const __=l.__;const v=function({className:e,attributes:t,setAttributes:s,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){s({load_placeholders:!1});const e=[(0,n.createBlock)("core/heading",{content:__("Blogroll","jetpack"),level:3}),...C.map(f.dy)];T(l,e)}},[C,j,s,l,T]);const B=(0,r.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 P=A||N;return(0,b.jsxs)("div",{...B,children:[(0,b.jsx)(r.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})}),P&&(0,b.jsx)(o.Notice,{status:"error",isDismissible:!1,children:(0,b.jsx)("p",{children:P})}),j&&_&&(0,b.jsx)(o.FlexBlock,{style:{padding:"30px",textAlign:"center"},children:(0,b.jsx)(o.Spinner,{})}),(0,b.jsx)(r.InspectorControls,{children:(0,b.jsxs)(o.PanelBody,{title:__("Settings","jetpack"),children:[(0,b.jsx)(o.ToggleControl,{label:__("Show avatar","jetpack"),checked:!!v,onChange:()=>s({show_avatar:!v}),__nextHasNoMarginBottom:!0}),(0,b.jsx)(o.ToggleControl,{label:__("Show description","jetpack"),checked:!!k,onChange:()
// translators: %s is a link to the cookie policy.
__("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,s){"use strict";s.d(t,{A:()=>c});var r=s(94715),n=s(56427),o=s(27723),a=s(68071),i=s(34839),l=s(10790);const __=o.__;const c=function({clientId:e,attributes:t,setAttributes:s}){const{consentExpiryDays:c,align:u,text:d=a.a}=t;(0,i.w)(e);const p=(0,r.useBlockProps)({className:`wp-block-jetpack-cookie-consent align${u}`});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r.InspectorControls,{children:(0,l.jsxs)(n.PanelBody,{title:__("Block Settings","jetpack"),children:[(0,l.jsx)(n.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}:{};s({...t,align:e})}(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,l.jsx)(n.TextControl,{label:__("Consent Expiry Time (in days)","jetpack"),value:c,type:"number",min:"1",max:"365",onChange:e=>s({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)(r.RichText,{tagName:"p",value:d,onChange:e=>s({text:e})}),(0,l.jsx)(r.InnerBlocks,{allowedBlocks:["core/button"],template:[["core/button",{text:__("Accept","jetpack")}]],templateLock:"all"})]})]})}},78165(e,t,s){"use strict";var r=s(94375),n=s(74095),o=s(15216),a=s(75757);(0,r.M)(n,{edit:o.A,save:a.A})},75757(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(94715),n=s(68071),o=s(10790);function a({attributes:e}){const t=r.useBlockProps.save(),{text:s=n.a,consentExpiryDays:a}=e;return(0,o.jsxs)("div",{...t,style:t.style,role:"dialog","aria-modal":"true",children:[(0,o.jsx)(r.RichText.Content,{tagName:"p",value:s}),(0,o.jsx)(r.InnerBlocks.Content,{}),(0,o.jsx)("span",{children:a})]})}},34839(e,t,s){"use strict";s.d(t,{w:()=>l});var r=s(74997),n=s(29491),o=s(3582),a=s(47143),i=s(86087);function l(e){const t=(0,a.useSelect)(e=>{const{isSavingPost:t,isSavingNonPostEntityChanges:s}=e("core/editor");return t()||s()},[]),s=!(!(0,n.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)(()=>{s&&!u&&h((0,r.serialize)([p(e)]))},[s,u,h,p,e])}},75800(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(4567),n=s(3975),o=s(94715),a=s(86087),i=s(13022),l=s(72730),c=s(10790);const u=({className:e=null,currency:t=null,defaultValue:s=null,disabled:u=!1,label:d="",onChange:p=null,value:h=""})=>{const[m,g]=(0,a.useState)((0,r.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,s)=>{g(r=>{if(e!==r){const r=(0,l.C_)(e,t);r&&r>=(0,l.dv)(t)?(k(!1),s&&p?.(r)):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,n=()=>{b(!1),m||x((0,r.Ay)(s,t,{symbol:""}))};return e.addEventListener("blur",n),()=>{e.removeEventListener("blur",n)}},[t,s,m,y,x]),(0,a.useEffect)(()=>{f||v||g((0,r.Ay)(h,t,{symbol:""}))},[t,f,v,h]),(0,a.useEffect)(()=>{x((0,r.Ay)(h,t,{symbol:""}))},[t,h]),(0,c.jsxs)("div",{className:(0,i.A)("donations__amount",e,{"has-focus":f,"has-error":v}),role:"button",tabIndex:0,onC
// translators: %d: Tier level e.g: "1", "2", "3"
__("Tier %d","jetpack"),t+1),onChange:e=>((e,t)=>{const s=[...x];s[t]=e,k("amounts",s)})(e,t),value:e},`jetpack-donations-amount-${t}`))}),m&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.RichText,{tagName:"p",placeholder:__("Write a message…","jetpack"),value:f,onChange:e=>s({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)(r.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)(r.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 s({oneTimeDonation:{...d,buttonText:t},monthlyDonation:{...p,buttonText:t},annualDonation:{...h,buttonText:t}});var t},allowedFormats:j})})]})}},36580(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(86087),n=s(27723),o=s(13022),a=s(57018),i=s(62225),l=s(10790);const __=n.__,c=e=>{const{attributes:t,products:s,setAttributes:n}=e,{oneTimeDonation:c,monthlyDonation:u,annualDonation:d}=t,[p,h]=(0,r.useState)("one-time"),m=(0,r.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,r.useEffect)(()=>{c.planId===s["one-time"]&&u.planId===s["1 month"]&&d.planId===s["1 year"]||n({...s["one-time"]&&{oneTimeDonation:{...c,planId:s["one-time"]}},...s["1 month"]&&{monthlyDonation:{...u,planId:s["1 month"]}},...s["1 year"]&&{annualDonation:{...d,planId:s["1 year"]}}})},[c,u,d,n,s]),(0,r.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:n})})]}),(0,l.jsx)(a.A,{...e})]})}},75703(e,t,s){"use strict";function r(){if("undefined"==typeof window)return{};const e=window.Jetpack_DonationsBlock?.defaultTexts;return"object"!=typeof e?{}:e}s.d(t,{O:()=>r})},36850(e,t,s){"use strict";s.d(t,{GY:()=>n,_t:()=>r,gQ:()=>o});const r=/^\s*https?:\/\/(?:www\.)?(?:eventbrite\.[a-z.]+)\/e\/[^/]*?(\d+)\/?(?:\?[^/]*)?\s*$/i,n=/^\s*https?:\/\/(?:.+\.)?(?:eventbrite\.[a-z.]+)\/?(?:\?[^/]*)?\s*$/i,o="https://www.eventbrite.com/e/test-event-tickets-123456789"},38449(e,t,s){"use strict";s.d(t,{o:()=>c,s:()=>u});var r=s(56427),n=s(27723),o=s(5873),a=s(72660),i=s(10790);const __=n.__,_x=n._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)(r.ToolbarGroup,{children:(0,i.jsx)(r.ToolbarButton,{className:"components-toolbar__control",label:__("Edit URL","jetpack"),icon:"edit",onClick:()=>e(!0)})}),u=({attributes:e,clientId:t,setAttributes:s})=>(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:s,activeStyle:e.style,attributes:e,viewportWidth:130})},77629(e,t,s){"use strict";s.d(t,{A:()=>r});const r=[s(87879).A]},87879(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(94715),n=s(74997),o=s(27723),a=s(13022),i=s(66087),l=s(10790);const _x=o._x,c=["text","backgroundColor","textColor","customBackgroundColor","customTextCo
_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)(r.Notice,{isDismissible:!1,status:"info",children:t})})})():null,(0,a.jsx)(r.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)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Number of Columns","jetpack"),value:d,onChange:e=>c({columns:e}),min:1,max:6}),(0,a.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Image Spacing (px)","jetpack"),value:g,onChange:e=>c({spacing:e}),min:0,max:50}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Stack on mobile","jetpack"),checked:m,onChange:()=>c({isStackedOnMobile:!m})})]})]})}},11148(e,t,s){"use strict";s.d(t,{A:()=>k});var r=s(85985),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13022),c=s(66087),u=s(78218),d=s(89525),p=s(80427),h=s(57926),m=s(86975),g=s(49783),f=s(53495),b=s(80619),v=s(10790);const __=i.__,k=(0,o.withNotices)(e=>{const t=(0,n.useBlockProps)(),{attributes:s,isSelected:i,noticeOperations:k,noticeUI:y,setAttributes:x}=e,{accessToken:j,align:w,columns:_,count:C,isStackedOnMobile:A,spacing:S}=s;(0,a.useEffect)(()=>{const e=(0,u.y)(d.attributes,s);(0,c.isEqual)(e,s)||x(e)},[s,x]);const[E,N]=(0,a.useState)(j),{isRequestingWpcomConnectUrl:T,wpcomConnectUrl:B}=(0,f.A)(),{images:P,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,r.gB)(),U=C>P.length?P.length:C,H=!I&&(!j||(0,c.isEmpty)(P)),q=!H,V=j&&I&&(0,c.isEmpty)(P),$=!H&&!V,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(P[e]){const t=P[e];return(0,v.jsx)(m.A,{alt:t.title||t.url,src:t.url,attributes:s,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:O.find(e=>e.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=[...O.map(e=>({label:`@${e.username}`,value:e.token})),{label:__("Add a new account","jetpack"),value:p.B}],s=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:s,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||!B,href:B,variant:"secondary",children:__("Connect to WordPress.com","jetpack")})}),V&&(0,v.jsxs)("div",{className:"wp-block-embed is-loading",children:[(0,v.jsx)(o.Spinner,{}),(0,v.jsx)("p",{children:__("Embedding…","jetpack")})]}),$&&(
2025-12-12 13:13:07 +01:00
// translators: %1$d: Number of likes
2026-03-31 11:30:59 +02:00
__("<span>%1$d</span> likes","jetpack"),v.length),{span:(0,h.jsx)("span",{className:"wpl-count-number"})})})})})]})]})}},67511(e,t,s){"use strict";var r=s(94375),n=s(71969),o=s(434);(0,r.M)(n,{edit:o.A,save:()=>null})},40483(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(94715),n=s(56427),o=s(27723),a=s(13022),i=s(54790),l=s(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:s})=>{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}[s];return(0,l.jsxs)("div",{className:(0,a.A)({[`${i.j7}_notication-audition`]:s}),children:[(0,l.jsx)(n.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)(r.InnerBlocks,{template:[[c.name,c.attributes]],templateLock:"all"}),(0,l.jsx)(r.RichText,{tagName:"p",placeholder:__("Write consent text","jetpack"),value:u,onChange:e=>t({consentText:e}),inlineToolbar:!0}),s&&(0,l.jsx)("div",{className:`${i.j7}_notification ${i.j7}_${s}`,role:s===i.Dc?"alert":"status",children:m})]})}},54790(e,t,s){"use strict";s.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:()=>n});var r=s(27723);const __=r.__,n="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,s){"use strict";s.d(t,{o:()=>d});var r=s(94715),n=s(56427),o=s(86087),a=s(27723),i=s(54790),l=s(60462),c=s(10790);const __=a.__,u=({auditionNotification:e,clearAudition:t,setAttributes:s,emailPlaceholder:r=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)(n.PanelBody,{title:__("Text Elements","jetpack"),children:(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Email Placeholder","jetpack"),value:r,onChange:e=>{s({emailPlaceholder:e}),t()}})}),(0,c.jsxs)(n.PanelBody,{title:__("Notifications","jetpack"),children:[(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Processing text","jetpack"),value:o,onChange:t=>{s({processingLabel:t}),e(i.k1)}}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Success text","jetpack"),value:a,onChange:t=>{s({successLabel:t}),e(i.EM)}}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Error text","jetpack"),value:u,onChange:t=>{s({errorLabel:t}),e(i.Dc)}})]}),(0,c.jsxs)(n.PanelBody,{title:__("Mailchimp Groups","jetpack"),children:[(0,c.jsx)(l.A,{interests:d,onChange:(e,t)=>{const r=[...new Set([...d,e])].filter(s=>!(s===e&&!t)&&s);s({interests:r})}}),(0,c.jsx)(n.ExternalLink,{href:"https://mailchimp.com/help/send-groups-audience/",children:__("Learn about groups","jetpack")})]}),(0,c.jsxs)(n.PanelBody,{title:__("Signup Location Tracking","jetpack"),children:[(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Tag","jetpack"),placeholder:__("SIGNUP","jetpack"),value:p,onChange:e=>s({signupFieldTag:e})}),(0,c.jsx)(n.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Signup Field Value","jetpack"),placeholder:__("website","jetpack"),value:h,onChange:e=>s({signupFieldValue:e})}),(0,c.jsx)(n.External
_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:s,instanceId:n,completer:o}=this.props,{selectedIndex:a,filteredOptions:i}=this.state,{key:c=""}=i[a]||{},{className:d}=o,p=i.length>0,h=p?`components-autocomplete-listbox-${n}`:null,m=p?`components-autocomplete-item-${n}-${c}`:null;return(0,u.jsxs)("div",{className:"components-autocomplete",children:[s({isExpanded:p,listBoxId:h,activeId:m,onChange:e,onKeyDown:t}),p&&(0,u.jsx)(r.Popover,{focusOnMount:!1,onClose:this.reset,position:"top center",className:"components-autocomplete__popover",noArrow:!0,children:(0,u.jsx)("div",{id:h,role:"listbox",className:"components-autocomplete__results",children:i.map((e,t)=>(0,u.jsx)(r.Button,{id:`components-autocomplete-item-${n}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:(0,l.A)("components-autocomplete__result",d,{"is-selected":t===a}),onClick:()=>this.select(e),children:e.label},e.key))})})]})}}const h=(0,n.compose)([r.withSpokenMessages,n.withInstanceId,r.withFocusOutside])(p)},82063(e,t,s){"use strict";function r(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"]}s.d(t,{o:()=>r})},16815(e,t,s){"use strict";s.d(t,{BY:()=>i,ES:()=>n,_t:()=>o,iU:()=>a,jF:()=>r});const r=e=>Object.hasOwn(e,"lat")&&Object.hasOwn(e,"lng")?e:{lat:e.latitude||0,lng:e.longitude||0};function n(e,t){const s=new e.LngLatBounds;return t.forEach(e=>{s.extend([e.coordinates.longitude,e.coordinates.latitude])}),s}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,s){"use strict";s.d(t,{IR:()=>u,K5:()=>l,Sm:()=>a,Yc:()=>c,c6:()=>o,nQ:()=>i});var r=s(34377);function n(e){return Math.abs(6371e3*Math.cos(e*Math.PI/180)*2*Math.PI/256)}function o(e,t){return 512/Math.pow(2,e)*.5*n(t)}function a(e,t){const s=e/n(t);return Math.log2(512/(s/.5))}function i(e,t){if(0===t.length)return null;const s=new e.Coordinate(-90,180),r=new e.Coordinate(90,-180);t.forEach(e=>{s.latitude=Math.max(s.latitude,e.coordinates.latitude),s.longitude=Math.min(s.longitude,e.coordinates.longitude),r.latitude=Math.min(r.latitude,e.coordinates.latitude),r.longitude=Math.max(r.longitude,e.coordinates.longitude)});const n=new e.Coordinate(s.latitude-.5*(s.latitude-r.latitude),s.longitude+.5*(r.longitude-s.longitude)),o=new e.CoordinateSpan(1.3*Math.abs(s.latitude-r.latitude),1.3*Math.abs(r.longitude-s.longitude));return new e.CoordinateRegion(n,o)}function l(e,t){return()=>{const s=e.createElement("div");return s.classList.add("mapkit-popup-content"),t(s),s}}function c(e,t){return new Promise(s=>{if(t.mapkitScriptIsLoading)(0,r.Cu)(t,"mapkit").then(e=>{s(e)});else{t.mapkitScriptIsLoading=!0;const n=e.createElement("script");n.addEventListener("load",async()=>{const e=await(0,r.Cu)(t,"mapkit");t.mapkitScriptIsLoading=!1,s(e)},{once:!0}),n.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",n.crossOrigin="a
__("Open Table Preview %s","jetpack"),t),scrolling:"no",src:`https://www.opentable.com/widget/reservation/canvas?rid=${Array.isArray(N)?N.join("%2C"):""}&type=${s}&theme=${r}&overlay=false&domain=${B}&lang=${P&&g.L.includes(P)?P:"en-US"}&newtab=${I}&disablega=true`})]})})()]})]})})},82144(e,t,s){"use strict";var r=s(94715),n=s(74997),o=s(94375),a=s(79018),i=s(34157),l=s(8100),c=s(71833),u=s(50387),d=s(84260),p=s(10790);(0,o.M)(a,{edit:c.A,save:({attributes:{rid:e}})=>{const t=r.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,n.createBlock)("jetpack/opentable",t)}}]},deprecated:[i.A,l.A]})},82101(e,t,s){"use strict";s.d(t,{L:()=>n,P:()=>r});const r=[{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"}],n=r.map(e=>e.value)},98233(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(56427),n=s(86087),o=s(27723),a=s(66087),i=s(10790);const __=o.__,_n=o._n,l=/^\s*(http[s]?:\/\/|<script)/;function c(e){const[t,s]=(0,n.useState)(""),[o,c]=(0,n.useState)(e.rids||[]),u=/^(\d+)$|\(#(\d+)\)$/,d=(0,i.jsx)(r.FormTokenField,{value:o,saveTransform:e=>l.test(e)?"":e.trim(),onInputChange:s,label:_n("Restaurant ID","Restaurant IDs",o.length,"jetpack"),...e,onChange:t=>{const s=t.map(e=>{const t=u.exec(e);if(t){return t[1]||t[2]}return e});c(s),e.onChange&&e.onChange(s)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0});return(0,i.jsx)("div",{className:"wp-block-jetpack-opentable-restaurant-picker",children:e.onSubmit?(0,i.jsxs)("form",{onSubmit:s=>{s.preventDefault(),e.onSubmit((0,a.isEmpty)(o)?t:o)},children:[d,(0,i.jsx)(r.Button,{variant:"secondary",type:"submit",children:__("Embed","jetpack")})]}):d})}},50387(e,t,s){"use strict";s.d(t,{Iy:()=>o,K5:()=>a,i9:()=>n});var r=s(27723);const __=r.__,n={name:"button",label:__("Button (210 x 113 pixels)","jetpack")},o=e=>[{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)&&n].filter(Boolean),a=e=>o(e).map(e=>e.name)},59038(e,t,s){"use strict";s.d(t,{A:()=>n});var r=s(86087);function n(e){const t=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}},84260(e,t,s){"use strict";s.d(t,{JJ:()=>n,XA:()=>o,a9:()=>a});const r=/<\s*script[^>]*src\s*=\s*["']?([^"']*)/i,n=/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 s=new URLSearchParams(t.search);let r=s.get("theme");"button"===s.get("type")&&(r=s.get("type"));let n=s.getAll("rid");if(n&&0!==n.length||(n=s.getAll("restref")),!n||0===n.length)return;const o={};n&&(o.rid=n);const a=s.get("domain");a&&(o.domain=a);const i=s.get("iframe");i&&(o.iframe=i);const l=s.get("lang");l&&(o.lang=l);const c=s.get("newtab");return c&&(o.newtab=c),r&&(o.style=r),o})((e=>{const t=e.match(r);return t&&t[1]?t[1]:n.test(e)||o.test(e)?e:void 0})(e))}},72347(e,t,s){"use strict";s.d(t,{A:()=>f});var r=s(94715),n=s(47143),o=s(86087),a=s(52619),i=s(27723),l=s(13022),c=s(2274),u=s(72462),d=s(53796),p=s(26247),h=s(16521),m=s(10790);const __=i.__,g=["jetpack/recurring-payments"];const f=function({clientId:e,attributes:t}){const{layout:s,fontSize:i}=t,{connectUrl:f,isApiConnected:b}=(0,n.useSelect)(e=>{const{getConnectUrl:t,isApiStateConnected:s}=e(h.M);return{connectUrl:t(),isApiConnected:s()}}),v=(0,p.A)(),k=(0,n.useSelect)(t=>t("core/block-editor")
`${(0,i.sprintf)(__("Loading: %s","jetpack"),s)} ${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,r.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):[],s=t(this.props.tracks),r=new Set(t(e.tracks));s.length===r.size&&s.every(e=>r.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:s,cover:r,tracks:n,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=n.slice(0,m),T=this.getTrack(E),B=(0,d.GU)({primaryColor:f,customPrimaryColor:b,secondaryColor:k,customSecondaryColor:y,backgroundColor:j,customBackgroundColor:w}),P={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,B.secondary.classes,B.background.classes);return(0,g.jsxs)("section",{className:I,style:P,"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:s,cover:r,track:this.getTrack(E),showCoverArt:C,showEpisodeTitle:A,showEpisodeDescription:S,colors:B,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)(
// translators: %s is the track title.
__("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:B})]})]})}}f.defaultProps={title:"",cover:"",link:"",attributes:{url:null,itemsToShow:5,showCoverArt:!0,showEpisodeTitle:!0,showEpisodeDescription:!0},tracks:[]};const b=(0,n.compose)([m.A,(0,o.withSelect)((e,t)=>{const{playerId:s}=t,{getMediaSourceCurrentTime:r,getMediaPlayerState:n}=e(u.ax);return{currentTime:r(s),playerState:n(s)}}),(0,o.withDispatch)(e=>{const{registerMediaSource:t,updateMediaSourceData:s,unregisterMediaSource:r,setDefaultMediaSource:n,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}=e(u.ax);return{registerMediaSource:t,updateMediaSourceData:s,unregisterMediaSource:r,setDefaultMediaSource:n,playMediaSource:o,pauseMediaSource:a,toggleMediaSource:i,errorMediaSource:l,setMediaSourceCurrentTime:c}})])(f)},74050(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(86087),n=s(27723),o=s(10790);const __=n.__,a=(0,r.memo)(({link:e,title:t,colors:s})=>(0,o.jsxs)("div",{className:"jetpack-podcast-player__track-error",children:[__("Episode unavailable.","jetpack")," ",e&&(0,o.jsx)("span",{className:s.secondary.classes,style:{color:s.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,n.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,s){"use strict";s.d(t,{A:()=>i});var r=s(86087),n=s(27723),o=s(62796),a=s(10790);const __=n.__,i=(0,r.memo)(({isPlaying:e,isError:t,className:s})=>{let r,n;t?(n="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]". */
2026-03-31 11:30:59 +02:00
r=__("Error:","jetpack")):e&&(n="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]". */
2026-03-31 11:30:59 +02:00
r=__("Playing:","jetpack"));const i=o[n];return i?(0,a.jsxs)("span",{className:`${s} ${s}--${n}`,children:[(0,a.jsx)("span",{className:"jetpack-podcast-player--visually-hidden",children:`${r} `}),i]}):(0,a.jsx)("span",{className:s})})},91677(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(86087),n=s(27723),o=s(13022),a=s(19812),i=s(74050),l=s(35311),c=s(10790);const __=n.__,u=(0,r.memo)(({track:e,isActive:t,isPlaying:s,isError:r,selectTrack:n,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
/* 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". */
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(),n(u))},onKeyDown:e=>{" "===event.key&&(e.preventDefault(),n(u))},children:[(0,c.jsx)(l.A,{className:"jetpack-podcast-player__track-status-icon",isPlaying:s,isError:r}),(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&&r&&(0,c.jsx)(i.A,{link:e.link,title:e.title,colors:d})]})})},81166(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(86087),n=s(27723),o=s(10790);const __=n.__;function a(e){class t extends r.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:s}=this.state;return t?(0,o.jsx)("section",{className:"jetpack-podcast-player",children:(0,o.jsx)("p",{className:"jetpack-podcast-player__error",children:s?__('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 occurred 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,s){"use strict";s.d(t,{Q:()=>n,g:()=>r});const r="podcast-feed",n="embed-block"},18029(e,t,s){"use strict";s.d(t,{A:()=>n});var r=s(98329);const n={attributes:{url:{type:"string"},itemsToShow:{type:"integer",default:5},showCoverArt:{type:"boolean",default:!0},showEpisodeDescription:{type:"boolean",default:!0},primaryColor:{type:"string"},customPrimaryColor:{type:"string",validator:r.A},hexPrimaryColor:{type:"string",validator:r.A},secondaryColor:{type:"string"},customSecondaryColor:{type:"string",validator:r.A},hexSecondaryColor:{type:"string",validator:r.A},backgroundColor:{type:"string"},customBackgroundColor:{type:"string",validator:r.A},hexBackgroundColor:{type:"string",validator:r.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,s){"use strict";s.d(t,{A:()=>N});var r=s(97999),n=s(94715),o=s(74997),a=s(56427),i=s(29491),l=s(47143),c=s(86087),u=s(27723),d=s(93832),p=s(10067),h=s.n(p),m=s(66087),g=s(49487),f=s(34377),b=s(78218),v=s(50961),k=s(1624),y=s(57162),x=s(38288),j=s(90388),w=s(90764),_=s(19812),C=s(10790);const __=u.__,A=h()("jetpack:podcast-player:edit"),S=()=>{},E=(0,r.isWpcomPlatformSite)()?"http://en.support.wordpress.com/wordpress-editor/blocks/podcast-player-block/":"https://jetpack.com/support/jetpack-blocks/podcast-player-block/",N=(0,i.compose)([(0,l.withDispatch)((e,{clientId:t,attributes:s})=>({replaceWithEmbedBlock(){e("core/block-editor").replaceBlock(t,(0,o.createBlock)("core/embed",{url:s.url}))}})),(0,n.withColors)("backgroundColor",{primaryColor:"color"},{secondaryColor:"color"}),a.withNotices,i.withInstanceId,g.T])(({instanceId:e,attributes:t,setAttributes:s,noticeOperations:{createErrorNotice:r,removeAllNotices:o},noticeUI:i,primaryColor:l,setPrimaryColor:u,secondaryColor:p,setSecondaryColor:h,fallbackTextColor:g,backgroundColor:N,setBackgroundColor:T,fallbackBackgroundColor:B,isSelected:P,replaceWithEmbedBlock:I})=>{const M=(0,b.y)(k.attributes,t),{url:L,selectedEpisodes:R,itemsToShow:D,showCoverArt:F,showEpisodeTitle:O,showEpisodeDescription:z,exampleFeedData:U}=M,H=`jetpack-podcast-player-block-${e}`,q=(0,n.u
_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: %d: the number of people. */
_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)(n.InnerBlocks,{})})]})})},53183(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(94715),n=s(10790);const o=()=>{const e=r.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)("div",{className:"wp-block-jetpack-repeat-visitor__inner-container",children:(0,n.jsx)(r.InnerBlocks.Content,{})})})}},84730(e,t,s){"use strict";s.d(t,{DF:()=>r,aV:()=>o,et:()=>n});const r="after-visits",n="before-visits",o=3},31566(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(94715),n=s(84730),o=s(10790);const a={attributes:{criteria:{type:"string",default:n.DF},threshold:{type:"number",default:n.aV}},supports:{html:!1},save:({className:e})=>(0,o.jsx)("div",{className:e,children:(0,o.jsx)(r.InnerBlocks.Content,{})})}},79238(e,t,s){"use strict";var r=s(94375),n=s(20242),o=s(34570),a=s(53183),i=s(31566);(0,r.M)(n,{edit:o.A,save:a.A,deprecated:[i.A]})},24097(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(94715),n=s(10790);function o(){const e=(0,r.useBlockProps)();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(r.InnerBlocks,{template:[["jetpack/whatsapp-button",{}]],allowedBlocks:["jetpack/whatsapp-button"]})})}},38136(e,t,s){"use strict";var r=s(94375),n=s(58180),o=s(24097),a=s(92908),i=s(92335),l=s(7651);(0,r.M)(n,{edit:o.A,save:a.A,variations:i.A},[{name:l.UU,settings:l.W0}])},92908(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(94715),n=s(10790);const o=()=>{const e=r.useBlockProps.save();return(0,n.jsx)("div",{...e,children:(0,n.jsx)(r.InnerBlocks.Content,{})})}},57699(e,t,s){"use strict";s.d(t,{N:()=>r});const r=[{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:"🇨🇻 +238",value:"238CV"},{c
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.
2026-03-31 11:30:59 +02:00
title:__("Print","jetpack"),icon:(0,o.jsx)(n.d6,{icon:"print",size:24})},{name:"facebook",attributes:{service:"facebook",label:"Facebook"},title:"Facebook",icon:(0,o.jsx)(n.d6,{icon:"facebook",size:24})},{name:"linkedin",attributes:{service:"linkedin",label:"LinkedIn"},title:"LinkedIn",isDefault:!0,icon:(0,o.jsx)(n.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.
2026-03-31 11:30:59 +02:00
title:__("Mail","jetpack"),keywords:["email","e-mail"],icon:(0,o.jsx)(n.d6,{icon:"mail",size:24})},{name:"mastodon",attributes:{service:"mastodon",label:"Mastodon"},title:"Mastodon",icon:(0,o.jsx)(n.d6,{icon:"mastodon",size:24})},{name:"pinterest",attributes:{service:"pinterest",label:"Pinterest"},title:"Pinterest",icon:(0,o.jsx)(n.d6,{icon:"pinterest",size:24})},{name:"reddit",attributes:{service:"reddit",label:"Reddit"},title:"Reddit",icon:(0,o.jsx)(n.d6,{icon:"reddit",size:24})},{name:"telegram",attributes:{service:"telegram",label:"Telegram"},title:"Telegram",icon:(0,o.jsx)(n.d6,{icon:"telegram",size:24})},{name:"threads",attributes:{service:"threads",label:"Threads"},title:"Threads",icon:(0,o.jsx)(n.d6,{icon:"threads",size:24})},{name:"tumblr",attributes:{service:"tumblr",label:"Tumblr"},title:"Tumblr",icon:(0,o.jsx)(n.d6,{icon:"tumblr",size:24})},{name:"whatsapp",attributes:{service:"whatsapp",label:"WhatsApp"},title:"WhatsApp",icon:(0,o.jsx)(n.d6,{icon:"whatsapp",size:24})},{name:"x",attributes:{service:"x",label:"X"},keywords:["twitter","x"],title:"X",icon:(0,o.jsx)(n.d6,{icon:"x",size:24})},{name:"nextdoor",attributes:{service:"nextdoor",label:"Nextdoor"},title:"Nextdoor",icon:(0,o.jsx)(n.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.
2026-03-31 11:30:59 +02:00
title:__("Native Share","jetpack"),icon:(0,o.jsx)(n.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,s){"use strict";s.d(t,{A:()=>c});var r=s(94715),n=s(56427),o=s(27723),a=s(88901),i=s(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:s}=e,{size:o}=t,c=e=>o===e||!o&&"has-normal-icon-size"===e;return(0,i.jsx)(r.BlockControls,{group:"other",children:(0,i.jsx)(n.ToolbarDropdownMenu,{label:__("Size","jetpack"),text:__("Size","jetpack"),icon:null,popoverProps:{position:"bottom right"},children:()=>(0,i.jsx)(n.MenuGroup,{children:l.map(({name:e,value:t})=>(0,i.jsx)(n.MenuItem,{icon:c(t)&&a.A,isSelected:c(t),role:"menuitemradio",onClick:()=>{s({size:t})},children:e},t))})})})}},67650(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(94715),n=s(56427),o=s(27723),a=s(10790);const __=o.__,i=(0,r.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})(e=>{const{clientId:t,attributes:s,iconBackgroundColor:o,iconColor:i,setAttributes:l,setIconBackgroundColor:c,setIconColor:u}=e,{iconBackgroundColorValue:d,iconColorValue:p}=s,{styleType:h}=s,m=(0,r.__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)(r.InspectorControls,{children:(0,a.jsx)(n.PanelBody,{title:__("Settings","jetpack"),children:(0,a.jsx)(n.MenuItemsChoice,{choices:[/* translators: Sharing: Sharing button option label. */
{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. */
{value:"text",label:__("Text Only","jetpack")}],value:h,onSelect:e=>l({styleType:e})})})}),(0,a.jsxs)(r.InspectorControls,{group:"color",children:[g.map(({onChange:e,label:s,value:n,resetAllFilter:o})=>(0,a.jsx)(r.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:n,label:s,onColorChange:e,isShownByDefault:!0,resetAllFilter:o,enableAlpha:!0,clearable:!0}],panelId:t,gradients:"",...m},`social-links-color-${s}`)),(0,a.jsx)(r.ContrastChecker,{textColor:p,backgroundColor:d,isLargeText:!1})]})]})})},83597(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(94715),n=s(27723),o=s(13022),a=s(11906),i=s(67650),l=s(10790);const __=n.__,c=["jetpack/sharing-button"];const u=function(e){const{attributes:t}=e,{size:s}=t,n=(0,l.jsx)("li",{children:__("Click plus to add a Sharing Button","jetpack")}),u=(0,o.A)(s,"jetpack-sharing-buttons__services-list"),d=(0,r.useBlockProps)({className:u}),p=(0,r.useInnerBlocksProps)(d,{allowedBlocks:c,placeholder:n,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,s){"use strict";var r=s(94375),n=s(32870),o=s(83597),a=s(53840);(0,r.M)(n,{edit:o.A,save:a.A})},53840(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(94715),n=s(13022),o=s(10790);function a({attributes:e}){const{size:t}=e,s=(0,n.A)(t,"jetpack-sharing-buttons__services-list"),a=r.useBlockProps.save({className:s}),i=r.useInnerBlocksProps.save(a);return(0,o.jsx)("ul",{...i,id:"jetpack-sharing-serivces-list"})}},48715(e,t,s){"use strict";var r=s(85985),n=s(18692);(0,r.vp)(n.U,n.W)},18692(e,t,s){"use strict";s.d(t,{U:()=>u,W:()=>d});var r=s(56427),n=s(47143),o=s(86087),a=s(27723),i=s(71046),l=s(90062),c=s(10790);const __=a.__,u="shortlinks",d={render:()=>(0,c.jsx)(h,{})};class p extends o.Component{render(){const{shortlink:e}=this.props;return e?(0,c.jsx)(l.A,{children:(0,c.jsx)(r.PanelBody,{title:__("Shortlink","jetpack"),className:"jetpack-shortlinks__panel",initialOpen:!1,children:(0,c.jsx)(i.A,{link:e})})}):null}}const h=(0,n.withSelect)(e=>{const t=e("core/editor").getCurrentPost();return{shortlink:t?.jetpack_shortlink??""}})(p)},94247(e,t,s){"use strict";s.d(t,{H:()=>c,o:()=>u});var r=s(94715),n=s(56427),o=s(86087),a=s(27723),i=s(66087),l=s(10790);const __=a.__,_x=a._x;function c({attributes:{autoplay:e,delay:t,effect:s,images:r,sizeSlug:a},imageSizeOptions:c,onChangeImageSize:u,setAttributes:d}){const p="undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,h=[{label:_x("Slide","Slideshow transition effect","jetpack"),value:"slide"},{label:_x("Fade","Slideshow transition effect","jetpack"),value:"fade"}];return(0,l.jsxs)(o.Fragment,{children:[(0,l.jsxs)(n.PanelBody,{title:__("Autoplay","jetpack"),children:[(0,l.jsx)(n.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Autoplay","jetpack"),help:__("Autoplay between slides","jetpack"),checked:e,onChange:e=>{d({autoplay:e})}}),e&&(0,l.jsx)(n.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Delay between transitions (in seconds)","jetpack"),value:t,onChange:e=>{d({delay:e})},min:1,max:5}),e&&p&&(0,l.jsx)("span",{children:__("The Reduce Motion accessibility option is selected, therefore autoplay will be disabled in this browser.","jetpack")})]}),(0,l.jsx)(n.PanelBody,{title:__("Effects","jetpack"),children:(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Transition","jetpack"),value:s,onChange:e=>{d({effect:e})},options:h})}),!(0,i.isEmpty)(r)&&!(0,i.isEmpty)(c)&&(0,l.jsx)(n.PanelBody,{title:__("Image Settings","jetpack"),children:(0,l.jsx)(n.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:__("Size","jetpack"),value:a,options:c,onChange:e=>u(e)})})]})}function u({allowedMediaTypes:e,attributes:{images:t},onSelectImages:s}){return(0,l.jsx)(o.Fragment,{children:!!t.length&&(0,l.jsx)(n.ToolbarGroup,{children:(0,l.jsx)(n.ToolbarItem,{childr
__("Go to slide %s","jetpack"),e)+'"></button>'}else n+=`<div class="swiper-pagination-simple">${t} / ${s}</div>`;return n}},16445(e,t,s){"use strict";s.d(t,{A:()=>f});var r=s(63162),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13022),c=s(66087),u=s(94107),d=s(39126),p=s(31837),h=s(57464),m=s(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:s,delay:r,effect:n,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),n!==e.effect||s!==e.autoplay||r!==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:s,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?s: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:s,url:a})=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,r.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${s}`,"data-id":s,src:a}),(0,r.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(n.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},s||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,s){"use strict";s.d(t,{A:()=>r});const r={html:!1,align:["cente
__("Go to slide %s","jetpack"),e)+'"></button>'}else n+=`<div class="swiper-pagination-simple">${t} / ${s}</div>`;return n}},41952(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(94715),n=s(241),o=s(10790);const a=({attributes:{align:e,autoplay:t,delay:s,effect:a,images:i},className:l})=>{const c=r.useBlockProps.save({className:l});return(0,o.jsx)(n.A,{align:e,autoplay:t,className:c.className,delay:s,effect:a,images:i})}},241(e,t,s){"use strict";s.d(t,{A:()=>f});var r=s(63162),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13022),c=s(66087),u=s(94107),d=s(33170),p=s(30889),h=s(34308),m=s(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:s,delay:r,effect:n,images:o,onError:a}=this.props;if(t===e.align&&(0,c.isEqual)(o,e.images)||this.swiperInstance&&this.swiperInstance.update(),n!==e.effect||s!==e.autoplay||r!==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:s,effect:a,images:i}=this.props;return(0,m.jsx)("div",{className:t,"data-autoplay":e||null,"data-delay":e?s: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",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:s,url:a,aspectRatio:i},c)=>(0,m.jsx)("li",{className:(0,l.A)("wp-block-jetpack-slideshow_slide","swiper-slide",(0,r.isBlobURL)(a)&&"is-transient"),children:(0,m.jsxs)("figure",{children:[(0,m.jsx)("img",{alt:e,className:`wp-block-jetpack-slideshow_image wp-image-${s}`,"data-id":s,"data-aspect-ratio":i,src:a}),(0,r.isBlobURL)(a)&&(0,m.jsx)(o.Spinner,{}),t&&(0,m.jsx)(n.RichText.Content,{className:"wp-block-jetpack-slideshow_caption gallery-caption",tagName:"figcaption",value:t})]})},s?`${s}-${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.autoplay||this.prefersReducedMotion(
__("Slide %d, currently selected","jetpack"),s+1):(0,r.sprintf)(/* translators: %d: Slide number. */
__("Go to slide %d","jetpack"),s+1)),(0,o.jsx)("button",{role:c?"presentation":"tab",className:(0,n.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}%`}})})},s)}},35941(e,t,s){"use strict";s.d(t,{d:()=>a,k:()=>o});var r=s(13022),n=s(10790);const o=({className:e,size:t,label:s,isPressed:o,...a})=>(0,n.jsx)("button",{type:"button","aria-label":s,"aria-pressed":o,className:(0,r.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:s,isPressed:o,...a})=>(0,n.jsx)("button",{type:"button","aria-label":s,"aria-pressed":o,className:(0,r.A)("jetpack-mdc-icon-button",e),style:{width:`${t}px`,height:`${t}px`},...a})},20058(e,t,s){"use strict";s.d(t,{A:()=>n});var r=s(10790);const n=()=>(0,r.jsx)("div",{className:"wp-story-loading-spinner",children:(0,r.jsx)("div",{className:"wp-story-loading-spinner__outer",children:(0,r.jsx)("div",{className:"wp-story-loading-spinner__inner"})})})},48907(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(27723),n=s(35941),o=s(44227),a=s(10790);const _x=r._x;function i({playing:e,muted:t,onPlayPressed:s,onMutePressed:r,showMute:i}){return(0,a.jsxs)("div",{className:"wp-story-controls",children:[(0,a.jsx)(n.d,{isPressed:e,label:e?_x("pause","Button tooltip text","jetpack"):_x("play","Button tooltip text","jetpack",0),onClick:s,children:e?(0,a.jsx)(o.E$,{}):(0,a.jsx)(o.ud,{})}),i&&(0,a.jsx)(n.d,{isPressed:t,label:t?_x("unmute","Button tooltip text","jetpack"):_x("mute","Button tooltip text","jetpack",0),onClick:r,children:t?(0,a.jsx)(o.lQ,{}):(0,a.jsx)(o.Fz,{})})]})}},41256(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(27723),n=s(35941),o=s(44227),a=s(10790);const __=r.__;function i({fullscreen:e,onExitFullscreen:t,siteIconUrl:s,storyTitle:r}){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:s,width:"40",height:"40"})}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"wp-story-title",children:r})}),(0,a.jsx)(n.d,{className:"wp-story-exit-fullscreen",label:__("Exit Fullscreen","jetpack"),onClick:t,children:(0,a.jsx)(o.US,{})})]}):null}},44227(e,t,s){"use strict";s.d(t,{E$:()=>l,Ej:()=>p,Fz:()=>u,US:()=>c,af:()=>h,lQ:()=>d,ud:()=>i});var r=s(5573),n=s(62289),o=s(10790);const a=({children:e,size:t})=>(0,n.A)(e,t,t),i=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(r.Path,{d:"M8 5v14l11-7z"})}),l=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(r.Path,{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}),c=({size:e})=>(0,o.jsx)(a,{size:e,children:(0,o.jsx)(r.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)(r.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)(r.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)(r.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)(r.Path,{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})})},84545(e,t,s){"use strict";s.d(t,{$U:()=>c.$U,Dv:()=>r.A,H2:()=>n.A,VS:()=>i.A,Y9:()=>o.A,hJ:()=>a.A,xu:()=>l.A});var r=s(79809),n=s(48907),o=s(41256),a=s(38925),i=s(71645),l=s(20058),c=s(45221);s(359
_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:s.color,onColorChange:T,gradientValue:g.gradientValue,onGradientChange:g.setGradient,label:__("Button Background","jetpack")},{colorValue:L.color,onColorChange:B,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:s.color,onChange:T,label:__("Button Background Color","jetpack")},{value:L.color,onChange:B,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:P,onChange:()=>{E({showSubscribersTotal:!P,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:!P,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,r.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",r,"jetpack"),(0,n.qe)(r,{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"}),se={"no-border-radius":0===L,[B.class]:B.class,"has-text-color":A.color,[A.class]:A.class},re={...se,"has-background":r.color||ee.gradientValue,[r.class]:!ee.gradientValue&&r.class,[ee.gradientClass]:ee.gradientClass},ne={...se,"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:B.size?B.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,...!r.color&&ee.gradientValue?{background:ee.gradientValue}:{backgroundColor:r.color}},ce={...ae,...!x.color&&te.gradientValue?{background:te.gradientValue}:{backgroundColor:x.color},width:D?.length?D:"auto"};"button"!==J&&(W?ce.marginTop=oe(q)+"px":ce.marginLeft=oe(q)+"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:r,fallbackButtonBackgroundColor:C,fallbackTextColor:S,fontSize:B,includeSocialFollowers:O,isGradientAvailable:j,padding:z,preselectNewsletterCategories:U,setAttributes:s,setBorderColor:T,setButtonBackgroundColor:_,setTextColor:E,showSubscribersTotal:G,spacing:q,subscriberCount:K,textColor:A,buttonWidth:D,selectedNewsletterCategoryIds:H,subscribePlaceholder:$,submitButtonText:V,successMessage:Z})}),(0,y.jsx)(o.BlockControls,{children:(0,y.jsx)(a.ToolbarGroup,{children:(0,y.jsx)(a.ToolbarButton,{href:(0,g.Qu)(P),target:"_blank",children:P?_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)(re,"wp-block-jetpack-subscriptions__textfield"),style:le}),(0,y.jsx)(o.RichText,{className:(0,d.A)(ne,"wp-block-jetpack-subscriptions__button","wp-block-button__link"),onChange:e=>s({submitButtonText:e}),style:ce,value:V,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,s){"use strict";var r=s(85985),n=s(74997),o=s(47143),a=s(43656),i=s(86087),l=s(52619),c=s(27723),u=s(12549),d=s(94157),p=s(94375),h=s(99876),m=s(63200),g=s(39025),f=s(38387),b=s(3722),v=s(74500),k=s(48313),y=s(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_subscription"===
__("image %1$d of %2$d in gallery","jetpack"),t+1,s.length);return(0,d.jsx)(l.A,{alt:e.alt,"aria-label":a,height:e.height,id:e.id,origUrl:e.url,isSelected:n===t,link:e.link,linkTo:r,url:this.photonize(e),width:e.width},t)}render(){const{align:e,children:t,className:s,columns:r,images:n,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:s,children:[(0,d.jsx)(a,{align:e,columns:r,images:n,layoutStyle:o,renderedImages:i}),t]})}}function h(e){return["circle","square"].includes(e)}function m(e,t={}){const s={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,n]of Object.entries(t))r.searchParams.set(Object.hasOwn(s,e)?s[e]:e,n);return r.toString()}},58070(e,t,s){"use strict";s.d(t,{A:()=>d});var r=s(86087),n=s(94107),o=s(29971),a=s(75303),i=s(56237),l=s(34896),c=s(5236),u=s(10790);class d extends r.Component{gallery=(0,r.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:s}of e){const{width:e}=t;(0,c.S)(s).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 n.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:s,layoutStyle:r,renderedImages:n}=this.props,c=(0,l.mJ)(s),d="columns"===r?(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 s=n.slice(p,p+e);return p+=e,(0,u.jsx)(o.A,{children:s},t)})},t))})}}},34896(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var r=s(66087);function n(e){return e.map(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 s=(0,r.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(o,t=>{const r=a<=(e+1)*s;return r&&(a+=t),r}).length;n.push(t),o=o.slice(t)}return n.push(o.length),[n]}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([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(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,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const s=(e,n)=>{if(!n.length)return e;let o;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const s=(0,r.sum)(t.slice(0,4));return y(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){const n=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);return s(a,A)};return s([],e)}function A(e,t){return s=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(
__("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:s,height:e.height,id:e.id,imageFilter:r,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:s,columns:r,images:n,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)(s,{[`has-rounded-corners-${g}`]:g>0}),children:[(0,d.jsx)(h,{align:e,columns:r,images:n,layoutStyle:i,renderedImages:m}),t]})}}},84255(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(86087),n=s(84394),o=s(38548),a=s(70954),i=s(89195),l=s(10790);class c extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:c}=this.props,u=(0,i.mJ)(s),d="columns"===r?(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 s=c.slice(p,p+e);return p+=e,(0,l.jsx)(n.A,{children:s},t)})},t))})}}},89195(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var r=s(66087);function n(e){return e.map(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 s=(0,r.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(o,t=>{const r=a<=(e+1)*s;return r&&(a+=t),r}).length;n.push(t),o=o.slice(t)}return n.push(o.length),[n]}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([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(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,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const s=(e,n)=>{if(!n.length)return e;let o;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const s=(0,r.sum)(t.slice(0,4));return y(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){const n=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);return s(a,A)};return s([],e)}function A(e,t){return s=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function B(e){return t=>t<e}},70954(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(13022),n=s(10790);function o({children:e,className:t}){return(0,n.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},51475(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(66087),n=s(43566),o=s(84394),a=s(38548),i=s(70954),l=s(10790);function c({columns:e,renderedImages:t}){const s=Math.min(n.ZS,e),c=t.length%s;return(0,l.jsx)(a.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),s)].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,s){"use strict";s.d(t,{A:()=>l});var r=s(90907),n=s(43566),o=s(65378),a=s(10790);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:s}=e;if(!s.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,className:c,columns:u,imageFilter:t,images:s,isSave:!0,layoutStyle:(0,r.D
__("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:s,height:e.height,id:e.id,imageFilter:r,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:s,columns:r,images:n,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)(s,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:r,columnWidths:m?g:void 0,images:n,layoutStyle:i,renderedImages:b,onResize:m?void 0:h}),t]})}}},56420(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(86087),n=s(54001),o=s(99309),a=s(46479),i=s(70394),l=s(10790);class c extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(s),p="columns"===r?(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,s)=>{const r=c.slice(h,h+e);return h+=e,(0,l.jsx)(n.A,{width:u?.[t]?.[s],children:r},s)})},t))})}}},70394(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var r=s(66087);function n(e){return e.map(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 s=(0,r.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(o,t=>{const r=a<=(e+1)*s;return r&&(a+=t),r}).length;n.push(t),o=o.slice(t)}return n.push(o.length),[n]}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([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(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,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const s=(e,n)=>{if(!n.length)return e;let o;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const s=(0,r.sum)(t.slice(0,4));return y(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){const n=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);return s(a,A)};return s([],e)}function A(e,t){return s=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function B(e){return t=>t<e}},46479(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(13022),n=s(10790);function o({children:e,className:t}){return(0,n.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},65216(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(66087),n=s(60041),o=s(54001),a=s(99309),i=s(46479),l=s(10790);function c({columns:e,renderedImages:t}){const s=Math.min(n.ZS,e),c=t.length%s;return(0,l.jsx)(a.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),s)].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,s){"use strict";s.d(t,{A:()=>l});var r=s(90907),n=s(60041),o=s(77511),a=s(10790);function i(e){return Math.min(3,e.images.length)}function l({a
__("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:s,height:e.height,id:e.id,imageFilter:r,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:s,columns:r,images:n,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)(s,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:r,columnWidths:g?f:void 0,images:n,layoutStyle:i,renderedImages:v,onResize:g?void 0:h}),t]})}}},91341(e,t,s){"use strict";s.d(t,{A:()=>d});var r=s(86087),n=s(94107),o=s(78608),a=s(52042),i=s(9276),l=s(71245),c=s(86461),u=s(10790);class d extends r.Component{gallery=(0,r.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:s}of e){const{width:e}=t,r=[];(0,c.S)(s).forEach(t=>{r.push((0,c.r)(t,e))}),void 0!==this.props.onResize&&this.props.onResize(r)}})};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new n.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,s){let r=0;return e.map(e=>e.map(e=>{const s=t.slice(r,r+e);return r+=e,s})).map(e=>(0,c.r)(e,s))}render(){const{align:e,columns:t,images:s,layoutStyle:n,renderedImages:c}=this.props,d=(0,l.mJ)(s),p="columns"===n?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.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,s)=>{const r=c.slice(m,m+e);return m+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[s],children:r},s)})},t))})}}},71245(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var r=s(66087);function n(e){return e.map(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 s=(0,r.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(o,t=>{const r=a<=(e+1)*s;return r&&(a+=t),r}).length;n.push(t),o=o.slice(t)}return n.push(o.length),[n]}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([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(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,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const s=(e,n)=>{if(!n.length)return e;let o;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const s=(0,r.sum)(t.slice(0,4));return y(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){const n=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.le
__("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:s,height:e.height,id:e.id,imageFilter:r,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:s,columns:r,images:n,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)(s,{[`has-rounded-corners-${v}`]:v>0}),children:[(0,d.jsx)(f,{align:e,columns:r,columnWidths:m?g:void 0,images:n,layoutStyle:i,renderedImages:b,onResize:m?void 0:h}),t]})}}},62579(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(86087),n=s(89798),o=s(38448),a=s(26054),i=s(79167),l=s(10790);class c extends r.Component{gallery=(0,r.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:s,layoutStyle:r,renderedImages:c,columnWidths:u}=this.props,d=(0,i.mJ)(s),p="columns"===r?(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,s)=>{const r=c.slice(h,h+e);return h+=e,(0,l.jsx)(n.A,{width:u?.[t]?.[s],children:r},s)})},t))})}}},79167(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var r=s(66087);function n(e){return e.map(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 s=(0,r.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(o,t=>{const r=a<=(e+1)*s;return r&&(a+=t),r}).length;n.push(t),o=o.slice(t)}return n.push(o.length),[n]}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([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(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,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const s=(e,n)=>{if(!n.length)return e;let o;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const s=(0,r.sum)(t.slice(0,4));return y(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){const n=(0,r.sum)(t.slice(0,3));return t.length>=3&&4!==t.length&&6!==t.length&&x(e)&&(n<2.5||n<5&&t.length>=3&&t[0]===t[2]||s)}(e,n,t)?[1,1,1]:j(n)&&w(e)?[2,1]:_(n)?[1]:n.length>3?[1,1]:Array(n.length).fill(1);const a=e.concat([o]),C=(0,r.sum)(o),A=n.slice(C);return s(a,A)};return s([],e)}function A(e,t){return s=>!s.slice(-t).some(t=>(0,r.isEqual)(t,e))}function S(e){return t=>t.length>=e.length&&(0,r.zipWith)(e,t.slice(0,e.length),(e,t)=>e(t)).every(Boolean)}function E(e){return e>=1&&e<2}function N(e){return e<1}function T(e){return t=>t>=e}function B(e){return t=>t<e}},26054(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(13022),n=s(10790);function o({children:e,className:t}){return(0,n.jsx)("div",{className:(0,r.A)("tiled-gallery__row",t),children:e})}},58711(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(66087),n=s(41314),o=s(89798),a=s(38448),i=s(26054),l=s(10790);function c({columns:e,renderedImages:t}){const s=Math.min(n.ZS,e),c=t.length%s;return(0,l.jsx)(a.A,{children:[...c?[t.slice(0,c)]:[],...(0,r.chunk)(t.slice(c),s)].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,s){"use strict";s.d(t,{A:()=>u});var r=s(94715),n=s(13022),o=s(90907),a=s(35463),i=s(29520),l=s(6454),c=s(10790);function u({attributes:e}){con
__("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:s,height:e.height,id:e.id,imageFilter:r,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:s,columns:r,images:n,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)(s,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,d.jsx)(b,{align:e,columns:r,columnWidths:g?f:void 0,images:n,layoutStyle:u,renderedImages:v,onResize:g?void 0:h}),t]})}}},80720(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(94715),n=s(13022),o=s(90907),a=s(35463),i=s(29520),l=s(1456),c=s(10790);function u({attributes:e}){const{imageFilter:t,images:s}=e;if(!s.length)return null;const{align:u,className:d,columns:p=(0,i.EB)(e),linkTo:h,roundedCorners:m,columnWidths:g}=e,f=r.useBlockProps.save();return(0,c.jsxs)("div",{...f,className:(0,n.A)(f.className,d),children:[" ",(0,c.jsx)(l.A,{align:u,columns:p,imageFilter:t,images:s,isSave:!0,layoutStyle:(0,o.D)(a.kc,d),linkTo:h,roundedCorners:m,columnWidths:g})]})}},69813(e,t,s){"use strict";s.d(t,{A:()=>r});const r={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},29520(e,t,s){"use strict";s.d(t,{Ay:()=>v,EB:()=>f});var r=s(85985),n=s(94715),o=s(56427),a=s(43656),i=s(86087),l=s(27723),c=s(66087),u=s(90907),d=s(76585),p=s(35463),h=s(77530),m=s(10309),g=s(10790);const __=l.__;function f(e){return e.images.length>0?Math.min(3,e.images.length):3}const b=e=>{const t=(0,c.pick)(e,[["alt"],["id"],["link"]]);return t.url=e?.sizes?.large?.url||e?.media_details?.sizes?.large?.source_url||e.url,t},v=(0,o.withNotices)(({attributes:e,isSelected:t,noticeOperations:s,noticeUI:l,setAttributes:c})=>{const{align:v,columns:k=f(e),imageFilter:y,images:x,linkTo:j,roundedCorners:w,columnWidths:_}=e,C=(0,u.D)(p.kc,e.className),A=(0,n.useBlockProps)(),[S,E]=(0,i.useState)(null),[N,T]=(0,i.useState)(void 0===_||0===_?.length),B=e=>{c({images:e,ids:e.map(({id:e})=>parseInt(e,10))})},P=e=>{(0,a.mediaUpload)({allowedTypes:p.eN,filesList:e,onFileChange:e=>B((x||[]).concat(e.map(b))),onError:s.createErrorNotice}),T(!0)},I=e=>()=>{const t=x.filter((t,s)=>e!==s);E(null),T(!0),B(t),c({columns:k?Math.min(t.length,k):k})},M=e=>()=>{S!==e&&E(e)},L=e=>{const t=e.map(e=>{const t=x.find(t=>parseInt(t.id,10)===parseInt(e.id,10));return t?.customLink?{...b(e),customLink:t.customLink}:b(e)});B(t),c({columns:k?Math.min(e.length,k):k}),T(!0)},R=(e,t)=>{const s=[...x];s.splice(t,1,x[e]),s.splice(e,1,x[t]),E(t),T(!0),B(s)},D=e=>()=>{e!==x.length-1&&R(e,e+1)},F=e=>()=>{0!==e&&R(e,e-1)},O=e=>{N&&c({columnWidths:e})},z=e=>P(e.target.files),U=e=>t=>{x[e]&&B([...x.slice(0,e),{...x[e],...t},...x.slice(e+1)])};let H;return(0,i.useEffect)(()=>{t||null===S||E(null)},[t,S,E]),H=0===x.length?(0,g.jsx)(n.MediaPlaceholder,{icon:(0,r.sh)(d),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:L,accept:"image/*",allowedTypes:p.eN,multiple:!0,notices:l,onError:s.createErrorNotice}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(h.M,{layoutStyle:C,images:x,columns:k,selectedImage:S,setImageAttributes:U,onColumnsChange:e=>c({columns:e}),roundedCorners:w,onRoundedCornersChange:e=>c({roundedCorners:e}),linkTo:j,onLinkToChange:e=>c({linkTo:e})}),l,(0,g.jsxs)(m.A,{className:"tiled-gallery__wrapper",align:v,columns:k,imageFilter:y,images:x,layoutStyle:C,linkTo:j,onMoveBackward:F,onMoveForward:D,onRemoveImage:I,onSelectImage:M,onResize:O,roundedCorners:w,selectedImage:t?S:null,setImageAttributes:U,children:[(0,g.js
__("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:s,height:e.height,id:e.id,imageFilter:r,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:s,columns:r,images:n,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)(s,{[`has-rounded-corners-${k}`]:k>0}),children:[(0,p.jsx)(b,{align:e,columns:r,columnWidths:g?f:void 0,images:n,layoutStyle:i,renderedImages:v,onResize:g?void 0:h}),t]})}}},31238(e,t,s){"use strict";s.d(t,{A:()=>d});var r=s(86087),n=s(94107),o=s(98627),a=s(54359),i=s(43645),l=s(74176),c=s(18980),u=s(10790);class d extends r.Component{gallery=(0,r.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:s}of e){const{width:e}=t,r=[];(0,c.S)(s).forEach(t=>{r.push((0,c.r)(t,e))}),void 0!==this.props.onResize&&this.props.onResize(r)}})};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new n.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,s){let r=0;return e.map(e=>e.map(e=>{const s=t.slice(r,r+e);return r+=e,s})).map(e=>(0,c.r)(e,s))}render(){const{align:e,columns:t,images:s,layoutStyle:n,renderedImages:c}=this.props,d=(0,l.mJ)(s),p="columns"===n?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)}),h=r.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,s)=>{const r=c.slice(m,m+e);return m+=e,(0,u.jsx)(o.A,{width:h?.[t]?.[s],children:r},s)})},t))})}}},74176(e,t,s){"use strict";s.d(t,{FL:()=>a,VU:()=>C,mJ:()=>n});var r=s(66087);function n(e){return e.map(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 s=(0,r.sum)(e)/t,n=[];let o=e,a=0;for(let e=0;e<t-1;e++){const t=(0,r.takeWhile)(o,t=>{const r=a<=(e+1)*s;return r&&(a+=t),r}).length;n.push(t),o=o.slice(t)}return n.push(o.length),[n]}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([B(1.6),(0,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(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,r.overEvery)(T(.9),B(2)),(0,r.overEvery)(T(.9),B(2)),B(1.6)]),w=A([2,1],3),_=S([function(e){return e>=2}]);function C(e,{isWide:t}={}){const s=(e,n)=>{if(!n.length)return e;let o;o=n.length>15&&l(n)&&i(e)?[2,1,2]:n.length>15&&c(n)&&u(e)?[3,1,3]:5!==n.length&&d(n)&&p(e)?[1,2,1]:h(n)&&m(e)?[1,3]:g(n)&&f(e)?[3,1]:b(n)&&v(e)?[1,2]:t&&(5===n.length||10!==n.length&&n.length>6)&&k(e)&&(0,r.sum)(n.slice(0,5))<5?[1,1,1,1,1]:function(e,t){const s=(0,r.sum)(t.slice(0,4));return y(e)&&s<3.5&&t.length>5||s<7&&4===t.length}(e,n)?[1,1,1,1]:function(e,t,s){const n=(0,r.sum)(t.slice(0,3));return
__("Display %s","jetpack"),e.label.toLowerCase()),checked:i[e.id]||!1,onChange:(s=e.id,e=>{const r={...i,[s]:e};if(Object.values(r).every(e=>!1===e))return f(!0);l(r),t({postTypes:r}),f(!1)})},e.id);var s}),g&&(0,a.jsx)(r.Notice,{className:"jetpack-top-posts__error",status:"error",isDismissible:!1,children:__("At least one item must be selected.","jetpack")})]}),(0,a.jsxs)(r.PanelBody,{title:__("Metadata settings","jetpack"),children:[(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display date","jetpack"),checked:d,onChange:e=>t({displayDate:e})}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display author","jetpack"),checked:c,onChange:e=>t({displayAuthor:e})}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display context","jetpack"),checked:u,onChange:e=>t({displayContext:e})}),(0,a.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:__("Display thumbnail","jetpack"),checked:p,onChange:e=>t({displayThumbnail:e})})]})]})}function l({attributes:e,setAttributes:t}){const{layout:s}=e,n=[{icon:"grid-view",title:__("Grid view","jetpack"),onClick:()=>t({layout:"grid"}),isActive:"grid"===s},{icon:"list-view",title:__("List view","jetpack"),onClick:()=>t({layout:"list"}),isActive:"list"===s}];return(0,a.jsx)(r.ToolbarGroup,{controls:n})}},96894(e,t,s){"use strict";s.d(t,{A:()=>m});var r=s(85985),n=s(1455),o=s.n(n),a=s(94715),i=s(86087),l=s(13022),c=s(9522),u=s(20600),d=s(8031),p=s(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:s,isChangingStatus:n,isModuleActive:m,changeStatus:g}=(0,r.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:B,postsToShow:P,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=${B}`}).then(e=>{k(e)})},[B,m]),(0,i.useEffect)(()=>{const e=v;if(!e)return;const t=[];for(let s=0;t.length!==P&&(e[s]&&I[e[s].type]&&t.push((0,p.jsx)(h,{title:e[s].title,date:e[s].date,author:e[s].author,thumbnail:e[s].thumbnail,context:e[s].context,displayDate:E,displayAuthor:A,displayThumbnail:N,displayContext:S},"jetpack-top-posts-"+e[s].id)),e[s]);s++);x(t)},[A,S,E,N,v,I,P,x]),M=m||s?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:n}),(0,p.jsx)("div",{...f,className:(0,l.A)(b,`is-${T}-layout`),children:M})}},99883(e,t,s){"use strict";var r=s(74997),n=s(94375),o=s(35075),a=s(96894);(0,n.M)(o,{edit:a.A,save:()=>null,transforms:{from:[{t
2025-08-27 08:44:30 +02:00
__("Start playing the video as soon as the page loads","jetpack")),onChange:this.toggleAttribute("autoplay"),checked:L,help:this.getAutoplayHelp,__nextHasNoMarginBottom:!0}),(0,C.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,C.jsx)(l.ToggleControl,{label:__("Muted","jetpack"),onChange:this.toggleAttribute("muted"),checked:z,__nextHasNoMarginBottom:!0}),(0,C.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,C.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,C.jsx)(l.SelectControl,{label:this.renderControlLabelWithTooltip(__("Preload","jetpack"),/* translators: Tooltip describing the "preload" option for the VideoPress player */
2025-12-12 13:13:07 +01:00
__("Content to dowload before the video is played","jetpack")),value:q??"",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,C.jsx)(i.MediaUploadCheck,{children:(0,C.jsxs)(l.BaseControl,{className:"editor-video-poster-control",children:[(0,C.jsx)(l.BaseControl.VisualLabel,{children:__("Poster Image","jetpack")}),(0,C.jsx)(i.MediaUpload,{title:__("Select Poster Image","jetpack"),onSelect:this.onSelectPoster,allowedTypes:A,render:({open:e})=>(0,C.jsx)(l.Button,{variant:"secondary",onClick:e,ref:this.posterImageButton,"aria-describedby":Z,children:J?__("Replace image","jetpack",0):__("Select Poster Image","jetpack")})}),(0,C.jsx)("p",{id:Z,hidden:!0,children:J?(0,h.sprintf)(/* translators: %s: an image URL. */
__("The current poster image url is %s","jetpack"),H??M):__("There is no poster image currently selected","jetpack")}),J&&(0,C.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,C.jsx)(l.ExternalLink,{href:"https://automattic.survey.fm/videopress-feedback"})})]}),(0,C.jsx)(y.A,{attributes:t,setAttributes:u,useAverageColor:V,toggleAttribute:this.toggleAttribute}),(0,C.jsxs)(l.PanelBody,{title:__("Video File Settings","jetpack"),children:[(0,C.jsx)(l.SelectControl,{label:_x("Rating","The age rating for this video.","jetpack"),value:N??"",disabled:k||j,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,C.jsx)(l.ToggleControl,{label:this.renderControlLabelWithTooltip(__("Allow download","jetpack"),/* translators: Tooltip describing the "allow download" option for the VideoPress player */
2026-03-31 11:30:59 +02:00
__("Display download option and allow viewers to download this video","jetpack")),onChange:this.onChangeAllowDownload,checked:T,disabled:k||P,__nextHasNoMarginBottom:!0}),(0,C.jsx)(l.SelectControl,{label:__("Video Privacy","jetpack"),help:this.getPrivacySettingHelp(B),onChange:this.onChangePrivacySetting,value:B??"",options:[{value:b.NF.SITE_DEFAULT,label:_x("Site Default","VideoPress privacy setting","jetpack")},{value:b.NF.PUBLIC,label:_x("Public","VideoPress privacy setting","jetpack")},{value:b.NF.PRIVATE,label:_x("Private","VideoPress privacy setting","jetpack")}],disabled:k||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,_.T3)(g.name):""),te=({mediaId:e,guid:t,src:s})=>{this.setState({title:this.state.title??ee,fileForUpload:null,isUploadComplete:!!e,isEditingWhileUploading:!!e&&this.state.isEditingWhileUploading,pendingVideoAttributes:e&&t&&s?{id:e,guid:t,src:s}:null})},se=e=>{this.setState({title:e})},re=e=>{this.setState({videoFrameSelectedInMillis:e,videoPosterImageData:null})},ne=()=>{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&&ne(),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,C.jsx)(S,{fileForUpload:g,filename:ee,uploadFinished:te,blockSettings:K,onDismissEditor:pe,isUploadComplete:this.state.isUploadComplete,onSelectPoster:this.onSelectPoster,onRemovePoster:this.onRemovePoster,onChangeTitle:se,title:e,videoPosterImageData:this.state.videoPosterImageData,onVideoFrameSelected:re,onSave:de})}const he=k||r,me=m||n||!F,ge=me&&!n&&!he,fe=(0,C.jsxs)(d.Fragment,{children:[(0,C.jsx)("div",{className:n||he?"":"videopress-block-hide",children:(0,C.jsx)(v.A,{text:n?__("Uploading…","jetpack"):__("Generating preview…","jetpack",0)})}),(0,C.jsx)("div",{className:ge?"":"videopress-block-hide",children:(0,C.jsx)(e,{...this.props})})]});if(me)return c?(0,C.jsx)(f.f,{onFilesSelected:Y,onMediaItemSelected:Q,children:fe}):(0,C.jsx)(d.Fragment,{children:fe});const{html:be,scripts:ve}=a||{html:null,scripts:null},ke=he||!a;return(0,C.jsxs)(d.Fragment,{children:[K,(0,C.jsx)(E,{...this.props,hideOverlay:this.hideOverlay,html:be,scripts:ve,interactive:w,caption:R,shouldRenderLoadingBlock:ke})]})}}]),"withVideoPressEdit")},27156(e,t,s){"use strict";var r=s(90372),n=s(97999),o=s(85985),a=s(63162),i=s(94715),l=s(75994),c=s(74997),u=s(56427),d=s(29491),p=s(47143),h=s(43656),m=s(86087),g=s(52619),f=s(27723),b=s(81837),v=s(59257),k=s(21440),y=s(54727),x=s(65390),j=s(77189),w=s(41560),_=s(47960),C=s(51983),A=s(7345),S=s(40932),E=s(10790);const __=f.__,N=(0,d.createHigherOrderComponent)(e=>t=>{const{name:s}=(0,i.useBlockEditContext)();return"core/video"!==s&&"videopress/video"!==s?(0,E.jsx)(e,{...t}):(0,E.jsxs)(e,{...t,disableDropZone:!0,className:"no-videopress-media-placeholder",children:[(0,E.jsx)(u.Button,{disabled:!0,className:"componen
2025-12-12 13:13:07 +01:00
__("Paused (%s%%)","jetpack"),x):(0,o.sprintf)(/* translators: %s: an upload progress percentage number, from 0-100. */
2026-03-31 11:30:59 +02:00
__("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)(r.Button,{variant:"link",onClick:()=>{p&&(u?p.start():p.abort(),d(!u))},children:u?"Resume":"Pause"})})]})})}},80534(e,t,s){"use strict";s.d(t,{Q:()=>n,l:()=>a});var r=s(10781);const n=function(e){return new Promise(function(t,s){const r=e?{data:{key:e}}:{};wp.media.ajax("videopress-get-upload-jwt",{async:!0,...r}).done(function(e){t({token:e.upload_token,blogId:e.upload_blog_id,url:e.upload_action_url})}).fail(function(e){s(e)})})},o={},a=({onUploadUuidRetrieved:e,onError:t,onProgress:s,onSuccess:a})=>(i,l)=>{const c=new r._O(i,{onError:t,onProgress:s,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,s){if(s.getStatus()>=400)return;const r=s.getHeader("x-videopress-upload-guid"),n=s.getHeader("x-videopress-upload-media-id"),i=s.getHeader("x-videopress-upload-src-url");if(r&&n&&i)return void(a&&a({mediaId:Number(n),guid:r,src:i}));const l={"x-videopress-upload-key-token":"token","x-videopress-upload-key":"key"},c={};Object.keys(l).forEach(function(e){const t=s.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 s=new URL(e._url).pathname.split("/"),r=s[s.length-1];if(o[r])e.setHeader("x-videopress-upload-token",o[r]);else if("HEAD"===t)return n(r).then(t=>(o[r]=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,s){"use strict";s.d(t,{A:()=>l});var r=s(94715),n=s(29491),o=s(13022),a=s(17900),i=s(10790);const l=(0,n.createHigherOrderComponent)(e=>t=>{const{attributes:{autoplay:s,caption:n,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=r.useBlockProps.save({className:(0,o.A)("wp-block-video",f,g,{[`align${b}`]:b})}),_=(0,a.e)(c,{autoplay:s,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`}),!r.RichText.isEmpty(n)&&(0,i.jsx)(r.RichText.Content,{tagName:"figcaption",value:n})]})},"withVideoPressSave")},57954(e,t,s){"use strict";s.d(t,{A:()=>c});var r=s(94715),n=s(56427),o=s(86087),a=s(27723),i=s(10790);const __=a.__;class l extends o.Component{constructor(){super(...arguments);const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:s}=this.props.attributes;this.state={seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:s}}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:s}=this.state,{setAttributes:r}=this.props;r({seekbarColor:e,seekbarLoadingColor:t,seekbarPlayedColor:s})};render(){const{seekbarColor:e,seekbarPlayedColor:t,seekbarLoadingColor:s}=this.state,{toggleAt
__("Delete %s","jetpack"),e.label),disabled:r===t,children:r===t?__("Deleting","jetpack"):__("Delete","jetpack",0)})})]},t)),(0,d.jsx)(a.MenuGroup,{label:__("Text tracks","jetpack"),className:"videopress-block-tracks-editor__track-list",children:u})}function k({track:e,guid:t,onChange:s,onClose:r,onCancel:n,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 r=t.target.files;!r.length>0||(e.tmpFile=r[0],s(e))},accept:Object.entries(h).join(),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:(0,c.sprintf)(/* translators: %s: The allowed file types to be uploaded as a video text track." */
__("Allowed formats: %s","jetpack"),Object.keys(h).join(", "))})]}),(0,d.jsxs)("div",{className:"videopress-block-tracks-editor__single-track-editor-label-language",children:[(0,d.jsx)(a.TextControl,{onChange:t=>s({...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=>s({...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=>{s({...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(()=>{s(e),f(null),r()}).catch(e=>{e.message&&f(e.message)}).finally(()=>{k(!1)}))},children:__("Save","jetpack")}),(0,d.jsx)(a.Button,{variant:"link",onClick:n,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 y({tracks:e=[],onChange:t,guid:s}){const[r,n]=(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!==r?(0,d.jsx)(k,{track:e[r],guid:s,onChange:s=>{const n=[...e];n[r]=s,t(n)},onClose:()=>n(null),onCancel:()=>{t(e.filter((e,t)=>t!==r)),n(null)},trackExists:t=>-1!==e.filter((e,t)=>t!==r).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)(v,{tracks:e,onChange:t,guid:s}),(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 s=e.length,r=[...e];r[s]||(r[s]={}),r[s]={...e[s]},t(r),n(s)})()},children:__("Upload track","jetpack")})})]})})})}},22857(e,t,s){"use strict";s.d(t,{d:()=>m});var r=s(62410),n=s(94715),o=s(56427),a=s(86087),i=s(27723),l=s(13109),c=s(13022),u=s(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:r.ud})]}):(0,u.jsx)("span",{children:"No Poster Selected"})})},h=e=>{const{onSelectPoster:t,onRemovePoster:s}=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)(n.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:s,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:s,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:s,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:r.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 choose a post
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:s,title:d=l,description:p=null,buttonText:h=u,visible:m=!0,requiredPlan:g,context:f})=>{const[b,v,k]=(0,r._6)(g,e),y=(0,o.useSelect)(e=>{if(p)return p;const t=e("wordpress-com/plans"),s=t&&t.getPlan(g);return s?(0,a.sprintf)(c,s.product_name_short):null},[p,g]);return y&&(0,i.jsx)(n.cb,{align:t,buttonText:h,checkoutUrl:b,className:s,context:f,description:y,goToCheckoutPage:v,isRedirecting:k,title:d,visible:m})}},23887(e,t,s){"use strict";s.d(t,{W:()=>r,r:()=>n});const r=({plan:e,blockName:t,context:s,tracks:r})=>{r.recordEvent("jetpack_editor_block_upgrade_click",{plan:e,block:t,context:s})},n=({plan:e,blockName:t,context:s,tracks:r})=>{r.recordEvent("jetpack_editor_block_upgrade_banner_impression",{plan:e,block:t,context:s})}},3120(e,t,s){"use strict";s.d(t,{e:()=>h});var r=s(85985),n=s(94715),o=s(29491),a=s(47143),i=s(86087),l=s(95104),c=s(26845),u=s(23887),d=s(10790);const p=(0,o.createHigherOrderComponent)(e=>t=>{const{name:s,clientId:o,isSelected:p,attributes:h,setAttributes:m}=t||{},g=(0,r.tu)(s);if(!g)return(0,d.jsx)(e,{...t});const f=(0,r.sH)(s),b=(0,r.GT)(s),[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,r.st)(),S=(0,i.useMemo)(()=>({plan:g,blockName:s,context:j,tracks:A}),[g,s,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,n.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-${s.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,r.tu)(t)?{...e,edit:p(e.edit)}:e}},76047(e,t,s){"use strict";s.d(t,{k6:()=>o,s6:()=>r,wb:()=>n});const r="jetpack-sidebar",n="document-settings",o="pre-publish"},23162(e,t,s){"use strict";s.d(t,{A:()=>M});var r=s(96865),n=s(85985),o=s(82201),a=s(56427),i=s(3582),l=s(47143),c=s(43656),u=s(52619),d=s(27723),p=s(10067),h=s.n(p),m=s(51609),g=s(44732),f=s(48499),b=s(90062),v=s(50976),k=s(81932),y=s(37215),x=s(76318),j=s(27970),w=s(76047),_=s(45606),C=s(10790);const __=d.__,A=c.PluginPrePublishPanel,S=c.PluginDocumentSettingPanel,E=h()("jetpack-ai-assistant-plugin:sidebar"),N=window?.Jetpack_Editor_Initial_State?.available_blocks?.["ai-assistant-usage-panel"]?.available||!1,T=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,P=(0,f.C)("ai-title-optimization-keywords-support"),I=({placement:e,requireUpgrade:t,upgradeType:s,showUsagePanel:n,showFairUsageNotice:o})=>{const{checkoutUrl:i}=(0,r.ON)(),{productPageUrl:d}=(0,g.A)(),p=(0,k.Ul)(),h=(0,l.useSelect)(e=>e(c.store).isEditedPostEmpty(),[]),{editPost:f}=(0,l.useDispatch)(c.store),b=(0,m.useCallback)(e=>{f({featured_media:e.id})},[f]),w=(0,m.useMemo)(()=>{const s=(0,u.applyFilters)("jetpack.ai.imageGenerationHandler",null,{entryPoint:"featured-image",onImageSelect:b,extra:{placement:e,disabled:t}});return"function"==typeof s?s:null},[b,e,t]),A=__("Optimize Publishing","jetpack"),S=__("Optimize Title","jetpack"),E=P?S:A;return(0,C.jsxs)(C.Fragment,{children:[o&&(0,C.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__feature-section",children:(0,C.jsx)(a.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,C.jsx)(r.QA,{variant:"muted"})})}),h&&(0,C.jsx)(a.PanelRow,{className:"jetpack-ai-sidebar__warning-content",children:(0,C.jsx)(a.Notice,{isDismissible:!1,status:"wa
__("You have reached the limit of <strong>%d requests</strong>. <button><span>Upgrade to continue generating feedback.</span></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)(n.Button,{variant:"link",onClick:d,href:c,target:"_blank"}),span:(0,i.jsx)("span",{})});return(0,i.jsx)("p",{children:"vip"===t?g:f})}},1661(e,t,s){"use strict";s.d(t,{S:()=>r});const r="jetpack-ai-breve"},27180(e,t,s){"use strict";s.d(t,{A:()=>m});var r=s(85985),n=s(56427),o=s(29491),a=s(47143),i=s(27723),l=s(51609),c=s(29526),u=s(80555),d=s(81932),p=s(36205),h=s(10790);const __=i.__,m=(0,o.compose)((0,a.withSelect)(e=>({blocks:e("core/block-editor").getBlocks(),disabledFeatures:e("jetpack/ai-breve").getDisabledFeatures()})))(({blocks:e,disabledFeatures:t})=>{const[s,i]=(0,l.useState)(null),{toggleFeature:m,toggleProofread:g,setPopoverHover:f,setHighlightHover:b,setPopoverAnchor:v}=(0,a.useDispatch)("jetpack/ai-breve"),{tracks:k}=(0,r.st)(),y=(0,a.useSelect)(e=>e("jetpack/ai-breve").isProofreadEnabled(),[]),x=(0,l.useCallback)(()=>{if(!y)return;const t=(0,p.M)(e),s=(0,u.A)(t),r="number"==typeof s?s.toFixed(2):null;i(r)},[e,y]),j=(0,o.useDebounce)(x,250),w=(0,l.useCallback)(e=>t=>{k.recordEvent("jetpack_ai_breve_feature_toggle",{type:e,on:t}),m(e,t)},[k,m]),_=(0,l.useCallback)(()=>{k.recordEvent("jetpack_ai_breve_toggle",{on:!y}),g()},[k,y,g]);return(0,l.useEffect)(()=>{j()},[j]),(e=>{const[t,s]=(0,l.useState)(!1);t||(e(),s(!0))})(x),(0,l.useEffect)(()=>{f(!1),b(!1),v({target:null,virtual:null})},[f,b,v,y,t]),(0,h.jsxs)("div",{className:"jetpack-ai-proofread",children:[(0,h.jsx)(n.PanelRow,{children:(0,h.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,h.jsx)(n.ToggleControl,{checked:y,onChange:_,label:__("Show issues & suggestions","jetpack"),__nextHasNoMarginBottom:!0})})}),y&&(0,h.jsx)(n.PanelRow,{children:(0,h.jsxs)(n.Card,{size:"small",className:"jetpack-ai__write-brief-card",children:[(0,h.jsx)(n.CardBody,{size:"small",children:(0,h.jsx)(n.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,h.jsx)("div",{className:"feature-checkboxes-container",children:c.A.map(e=>(0,d.Ur)(e.config.name)&&(0,h.jsx)(n.CheckboxControl,{className:y?"":"is-disabled",disabled:!y,"data-breve-type":e.config.name,label:e.config.title,checked:!t.includes(e.config.name),onChange:w(e.config.name),__nextHasNoMarginBottom:!0},e.config.name))})})}),(0,h.jsx)(n.CardFooter,{size:"small",className:"jetpack-ai-proofread__grade-level-container",children:null===s?(0,h.jsx)("p",{className:"jetpack-ai-proofread__help-text",children:__("Write to see your grade level.","jetpack")}):(0,h.jsxs)("div",{className:"jetpack-ai-proofread__grade-label",children:[s," ",__("Reading grade score","jetpack")]})})]})})]})})},64949(e,t,s){"use strict";s.d(t,{Ay:()=>c,jp:()=>i,zz:()=>a});var r=s(27723),n=s(53817),o=s(80811);const __=r.__,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(n.N).join("|")})\\b`,"gi");function c(e){const t=e.matchAll(l),s=[];for(const e of t){const t=e[0].trim();s.push({text:t,suggestion:o.A[t],startIndex:e.index,endIndex:e.index+t.length})}return s}},80811(e,t,s){"use strict";s.d(t,{A:()=>r});const r={"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","allows you to":"lets you",alternative:"other",anticipate:"expect","a number of":"some",apparent:"clear",appreciable:"many",approximate:"about","arrive onboard":"arrive","as a mean
// Translators: %1$d is the number of images with alt text, %2$d is the total number of images.
__("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)(n.PanelRow,{className:"jetpack-seo-sidebar__feature-section jetpack-seo-sidebar__feature-section--toggle",children:[(0,h.jsx)(n.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)(n.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)(n.Button,{variant:"secondary",__next40pxDefaultSize:!0,className:"jetpack-seo-enhancer-summary__edit-button",onClick:e,children:__("Edit SEO metadata","jetpack")})]})})}},6363(e,t,s){"use strict";function r(e){return{type:"SET_BUSY",isBusy:e}}function n(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}}s.r(t),s.d(t,{setBusy:()=>r,setDescriptionBusy:()=>o,setFeatureEnabled:()=>u,setImageBusy:()=>l,setImageFailed:()=>c,setIsAutoEnhanceEnabled:()=>i,setIsTogglingAutoEnhance:()=>a,setTitleBusy:()=>n})},16204(e,t,s){"use strict";s.d(t,{M:()=>d});var r=s(97999),n=s(85985),o=s(47143),a=s(4167),i=s(6363),l=s(49824),c=s(16886);let u=!1;try{if(!(0,r.isSimpleSite)()){const e=(0,o.select)(n.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"),s=t?JSON.parse(t):{};for(const t of a.G)e[t]=s[t]??!0}catch{}return{isBusy:!1,isTogglingAutoEnhance:!1,isAutoEnhanceEnabled:u,busyImages:{},failedImages:{},features:e}}()});(0,o.register)(d)},49824(e,t,s){"use strict";s.d(t,{A:()=>r});const r=function(e,t){let s=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 s={...e,features:{...e.features,[t.feature]:t.enabled}},r=s.features,localStorage.setItem("jetpack-seo-enhancer-features",JSON.stringify(r)),s;default:return e}var r}},16886(e,t,s){"use strict";s.r(t),s.d(t,{getEnabledFeatures:()=>p,hasImageFailed:()=>d,isAnyImageBusy:()=>u,isAutoEnhanceEnabled:()=>l,isBusy:()=>n,isDescriptionBusy:()=>a,isImageAltTextFeatureEnabled:()=>h,isImageBusy:()=>c,isTitleBusy:()=>o,isTogglingAutoEnhance:()=>i});var r=s(47143);function n(e){return e.isBusy}function o(e){return e.isTitleBusy}function a(e){return e.isDescriptionBusy}function i(e){
// translators: %1$d: number of days until the next usage count reset, %2$s: date of next reset
__("Requests will reset to <strong>%1$d</strong> on %2$s.","jetpack"),l,d),{strong:(0,c.jsx)("strong",{})}));const b=s/l,v=(0,c.jsxs)(c.Fragment,{children:[t===n.Ti&&(0,c.jsx)("p",{children:__("Unlimited requests.","jetpack")}),(t===n._X||t===n.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)(r.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,s){"use strict";s.d(t,{A:()=>g});var r=s(96865),n=s(3924),o=s(97999),a=s(85985),i=s(56427),l=s(38443),c=s(86087),u=s(27723),d=s(75956),p=s(93471),h=s(10790);const __=u.__;function m({isOverLimit:e,requestsCount:t,requestsLimit:s,nextStart:r,planType:n,loading:o,canUpgrade:c,showContactUsCallToAction:d,nextLimit:m,contactUsURL:g,handleContactUsClick:f,checkoutUrl:b,handleUpgradeClick:v}){const k=((e,t)=>e===a._X?__("Upgrade","jetpack"):t?(0,u.sprintf)(
// translators: %1$d: an integer, the number of requests to upgrade to on the next tier
__("Get %1$d requests","jetpack"),t):__("Get more requests","jetpack"))(n,m),y=(x=r)?(0,l.gmdateI18n)("F j",x):null;var x;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:s,nextResetDate:y,planType:n,loading:o}),!o&&(n===a._X||n===a.ds)&&c&&(0,h.jsxs)("div",{className:"jetpack-ai-usage-panel-upgrade-button",children:[d&&(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:g,onClick:f,children:(0,h.jsx)("span",{children:__("Contact Us","jetpack")})})]}),!d&&(0,h.jsx)(i.Button,{target:"_blank",variant:"primary",label:__("Upgrade your Jetpack AI plan","jetpack"),href:b,onClick:v,children:(0,h.jsx)("span",{children:k})})]})]})})}function g({placement:e=null}){const{checkoutUrl:t}=(0,r.ON)(),{contactUsURL:s}=(()=>{const e=(0,n.A)("jetpack-ai-tiers-more-requests-contact"),{autosaveAndRedirect:t,isRedirecting:s}=(0,a.ZR)(e);return{contactUsURL:e,autosaveAndRedirectContactUs:t,isRedirectingContactUs:s}})(),{tracks:i}=(0,d.A)(),l=(0,a.CP)(),{requestsCount:u,requestsLimit:p,isOverLimit:g,usagePeriod:f,currentTier:b,nextTier:v,loading:k}=(0,r.yM)(),y=(0,a.Bd)(b),x=(0,c.useCallback)(()=>{i.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:b?.slug,requests_count:u,...e?{placement:e}:{}})},[i,b,u,e]),j=(0,c.useCallback)(()=>{i.recordEvent("jetpack_ai_upgrade_button",{current_tier_slug:b?.slug,requests_count:u,...e?{placement:e}:{}})},[i,b,u,e]),w=(0,o.isWpcomPlatformSite)()&&y===a.ds&&!v;return(0,h.jsx)(m,{isOverLimit:g,requestsCount:u,requestsLimit:p,nextStart:f?.nextStart,nextLimit:v?.limit,planType:y,loading:k,canUpgrade:l,showContactUsCallToAction:w,contactUsURL:s,handleContactUsClick:j,checkoutUrl:t,handleUpgradeClick:x})}},56199(e,t,s){"use strict";s.d(t,{k:()=>r});const r="block_settings_sidebar"},88797(e,t,s){"use strict";var r=s(85985),n=s(23806);(0,r.vp)(n.U,n.W)},23806(e,t,s){"use strict";s.d(t,{U:()=>n,W:()=>o});var r=s(23162);const n="ai-assistant-plugin",o={render:r.A}},1176(e,t,s){"use strict";s.d(t,{N:()=>u});var r=s(96865),n=s(56427),o=s(27723),a=s(51609),i=s(2162),l=s(62402),c=s(10790);const __=o.__;function u({minWords:e=10,maxWords:t=100,disabled:s,words:o,onWordsNumberChange:u,language:d,onLanguageChange:p,tone:h,onToneChange:m}){const[g,f]=(0,a.useState)(!1);const b=d?.split(" ")[0],v=r.so[b]?.label||__("Language","jetpack"),k=r.oZ[h]?.label||__("Tone","jetpack");return(0,c.jsxs)("div",{className:"jetpack-ai-generate-excerpt-control",children:[(0,c.jsxs)(n.BaseControl,{className:"jetpack-ai-generate-excerpt-control__header",__nextHasNoMarginBottom:!0,children:[(0,c.jsx)(n.BaseControl.VisualLabel,{children:__("Settings","jetpack")}),(0,c.jsx)(n.Button,{label:__("Advanced AI options","jetpack"),icon:r.cj,onClick:function(){f(e=>!e)},"aria-pressed":g,isSmall:!0})]}),g&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(i.HU,{disabled:s,onChange:p,value:d,label:v}),(0,c.jsx)(l.hN,{disabled:s,label:k,value:h,onChange:m})]}),(0,c.jsx)(n.RangeControl,{label:__("Desired length","jetpack"),value:o,onChange:u,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:s,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})}},25101(e,t,s){"use strict";var r=s(85985),n=s(47143),o=s(43656),a=s(52619),i=s(10067),l=s.n(i),c=s(54681),u=s(10821),d=s(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,r.vp)(d.s,d.$),p("Registered AI Excerpt plugin"),(0,(0,n.dispatch)(o.store).removeEditorPanel)("post-excerpt"),p("Removed the post-excerpt panel"),e):e}),p("Added filter for AI Content Lens features"))},33251(e,t,s){"use strict";s.d(t,{g:()=>b})
// Translators: %1$d is the number of words in the excerpt.
_n("%1$d word","%1$d words",R,"jetpack"),R),F="requesting"===T||"suggesting"===T||"done"===T&&!x,O="requesting"===T||"suggesting"===T,z=O||"done"===T;const{requireUpgrade:U,isOverLimit:H}=(0,r.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=>f({excerpt:e}),help:R?D:null,value:L,disabled:z}),(0,n.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:[B?.code&&"error_quota_exceeded"!==B.code&&(0,g.jsx)(i.Notice,{status:B.severity,isDismissible:!1,className:"jetpack-ai-assistant__error",children:B.message}),H&&(0,g.jsx)(r.Hb,{placement:"excerpt-panel"}),(0,g.jsx)(m.N,{words:k,onWordsNumberChange:e=>{y(e),j(!0)},language:w,onLanguageChange:e=>{_(e),j(!0)},tone:C,onToneChange:e=>{A(e),j(!0)},disabled:O||U}),(0,g.jsx)(i.BaseControl,{help:M?.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(){f({excerpt:t}),h.recordEvent("jetpack_ai_assistant_block_discard",{feature:"jetpack-ai-content-lens",model:I}),P()},variant:"secondary",isDestructive:!0,disabled:"done"!==T||U,children:__("Discard","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){f({excerpt:N}),h.recordEvent("jetpack_ai_assistant_block_accept",{feature:"jetpack-ai-content-lens",model:I}),P()},variant:"secondary",disabled:"done"!==T||U,children:__("Accept","jetpack")}),(0,g.jsx)(i.Button,{onClick:function(){j(!1),P();const t=[{role:"jetpack-ai",context:{type:"ai-content-lens",contentType:"post-excerpt",postId:Number(s),words:k,language:w,tone:C,content:`Post content:\n${M}\n`}}];b(),h.recordEvent("jetpack_ai_assistant_block_request",{feature:"jetpack-ai-content-lens",model:I}),e.current=window?.performance?.now?.()||null,S(t,{feature:"jetpack-ai-content-lens",model:I})},variant:"secondary",isBusy:O,disabled:F||U||!M,children:__("Generate","jetpack")})]})})]})]})}const b=()=>{if((0,l.useSelect)(e=>{const{getCurrentPostType:t}=e(c.store),s=t();return"wp_template"===s||"wp_template_part"===s||"wp_block"===s},[]))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,s){"use strict";s.d(t,{$:()=>o,s:()=>n});var r=s(33251);const n="ai-content-lens",o={render:r.g}},31009(e,t,s){"use strict";s.d(t,{m:()=>l});var r=s(3924),n=s(85985),o=s(56427),a=s(27723),i=s(10790);const __=a.__,l=({changeStatus:e,isLoading:t,isModuleActive:s})=>{const{tracks:a}=(0,n.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:s||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,r.A)("jetpack-support-likes"),children:__("Learn more about Jetpack Likes.","jetpack")})})]})}},79013(e,t,s){"use strict";s.d(t,{L:()=>i});var r=s(50723),n=s(11876),o=s(56427),a=s(10790);const i=()=>(0,a.jsx)(r.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
__("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)(n.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"),s(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,s){"use strict";s.d(t,{P:()=>a});var r=s(56427),n=s(27723),o=s(10790);const __=n.__,_n=n._n,a=({suggestedLimit:e,value:t,label:s,...a})=>{const i=!e||t.length<=e?(0,n.sprintf)(/* translators: %d: the number of characters in a sentence. */
_n("%d character","%d characters",t.length,"jetpack"),t.length):(0,n.sprintf)(/* translators: %1$d: suggested character limit, %2$d: number of characters in a sentence. */
__("It is 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)(r.TextareaControl,{__nextHasNoMarginBottom:!0,label:s,help:i,value:t,...a})})}},92411(e,t,s){"use strict";s.d(t,{A:()=>d});var r=s(85985),n=s(86087),o=s(27723),a=s(99463),i=s(53189),l=s(10790);const __=o.__,c=!0===(0,r.FB)("ai-seo-enhancer")?.available;class u extends n.Component{onMessageChange=e=>{this.props.updateMetaValue(e)};render(){const{metaValue:e}=this.props,t=__("Write a description…","jetpack"),s=__("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?s:t,suggestedLimit:156,rows:4})}}const d=(0,i.m)("advanced_seo_description")(u)},44921(e,t,s){"use strict";var r=s(85985),n=s(37802);(0,r.vp)(n.U,n.W)},37802(e,t,s){"use strict";s.d(t,{U:()=>C,W:()=>T});var r=s(70499),n=s(97999),o=s(85985),a=s(82201),i=s(56427),l=s(3582),c=s(47143),u=s(43656),d=s(86087),p=s(27723),h=s(89870),m=s(12430),g=s(77682),f=s(96012),b=s(76262),v=s(51626),k=s(24294),y=s(92411),x=s(5664),j=s(9411),w=s(80151),_=s(10790);const __=p.__,C="seo",A="function"==typeof(0,c.select)(u.store).isPublishSidebarOpened,S=!0===(0,o.FB)("ai-seo-enhancer")?.available&&A,E=!(0,n.isSimpleSite)(),N=()=>{const{isLoadingModules:e,isChangingStatus:t,isModuleActive:s,changeStatus:p}=(0,o.q7)("seo-tools"),C=(0,c.useSelect)(e=>e(u.store).isPublishSidebarOpened?.(),[]),{updateSeoData:N,isBusy:T}=(0,f.X)(),B=(0,c.useSelect)(e=>{const t=e(u.store).getCurrentPostType(),s=e(l.store).getPostType(t);return s?.viewable},[]),P=(0,d.useRef)(!1),{isEnabled:I,isToggling:M}=(0,g.S)(),{closePublishSidebar:L}=(0,c.useDispatch)(u.store);(0,d.useEffect)(()=>{S&&C&&!P.current&&!T&&I&&!M&&E&&A&&N({trigger:"auto"}),P.current=C},[C,N,T,I,M]);if(!B)return null;const R=(0,o.tu)("advanced-seo"),D=(0,n.isWpcomPlatformSite)(),F=!(0,o.tu)("ai-seo-enhancer");if(D&&!1!==R)return(0,_.jsx)(u.PluginDocumentSettingPanel,{className:"jetpack-seo-panel",title:__("Optimize SEO","jetpack"),name:"jetpack-seo",icon:(0,_.jsx)(a.jt,{}),children:(0,_.jsx)(k.A,{requiredPlan:R})});if(!s)return(0,_.jsx)(u.PluginDocumentSettingPanel,{className:"jetpack-seo-panel",title:__("Optimize SEO","jetpack"),name:"jetpack-seo",icon:(0,_.jsx)(a.jt,{}),children:e?(0,_.jsx)(v.G,{}):(0,_.jsx)(b.l,{changeStatus:p,isModuleActive:s,isLoading:t})});const O={icon:(0,_.jsx)(a.jt,{}),title:__("SEO","jetpack"),initialOpen:S};return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(u.PluginDocumentSettingPanel,{className:"jetpack-seo-panel",title:__("Optimize SEO","jetpack"),name:"jetpack-seo",icon:(0,_.jsx)(a.jt,{}),children:[S&&F&&(0,_.jsx)(h.k,{placement:"document-settings",disableAutoEnhance:!E}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(w.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(y.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(r.m2,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(x.A,{})})]}),(0,_.jsx)(u.PluginPrePublishPanel,{...O,children:(0,_.jsxs)("div",{className:"jetpack-seo-panel",children:[S&&F&&(0,_.jsx)(h.k,{placement:"jetpack-prepublish-sidebar",disableAutoEnhance:!E}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(w.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(y.A,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(r.m2,{})}),(0,_.jsx)(i.PanelRow,{children:(0,_.jsx)(x.A,{})})]})}),S&&(0,_.jsx)(u.PluginPostPublishPanel,{...O,children:(0,_.jsx)("div",{className:"jetpack-seo-panel",children:(0,_.jsx)(m.A,{onEdit:async()=>{await L(),(0,j.k)()}})})})]})},T={render:()=>(0,_.jsx)(N,{})}},5664(e,t,s){"use strict";s.d(t,{A:()=>i});var r=s(56427),n=s(27723),o=s(53189),a=s(10790);const __=n.__,i=(0,o.m)("jetpack_seo_noindex")(({metaValue:e,updateMetaValue:t})=>(0,a.jsx)(r.ToggleControl,{label:__("Hide page from search engines","jetpack"),help:__("If selected, a 'noindex' tag will help instruct search engines to not include this page in search results. This page will also be removed fr
// translators: %s: amount
__("%s / month","jetpack"),o);case"1 year":return(0,i.sprintf)(
// translators: %s: amount
__("%s / year","jetpack"),o);case"one-time":return o}return(0,i.sprintf)(
// translators: %1$s: formatted price, %2$s: plan interval
__("%1$s / %2$s","jetpack"),o,s)}function v({onClose:e,product:t}){const{selectedProductIds:s,setSelectedProductIds:r}=(0,h.B)(),{id:n,title:a}=t,i=s&&s.includes(n),l=i?c.A:void 0,u=t?" "+b(t):null;return(0,f.jsxs)(o.MenuItem,{icon:l,onClick:t=>{t.preventDefault();const o=i?s.filter(e=>e!==n):[...s,n];r(o),e()},selected:i,value:n,children:[a," : ",u]})}function k({onClose:e}){const{clientId:t,productType:s}=(0,h.B)(),r=(0,a.useSelect)(e=>e(d.M).getSiteSlug()),n=(0,m.A)(t);if(p.Wd===(0,p.AU)())return(0,f.jsx)(o.MenuItem,{children:r&&(0,f.jsx)(o.ExternalLink,{href:`https://wordpress.com/earn/payments/${r}#add-new-payment-plan`,children:(0,g.W)("add a new product",s)})});return(0,f.jsx)(o.MenuItem,{onClick:t=>{t.preventDefault(),n(),setTimeout(()=>{const e=document.getElementById("new-product-title");null!==e&&e.focus()},100),e()},children:(0,g.W)("add a new product",s)})}function y(){const{products:e,productType:t,selectedProductIds:s}=(0,h.B)(),r=(0,a.useSelect)(e=>e(d.M).getSelectedProducts(s),[s]);let i=null,c=u.A;return r.length>1?i=__("Multiple products selected","jetpack"):1===r.length&&(i=b(r[0])),r.length!=r.length&&(i=(0,g.W)("product not found",t),c=l.A),(0,f.jsx)(n.BlockControls,{__experimentalShareWithChildBlocks:!0,group:"block",children:(0,f.jsx)(o.ToolbarDropdownMenu,{className:"product-management-control-toolbar__dropdown-button",icon:c,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,s){"use strict";s.d(t,{A:()=>i});var r=s(94715),n=s(47143),o=s(14309),a=s(59340);function i(e){const t=(0,a.AU)(),{selectBlock:s}=(0,n.useDispatch)(r.store),{enableComplementaryArea:i}=(0,n.useDispatch)("core/interface"),{closePublishSidebar:l}=(0,n.useDispatch)(o.store);return()=>{switch(e&&s(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,s){"use strict";s.d(t,{G:()=>l,W:()=>a});var r=s(27723),n=s(29726);const __=r.__,o={"add a new product":{[n._$]:__("Add a new payment plan","jetpack"),[n.h5]:__("Add a new subscription","jetpack")},"product not found":{[n._$]:__("Payment plan not found","jetpack"),[n.h5]:__("Subscription not found","jetpack")},"select a product":{[n._$]:__("Select a payment plan","jetpack"),[n.h5]:__("Select a subscription","jetpack")},"default new product title":{[n._$]:__("Monthly Subscription","jetpack"),[n.h5]:__("Monthly Subscription","jetpack")},"manage your products":{[n._$]:__("Manage your payment plans.","jetpack"),[n.h5]:__("Manage your subscriptions.","jetpack")},"saving product":{[n._$]:__("Saving payment plan…","jetpack"),[n.h5]:__("Saving subscription…","jetpack")},"add product":{[n._$]:__("Add payment plan","jetpack"),[n.h5]:__("Add subscription","jetpack")},"product requires a name":{[n._$]:__("Payment plan requires a name","jetpack"),[n.h5]:__("Subscription requires a name","jetpack")},"product requires a valid price":{[n._$]:__("Payment plan requires a valid price","jetpack"),[n.h5]:__("Subscription requires a valid price","jetpack")},"successfully created product":{[n._$]:__("Successfully created payment plan","jetpack"),[n.h5]:__("Successfully created subscription","jetpack")},"there was an error when adding the product":{[n._$]:__("There was an error when adding the payment plan.","jetpack"),[n.h5]:__("There was an error when adding the subscription.","jetpack")},"invalid product configured for this block":{[n._$]:__("Invalid payment plan configured for this block.","jetpack"),[n.h5]:__("Invalid subscription configured for this block.","jetpack")},"the button will be hidden from your visitors until you select a valid product":{[n._$]:__("The button will be hidden from your visitors until you select a valid payment plan.","jetpack"),[n.h5]:__("The subscribe button will be hidden from your visitors until you select a val
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
2026-03-31 11:30:59 +02:00
__("%1$s, and %2$s","jetpack"),e,t)}return a})(s,t),o=void 0===r?"0":r.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
2026-03-31 11:30:59 +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).",r??0,"jetpack"),n,o):(0,c.sprintf)(
2024-02-16 11:03:01 +01:00
// translators: %1s is the list of categories, %2d is subscriptions count
2026-03-31 11:30:59 +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>).",r??0,"jetpack"),n,o)};function f(e,t){return(0,r.getAdminUrl)(`admin.php?page=stats#!/stats/email/opens/day/${t}/${e}`)}const b=function({accessLevel:e,prePublish:t=!1}){const s=(0,a.useSelect)(e=>e("core/block-editor").getBlocks().some(e=>e.name===u.name)),{isScheduledPost:r,isPostOlderThanADay:b,postCategories:v,postId:k,postMeta:y}=(0,a.useSelect)(e=>{const{isCurrentPostScheduled:t,getEditedPostAttribute:s,getCurrentPost:r}=e(i.store),n=r()?.status,o=new Date(r()?.date),a=new Date(Date.now()-864e5);return{isScheduledPost:t(),isPostOlderThanADay:"publish"===n&&o<a,postCategories:s("categories"),postId:r()?.id,postMeta:s("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:s,getNewsletterCategoriesSubscriptionsCount:r,getSubscriberCounts:n,getTotalEmailsSentCount:o,hasFinishedResolution:a}=e(h.M),{emailSubscribers:i,paidSubscribers:l}=n();return{hasFinishedLoading:[a("getSubscriberCounts"),a("getNewsletterCategories"),a("getNewsletterCategoriesSubscriptionsCount")].every(Boolean),emailSubscribersCount:i,newsletterCategories:t(),newsletterCategoriesEnabled:s(),newsletterCategorySubscriberCount:r(),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||r,B=(0,p.Yc)({accessLevel:e,subscribers:b?E:j,paidSubscribers:S,postHasPaywallBlock:s});let P;return P=y?.[d.KG]?__("Not sent via email.","jetpack"):(0,n.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:s,reachCount:r})=>{const n=r.toLocaleString();return e?t&&!s?(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>.",r,"jetpack"),n):(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>.",r,"jetpack"),n):t&&!s?(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>.",r,"jetpack"),n):(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>.",r,"jetpack"),n)})({futureTense:T,isPaidPost:N,postHasPaywallBlock:s,reachCount:B}),(0,m.jsx)("p",{children:(0,l.createInterpolateElement)(P,{strong:(0,m.jsx)("strong",{}),link:(0,m.jsx)("a",{href:f(x,k)})})})}},64234(e,t,s){"use strict";s.d(t,{Qu:()=>l,fI:()=>c,mf:()=>u});var r=s(56427),n=s(86087),o=s(27723),a=s(37906),i=s(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)(r.Notice,{status:"warning",isDismissible:!1,className:"edit-post-post-misconfiguration__warning",children:(0,n.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,s){"use strict";var r=s(97999),n=s(85985),o=s(1455),a=s.n(o),i=s(47143),l=s(27723);s(692);const __=l.__;function c(){const e=(0,n.GE)();return window?.location&&e?(0,r.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,r.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,s){"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&(s.p=window.Jetpack_Block_Assets_Base_Url)},59740(e,t,s){"use strict";var r=s(74997),n=s(47143),o=s(93832),a=s(30552);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,r.createBlock)("core/quote",{value:`<p>${c}</p>`,citation:t}))}u&&e.push((0,r.createBlock)("core/quote",{value:u,citation:d})),e.push((0,r.createBlock)("core/embed",{url:i,type:"wp-embed"})),(0,n.dispatch)("core/editor").resetEditorBlocks(e)})()},94375(e,t,s){"use strict";s.d(t,{A:()=>i,M:()=>l});var r=s(85985),n=s(74997),o=s(52619);const a="jetpack/";function i(e,t,s=[],i=!0){const l="string"==typeof e?e:e.name,c=l.startsWith(a),u=c?l.slice(8):l,{available:d,details:p,unavailableReason:h}=(0,r.FB)(u),m=(0,r.aq)(h,p),g=i||c?a:"";if(!d&&!m)return!1;const f=g+u,b=(0,n.registerBlockType)("object"==typeof e?e:f,t);return m&&(0,o.addFilter)("editor.BlockListBlock",`${f}-with-has-warning-is-interactive-class-names`,(0,r.BT)(f)),s.forEach(e=>(0,n.registerBlockType)(g+e.name,e.settings)),b}function l(e,t,s,n){return i(e,{...t,icon:(0,r.Cq)(e),attributes:e.attributes||{}},s,n)}},62289(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(5573),n=s(10790);const o=(e,t=24,s=24,o="0 0 24 24")=>(0,n.jsxs)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",width:t,height:s,viewBox:o,children:[(0,n.jsx)(r.Path,{fill:"none",d:"M0 0h24v24H0V0z",className:"icon-filler"}),e]})},64882(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(94715),n=s(13022),o=s(10790);const a=(e,t,s,a,i,l={})=>{const{isSelected:c}=t,u=t.attributes[e];return l.className=(0,n.A)(l.className,`jetpack-${e}-block`,{"is-selected":c}),(0,o.jsxs)("div",{...l,children:[!c&&""!==u&&a(t),(c||""===u)&&(0,o.jsx)(r.PlainText,{value:u,placeholder:s,"aria-label":s,onChange:i})]})}},21929(e,t,s){"use strict";var r=s(47143),n=s(27723);s(692);const __=n.__;if("undefined"!=typeof window&&window.location){const e=new URLSearchParams(window.location.search);e.get("stripe_connect_success")?(0,r.dispatch)("core/notices").createNotice("success",__("Congrats! Your site is now connected to Stripe. You can now start accepting funds!","jetpack")):e.get("stripe_connect_cancelled")&&(0,r.dispatch)("core/notices").createNotice("error",__("You cancelled connecting your site to Stripe.","jetpack"))}},56145(e,t,s){"use strict";s.d(t,{A:()=>a});var r=s(1455),n=s.n(r);const o=()=>{};function a(e,t=o){return t(!0),new Promise((s,r)=>{n()({path:`/wpcom/v2/resolve-redirect/?url=${encodeURIComponent(e)}`}).then(n=>{t(!1);const o=n.status?parseInt(n.status,10):null;o&&o>=400?r():s(n.url||e)},()=>{t(!1),r()})})}},26247(e,t,s){"use strict";s.d(t,{A:()=>o});var r=s(39384),n=s(97999);const o=()=>{const{isUserConnected:e}=(0,r.useConnection)();return(0,n.isSimpleSite)()||e}},89303(e,t,s){"use strict";s.d(t,{A:()=>n});var r=s(86087);function n({attributes:e,disableEffects:t=!1,setAttributes:s}){const{align:n,width:o}=e,a=(e=>{const t=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{t.current=e},[e]),t.current})(n);(0,r.useEffect)(()=>{if(t)return;a!==n&&("left"===n||"right"===n)&&o?.includes("%")&&s({width:void 0})},[n,t,a,s,o])}},30552(e,t,s){"use strict";s.d(t,{O:()=>n});var r=s(47143);function n(){return new Promise((e,t)=>{if(o())return void e();const s=(0,r.subscribe)(()=>{o()&&(clearTimeout(n),s(),e())}),n=setTimeout(()=>{s(),t(new Error("Timeout: Waiting for the editor to be ready has timed out."))},7e3)})}function o(){const e=(0,r.select)("core/editor"),t=(0,r.select)("core/block-editor");return!(!e||!t)&&(e.isCleanNewPost()||e.getCurrentPostId()||t.getBlocks().length>0)}},38062(e,t,s){"use strict";s.d(t,{D:()=>d,s:()=>p});var r=s(56427),n=s(86087),o=s(27723),a=s(13022),i=s(10790);const __=o.__,l=[{value:"%",label:"
// translators: %s: Price
__("Minimum allowed price is %s.","jetpack"),(0,r.vv)(k,b)),m),void n(!1);if(!(0,c.kF)(b,v))return(0,d.S)((0,l.W)("product requires a valid price",t),m),void n(!1);try{const r=await o()({path:"/wpcom/v2/memberships/product",method:"POST",data:e}),a={id:r.id,title:r.title,interval:r.interval,price:r.price,currency:r.currency},c=m.select(u.EF).getProducts();i(p(c.concat([a]))),s([a.id]),h&&(0,d.L)((0,l.W)("successfully created product",t),m),n(!0)}catch{(0,d.S)((0,l.W)("there was an error when adding the product",t),m),n(!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,s){"use strict";s.d(t,{EF:()=>r,JA:()=>o,an:()=>n,gI:()=>a,ky:()=>i});const r="jetpack/membership-products",n=0,o=1,a=2,i="tier"},16521(e,t,s){"use strict";s.d(t,{M:()=>c});var r=s(47143),n=s(66314),o=s(3696),a=s(91497),i=s(18410),l=s(92955);const c=(0,r.createReduxStore)(o.EF,{actions:n,reducer:a.A,resolvers:i,selectors:l,__experimentalUseThunks:!0});(0,r.register)(c)},91497(e,t,s){"use strict";s.d(t,{A:()=>n});const r={products:[],apiState:s(3696).an,connectUrl:null,siteSlug:"",connectedAccountDefaultCurrency:"",subscriberCounts:{totalSubscribers:null,socialFollowers:null,emailSubscribers:null,paidSubscribers:null},newsletterCategories:{enabled:!1,categories:[]}};function n(e=r,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,s){"use strict";s.r(t),s.d(t,{fetchNewsletterCategoriesSubscriptionsCount:()=>x,getNewsletterCategories:()=>S,getNewsletterCategoriesSubscriptionsCount:()=>E,getNewsletterTierProducts:()=>w,getProducts:()=>_,getSubscriberCounts:()=>C,getTotalEmailsSentCount:()=>A});var r=s(97999),n=s(1455),o=s.n(n),a=s(43656),i=s(93832),l=s(29726),c=s(1990),u=s(56539),d=s(27574),p=s(66314),h=s(3696),m=s(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 s=t?.errors&&Object.values(t.errors)?.[0]?.[0];if(s)throw new Error(s);return t},j=(e,t,s)=>{if(e.length>0)return;const r=s.getProductsNoResolver()[0]?.id;r&&t([r])},w=(e=l._$,t=[],s=()=>{})=>_(e,t,s,!1),_=(e=l._$,t=[],s=()=>{},r=!0)=>async({dispatch:n,registry:l,select:f})=>{if(await u.A.blockExecution(g),y)return void j(t,s,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}),s=await o()({path:t,method:"GET"});if(!s&&"object"!=typeof s)throw new Error("Unexpected API response");const r=s?.errors&&Object.values(s.errors)?.[0]?.[0];if(r)throw new Error(r);return s})();((e,t,s)=>{const r=t.select(a.store).getCurrentPostId();s((0,p.setConnectUrl)((0,d.A)(r,e.connect_url))),s((0,p.setSi