Web Stories - Version 1.18.1

Version Description

Release Date: March 8, 2022.

  • Fixes an issue where adding video captions did not work.
Download this release

Release Info

Developer swissspidy
Plugin Icon 128x128 Web Stories
Version 1.18.1
Comparing to
See all releases

Code changes from version 1.18.0 to 1.18.1

assets/js/wp-story-editor.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-api-fetch', 'wp-dom-ready'), 'version' => 'a415fde4a2d1b5ed1cad154b113ff3d8');
1
+ <?php return array('dependencies' => array('wp-api-fetch', 'wp-dom-ready'), 'version' => '639e3c178f6b1f7f2d99215de5fb7034');
assets/js/wp-story-editor.js CHANGED
@@ -264,10 +264,10 @@ Object(i.__)("Would you like to include it on a new post?","web-stories")))},w=n
264
  /* translators: %s: list of allowed file types. */
265
  Object(i.__)("Please choose only %s as publisher logo.","web-stories")),Z=T(
266
  /* translators: %s: list of allowed file types. */
267
- Object(i.__)("Please choose only %s as a poster.","web-stories")),R=Object(f.j)(((e,t)=>{let{option:n,...a}=e;return n.props?n:o.a.createElement(Q.a.Option,me({value:n.id,ref:t},a),o.a.createElement(xe,{src:n.url,alt:"",decoding:"async",crossOrigin:"anonymous"}))})),N=e=>o.a.createElement(Q.a.Option,{onClick:e,"aria-label":Object(i.__)("Add new","web-stories")},o.a.createElement(p.a.ArrowCloud,{height:32,width:32}),o.a.createElement(b.a,{as:"span",size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},Object(i.__)("Add new","web-stories"))),D=[...E];if(m){const e={width:96,height:96};D.unshift(o.a.createElement(g,{onSelect:A,onSelectErrorMessage:P,type:c,render:N,title:Object(i.__)("Select as publisher logo","web-stories"),buttonInsertText:Object(i.__)("Select as publisher logo","web-stories"),cropParams:e}))}return o.a.createElement(d.Panel,{name:t||"publishing",collapsedByDefault:!1,isPersistable:!(M||O)},o.a.createElement(d.PanelTitle,null,Object(i.__)("Publishing","web-stories")),o.a.createElement(d.PanelContent,null,(null==S?void 0:S.publish)&&o.a.createElement(de,null),(null==S?void 0:S["assign-author"])&&n&&o.a.createElement(fe,null),o.a.createElement(ye,{isHighlighted:(null==O?void 0:O.showEffect)||(null==M?void 0:M.showEffect),onAnimationEnd:()=>_()},o.a.createElement(we,null,o.a.createElement(be,null,o.a.createElement(ve,{ref:e=>{e&&null!=O&&O.focus&&null!=O&&O.showEffect&&e.focus()},width:72,height:96,cropParams:{width:640,height:853},value:null==L?void 0:L.url,onChange:I,title:Object(i.__)("Select as poster image","web-stories"),buttonInsertText:Object(i.__)("Select as poster image","web-stories"),type:c,ariaLabel:Object(i.__)("Poster image","web-stories"),onChangeErrorText:Z,imgProps:L,canUpload:m})),o.a.createElement(he,null,o.a.createElement(ge,null,Object(i.__)("Poster image","web-stories")),o.a.createElement(d.Required,null))),o.a.createElement(_e,null,o.a.createElement(be,null,o.a.createElement(Q.a.DropDown,{options:D,primaryOptions:D,onChange:k,"aria-label":Object(i.__)("Publisher Logo","web-stories"),renderer:R,activeItemRenderer:()=>{const e=E.length?Object(i.__)("Select logo","web-stories"):Object(i.__)("No logo","web-stories");return x.id?o.a.createElement(xe,{src:x.url,alt:""}):o.a.createElement(b.a,{as:"span",size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},e)},selectedId:x.id,zIndex:10,disabled:!D.length,ref:e=>{e&&null!=M&&M.focus&&null!=M&&M.showEffect&&e.focus()}})),o.a.createElement(he,null,o.a.createElement(ge,null,Object(i.__)("Publisher Logo","web-stories")),o.a.createElement(d.Row,null,o.a.createElement(d.Required,null),h&&o.a.createElement(y.a,{rel:"noopener noreferrer",target:"_blank",href:u,size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},Object(i.__)("Manage","web-stories"))))))))},Se=n(12),Ie=n(224),ke=n(141),Pe=n(33);function ze(){return(ze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const $e=w.f.li.withConfig({displayName:"status__StyledListItem",componentId:"sc-1pq370j-0"})(["position:relative;padding:6px 8px;margin:4px 8px;align-items:center;border-radius:4px;cursor:pointer;"," &:hover{background-color:",";}"],Se.c.focusableOutlineCSS,Se.b.colors.border.defaultNormal),Ye=Object(w.f)(Text).attrs({as:"span"}).withConfig({displayName:"status__LabelText",componentId:"sc-1pq370j-1"})(["font-size:14px;color:",";"],Se.b.colors.fg.primary),qe=Object(w.f)(Text).attrs({as:"span"}).withConfig({displayName:"status__HelperText",componentId:"sc-1pq370j-2"})(["color:",";"],Se.b.colors.fg.tertiary),Xe=Object(f.j)(((e,t)=>{let{option:n,isSelected:a,...r}=e;return o.a.createElement($e,ze({ref:t,active:a},r),o.a.createElement(Ye,null,n.label),o.a.createElement("br",null),o.a.createElement(qe,null,n.helper))}));var Qe=function StatusPanel(e){var t;let{nameOverride:n,popupZIndex:a,canCollapse:r,isPersistable:l,...C}=e;const{status:c="",password:s,updateStory:u,saveStory:p,capabilities:m,editLink:g,title:b,storyId:v,visibility:y}=Object(d.useStory)((e=>{let{state:{story:{status:t,password:n,editLink:a,title:r,storyId:l,visibility:o},capabilities:i},actions:{updateStory:C,saveStory:c}}=e;return{status:t,password:n,updateStory:C,saveStory:c,capabilities:i,editLink:a,title:r,storyId:l,visibility:o}})),E=Object(Pe.b)("enableUpdatedPublishStoryModal"),[w,O]=Object(f.I)(!1),M=Object(f.s)((()=>O(!1)),[]),{shouldReviewDialogBeSeen:_}=Object(d.useCheckpoint)((e=>{let{state:{shouldReviewDialogBeSeen:t}}=e;return{shouldReviewDialogBeSeen:t}})),L=Object(d.useIsUploadingToStory)();Object(f.y)((()=>{s?u({properties:{visibility:ie}}):c!==ce.PRIVATE?y||u({properties:{visibility:le}}):u({properties:{visibility:oe}})}),[s,c,u,y]);const x=[{value:le,label:Object(i.__)("Public","web-stories"),helper:Object(i.__)("Visible to everyone","web-stories")}];null!=m&&m.publish&&(x.push({value:oe,label:Object(i.__)("Private","web-stories"),helper:Object(i.__)("Visible to site admins & editors only","web-stories"),disabled:L&&y!==oe}),x.push({value:ie,label:Object(i.__)("Password Protected","web-stories"),helper:Object(i.__)("Visible only to those with the password.","web-stories")}));const j=Object(f.s)((e=>{u({properties:{password:e.target.value}})}),[u]),S=Object(d.useRefreshPostEditURL)(v,g),I=Object(f.s)((()=>{const e={status:ce.PRIVATE,password:"",visibility:oe};Object(h.g)("publish_story",{status:ce.PRIVATE,title_length:b.length}),S(),p(e)}),[b.length,S,p]),A=[ce.PUBLISH,ce.FUTURE,ce.PRIVATE].includes(c),k=Object(f.s)(((e,t)=>{const n=t;if(oe===n&&!A&&!window.confirm(Object(i.__)("Would you like to privately publish this story now?","web-stories")))return;const a={};switch(n){case le:a.status=y===oe?ce.DRAFT:c,a.password="",a.visibility=le;break;case oe:return void(E||!_||A?I():(O(!0),a.visibility=oe));case ie:a.status=y===oe?ce.DRAFT:c,a.password=s||"",a.visibility=ie}u({properties:a})}),[c,y,s,u,I,_,A,E]);return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.SimplePanel,ze({name:n||"status",title:Object(i.__)("Visibility","web-stories"),canCollapse:r,isPersistable:l,collapsedByDefault:!1},C),o.a.createElement(o.a.Fragment,null,o.a.createElement(d.Row,null,o.a.createElement(Ie.a,{options:x,selectedValue:y,onMenuItemClick:k,popupZIndex:a,disabled:x.length<=1,renderItem:Xe,hint:null===(t=x.find((e=>y===e.value)))||void 0===t?void 0:t.helper})),y===ie&&o.a.createElement(d.Row,null,o.a.createElement(ke.b,{"aria-label":Object(i.__)("Password","web-stories"),value:s,onChange:j,placeholder:Object(i.__)("Enter a password","web-stories")})))),o.a.createElement(d.ReviewChecklistDialog,{isOpen:w,onIgnore:I,onClose:M,onReview:M}))};function PublishModalDocumentPane(){return o.a.createElement(o.a.Fragment,null,o.a.createElement(je,{nameOverride:"storyDetailsPublishing"}),o.a.createElement(d.SlugPanel,{nameOverride:"storyDetailsExcerpt"}),o.a.createElement(d.PageAdvancementPanel,{nameOverride:"storyDetailsPageAdvancement"}),o.a.createElement(d.BackgroundAudioPanel,{nameOverride:"storyDetailsBackgroundAudio"}),o.a.createElement(d.TaxonomiesPanel,{nameOverride:"storyDetailsTaxonomies"}))}const et=Object(w.f)(Qe).withConfig({displayName:"documentPane__IsolatedPanel",componentId:"sc-3jx0y8-0"})(["padding:4px 4px 8px;"]);function IsolatedStatusPanel(){return o.a.createElement(et,{nameOverride:"storyDetailsStatus",canCollapse:!1,isPersistable:!1,popupZIndex:11})}var tt=function DocumentPane(){return o.a.createElement(o.a.Fragment,null,o.a.createElement(Qe,null),o.a.createElement(je,null),o.a.createElement(d.ExcerptPanel,null),o.a.createElement(d.SlugPanel,null),o.a.createElement(d.PageAdvancementPanel,null),o.a.createElement(d.BackgroundAudioPanel,null),o.a.createElement(d.TaxonomiesPanel,null))},nt=n(531);const at=w.f.div.withConfig({displayName:"videoOptimizationCheckbox__CheckboxContainer",componentId:"sc-mjnlj7-0"})(["display:flex;align-items:flex-start;"]),rt=w.f.div.withConfig({displayName:"videoOptimizationCheckbox__ButtonContainer",componentId:"sc-mjnlj7-1"})(["display:flex;align-items:center;justify-content:center;margin-top:16px;"]),lt=Object(w.f)(b.a).attrs({as:"span",isBold:!0}).withConfig({displayName:"videoOptimizationCheckbox__BoldText",componentId:"sc-mjnlj7-2"})(["color:",";"],(e=>{let{theme:t}=e;return t.colors.standard.white})),ot=Object(w.f)(b.a).attrs({size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL}).withConfig({displayName:"videoOptimizationCheckbox__DescriptionText",componentId:"sc-mjnlj7-3"})(["color:",";margin-bottom:16px;"],(e=>{let{theme:t}=e;return t.colors.fg.secondary})),it=Object(w.f)(ot).withConfig({displayName:"videoOptimizationCheckbox__CheckboxLabel",componentId:"sc-mjnlj7-4"})(["margin-left:8px;margin-bottom:0;line-height:20px;cursor:pointer;"]);var Ct=function VideoOptimizationCheckbox(){var e,t;const n=Object(d.useIsChecklistMounted)(),{capabilities:{hasUploadMediaAction:a}={},dashboardSettingsLink:r}=Object(d.useConfig)(),[l,C]=Object(f.I)(!1),c=Object(f.G)(),{currentUser:s,toggleWebStoriesMediaOptimization:u}=Object(d.useCurrentUser)((e=>{let{state:t,actions:n}=e;return{currentUser:t.currentUser,toggleWebStoriesMediaOptimization:n.toggleWebStoriesMediaOptimization}})),p=!(null==s||null===(e=s.meta)||void 0===e?void 0:e.web_stories_media_optimization)&&a,m=Object(f.s)((()=>{C(!0),u()}),[u]),{isSaving:g,saveStory:b}=Object(d.useStory)((e=>{let{state:t,actions:n}=e;return{isSaving:t.meta.isSaving,saveStory:n.saveStory}}));return Object(f.y)((()=>{l&&c.current.focus()}),[l]),(p||l)&&n?o.a.createElement(d.ChecklistCard,{title:Object(i.__)("Optimize all videos in the Story to ensure smooth playback.","web-stories"),footer:l?o.a.createElement(o.a.Fragment,null,o.a.createElement(d.DefaultFooterText,null,o.a.createElement(i.TranslateWithMarkup,{mapping:{b:o.a.createElement(lt,null)}},Object(i.__)("Automatic video optimization enabled. <b>Reload the page</b> to apply changes.","web-stories"))),o.a.createElement(rt,null,o.a.createElement(Z.a,{type:R.c.SECONDARY,size:R.a.SMALL,onClick:async()=>{await b(),window.location.reload(!0)},disabled:g,ref:c},Object(i.__)("Save & Reload","web-stories")))):o.a.createElement(at,null,o.a.createElement(nt.a,{id:"automatic-video-optimization-toggle",checked:null==s||null===(t=s.meta)||void 0===t?void 0:t.web_stories_media_optimization,onChange:m}),o.a.createElement(it,{forwardedAs:"label",htmlFor:"automatic-video-optimization-toggle"},o.a.createElement(i.TranslateWithMarkup,{mapping:{a:o.a.createElement(y.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL,onClick:e=>Object(h.e)(e,"click_video_optimization_settings"),href:r,isBold:!0})}},Object(i.__)("Enable automatic optimization. Change this any time in <a>Settings</a>.","web-stories"))))}):null};var ct=function Accessibility(){const{hasUploadMediaAction:e}=Object(d.useConfig)((e=>{let{capabilities:t}=e;return{hasUploadMediaAction:t.hasUploadMediaAction}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.PageBackgroundTextLowContrast,null),o.a.createElement(d.TextElementFontSizeTooSmall,null),o.a.createElement(d.VideoElementMissingDescription,null),e&&o.a.createElement(d.VideoElementMissingCaptions,null),o.a.createElement(d.ElementLinkTappableRegionTooSmall,null),o.a.createElement(d.ElementLinkTappableRegionTooBig,null),o.a.createElement(d.ImageElementMissingAlt,null),o.a.createElement(Ct,null))};var st=function Design(){const{hasUploadMediaAction:e}=Object(d.useConfig)((e=>{let{capabilities:t}=e;return{hasUploadMediaAction:t.hasUploadMediaAction}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.StoryPagesCount,null),o.a.createElement(d.PageTooMuchText,null),o.a.createElement(d.PageTooLittleText,null),o.a.createElement(d.PageTooManyLinks,null),e&&o.a.createElement(d.VideoElementResolution,null),e&&o.a.createElement(d.ImageElementResolution,null))};var ut=()=>{const e=Object(d.useIsChecklistMounted)(),{generalSettingsLink:t,publisherName:n}=Object(d.useConfig)((e=>{let{metadata:t,generalSettingsLink:n}=e;return{publisherName:null==t?void 0:t.publisher,generalSettingsLink:n}})),a=(null==n?void 0:n.trim().length)>0,{title:r}=d.CHECKLIST_PRIORITY_COPY.storyMissingPublisherName;return Object(d.useRegisterCheck)("StoryMissingPublisherName",!a),!a&&e&&o.a.createElement(d.ChecklistCard,{title:r,footer:o.a.createElement(d.DefaultFooterText,null,o.a.createElement(i.TranslateWithMarkup,{mapping:{a:o.a.createElement(y.a,{href:t,rel:"noreferrer",target:"_blank",size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL})}},Object(i.__)("Your site title is used when your Story appears on Google. You can set your site title by going to <a>General Settings</a>.","web-stories")))})};var dt=function Priority(){const{canManageSettings:e,hasUploadMediaAction:t}=Object(d.useConfig)((e=>{let{capabilities:t}=e;return{canManageSettings:t.canManageSettings,hasUploadMediaAction:t.hasUploadMediaAction}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.StoryMissingTitle,null),e&&o.a.createElement(ut,null),o.a.createElement(d.StoryTitleLength,null),o.a.createElement(d.StoryMissingExcerpt,null),t&&o.a.createElement(d.StoryPosterAttached,null),t&&o.a.createElement(d.StoryPosterSize,null),t&&o.a.createElement(d.PublisherLogoMissing,null),t&&o.a.createElement(d.PublisherLogoSize,null),t&&o.a.createElement(d.VideoElementMissingPoster,null),o.a.createElement(d.VideoOptimization,null),o.a.createElement(d.StoryAmpValidationErrors,null))};function pt(){return(pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const ft=w.f.div.withConfig({displayName:"footer__Panel",componentId:"sc-6wcfz2-0"})(["padding:16px 0 24px 0;border-top:1px solid ",";"],(e=>{let{theme:t}=e;return t.colors.bg.tertiary})),mt=w.f.ul.withConfig({displayName:"footer__Links",componentId:"sc-6wcfz2-1"})(["margin:8px 0 0 0;padding:0;list-style-position:inside;list-style-type:none;"]),ht=w.f.li.withConfig({displayName:"footer__ListItem",componentId:"sc-6wcfz2-2"})([""," &::before{content:'- ';}&,& > *{font-weight:700;}"],Se.c.expandTextPreset(((e,t)=>{let{paragraph:n}=e,{X_SMALL:a}=t;return n[a]})));function Link(e){let{children:t,...n}=e;return o.a.createElement(ht,null,o.a.createElement(y.a,pt({},n,{size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}),t))}const gt=Object(i.__)("https://wordpress.org/support/plugin/web-stories/","web-stories"),bt=Object(i.__)("https://youtube.com/playlist?list=PLfVPq9A6B0RNoQ3HTE9LQzgAdVzcb7tmt","web-stories");function Footer(){const e=Object(f.s)((e=>{Object(h.e)(e,"click_support_page")}),[]),t=Object(f.s)((e=>{Object(h.e)(e,"click_website_docs")}),[]),n=Object(f.s)((e=>{Object(h.e)(e,"click_storytime_channel")}),[]);return o.a.createElement(ft,null,o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},Object(i.__)("Discover more resources to get the most out of Web Stories. Read our start guide or visit our support forum to get answers to your questions.","web-stories")),o.a.createElement(mt,null,o.a.createElement(Link,{href:"https://wp.stories.google/docs/",target:"_blank",rel:"noreferrer",onClick:t},Object(i.__)("Read Start Guide","web-stories")),o.a.createElement(Link,{href:gt,target:"_blank",rel:"noreferrer",onClick:e},Object(i.__)("Visit Support Forums","web-stories")),o.a.createElement(Link,{href:bt,target:"_blank",rel:"noreferrer",onClick:n},Object(i.__)("Storytime YouTube Series","web-stories"))))}var vt=function Layout(){return o.a.createElement(K,null,o.a.createElement(d.InterfaceSkeleton,{header:o.a.createElement(T,null),footer:{secondaryMenu:{helpCenter:{Footer:Footer},checklist:{Priority:dt,Design:st,Accessibility:ct}}},inspectorTabs:{document:{title:Object(i.__)("Document","web-stories"),Pane:tt},publishModal:{DocumentPane:PublishModalDocumentPane,IsolatedStatusPanel:IsolatedStatusPanel}}},o.a.createElement(X,null)))},yt=n(44),Et=n.n(yt),wt=n(518);var Ot=(e,t)=>{const n=t.get("control"),a=Boolean(parseInt(n.params.flex_width)),r=Boolean(parseInt(n.params.flex_height)),l=e.get("width"),o=e.get("height");let i=parseInt(n.params.width),C=parseInt(n.params.height);const c=i/C,s=i,u=C;t.set("canSkipCrop",!n.mustBeCropped(a,r,i,C,l,o)),l/o>c?(C=o,i=C*c):(i=l,C=i/c);const d=(l-i)/2,p=(o-C)/2,f={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:l,imageHeight:o,minWidth:s>i?i:s,minHeight:u>C?C:u,x1:d,y1:p,x2:i+d,y2:C+p};return!1===r&&!1===a&&(f.aspectRatio=i+":"+C),!0===r&&(delete f.minHeight,f.maxWidth=l),!0===a&&(delete f.minWidth,f.maxHeight=o),f},Mt=n(569),_t=n(568);var Lt=e=>{const{src:t,url:n,mime:a,alt:r,date:l,id:o,featured_media:i,featured_media_src:{src:C,width:c,height:s,generated:u}="",media_details:{width:d,height:p,length:f,length_formatted:m,sizes:h},web_stories_media_source:b,web_stories_is_muted:v,web_stories_base_color:y,web_stories_blurhash:E,trim_data:w}=e,O=Object.entries(h).reduce(((e,t)=>{let[n,a]=t;return e[n]=Object(g.b)(a),e}),{});return Object(Mt.a)({baseColor:y,blurHash:E,mimeType:a,creationDate:l,src:n||t,...Object(_t.a)({width:d,height:p,posterGenerated:u,posterWidth:c,posterHeight:s}),poster:C,posterId:i,id:o,length:f,lengthFormatted:m,alt:r,sizes:O,local:!1,isExternal:!1,isOptimized:"video-optimization"===b,isMuted:v,trimData:w})};var xt,jt,St,It,At,kt=(e,t,n,a,r,l)=>(!0!==e||!0!==t)&&((!0!==e||a!==l)&&((!0!==t||n!==r)&&((n!==r||a!==l)&&!(Math.abs(n/a-r/l)<Number.EPSILON))));var Tt=null===(xt=window.wp)||void 0===xt||null===(jt=xt.media)||void 0===jt||null===(St=jt.controller)||void 0===St||null===(It=St.Cropper)||void 0===It||null===(At=It.extend)||void 0===At?void 0:At.call(It,{doCrop:function(e){const t=e.get("cropDetails"),n=this.get("control"),a=t.width/t.height;return n.params.flex_width&&n.params.flex_height?(t.dst_width=t.width,t.dst_height=t.height):(t.dst_width=n.params.flex_width?n.params.height*a:n.params.width,t.dst_height=n.params.flex_height?n.params.width/a:n.params.height),window.wp.ajax.post("crop-image",{nonce:e.get("nonces").edit,id:e.get("id"),context:n.id,cropDetails:t})}});const Pt={height:0,width:0,flex_width:!1,flex_height:!1};function Zt(e){let{title:t=Object(i.__)("Upload to Story","web-stories"),buttonInsertText:n=Object(i.__)("Insert into page","web-stories"),onSelect:a,onSelectErrorMessage:r=Object(i.__)("Unable to use this file type.","web-stories"),onClose:l,onPermissionError:o,type:C="",multiple:c=!1,cropParams:s}=e;const{actions:{updateMedia:u}}=Object(d.useAPI)(),{capabilities:{hasUploadMediaAction:p}}=Object(d.useConfig)(),{showSnackbar:m}=Object(wt.a)();Object(f.y)((()=>{try{window.wp.Uploader.prototype.success=e=>{let{attributes:t}=e;u(t.id,{web_stories_media_source:"editor",alt_text:t.alt||t.title})}}catch(e){}}),[u]);const g=Object(f.s)((e=>{if(Object(h.g)("open_media_modal"),!p)return o&&o(),void e.preventDefault();const i=window.wp.media({title:t,library:{type:C},button:{text:n},multiple:c});i.once("select",(()=>{const e=i.state().get("selection").first().toJSON();!Array.isArray(C)||C.includes(e.mime)?(e.alt=e.alt||e.title,a(Lt(e))):m({message:r})})),l&&i.once("close",l),i.once("content:activate:browse",(()=>{var e,t,n,a,r,l,o;null===(e=i.content)||void 0===e||null===(t=e.get())||void 0===t||null===(n=t.collection)||void 0===n||n._requery(!0),null===(a=i.content)||void 0===a||null===(r=a.get())||void 0===r||null===(l=r.options)||void 0===l||null===(o=l.selection)||void 0===o||o.reset()})),i.open(),e.preventDefault()}),[p,m,o,l,a,n,r,c,C,t]),b=Object(f.s)((e=>{if(Object(h.g)("open_media_crop_modal"),!p)return o&&o(),void e.preventDefault();const i={...Pt,...s},d={id:"control-id",params:i,mustBeCropped:kt},f={text:n,close:!1},g=window.wp.media({button:f,states:[new window.wp.media.controller.Library({title:t,library:window.wp.media.query({type:C}),button:f,multiple:c,suggestedWidth:i.width,suggestedHeight:i.height}),Tt&&new Tt({imgSelectOptions:Ot,control:d})]});g.once("cropped",(e=>{if(null!=e&&e.id){const t=e.alt||e.title;u(e.id,{web_stories_media_source:"editor",alt_text:t}),e.alt=t}a(Lt(e))})),g.once("skippedcrop",(()=>{const e=g.state().get("selection").first().toJSON();e.alt=e.alt||e.title,a(Lt(e))})),g.once("select",(()=>{const e=g.state().get("selection").first().toJSON();if(Array.isArray(C)&&!C.includes(e.mime))return g.close(),void m({message:r});d.params.width!==e.width||d.params.height!==e.height||d.params.flex_width||d.params.flex_height?g.setState("cropper"):(e.alt=e.alt||e.title,a(Lt(e)),g.close())})),l&&g.once("close",l),g.once("content:activate:browse",(()=>{var e,t,n,a,r,l,o;null===(e=g.content)||void 0===e||null===(t=e.get())||void 0===t||null===(n=t.collection)||void 0===n||n._requery(!0),null===(a=g.content)||void 0===a||null===(r=a.get())||void 0===r||null===(l=r.options)||void 0===l||null===(o=l.selection)||void 0===o||o.reset()})),g.open(),e.preventDefault()}),[p,s,n,t,C,c,a,l,o,u,m,r]);return Object(f.C)((()=>s?b:g),[s,b,g])}Zt.propTypes={title:Et.a.string,buttonInsertText:Et.a.string,onSelect:Et.a.func.isRequired,onSelectErrorMessage:Et.a.string,onClose:Et.a.func,onPermissionError:Et.a.func,type:Et.a.oneOfType([Et.a.string,Et.a.arrayOf(Et.a.string)]),cropParams:Et.a.object,multiple:Et.a.bool};var Rt=Zt;function Nt(e){let{render:t,...n}=e;return t(Rt(n))}Nt.propTypes={render:Et.a.func.isRequired,...Rt.propTypes};var Dt=Nt,zt=n(17);function Bt(e,t){const n=`${t}${e}/lock/`;return V()({path:n,method:"POST"})}const Ft=w.f.img.withConfig({displayName:"shared__Img",componentId:"sc-1djlecd-0"})(["float:left;margin:0px 10px 10px 0px;"]);var Ht=function PostLockDialog(e){let{isOpen:t,onClose:n,user:a,dashboardLink:r,previewLink:l,showTakeOver:C=!1}=e;const c=Object(i.__)("Story is locked","web-stories"),s=C?Object(i.sprintf)(
268
  /* translators: %s: user's name */
269
  Object(i.__)("%s is already editing this story. Do you want to take over?","web-stories"),null==a?void 0:a.name):Object(i.sprintf)(
270
  /* translators: %s: user's name */
271
  Object(i.__)("%s is already editing this story.","web-stories"),null==a?void 0:a.name);return o.a.createElement(d.Dialog,{isOpen:t,onClose:n,title:c,contentLabel:c,actions:o.a.createElement(o.a.Fragment,null,o.a.createElement(Z.a,{type:R.c.TERTIARY,size:R.a.SMALL,href:r},Object(i.__)("Dashboard","web-stories")),o.a.createElement(Z.a,{type:R.c.TERTIARY,size:R.a.SMALL,href:l,target:"_blank",rel:"noreferrer"},Object(i.__)("Preview","web-stories")),C&&o.a.createElement(Z.a,{type:R.c.TERTIARY,size:R.a.SMALL,onClick:n},Object(i.__)("Take over","web-stories")))},o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},(null==a?void 0:a.avatar)&&o.a.createElement(Ft,{src:a.avatar,alt:a.name,height:48,width:48,crossOrigin:"anonymous",decoding:"async"}),s))};var Ut=function PostTakeOverDialog(e){let{isOpen:t,user:n,dashboardLink:a,onClose:r}=e;const l=Object(i.__)("Someone else has taken over this story.","web-stories"),C=Object(i.sprintf)(
272
  /* translators: %s: user's name */
273
- Object(i.__)("%s now has editing control of this story.","web-stories"),null==n?void 0:n.name);return o.a.createElement(d.Dialog,{isOpen:t,title:l,contentLabel:l,onClose:r,actions:o.a.createElement(Z.a,{type:R.c.QUATERNARY,size:R.a.SMALL,variant:R.d.RECTANGLE,href:a},Object(i.__)("Dashboard","web-stories"))},o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},n.avatar&&o.a.createElement(Ft,{src:n.avatar,alt:n.name,height:48,width:48,crossOrigin:"anonymous",decoding:"async"}),C))};var Gt=function PostLock(){const{currentUser:e}=Object(d.useCurrentUser)((e=>{let{state:t}=e;return{currentUser:t.currentUser}})),{storyId:t,dashboardLink:n,nonce:a,postLock:{interval:r,showLockedDialog:l},api:{stories:i,storyLocking:C}}=Object(d.useConfig)(),{previewLink:c,lockUser:s}=Object(d.useStory)((e=>{let{state:{story:{previewLink:t,extras:{lockUser:n={}}={}}}}=e;return{previewLink:t,lockUser:n}})),{enablePostLocking:u,enablePostLockingTakeOver:p}=Object(Pe.c)(),[m,g]=Object(f.I)(!0),[b,v]=Object(f.I)({}),[y,E]=Object(f.I)(a),w=Object(f.s)((()=>{p&&(v({}),Bt(t,i))}),[p,t,i]),O=Object(f.C)((()=>Boolean(Object.keys(e).length)),[e]),M=Object(f.s)((()=>{u&&l&&O&&function(e,t){const n=Object(zt.a)(`${t}${e}/lock/`,{_embed:"author"});return V()({path:n})}(t,i).then((n=>{var a,r,l,o,C,c,s;let{locked:u,nonce:d,_embedded:p}=n;const f={id:(null==p||null===(a=p.author)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.id)||0,name:(null==p||null===(l=p.author)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.name)||"",avatar:(null==p||null===(C=p.author)||void 0===C||null===(c=C[0])||void 0===c||null===(s=c.avatar_urls)||void 0===s?void 0:s[96])||""};u&&null!=f&&f.id&&(null==f?void 0:f.id)!==e.id?v(f):Bt(t,i),E(d)})).catch((e=>{Object(h.f)("post_lock",e.message)}))}),[v,t,i,e,u,l,O]),_=Object(f.G)(M);return Object(f.y)((()=>{_.current=M}),[M,O]),Object(f.y)((()=>{u&&l&&O&&null!=s&&s.id&&(null==s?void 0:s.id)!==e.id&&v(s)}),[s,e,O,u,l]),Object(f.y)((()=>{function e(){u&&l&&null!=b&&b.id&&y&&function(e,t,n){var a,r;const l=new window.FormData;l.append("_wpnonce",t);const o=Object(zt.a)(n,{_method:"DELETE"});null===(a=(r=window.navigator).sendBeacon)||void 0===a||a.call(r,o,l)}(0,y,C)}return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[t,u,l,b,y,C]),Object(f.y)((()=>{const e=setInterval((()=>{r&&O&&(_.current(),g(!1))}),1e3*r);return()=>clearInterval(e)}),[r,O]),u&&l&&b?m?o.a.createElement(Ht,{isOpen:Boolean(null==b?void 0:b.id),user:b,onClose:w,previewLink:c,dashboardLink:n,showTakeOver:p}):p?o.a.createElement(Ut,{isOpen:Boolean(null==b?void 0:b.id),user:b,dashboardLink:n,onClose:w}):null:null};const Vt=(e,t,n)=>{if("object"==typeof n)for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&Vt(e,`${t}[${a}]`,n[a]);else e.append(t,n)};var Wt=Vt;var $t=function(e){return"__WEB_STORIES_ENCODED__"+btoa(encodeURIComponent(e))},Yt=n(228);var qt=function(e){const{mime_type:t,web_stories_media_source:n}=e;return"gif-conversion"===n?function(e){const{id:t,date_gmt:n,media_details:{width:a,height:r},mime_type:l,featured_media:o,featured_media_src:{src:i,width:C,height:c,generated:s},alt_text:u,source_url:d,meta:{web_stories_base_color:p,web_stories_blurhash:f}}=e;return Object(Mt.a)({baseColor:p,blurHash:f,type:"gif",mimeType:"image/gif",creationDate:n,src:d,...Object(_t.a)({width:a,height:r,posterGenerated:s,posterWidth:C,posterHeight:c}),posterId:o,poster:i,id:t,alt:u,local:!1,isOptimized:!0,isExternal:!1,output:{mimeType:l,src:d}})}(e):"image"===Object(Yt.a)(t)?function(e){const{id:t,date_gmt:n,media_details:{width:a,height:r,sizes:l},mime_type:o,alt_text:i,source_url:C,meta:{web_stories_base_color:c,web_stories_blurhash:s}}=e,u=Object.entries(l).reduce(((e,t)=>{let[n,a]=t;return e[n]=Object(g.b)(a),e}),{});return Object(Mt.a)({baseColor:c,blurHash:s,mimeType:o,creationDate:n,src:C,width:a,height:r,id:t,alt:i,sizes:u,local:!1,isExternal:!1})}(e):function(e){const{id:t,date_gmt:n,media_details:{width:a,height:r,length:l,length_formatted:o},mime_type:i,featured_media:C,featured_media_src:{src:c,width:s,height:u,generated:d},web_stories_is_muted:p,alt_text:f,source_url:m,web_stories_media_source:h,meta:{web_stories_trim_data:g,web_stories_base_color:b,web_stories_blurhash:v}}=e;return Object(Mt.a)({baseColor:b,blurHash:v,mimeType:i,creationDate:n,src:m,...Object(_t.a)({width:a,height:r,posterGenerated:d,posterWidth:s,posterHeight:u}),poster:c,posterId:C,id:t,length:l,lengthFormatted:o,alt:f,local:!1,isExternal:!1,isOptimized:"video-optimization"===h,isMuted:p,trimData:g})}(e)};var Xt=function(e){var t,n,a,r,l,o,i,C,c,s,u,d,p,f,m,h,b,v,y,E,w,O,M,_,L;const{_embedded:x={},_links:j={},...S}=e,I={...Object(g.b)(S,["story_data"]),author:{id:(null==x||null===(t=x.author)||void 0===t?void 0:t[0].id)||0,name:(null==x||null===(n=x.author)||void 0===n?void 0:n[0].name)||""},capabilities:{},extras:{lockUser:{id:(null==x||null===(a=x["wp:lockuser"])||void 0===a?void 0:a[0].id)||0,name:(null==x||null===(r=x["wp:lockuser"])||void 0===r?void 0:r[0].name)||"",avatar:(null==x||null===(l=x["wp:lockuser"])||void 0===l||null===(o=l[0].avatar_urls)||void 0===o?void 0:o[96])||""}},featuredMedia:{id:(null==x||null===(i=x["wp:featuredmedia"])||void 0===i?void 0:i[0].id)||0,height:(null==x||null===(C=x["wp:featuredmedia"])||void 0===C||null===(c=C[0])||void 0===c||null===(s=c.media_details)||void 0===s?void 0:s.height)||0,width:(null==x||null===(u=x["wp:featuredmedia"])||void 0===u||null===(d=u[0])||void 0===d||null===(p=d.media_details)||void 0===p?void 0:p.width)||0,url:(null==x||null===(f=x["wp:featuredmedia"])||void 0===f||null===(m=f[0])||void 0===m?void 0:m.source_url)||""},publisherLogo:{id:(null==x||null===(h=x["wp:publisherlogo"])||void 0===h?void 0:h[0].id)||0,height:(null==x||null===(b=x["wp:publisherlogo"])||void 0===b||null===(v=b[0])||void 0===v||null===(y=v.media_details)||void 0===y?void 0:y.height)||0,width:(null==x||null===(E=x["wp:publisherlogo"])||void 0===E||null===(w=E[0])||void 0===w||null===(O=w.media_details)||void 0===O?void 0:O.width)||0,url:(null==x||null===(M=x["wp:publisherlogo"])||void 0===M||null===(_=M[0])||void 0===_?void 0:_.source_url)||""},taxonomies:(null==j||null===(L=j["wp:term"])||void 0===L?void 0:L.map((e=>{let{taxonomy:t}=e;return t})))||[],terms:(null==x?void 0:x["wp:term"])||[]};for(const e of Object.keys(j)){if(!e.startsWith("wp:action-"))continue;const t=e.replace("wp:action-","");I.capabilities[t]=!0}return I};const Kt=Object(i.__)("https://wordpress.org/support/plugin/web-stories/","web-stories");var Qt=function StatusCheckFailed(e){let{isOpen:t,onClose:n}=e;const a=Object(f.s)((e=>{Object(h.e)(e,"click_support_page")}),[]);return o.a.createElement(d.Dialog,{isOpen:t,onClose:n,title:Object(i.__)("Unable to save your story","web-stories"),contentLabel:Object(i.__)("Unable to save your story","web-stories"),onPrimary:n,primaryText:Object(i.__)("Dismiss","web-stories")},o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},o.a.createElement(i.TranslateWithMarkup,{mapping:{a:o.a.createElement(y.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL,href:Kt,target:"_blank",rel:"noopener noreferrer",onClick:a})}},Object(i.__)("We are currently unable to save your story, any changes you make may be lost. This may be due to temporary issues connecting to WordPress. <a>Submit a new support topic</a> for additional help.","web-stories"))))};var Jt=function StatusCheck(){const[e,t]=Object(f.I)(!1),n=Object(f.s)((()=>t(!1)),[]),{api:{statusCheck:a},encodeMarkup:r}=Object(d.useConfig)();return Object(f.y)((()=>{(function(e,t,n){return V()({path:t,data:{content:n?$t(e):e},method:"POST"})})(Object(d.getStoryMarkup)({storyId:1,title:"Story!",author:{id:1,name:"John Doe"},slug:"story",publisherLogo:{id:1,url:"https://example.com/logo.png",height:0,width:0},defaultPageDuration:7,status:"publish",date:"2020-04-10T07:06:26",modified:"",excerpt:"",featuredMedia:{id:123,url:"https://example.com/image.png",width:123,height:456},password:"",globalStoryStyles:""},[{type:"page",id:"2",elements:[]}],{publisher:"Web Stories"}),a,r).catch((e=>{t(!0),Object(h.f)("status_check",e.message)}))}),[r,a]),o.a.createElement(Qt,{isOpen:e,onClose:n})};function en(e,t){return V()({path:Object(zt.a)(e.api.users,{per_page:"100",who:"authors",search:t})}).then((e=>e.map((e=>(delete e._links,Object(g.b)(e))))))}var tn=n(48);const nn=["id","title","status","slug","date","modified","excerpt","link","story_data","preview_link","edit_link","embed_post_link","permalink_template","style_presets","password"].join(","),an="wp:featuredmedia,wp:lockuser,author,wp:publisherlogo,wp:term",rn=["id","date_gmt","media_details","mime_type","featured_media","featured_media_src","alt_text","source_url","meta","web_stories_media_source","web_stories_is_muted","body","status","headers"].join(",");function ln(e,t){const n=Object(zt.a)(`${e.api.stories}${t}/`,{context:"edit",_embed:an,_fields:nn});return V()({path:n}).then(Xt)}const on=(e,t)=>{let{pages:n,featuredMedia:a,globalStoryStyles:r,publisherLogo:l,autoAdvance:o,defaultPageDuration:i,currentStoryStyles:C,backgroundAudio:c,content:s,author:u,...d}=e;return{story_data:{version:tn.a,pages:n,autoAdvance:o,defaultPageDuration:i,currentStoryStyles:C,backgroundAudio:c},featured_media:a.id,style_presets:r,meta:{web_stories_publisher_logo:null==l?void 0:l.id},publisher_logo:l,content:t?$t(s):s,author:u.id,...d}};function Cn(e,t){const{storyId:n}=t,a=on(t,e.encodeMarkup),r=Object(zt.a)(`${e.api.stories}${n}/`,{_fields:["status","slug","link","preview_link","edit_link","embed_post_link"].join(","),_embed:an});return V()({path:r,data:a,method:"POST"}).then((e=>{var t,n,a,r,l,o,i,C,c;const{_embedded:s={},...u}=e;return{...Object(g.b)(u),featuredMedia:{id:(null==s||null===(t=s["wp:featuredmedia"])||void 0===t?void 0:t[0].id)||0,height:(null==s||null===(n=s["wp:featuredmedia"])||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.media_details)||void 0===r?void 0:r.height)||0,width:(null==s||null===(l=s["wp:featuredmedia"])||void 0===l||null===(o=l[0])||void 0===o||null===(i=o.media_details)||void 0===i?void 0:i.width)||0,url:(null==s||null===(C=s["wp:featuredmedia"])||void 0===C||null===(c=C[0])||void 0===c?void 0:c.source_url)||""}}}))}function cn(e,t){const{storyId:n}=t,a=on(t,e.encodeMarkup);return V()({path:`${e.api.stories}${n}/autosaves/`,data:a,method:"POST"}).then((e=>Object(g.b)(e,["story_data"])))}function sn(e,t){let{mediaType:n,searchTerm:a,pagingNum:r,cacheBust:l}=t,o=Object(zt.a)(e.api.media,{context:"edit",per_page:50,page:r,_web_stories_envelope:!0,_fields:rn});return n&&(o=Object(zt.a)(o,{media_type:n})),a&&(o=Object(zt.a)(o,{search:a})),l&&(o=Object(zt.a)(o,{cache_bust:!0})),V()({path:o}).then((e=>{let{body:t,headers:n}=e;return{data:t.map(qt),headers:{...n,totalItems:n["X-WP-Total"],totalPages:n["X-WP-TotalPages"]}}}))}function un(e,t){const n=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:rn});return V()({path:n}).then(qt)}async function dn(e,t){var n;const a=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:"meta.web_stories_muted_id"}),r=await V()({path:a});return null!=r&&null!==(n=r.meta)&&void 0!==n&&n.web_stories_muted_id?un(e,r.meta.web_stories_muted_id):null}async function pn(e,t){var n;const a=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:"meta.web_stories_optimized_id"}),r=await V()({path:a});return null!=r&&null!==(n=r.meta)&&void 0!==n&&n.web_stories_optimized_id?un(e,r.meta.web_stories_optimized_id):null}async function fn(e,t){const n=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:"featured_media"}),a=await V()({path:n});return null!=a&&a.featured_media?un(e,a.featured_media):null}function mn(e,t,n){const a=new window.FormData;return a.append("file",t,t.name||t.type.replace("/",".")),Object.entries(n).forEach((e=>{let[t,n]=e;return Wt(a,t,n)})),V()({path:e.api.media,body:a,method:"POST"}).then((e=>qt(e)))}function hn(e,t,n){return V()({path:`${e.api.media}${t}/`,data:n,method:"POST"}).then(qt)}function gn(e,t){V()({path:Object(zt.a)(`${e.api.media}${t}/`,{_method:"DELETE"}),data:{force:!0},method:"POST"})}function bn(e,t){const n=Object(zt.a)(e.api.link,{url:t});return V()({path:n})}const vn=["id","story_data","body","headers"],yn="wp:featuredmedia";function En(e){var t,n,a,r,l,o,i,C,c;const{_embedded:s={},id:u,story_data:d}=e;return{...d,templateId:u,image:{id:(null==s||null===(t=s["wp:featuredmedia"])||void 0===t?void 0:t[0].id)||0,height:(null==s||null===(n=s["wp:featuredmedia"])||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.media_details)||void 0===r?void 0:r.height)||0,width:(null==s||null===(l=s["wp:featuredmedia"])||void 0===l||null===(o=l[0])||void 0===o||null===(i=o.media_details)||void 0===i?void 0:i.width)||0,url:(null==s||null===(C=s["wp:featuredmedia"])||void 0===C||null===(c=C[0])||void 0===c?void 0:c.source_url)||""}}}function wn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=100,a=Object(zt.a)(e.api.pageTemplates,{context:"edit",per_page:n,page:t,_web_stories_envelope:!0,_fields:vn,_embed:yn});return V()({path:a}).then((e=>{let{headers:n,body:a}=e;const r=parseInt(n["X-WP-TotalPages"]);return{templates:a.map(En),hasMore:r>t}}))}function On(e,t){return V()({path:`${e.api.pageTemplates}/`,data:{...t,status:"publish"},method:"POST"}).then(En)}function Mn(e,t,n){return V()({path:`${e.api.pageTemplates}${t}/`,data:{...n},method:"POST"}).then(En)}function Ln(e,t){return V()({path:Object(zt.a)(`${e.api.pageTemplates}${t}/`,{_method:"DELETE"}),data:{force:!0},method:"POST"})}function xn(e){return V()({path:e.api.currentUser})}function jn(e,t){return V()({path:e.api.currentUser,method:"POST",data:t}).then((e=>(delete e._links,Object(g.b)(e,["meta","capabilities","extra_capabilities"]))))}function Sn(e,t){const n=Object(zt.a)(e.api.hotlink,{url:t});return V()({path:n}).then(g.b)}function In(e,t){return Object(zt.a)(e.api.proxy,{url:t,_wpnonce:e.nonce})}async function An(e){const t=await V()({path:Object(zt.a)(e.api.taxonomies,{type:e.postType,context:"edit"})});return Object.values(t).map((e=>{var t,n,a;return e.restPath=null===(t=e._links)||void 0===t||null===(n=t["wp:items"])||void 0===n||null===(a=n[0])||void 0===a?void 0:a.href,delete e._links,Object(g.b)(e,["capabilities","visibility"])}))}function kn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return V()({url:Object(zt.a)(t,n)})}function Tn(e,t,n){return V()({url:Object(zt.a)(t,n),method:"POST"})}function Pn(e,t){let{include:n,search:a,service:r}=t,l=Object(zt.a)(`${e.api.fonts}`,{search:a,service:r});const o=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").filter(Boolean).map((e=>`include[]=${encodeURI(e)}`)).join("&")}(n);return o.length>0&&(l+=l.includes("?")?`&${o}`:`?${o}`),V()({path:l})}var Zn=n(148);const Rn=Object(w.d)([".","{top:","px !important;left:","px !important;}body.folded .","{left:","px !important;}"],Zn.c,32,160,Zn.c,36);window.webStories=window.webStories||{},window.webStories.domReady=u.a,window.webStories.initializeStoryEditor=(e,t,n)=>{const a=document.getElementById(e);Object(p.b)(a),Object(m.o)(t.locale),Object(h.d)("Editor"),n.story=n.story?Xt(n.story):null;const l={...t,apiCallbacks:Object(g.a)(r,t),additionalTips:re,MediaUpload:Dt,styleConstants:{topOffset:32,leftOffset:160}};Object(f.n)(o.a.createElement(f.c,null,o.a.createElement(d.StoryEditor,{config:l,initialEdits:n},o.a.createElement(Rn,null),o.a.createElement(vt,null),o.a.createElement(E,null),o.a.createElement(Jt,null),o.a.createElement(Gt,null))),a)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a={};n.r(a),n.d(a,"MenuButton",(function(){return g})),n.d(a,"MenuGroup",(function(){return v})),n.d(a,"MenuIcon",(function(){return L})),n.d(a,"MenuItem",(function(){return R})),n.d(a,"MenuItemSuffix",(function(){return k})),n.d(a,"MenuLabel",(function(){return N})),n.d(a,"MenuLink",(function(){return F})),n.d(a,"MenuSeparator",(function(){return U})),n.d(a,"MenuShortcut",(function(){return A})),n.d(a,"SubMenuTrigger",(function(){return $}));var r=n(0),l=n.n(r),o=n(3),i=n(157),C=n(1),c=n(169),s=n(534),u=n(12),d=n(27),p=n(28);const f=Object(o.e)(["",";display:flex;justify-content:space-between;align-items:center;padding:2px 16px;border:0;color:",";font-weight:500;text-align:left;transition:background-color ",";"],(e=>{let{theme:t}=e;return u.c.expandPresetStyles({preset:t.typography.presets.paragraph[d.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL],theme:t})}),(e=>{let{theme:t}=e;return t.colors.fg.primary}),p.b);function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const h=Object(o.f)(c.a).withConfig({displayName:"button__StyledButton",componentId:"sc-pequaj-0"})(["",";width:100%;",":disabled{background-color:transparent;span{color:",";}}:hover:not(:disabled){background-color:",";}:active:not(:disabled){background-color:",";}"],f,(e=>{let{isHorizontal:t,isIconMenu:n,forcePadding:a,theme:r}=e;return{height:t&&"32px",padding:!a&&(t||n)&&0,borderRadius:t||n?r.borders.radius.small:0}}),(e=>{let{theme:t}=e;return t.colors.fg.disable}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryHover}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryPress}));var g=Object(C.j)((function Button(e,t){let{id:n,onBlur:a,onClick:r,onFocus:o,forcePadding:c=!1,dismissOnClick:u=!0,...d}=e;const{focusedId:p,isIconMenu:f,isHorizontal:g,onDismiss:b,onMenuItemBlur:v,onMenuItemFocus:y}=Object(s.a)((e=>{let{state:t,actions:n}=e;return{focusedId:t.focusedId,isIconMenu:t.isIconMenu,isHorizontal:t.isHorizontal,onDismiss:n.onDismiss,onMenuItemBlur:n.onMenuItemBlur,onMenuItemFocus:n.onMenuItemFocus}})),E=Object(C.C)(i.a,[]),w=n||E;return l.a.createElement(h,m({ref:t,id:w,tabIndex:p===w?0:-1,role:"menuitem",isIconMenu:f,isHorizontal:g,forcePadding:c,onBlur:e=>{v(),null==a||a(e)},onClick:e=>{r(e),u&&b(e)},onFocus:e=>{y(w),null==o||o(e)}},d))}));function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var v=function Group(e){let{label:t,...n}=e;return l.a.createElement("div",b({role:"group","aria-label":t},n))},y=n(151),E=n(19),w=n(82);function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const M=o.f.div.withConfig({displayName:"icon__TooltipWrapper",componentId:"sc-scm7dy-0"})(["margin:0 auto;"]),_=o.f.div.withConfig({displayName:"icon__IconWrapper",componentId:"sc-scm7dy-1"})(["width:32px;height:32px;"]);var L=function Icon(e){let{children:t,placement:n=E.a.RIGHT,title:a,...r}=e;return l.a.createElement(l.a.Fragment,null,l.a.createElement(y.a,null,a),l.a.createElement(M,null,l.a.createElement(w.a,O({placement:n,title:a},r),l.a.createElement(_,null,t))))},x=n(6),j=n.n(x),S=n(97);const I=Object(o.f)(S.a).attrs({forwardedAs:"kbd",size:d.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}).withConfig({displayName:"shortcut__StyledText",componentId:"sc-74dfi9-0"})(["color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.secondary}));var A=function Shortcut(e){return l.a.createElement(I,e)};var k=o.f.div.withConfig({displayName:"suffix__Suffix",componentId:"sc-1l1uahg-0"})(["position:relative;svg{width:32px;color:",";position:absolute;right:-14px;top:-16px;}"],(e=>{let{theme:t}=e;return t.colors.fg.secondary}));function T(){return(T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const P=Object(o.f)(g).withConfig({displayName:"item__StyledButton",componentId:"sc-p2jje0-0"})(["",""],(e=>{let{supportsIcon:t}=e;return t&&"\n svg {\n width: 32px;\n position: absolute;\n margin-left: -12px;\n }\n span {\n padding-left: 18px;\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "}));const Z=Object(C.j)((function MenuItemWithRef(e,t){let{label:n,shortcut:a,icon:r,SuffixIcon:o,...i}=e;return l.a.createElement(P,T({ref:t},i),r,n,a&&l.a.createElement(A,null,a.display),o&&l.a.createElement(k,null,l.a.createElement(o,null)))}));Z.propTypes={label:j.a.oneOfType([j.a.string,j.a.object]),shortcut:j.a.shape({display:j.a.object.isRequired,title:j.a.string}),icon:j.a.node,SuffixIcon:j.a.object};var R=Z;var N=o.f.div.withConfig({displayName:"label__Label",componentId:"sc-wzcdl7-0"})(["",";"],f),D=n(150);function z(){return(z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const B=Object(o.f)(D.a).withConfig({displayName:"link__StyledLink",componentId:"sc-1q07ax2-0"})(["",";background-color:transparent;text-decoration:none;:active,:hover,:focus,:active *,:hover *,:focus *{color:"," !important;}:hover{background-color:",";}:active{background-color:",";}"],f,(e=>{let{theme:t}=e;return t.colors.fg.primary}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryHover}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryPress}));var F=function Link(e){let{id:t,onBlur:n,onClick:a,onFocus:r,openNewTab:o,...c}=e;const{focusedId:u,onDismiss:d,onMenuItemBlur:p,onMenuItemFocus:f}=Object(s.a)((e=>{let{state:t,actions:n}=e;return{focusedId:t.focusedId,onDismiss:n.onDismiss,onMenuItemBlur:n.onMenuItemBlur,onMenuItemFocus:n.onMenuItemFocus}})),m=Object(C.C)(i.a,[]),h=t||m,g=o?{target:"_blank",rel:"noreferrer"}:{};return l.a.createElement(B,z({id:h,tabIndex:u===h?0:-1,role:"menuitem",onBlur:e=>{p(),null==n||n(e)},onClick:e=>{null==a||a(e),d(e)},onFocus:e=>{f(h),null==r||r(e)}},g,c))};const H=o.f.div.withConfig({displayName:"separator__Line",componentId:"sc-1s2s628-0"})(["display:block;flex-shrink:0;",""],(e=>{let{isHorizontal:t,isIconMenu:n,theme:a}=e;return t?`\n width: 1px;\n height: 89%; /* 32px out of 36px */\n margin: auto 2px; /* there's an extra 6px horizontal flexbox gap */\n background-color: ${a.colors.divider.secondary};\n `:`\n height: 1px;\n margin: 2px auto; /* there's an extra 6px vertical flexbox gap */\n width: ${n?40:100}%;\n background-color: ${a.colors.divider.primary};\n `}));var U=function Separator(){const e=Object(s.a)((e=>{let{state:{isIconMenu:t,isHorizontal:n}}=e;return{isIconMenu:t,isHorizontal:n}}));return l.a.createElement(H,e)},G=n(35),V=n(519);function W(){return(W=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var $=function SubMenuTrigger(e){let{openSubMenu:t,closeSubMenu:n,isSubMenuOpen:a,isRTL:r=!1,subMenuRef:o,parentMenuRef:i,...c}=e;const u=Object(C.G)(),d=Object(C.G)({}),{setFocusedId:p}=Object(s.a)((e=>{let{actions:t}=e;return{setFocusedId:t.setFocusedId}})),f=e=>{const{x:t,y:n,width:a,height:r}=e.getBoundingClientRect(),{x:l,y:o}=d.current;if(void 0===l||void 0===o)return!0;return l<t-2||l>t+a+2||o<n-2||o>n+r+2},m=Object(C.x)((()=>{var e;u.current&&null!==(e=o.current)&&void 0!==e&&e.firstChild&&f(u.current)&&f(o.current.firstChild)&&n()}),200);Object(C.y)((()=>{if(a&&o.current){const t=(e=o.current,Array.from(e.querySelectorAll(V.a.join(", "))));t[0].focus(),p(t[0].id)}var e}),[a,o,p]),Object(C.y)((()=>{var e;const t=null===(e=i.current)||void 0===e?void 0:e.querySelector('[role="dialog"]');if(!a||!t)return;const n=e=>{d.current.x=e.clientX,d.current.y=e.clientY,m()};return t.addEventListener("pointermove",n),()=>{t.removeEventListener("pointermove",n)}}),[a,i,m]);const h=Object(C.s)((e=>{const{code:l}=e;[V.b.SPACE,V.b.ENTER].includes(l)?a?n():t():(!r&&V.b.RIGHT===l||(r&&V.b.LEFT)===l)&&(a||t())}),[t,n,a,r]);return Object(G.h)(u,{key:["enter","space","left","right"]},h,[h]),l.a.createElement(R,W({},c,{ref:u,onPointerEnter:t,onPointerLeave:()=>{d.current={},m()},onClick:e=>e.preventDefault(),"aria-haspopup":!0,"aria-expanded":a,dismissOnClick:!1}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Menu}));var a=n(0),r=n.n(a),l=n(1),o=n(3),i=n(6),C=n.n(i),c=n(12);const s=208,u=["up","down","left","right"],d=["esc","tab"],p=["space","enter"],f={ARROW_RIGHT:"ArrowRight",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown"},m=o.f.div.withConfig({displayName:"components__MenuContainer",componentId:"sc-6cd425-0"})((e=>{let{dropDownHeight:t=s,styleOverride:n="",theme:a,isAbsolute:r}=e;return Object(o.e)(["position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:calc(100% - 2px);max-height:","px;overflow-x:visible;overflow-y:auto;overscroll-behavior:none auto;z-index:2;margin-top:16px;margin-bottom:8px;padding:4px 0;background-color:",";border-radius:",";border:1px solid ",";",";",";",";"],t,a.colors.bg.primary,a.borders.radius.small,a.colors.divider.primary,r&&Object(o.e)(["position:absolute;top:0;left:0;right:0;"]),n,c.c.scrollbarCSS)}));m.propTypes={dropDownHeight:C.a.number,styleOverride:C.a.oneOfType([C.a.object,C.a.array])};var h=e=>null==e||""===e,g=n(35);var b=n(27),v=n(97);const y=o.f.ul.withConfig({displayName:"components__ListGroup",componentId:"sc-15nu3w2-0"})(["list-style-type:none;margin:6px 0;display:block;padding-inline-start:0;margin-block-start:0;margin-block-end:0;width:100%;"]),E=o.f.li.withConfig({displayName:"components__ListItemLabel",componentId:"sc-15nu3w2-1"})(["display:flex;padding:6px 2px 6px 8px;margin:4px 8px;align-items:center;"]),w=o.f.li.withConfig({displayName:"components__ListItem",componentId:"sc-15nu3w2-2"})(["position:relative;display:grid;grid-template-columns:32px 1fr;padding:6px 8px;margin:4px 8px;align-items:center;",""],(e=>{let{disabled:t,theme:n}=e;return Object(o.e)(["border-radius:",";cursor:",";",";&:hover{background-color:",";}"," svg{color:",";}& > span{grid-column-start:2;}"],n.borders.radius.small,t?"default":"pointer",c.c.focusableOutlineCSS(n.colors.border.focus),n.colors.bg.tertiary,t&&Object(o.e)(["pointer-events:none;span{color:",";}"],n.colors.fg.secondary),n.colors.fg.primary)})),O=Object(o.f)(v.a).withConfig({displayName:"components__ListItemDisplayText",componentId:"sc-15nu3w2-3"})((e=>{let{theme:t}=e;return Object(o.e)(["color:",";"],t.colors.fg.primary)})),M=Object(o.f)(v.a).withConfig({displayName:"components__ListItemLabelDisplayText",componentId:"sc-15nu3w2-4"})((e=>{let{theme:t}=e;return Object(o.e)(["color:",";"],t.colors.form.dropDownSubtitle)})),_=o.f.div.withConfig({displayName:"components__NoOptionsContainer",componentId:"sc-15nu3w2-5"})(["display:flex;align-items:center;justify-items:center;width:100%;"]),L=Object(o.f)(v.a).withConfig({displayName:"components__NoOptionsMessage",componentId:"sc-15nu3w2-6"})(["padding:6px 16px;margin:4px auto;color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.secondary}));var x=e=>{let{emptyText:t}=e;return t?r.a.createElement(_,null,r.a.createElement(L,{size:b.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},t)):null},j=n(73),S=n(2),I=n(130);function A(){return(A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const k=Object(o.f)(I.a).withConfig({displayName:"defaultListItem__ActiveIcon",componentId:"sc-ywsfnt-0"})(["position:absolute;left:4px;top:50%;transform:translateY(-50%);"]);var T=Object(l.j)(((e,t)=>{let{option:n,isSelected:a,...l}=e;return r.a.createElement(w,A({},l,{ref:t,isSelected:a,disabled:n.disabled,"aria-disabled":n.disabled}),a&&r.a.createElement(k,{"data-testid":"dropdownMenuItem_active_icon","aria-label":Object(S.__)("Selected","web-stories"),width:32,height:32}),r.a.createElement(O,{forwardedAs:"span",size:b.b.TYPOGRAPHY.PRESET_SIZES.SMALL},n.label))}));var P=e=>{let{label:t}=e;return t?r.a.createElement(E,{id:`dropDownMenuLabel-${t}`,role:"presentation"},r.a.createElement(M,{forwardedAs:"span",size:b.b.TYPOGRAPHY.TEXT_SIZES.EXTRA_SMALL},t)):null};function Z(){return(Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var R=e=>{let{isManyGroups:t,label:n,listId:a,children:l,role:o="group"}=e;const i=t?{"aria-label":n}:{"aria-labelledby":a};return r.a.createElement(y,Z({role:o,isNested:t},i),n&&r.a.createElement(P,{label:n}),l)};var N=e=>{let{options:t,activeValue:n,listLength:a,listId:l,hasMenuRole:o,handleMenuItemSelect:i,renderItem:C,optionsRef:c}=e;const s=C||T,u=(null==t?void 0:t.length)>1;return t.map(((e,C)=>{let{label:d,group:p}=e;return r.a.createElement(R,{key:d||`menuGroup_${C}`,isManyGroups:u,label:d,listId:l,role:o?"menu":"listbox"},p.map(((e,l)=>{const u=e.value===n,d=Object(j.a)(t,C,l);return r.a.createElement(s,{key:e.value,"aria-posinset":d+1,"aria-selected":u,"aria-setsize":a,id:`dropDownMenuItem-${e.value}`,isSelected:u,onClick:t=>!e.disabled&&i(t,e),option:e,role:o?"menuitem":"option",ref:e=>c.current[d]=e,tabIndex:0})})))}))};const Menu=e=>{let{dropDownHeight:t,emptyText:n,menuStylesOverride:a,hasMenuRole:o,handleReturnToParent:i,isMenuFocused:C=!0,isRTL:c,options:s=[],listId:b,onMenuItemClick:v,onDismissMenu:y,renderItem:E,activeValue:w,menuAriaLabel:O,parentId:M,isAbsolute:_=!1}=e;const L=Object(l.G)(),j=Object(l.G)([]),S=Object(l.s)(((e,t)=>{let{value:n}=t;return v(e,n)}),[v]),{focusedIndex:I,listLength:A}=function(e){let{activeValue:t,handleMenuItemSelect:n,handleReturnToParent:a,isRTL:r,options:o=[],listRef:i,onDismissMenu:C}=e;const c=Object(l.C)((()=>o.flatMap((e=>e.group))),[o]),s=c.length,[m,b]=Object(l.I)(t),v=Object(l.s)((()=>c.findIndex((e=>{var t;return(null==e||null===(t=e.value)||void 0===t?void 0:t.toString())===m.toString()}))),[c,m]);Object(l.y)((()=>{h(m)||-1===v()&&b(null)}),[m,v]);const y=Object(l.C)((()=>h(m)?0:v()),[m,v]),E=Object(l.s)((e=>b(c[y+e].value)),[c,y]),w=Object(l.s)((e=>{let{key:t}=e;[f.ARROW_UP,r?f.ARROW_RIGHT:f.ARROW_LEFT].includes(t)&&0!==y?E(-1):[f.ARROW_DOWN,r?f.ARROW_LEFT:f.ARROW_RIGHT].includes(t)&&y<s-1?E(1):[f.ARROW_UP,r?f.ARROW_RIGHT:f.ARROW_LEFT].includes(t)&&0===y&&(null==a||a())}),[y,E,a,r,s]),O=Object(l.s)((e=>{var t;if(null===(t=c[y])||void 0===t?void 0:t.disabled)return()=>{};const a=m||c[y].value;return n(e,{value:a})}),[c,y,m,n]);return Object(g.h)(i,{key:p,shift:!0},O,[O]),Object(g.h)(i,{key:d},(e=>null==C?void 0:C(e)),[C]),Object(g.h)(i,{key:u},w,[w]),Object(l.z)(i,(e=>null==C?void 0:C(e)),[]),Object(l.C)((()=>({focusedValue:m,focusedIndex:y,listLength:s})),[y,m,s])}({activeValue:w,handleMenuItemSelect:S,isRTL:c,options:s,listRef:L,onDismissMenu:y,handleReturnToParent:i});return Object(l.y)((()=>{var e;const t=null==L?void 0:L.current;if(!t||null===I||!C)return;if(-1===I)return void t.scrollTo(0,0);const n=j.current[I];n&&(n.focus(),null===(e=t.scrollTo)||void 0===e||e.call(t,0,n.offsetTop-t.clientHeight/2))}),[I,C]),r.a.createElement(m,{id:b,dropDownHeight:t,styleOverride:a,ref:L,"aria-label":O,"aria-labelledby":M,"aria-expanded":"true",isAbsolute:_},s&&0!==s.length?r.a.createElement(N,{options:s,activeValue:w,listId:b,listLength:A,hasMenuRole:o,handleMenuItemSelect:S,renderItem:E,optionsRef:j}):r.a.createElement(x,{emptyText:n}))}},function(e,t,n){"use strict";var a={};n.r(a),n.d(a,"List",(function(){return T})),n.d(a,"Group",(function(){return P})),n.d(a,"GroupLabel",(function(){return Z})),n.d(a,"Option",(function(){return R})),n.d(a,"Selected",(function(){return N})),n.d(a,"NoResult",(function(){return D})),n.d(a,"OverflowEllipses",(function(){return z}));var r=n(0),l=n.n(r),o=n(1),i=n(3),C=n(12),c=n(112),s=n(46),u=n(157),d=n(2),p=n(138),f=n(133),m=n(169),h=n(28),g=n(50);function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const v=i.f.div.withConfig({displayName:"searchInput__SearchContainer",componentId:"sc-ewszoh-0"})(["position:relative;width:100%;"]),y=Object(i.e)(["position:absolute;display:flex;justify-content:center;align-items:center;top:50%;width:30px;padding:0;margin:0;transform:translateY(-50%);background-color:transparent;border:none;> svg{height:100%;width:auto;color:",";fill:",";}"],(e=>{let{theme:t}=e;return t.colors.fg.primary}),(e=>{let{theme:t}=e;return t.colors.fg.primary})),E=i.f.div.withConfig({displayName:"searchInput__SearchIconContainer",componentId:"sc-ewszoh-1"})([""," left:0;height:28px;"],y),w=Object(i.f)(m.a).attrs({variant:h.d.ICON}).withConfig({displayName:"searchInput__ClearButton",componentId:"sc-ewszoh-2"})(["",";right:0;height:20.5px;opacity:0.4;"],y),O=i.f.input.attrs({type:"search",role:"combobox","aria-autocomplete":"list"}).withConfig({displayName:"searchInput__Input",componentId:"sc-ewszoh-3"})(["width:100%;padding:6px 20px 6px 30px;border-radius:",";background:",";border:1px solid ",";color:",";"," &::-ms-clear{display:none;}&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{appearance:none;}&:focus{border-color:",";}"],(e=>{let{theme:t}=e;return t.borders.radius.small}),(e=>{let{theme:t}=e;return t.colors.bg.primary}),(e=>{let{theme:t}=e;return t.colors.border.defaultActive}),(e=>{let{theme:t}=e;return t.colors.fg.primary}),C.c.expandTextPreset(((e,t)=>{let{paragraph:n}=e,{SMALL:a}=t;return n[a]})),(e=>{let{theme:t}=e;return t.colors.border.focus}));var M=Object(o.j)((function SearchInput(e,t){let{isExpanded:n,onClose:a,value:r,onChange:i,focusFontListFirstOption:C=g.a,...c}=e;const s=Object(o.s)((e=>{e.stopPropagation();const{key:t}=e;"Escape"===t?a():"ArrowDown"===t&&C()}),[a,C]);return l.a.createElement(v,null,l.a.createElement(O,b({ref:t,"aria-expanded":n,value:r,onKeyDown:s,placeholder:Object(d.__)("Search","web-stories"),onChange:i},c)),l.a.createElement(E,null,l.a.createElement(p.a,null)),r.trim().length>0&&l.a.createElement(w,{onClick:()=>i({target:{value:""}})},l.a.createElement(f.a,null)))}));const _=e=>t=>e.filter((e=>{let{name:n}=e;return n.toLowerCase().startsWith(t.toLowerCase())})),L=e=>e.trim().length>=2,x=(e,t,n)=>e.slice(0,t).map((e=>e.options.length)).reduce(((e,t)=>e+t),0)+n,j=i.f.div.withConfig({displayName:"container__Container",componentId:"sc-n7ncmi-0"})(["position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;min-width:120px;z-index:2;background-color:",";border-radius:",";padding:5px;margin-top:16px;"," ",""],(e=>{let{theme:t}=e;return t.colors.bg.primary}),(e=>{let{theme:t}=e;return t.borders.radius.small}),(e=>{let{isInline:t}=e;return t&&Object(i.e)(["position:absolute;margin-top:0;padding:0;min-width:initial;width:initial;"])}),(e=>{let{theme:t,hasDropDownBorder:n}=e;return n&&Object(i.e)(["border:1px solid ",";"],t.colors.border.defaultNormal)}));var S=Object(o.j)((function OptionsContainer(e,t){let{onClose:n,isOpen:a,getOptionsByQuery:r,hasSearch:i,renderContents:C,isInline:c,hasDropDownBorder:s=!1}=e;const d=Object(o.G)(),[p,f]=Object(o.I)(""),[m,h]=Object(o.I)(null),[g,b]=Object(o.I)(!0),[v,y]=Object(o.I)(0);Object(o.z)(d,n,[n]);const E=Object(o.s)((e=>{let{target:{value:t}}=e;return f(t)}),[]),w=Object(o.s)((()=>{r(p).then(h)}),[r,p]);Object(o.y)((()=>{r&&L(p)?w():h(null)}),[r,p,w]),Object(o.y)((()=>{var e;a&&(null==t||null===(e=t.current)||void 0===e||e.focus())}),[a,t]);const O=Object(o.C)((()=>`list-${Object(u.a)()}`),[]);return l.a.createElement(j,{role:"dialog",ref:d,isInline:c,hasDropDownBorder:s},i&&l.a.createElement(M,{ref:t,value:p,onChange:E,onClose:n,isExpanded:g,focusFontListFirstOption:()=>y((e=>e+1)),"aria-owns":O}),C({searchKeyword:p,setIsExpanded:b,trigger:v,queriedOptions:m,listId:O}))})),I=n(97),A=n(27),k=n(109);const T=i.f.div.withConfig({displayName:"styled__List",componentId:"sc-13zyw9u-0"})(["width:100%;overflow-x:visible;overflow-y:auto;overscroll-behavior:none auto;max-height:305px;padding:4px;margin:10px 0 0 0;font-size:14px;text-align:left;list-style:none;border-radius:",";",""],(e=>{let{theme:t}=e;return t.borders.radius.small}),C.c.focusableOutlineCSS),P=i.f.ul.withConfig({displayName:"styled__Group",componentId:"sc-13zyw9u-1"})(["margin:0;"]),Z=i.f.li.withConfig({displayName:"styled__GroupLabel",componentId:"sc-13zyw9u-2"})(["background:transparent;padding:8px;margin:0;"]),R=i.f.li.attrs((e=>{let{fontFamily:t}=e;return{style:{fontFamily:t}}})).withConfig({displayName:"styled__Option",componentId:"sc-13zyw9u-3"})(["display:flex;align-items:center;position:relative;padding:8px 16px;margin:6px 0 0 0;line-height:1;cursor:pointer;background-clip:padding-box;color:",";border-radius:",";"," ",":first-of-type{margin-top:0;}:hover{background-color:",";}:focus{outline:none;}"],(e=>{let{theme:t}=e;return t.colors.fg.primary}),(e=>{let{theme:t}=e;return t.borders.radius.small}),C.c.expandTextPreset(((e,t)=>{let{label:n}=e,{SMALL:a}=t;return n[a]})),C.c.focusableOutlineCSS,(e=>{let{theme:t}=e;return t.colors.interactiveBg.tertiaryHover})),N=Object(i.f)(k.a).withConfig({displayName:"styled__Selected",componentId:"sc-13zyw9u-4"})(["width:16px;min-width:16px;height:auto;margin-right:4px;color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.primary})),D=Object(i.f)(I.a).attrs((()=>({size:A.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}))).withConfig({displayName:"styled__NoResult",componentId:"sc-13zyw9u-5"})(["width:100%;padding:13px 11px;margin:0;text-align:center;color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.secondary})),z=i.f.span.withConfig({displayName:"styled__OverflowEllipses",componentId:"sc-13zyw9u-6"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);function B(){return(B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var F=Object(o.j)((function DefaultRenderer(e,t){let{option:n,value:a,...r}=e;return l.a.createElement(R,B({key:n.id},r,{ref:t}),a===n.id&&l.a.createElement(N,{"aria-label":Object(d.__)("Selected","web-stories")}),l.a.createElement(z,null,n.name))}));const H=Object(i.f)(I.a).attrs({forwardedAs:"span",size:A.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}).withConfig({displayName:"list__StyledLabel",componentId:"sc-1c2a66-0"})(["color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.tertiary})),U=Object(o.j)((function OptionList(e,t){let{keyword:n="",value:a="",onSelect:r=g.a,onClose:i=g.a,onExpandedChange:C=g.a,focusTrigger:c=0,options:s=[],primaryOptions:p,primaryLabel:f,priorityOptionGroups:m=[],searchResultsLabel:h,renderer:b=F,onObserve:v,focusSearch:y=g.a,listId:E}=e;const w=b,O=Object(o.G)([]),[M,j]=Object(o.I)(-1),S=Object(o.G)([]),I=Object(o.C)((()=>L(n)&&s?[{label:h,options:_(s)(n)}]:[...null!=m&&m.length?m:[],{label:f,options:p}]),[n,s,m,p,f,h]),A=Object(o.C)((()=>new window.IntersectionObserver((e=>{if(v){const t=e.filter((e=>e.isIntersecting)).map((e=>e.target.dataset.option));S.current=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return[...new Set(e.concat(n))]}(S.current,...t),v(S.current)}}),{root:t.current,rootMargin:"60px"})),[v,t]);Object(o.B)((()=>{const e=O.current;return v&&e.forEach((e=>e&&A.observe(e))),()=>{v&&e.forEach((e=>e&&A.unobserve(e))),O.current=[]}}),[A,v,I,b]);const k=Object(o.C)((()=>I.flatMap((e=>{let{options:t}=e;return t}))),[I]),R=Object(o.s)((e=>{const{key:t}=e;e.stopPropagation(),e.preventDefault(),"Tab"===t&&e.shiftKey&&y(),"Escape"===t?i():"Enter"===t?k[M]&&r(k[M]):"ArrowUp"===t?j((e=>Math.max(0,e-1))):"ArrowDown"===t&&j((e=>Math.min(k.length-1,e+1)))}),[M,k,i,r,y]);Object(o.z)(t,(()=>j(-1)),[]),Object(o.y)((()=>{const e=t.current;if(!e)return;if(-1===M)return void e.scrollTo(0,0);const n=O.current[M];n&&(n.focus(),e.scrollTo(0,n.offsetTop-e.clientHeight/2))}),[M,k,n,i,t]);const N=k.length>0;return Object(o.y)((()=>C(N)),[C,N]),Object(o.y)((()=>{c>0&&j(0)}),[c]),k.length<=0?l.a.createElement(D,null,Object(d.__)("No matches found","web-stories")):l.a.createElement(T,{ref:t,tabIndex:0,id:E,role:"listbox",onKeyDown:R,"aria-label":Object(d.__)("Option List Selector","web-stories"),"aria-required":!1},I.map(((e,t)=>{const n=`group-${Object(u.a)()}`;return e.options.length>0&&l.a.createElement(P,{key:n,role:"group","aria-labelledby":n},e.label&&l.a.createElement(Z,{id:n,role:"presentation"},l.a.createElement(H,null,e.label)),e.options.map(((e,n)=>l.a.createElement(w,{key:e.id||"",role:"option",tabIndex:"-1","aria-selected":a===e.id,"aria-posinset":x(I,t,n),"aria-setsize":k.length,"data-option":e.id,onClick:()=>r(e),ref:e=>O.current[x(I,t,n)]=e,option:e,value:a}))))})))}));var G=Object(o.m)(U);function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const W=Object(i.e)(["",";"],(e=>{let{theme:t}=e;return C.c.focusableOutlineCSS(t.colors.border.focus,t.colors.bg.secondary)})),$=i.f.div.withConfig({displayName:"datalist__Container",componentId:"sc-quu1n3-0"})(["display:flex;flex-direction:column;flex-grow:1;"]);var Y=Object(o.j)((function Datalist(e,t){let{onChange:n,disabled:a=!1,selectedId:r,options:i,hasSearch:C=!1,getOptionsByQuery:u,onObserve:d,primaryOptions:p,primaryLabel:f,priorityOptionGroups:m,searchResultsLabel:h,renderer:g,activeItemRenderer:b,isInline:v=!1,dropDownLabel:y="",highlightStylesOverride:E,hasDropDownBorder:w=!1,zIndex:O,...M}=e;const _=Object(o.G)(),L=Object(o.G)();if(!i&&!u)throw new Error("Dropdown initiated with invalid params: options or getOptionsByQuery has to be set");C||(p=i);const x=Object(o.G)(),[j,I]=Object(o.I)(!1),A=Object(o.s)((()=>{var e;I(!1),null===(e=x.current)||void 0===e||e.focus()}),[x]),k=Object(o.s)((()=>I((e=>!e))),[]),T=Object(o.x)(A,100),P=Object(o.s)((e=>{var t;n(e),I(!1),null===(t=x.current)||void 0===t||t.focus()}),[n,x]),Z=Object(o.s)((()=>{var e;null===(e=_.current)||void 0===e||e.focus()}),[]),R=l.a.createElement(S,{ref:_,isOpen:j,onClose:T,getOptionsByQuery:u,hasSearch:C,isInline:v,hasDropDownBorder:w,renderContents:e=>{let{searchKeyword:t,setIsExpanded:n,trigger:a,queriedOptions:o,listId:C}=e;return l.a.createElement(G,{ref:L,listId:C,value:r,keyword:t,onSelect:P,onClose:T,onExpandedChange:n,focusTrigger:a,onObserve:d,options:i||o,primaryOptions:p,primaryLabel:f,priorityOptionGroups:m,searchResultsLabel:h,focusSearch:Z,renderer:g})}}),N=Object(o.s)((e=>{"function"==typeof t?t(e):t&&(t.current=e),x.current=e}),[t]),D=p.find((e=>{let{id:t}=e;return t===r}));return l.a.createElement($,null,l.a.createElement(c.a,V({"aria-pressed":j,"aria-haspopup":!0,"aria-expanded":j,ref:N,activeItemLabel:null==D?void 0:D.name,activeItemRenderer:b,dropDownLabel:y,onSelectClick:k,selectButtonStylesOverride:E||W},M)),j&&!a&&v&&R,!a&&!v&&l.a.createElement(s.a,{anchor:x,isOpen:j,fillWidth:240,zIndex:O},R))}));t.a={DropDown:Y,...a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var a=n(65),r=n(13),l=n(10);function o(e,t){Object(l.a)(2,arguments);var n=Object(r.a)(e),a=Object(r.a)(t),o=n.getFullYear()-a.getFullYear(),i=n.getMonth()-a.getMonth();return 12*o+i}function i(e){Object(l.a)(1,arguments);var t=Object(r.a)(e);return t.setHours(23,59,59,999),t}function C(e){Object(l.a)(1,arguments);var t=Object(r.a)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function c(e){Object(l.a)(1,arguments);var t=Object(r.a)(e);return i(t).getTime()===C(t).getTime()}function s(e,t){Object(l.a)(2,arguments);var n,i=Object(r.a)(e),C=Object(r.a)(t),s=Object(a.a)(i,C),u=Math.abs(o(i,C));if(u<1)n=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-s*u);var d=Object(a.a)(i,C)===-s;c(Object(r.a)(e))&&1===u&&1===Object(a.a)(e,C)&&(d=!1),n=s*(u-Number(d))}return 0===n?0:n}var u=n(154),d=n(93),p=n(94),f=n(45),m=1440,h=43200;function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(l.a)(2,arguments);var o=n.locale||d.a;if(!o.formatDistance)throw new RangeError("locale must contain formatDistance property");var i=Object(a.a)(e,t);if(isNaN(i))throw new RangeError("Invalid time value");var C,c,g=Object(p.a)(n);g.addSuffix=Boolean(n.addSuffix),g.comparison=i,i>0?(C=Object(r.a)(t),c=Object(r.a)(e)):(C=Object(r.a)(e),c=Object(r.a)(t));var b,v=Object(u.a)(c,C),y=(Object(f.a)(c)-Object(f.a)(C))/1e3,E=Math.round((v-y)/60);if(E<2)return n.includeSeconds?v<5?o.formatDistance("lessThanXSeconds",5,g):v<10?o.formatDistance("lessThanXSeconds",10,g):v<20?o.formatDistance("lessThanXSeconds",20,g):v<40?o.formatDistance("halfAMinute",null,g):v<60?o.formatDistance("lessThanXMinutes",1,g):o.formatDistance("xMinutes",1,g):0===E?o.formatDistance("lessThanXMinutes",1,g):o.formatDistance("xMinutes",E,g);if(E<45)return o.formatDistance("xMinutes",E,g);if(E<90)return o.formatDistance("aboutXHours",1,g);if(E<m){var w=Math.round(E/60);return o.formatDistance("aboutXHours",w,g)}if(E<2520)return o.formatDistance("xDays",1,g);if(E<h){var O=Math.round(E/m);return o.formatDistance("xDays",O,g)}if(E<86400)return b=Math.round(E/h),o.formatDistance("aboutXMonths",b,g);if((b=s(c,C))<12){var M=Math.round(E/h);return o.formatDistance("xMonths",M,g)}var _=b%12,L=Math.floor(b/12);return _<3?o.formatDistance("aboutXYears",L,g):_<9?o.formatDistance("overXYears",L,g):o.formatDistance("almostXYears",L+1,g)}function b(e,t){return Object(l.a)(1,arguments),g(e,Date.now(),t)}},function(e,t,n){"use strict";var a=n(22),r=n(62),l=n(53);n(29);function o(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var i=n(0),C=n.n(i),c=n(156),CSSTransition_removeClass=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return a=t,void((n=e).classList?n.classList.remove(a):"string"==typeof n.className?n.className=o(n.className,a):n.setAttribute("class",o(n.className&&n.className.baseVal||"",a)));var n,a}))},s=function(e){function CSSTransition(){for(var t,n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return(t=e.call.apply(e,[this].concat(a))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var a=t.resolveArguments(e,n),r=a[0],l=a[1];t.removeClasses(r,"exit"),t.addClass(r,l?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var a=t.resolveArguments(e,n),r=a[0],l=a[1]?"appear":"enter";t.addClass(r,l,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var a=t.resolveArguments(e,n),r=a[0],l=a[1]?"appear":"enter";t.removeClasses(r,l),t.addClass(r,l,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,a="string"==typeof n,r=a?""+(a&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:a?r+"-active":n[e+"Active"],doneClassName:a?r+"-done":n[e+"Done"]}},t}Object(l.a)(CSSTransition,e);var t=CSSTransition.prototype;return t.addClass=function(e,t,n){var a=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(a+=" "+r),"active"===n&&e&&e.scrollTop,a&&(this.appliedClasses[t][n]=a,function(e,t){e&&t&&t.split(" ").forEach((function(t){return a=t,void((n=e).classList?n.classList.add(a):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,a)||("string"==typeof n.className?n.className=n.className+" "+a:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+a)));var n,a}))}(e,a))},t.removeClasses=function(e,t){var n=this.appliedClasses[t],a=n.base,r=n.active,l=n.done;this.appliedClasses[t]={},a&&CSSTransition_removeClass(e,a),r&&CSSTransition_removeClass(e,r),l&&CSSTransition_removeClass(e,l)},t.render=function(){var e=this.props,t=(e.classNames,Object(r.a)(e,["classNames"]));return C.a.createElement(c.a,Object(a.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},CSSTransition}(C.a.Component);s.defaultProps={classNames:""},s.propTypes={};t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(152);function r(e,t,n){var a=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return a.formatToParts?function(e,t){var n=e.formatToParts(t);return n[n.length-1].value}(a,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),a=/ [\w-+ ]+$/.exec(n);return a?a[0].substr(1):""}(a,t)}var l=n(54),o=6e4;function i(e,t){for(var n=e<0?"-":"",a=Math.abs(e).toString();a.length<t;)a="0"+a;return n+a}function C(e,t){var n=t||"",a=e>0?"-":"+",r=Math.abs(e);return a+i(Math.floor(r/60),2)+n+i(r%60,2)}function c(e,t){return e%60==0?(e>0?"-":"+")+i(Math.abs(e)/60,2):C(e,t)}var s={X:function(e,t,n,a){var r=a._originalDate||e,i=a.timeZone?Object(l.a)(a.timeZone,r,!0)/o:r.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return c(i);case"XXXX":case"XX":return C(i);case"XXXXX":case"XXX":default:return C(i,":")}},x:function(e,t,n,a){var r=a._originalDate||e,i=a.timeZone?Object(l.a)(a.timeZone,r,!0)/o:r.getTimezoneOffset();switch(t){case"x":return c(i);case"xxxx":case"xx":return C(i);case"xxxxx":case"xxx":default:return C(i,":")}},O:function(e,t,n,a){var r=a._originalDate||e,c=a.timeZone?Object(l.a)(a.timeZone,r,!0)/o:r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",a=Math.abs(e),r=Math.floor(a/60),l=a%60;if(0===l)return n+String(r);var o=t||"";return n+String(r)+o+i(l,2)}(c,":");case"OOOO":default:return"GMT"+C(c,":")}},z:function(e,t,n,a){var l=a._originalDate||e;switch(t){case"z":case"zz":case"zzz":return r("short",l,a);case"zzzz":default:return r("long",l,a)}}},u=n(74),d=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function p(e,t,n){var r=String(t),l=n||{},o=r.match(d);if(o){var i=Object(u.a)(e,l);r=o.reduce((function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),a="'"===e[n-1],r=e.replace(t,"'"+s[t[0]](i,t,null,l)+"'");return a?r.substring(0,n-1)+r.substring(n+1):r}),r)}return Object(a.a)(e,r,l)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(91),r=n(24),l=n(13),o=n(10);function i(e,t){Object(o.a)(2,arguments);var n=Object(l.a)(e),a=Object(r.a)(t);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}function C(e,t){Object(o.a)(2,arguments);var n=Object(r.a)(t);return i(e,-n)}function c(e){return Object(o.a)(1,arguments),Object(a.a)(e,C(Date.now(),1))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return N}));var a=n(0),r=n.n(a),l=n(1),o=n(6),i=n.n(o),C=n(3),c=n(558),s=n(551),u=n(157),d=n(50),p=n(532),f=n(19),m=n(15),h=n(2),g=n(27),b=n(169),v=n(130),y=n(135),E=n(133),w=n(97),O=n(85),M=n(36);function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const L=C.f.div.withConfig({displayName:"snackbarMessage__MessageContainer",componentId:"sc-fjv091-0"})(["display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:10px 16px;margin-top:20px;background-color:",";color:",";border:",";border-radius:",";z-index:",";pointer-events:auto;"],(e=>{let{theme:t}=e;return t.colors.inverted.bg.primary}),(e=>{let{theme:t}=e;return t.colors.inverted.fg.primary}),(e=>{let{theme:t}=e;return`1px solid ${Object(m.c)(t.colors.standard.white,.24)}`}),(e=>{let{theme:t}=e;return t.borders.radius.medium}),(e=>{let{customZIndex:t}=e;return t||M.c}));L.propTypes={customZIndex:i.a.number};const x=Object(C.f)(w.a).withConfig({displayName:"snackbarMessage__Message",componentId:"sc-fjv091-1"})(["color:",";max-width:430px;padding-right:",";"],(e=>{let{theme:t}=e;return t.colors.inverted.fg.primary}),(e=>{let{hasAction:t,hasThumbnail:n}=e;return n?"16px":t?"52px":"0px"})),j=C.f.div.withConfig({displayName:"snackbarMessage__ActionContainer",componentId:"sc-fjv091-2"})(["display:flex;align-items:center;justify-content:flex-end;"]),S=C.f.div.withConfig({displayName:"snackbarMessage__ThumbnailWrapper",componentId:"sc-fjv091-3"})(["position:relative;margin-left:16px;margin-right:","px;"],(e=>{let{hasAction:t}=e;return t?16:0})),I=C.f.img.withConfig({displayName:"snackbarMessage__Thumbnail",componentId:"sc-fjv091-4"})(["max-height:45px;max-width:45px;min-height:","px;min-width:","px;background-color:",";border-radius:",";",";"],30,30,(e=>{let{theme:t}=e;return t.colors.fg.tertiary}),(e=>{let{theme:t}=e;return t.borders.radius.small}),(e=>{let{theme:t,status:n}=e;return n===M.d.SUCCESS?Object(C.e)(["border:1px solid ",";"],t.colors.green[20]):n===M.d.ERROR?Object(C.e)(["border:1px solid ",";"],t.colors.red[20]):void 0})),A=C.f.div.withConfig({displayName:"snackbarMessage__ThumbnailIcon",componentId:"sc-fjv091-5"})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);",";svg{width:100%;height:auto;}"],(e=>{let{theme:t,status:n}=e;return n===M.d.SUCCESS?Object(C.e)(["width:30px;color:",";"],t.colors.fg.positive):n===M.d.ERROR?Object(C.e)(["width:20px;color:",";"],t.colors.fg.negative):void 0})),k=Object(C.f)(b.a).withConfig({displayName:"snackbarMessage__ActionButton",componentId:"sc-fjv091-6"})(["align-self:flex-end;min-width:1px;height:2em;padding:0;color:",";font-weight:",";"," &:hover,&:active{color:",";}"],(e=>{let{theme:t}=e;return t.colors.inverted.fg.linkNormal}),(e=>{let{theme:t}=e;return t.typography.weight.bold}),(e=>{let{theme:t}=e;return Object(O.b)(t.colors.border.focus,t.colors.inverted.bg.primary)}),(e=>{let{theme:t}=e;return t.colors.inverted.fg.linkHover})),T=Object(C.f)(b.a).withConfig({displayName:"snackbarMessage__CloseButton",componentId:"sc-fjv091-7"})(["height:2em;padding:0;margin-left:16px;color:",";"," svg{height:32px;}"],(e=>{let{theme:t}=e;return t.colors.inverted.fg.primary}),(e=>{let{theme:t}=e;return Object(O.b)(t.colors.border.focus,t.colors.inverted.bg.primary)})),SnackbarMessage=e=>{let{"aria-label":t,actionLabel:n,onAction:a=d.a,onDismiss:o=d.a,isPreventAutoDismiss:i,isPreventActionDismiss:C,thumbnail:c,message:s,removeMessageTimeInterval:u,showCloseButton:p,placement:f="bottom",actionHelpText:m,...b}=e;const w=Object(l.G)();w.current=i?d.a:o;const O=Object(l.G)("number"==typeof u&&u<=M.a&&u>=M.b?u:M.a);Object(l.y)((()=>{if(!w.current)return d.a;const e=setTimeout((()=>w.current()),O.current);return()=>clearTimeout(e)}),[]);const P=Object(l.s)((e=>{a(e),!C&&o()}),[a,o,C]),Z=Boolean(n),R=Boolean(n);return r.a.createElement(L,_({role:"alert",hasAction:Z,placement:f},b),r.a.createElement(x,{"aria-label":t,size:g.b.TYPOGRAPHY.PRESET_SIZES.SMALL,hasAction:Z,hasThumbnail:R},s),c&&r.a.createElement(S,{hasAction:Z},r.a.createElement(I,{src:c.src,alt:c.alt,status:c.status}),r.a.createElement(A,{status:c.status},c.status===M.d.SUCCESS&&r.a.createElement(v.a,null),c.status===M.d.ERROR&&r.a.createElement(y.a,null))),(n||p)&&r.a.createElement(j,null,n&&r.a.createElement(k,{onClick:P},n),p&&r.a.createElement(T,{onClick:o,"aria-label":Object(h.__)("Close","web-stories"),tabIndex:-1},r.a.createElement(E.a,{"aria-hidden":!0}))))};function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}SnackbarMessage.defaultProps={showCloseButton:!0};const Z=C.f.div.withConfig({displayName:"snackbarContainer__StyledContainer",componentId:"sc-7yig0q-0"})(["position:fixed;top:",";bottom:",";",";margin-bottom:33px;display:flex;flex-direction:column;align-items:",";width:100%;z-index:2147483647;pointer-events:none;"],(e=>{let{placement:t}=e;return 0===t.indexOf("top")?0:"inherit"}),(e=>{let{placement:t}=e;return 0===t.indexOf("bottom")?0:"inherit"}),(function(e){let{placement:t}=e;switch(t){case"top":case"bottom":return"\n left: calc(50% + 4rem);\n transform: translateX(-50%);\n width: auto;\n ";case"top-left":case"bottom-left":return"left: 60px;";case"top-right":case"bottom-right":return"right: 60px;";default:return"left: 60px;"}}),(e=>{let{alignItems:t}=e;return t}));Z.propTypes={alignItems:i.a.string},Z.defaultProps={alignItems:"center"};const R=C.f.div.withConfig({displayName:"snackbarContainer__ChildContainer",componentId:"sc-7yig0q-1"})(["&.react-snackbar-alert__snackbar-container-enter{max-height:0px;opacity:0;transition:all 300ms ease-out;}&.react-snackbar-alert__snackbar-container-enter-active{opacity:1;max-height:100px;transition:all 300ms ease-out;}&.react-snackbar-alert__snackbar-container-exit{opacity:1;transition:all 300ms ease-out;}&.react-snackbar-alert__snackbar-container-exit-active{opacity:0;transition:all 300ms ease-out;}"]),N={Container:e=>{let{component:t=SnackbarMessage,notifications:n=[],onRemove:a=d.a,placement:o=f.a.BOTTOM,max:i=10}=e;const C=Object(p.a)("assertive"),m=Object(l.G)(new Set),h=Object(l.C)((()=>n.map((()=>Object(u.a)()))),[n]),g=0===o.indexOf("top")?[...n].reverse():n,b=Object(l.s)((e=>()=>{var t;a(e),null===(t=e.onDismiss)||void 0===t||t.call(e)}),[a]);Object(l.y)((()=>{"number"==typeof i&&n.length>i&&setTimeout((()=>{a(n.slice(0,n.length-i))}),300)}),[i,n,a]),Object(l.y)((()=>{n.forEach((e=>{if(!m.current.has(e)){const t=`${e.message} ${e.actionHelpText||""}`.trim();C(t),m.current.add(e)}}))}),[n,C]);const v=Object(l.G)();return r.a.createElement(Z,{placement:o},r.a.createElement(c.a,null,g.map(((e,n)=>{const{actionLabel:a,dismissible:l,message:i,onAction:C,preventActionDismiss:c,preventAutoDismiss:u,timeout:d,...p}=e;return r.a.createElement(s.a,{in:!0,key:e.id||h[n],timeout:300,unmountOnExit:!0,nodeRef:v,classNames:"react-snackbar-alert__snackbar-container"},r.a.createElement(R,{ref:v,placement:o},r.a.createElement(t,P({},p,{"aria-hidden":!0,placement:o,onDismiss:b(e),onAction:C,actionLabel:a,message:i,showCloseButton:l,removeMessageTimeInterval:d,isPreventAutoDismiss:u,isPreventActionDismiss:c}))))}))))},Message:SnackbarMessage}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(24),r=n(88),l=n(10);function o(e,t){Object(l.a)(2,arguments);var n=Object(a.a)(t);return Object(r.a)(e,6e4*n)}function i(e,t){Object(l.a)(2,arguments);var n=Object(a.a)(t);return o(e,-n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(13),r=n(45),l=n(64),o=n(10),i=864e5;function C(e,t){Object(o.a)(2,arguments);var n=Object(l.a)(e),a=Object(l.a)(t),C=n.getTime()-Object(r.a)(n),c=a.getTime()-Object(r.a)(a);return Math.round((C-c)/i)}function c(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function s(e,t){Object(o.a)(2,arguments);var n=Object(a.a)(e),r=Object(a.a)(t),l=c(n,r),i=Math.abs(C(n,r));n.setDate(n.getDate()-l*i);var s=Number(c(n,r)===-l),u=l*(i-s);return 0===u?0:u}},function(e,t,n){"use strict";var a=n(1),r=n(35);function l(e){var t;const n=null==e||null===(t=e.querySelectorAll(["button","a"]))||void 0===t?void 0:t[0];n&&n.focus()}function o(e,t,n,a){const r=a?-1:1;return e===t?r:e===n?-1*r:0}function i(e,t){let n,a=0;for(const t of e.children){const{x:e}=t.getBoundingClientRect();if(null!=n&&e<n)break;n=e,a++}return{rows:Math.ceil(t/a),columns:a}}function C(e,t){return Math.ceil((e+1)/t)}function c(e,t){return e%t+1}function s(e){let{row:t,column:n,numRows:a,numColumns:r,numItems:l}=e;if(t>a||t<=0||n>r||n<=0)return-1;const o=r*(t-1)+(n-1);return o>=l?l-1:o}t.a=function(e){const{currentItemId:t,items:n,containerRef:u,gridRef:d,itemRefs:p,isRTL:f,arrangeItem:m}=e,[h,g]=Object(a.I)(),b=Object(a.C)((()=>n.map((e=>{let{id:t}=e;return t}))),[n]);Object(a.y)((()=>{g(t)}),[t]),Object(r.h)(u,{key:["up","down","left","right"]},(e=>{let{key:t}=e;switch(t){case"ArrowLeft":case"ArrowRight":{var n;const e=o(t,"ArrowRight","ArrowLeft",f);if(0===e)return;const a=b.indexOf(h)+e;if(a<0||a===b.length)return;const r=b[a];g(r);l(null==p||null===(n=p.current)||void 0===n?void 0:n[r]);break}case"ArrowUp":case"ArrowDown":{var a;const{rows:e,columns:n}=i(null==d?void 0:d.current,b.length),r=b.indexOf(h),o="ArrowDown"===t?1:-1,u=s({row:C(r,n)+o,column:c(r,n),numRows:e,numColumns:n,numItems:b.length});if(u<0)return;const f=b[u];g(f);l(null==p||null===(a=p.current)||void 0===a?void 0:a[f]);break}}}),[h,f,b,p,d,t]),Object(r.h)(u,{key:["mod+up","mod+down","mod+left","mod+right"],shift:!0},(e=>{const{key:t,shiftKey:n}=e;switch(e.preventDefault(),t){case"ArrowLeft":case"ArrowRight":{const e=o(t,"ArrowRight","ArrowLeft",f);if(0===e)return;const r=b.indexOf(h);let i=r;n?i=e<0?0:b.length-1:i+=e;if(i!==r&&i>=0&&i<=b.length-1){var a;m&&m(h,i);l(null==p||null===(a=p.current)||void 0===a?void 0:a[b[i]])}break}case"ArrowUp":case"ArrowDown":{const{rows:e,columns:n}=i(d.current,b.length),a=b.indexOf(h),o="ArrowDown"===t?1:-1,u=s({row:C(a,n)+o,column:c(a,n),numRows:e,numColumns:n,numItems:b.length});if(u<0)return;if(u!==a&&u>=0&&u<=b.length-1){var r;m&&m(h,u);l(null==p||null===(r=p.current)||void 0===r?void 0:r[b[u]])}break}}}),[t,b,f,d,p,h,m])}},function(e,t,n){"use strict";var a=n(62),r=n(22),l=n(84),o=n(53),i=(n(29),n(0)),C=n.n(i),c=n(63);function s(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function d(e,t,n){var a=s(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var a,r=Object.create(null),l=[];for(var o in e)o in t?l.length&&(r[o]=l,l=[]):l.push(o);var i={};for(var C in t){if(r[C])for(a=0;a<r[C].length;a++){var c=r[C][a];i[r[C][a]]=n(c)}i[C]=n(C)}for(a=0;a<l.length;a++)i[l[a]]=n(l[a]);return i}(t,a);return Object.keys(r).forEach((function(l){var o=r[l];if(Object(i.isValidElement)(o)){var C=l in t,c=l in a,s=t[l],d=Object(i.isValidElement)(s)&&!s.props.in;!c||C&&!d?c||!C||d?c&&C&&Object(i.isValidElement)(s)&&(r[l]=Object(i.cloneElement)(o,{onExited:n.bind(null,o),in:s.props.in,exit:u(o,"exit",e),enter:u(o,"enter",e)})):r[l]=Object(i.cloneElement)(o,{in:!1}):r[l]=Object(i.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:u(o,"exit",e),enter:u(o,"enter",e)})}})),r}var p=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},f=function(e){function TransitionGroup(t,n){var a,r=(a=e.call(this,t,n)||this).handleExited.bind(Object(l.a)(a));return a.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},a}Object(o.a)(TransitionGroup,e);var t=TransitionGroup.prototype;return t.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},t.componentWillUnmount=function(){this.mounted=!1},TransitionGroup.getDerivedStateFromProps=function(e,t){var n,a,r=t.children,l=t.handleExited;return{children:t.firstRender?(n=e,a=l,s(n.children,(function(e){return Object(i.cloneElement)(e,{onExited:a.bind(null,e),in:!0,appear:u(e,"appear",n),enter:u(e,"enter",n),exit:u(e,"exit",n)})}))):d(e,r,l),firstRender:!1}},t.handleExited=function(e,t){var n=s(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(r.a)({},t.children);return delete n[e.key],{children:n}})))},t.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(a.a)(e,["component","childFactory"]),l=this.state.contextValue,o=p(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?C.a.createElement(c.a.Provider,{value:l},o):C.a.createElement(c.a.Provider,{value:l},C.a.createElement(t,r,o))},TransitionGroup}(C.a.Component);f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};t.a=f},,,,,,,,,,function(e,t,n){"use strict";var a=n(68);t.a=function(e){let{width:t,height:n,posterGenerated:r,posterWidth:l,posterHeight:o}=e;return r&&l&&o?{width:l,height:o}:t||n?{width:t,height:n}:{width:a.h,height:a.d}}},function(e,t,n){"use strict";var a=n(228);var src_normalizeResourceSizes=function(e){const t={};if(!e)return t;for(const n of Object.keys(e)){const a=e[n];t[n]={...a,width:Number(a.width),height:Number(a.height)}}return t};t.a=function(e){let{baseColor:t,blurHash:n,type:r,mimeType:l,creationDate:o,src:i,width:C,height:c,poster:s,posterId:u,id:d,length:p,lengthFormatted:f,alt:m,sizes:h,attribution:g,output:b,isPlaceholder:v=!1,isOptimized:y=!1,isMuted:E=!1,isExternal:w=!1,trimData:O,needsProxy:M=!1}=e;return{baseColor:t,blurHash:n,type:r||Object(a.a)(l),mimeType:l,creationDate:o,src:i,width:Number(C||0),height:Number(c||0),poster:s,posterId:u,id:d,length:p,lengthFormatted:f,alt:m,sizes:src_normalizeResourceSizes(h),attribution:g,output:b,isPlaceholder:v,isOptimized:y,isMuted:E,isExternal:w,trimData:O,needsProxy:M}}}]);
264
  /* translators: %s: list of allowed file types. */
265
  Object(i.__)("Please choose only %s as publisher logo.","web-stories")),Z=T(
266
  /* translators: %s: list of allowed file types. */
267
+ Object(i.__)("Please choose only %s as a poster.","web-stories")),R=Object(f.j)(((e,t)=>{let{option:n,...a}=e;return n.props?n:o.a.createElement(Q.a.Option,me({value:n.id,ref:t},a),o.a.createElement(xe,{src:n.url,alt:"",decoding:"async",crossOrigin:"anonymous"}))})),N=e=>o.a.createElement(Q.a.Option,{onClick:e,"aria-label":Object(i.__)("Add new","web-stories")},o.a.createElement(p.a.ArrowCloud,{height:32,width:32}),o.a.createElement(b.a,{as:"span",size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},Object(i.__)("Add new","web-stories"))),D=[...E];if(m){const e={width:96,height:96};D.unshift(o.a.createElement(g,{onSelect:A,onSelectErrorMessage:P,type:c,render:N,title:Object(i.__)("Select as publisher logo","web-stories"),buttonInsertText:Object(i.__)("Select as publisher logo","web-stories"),cropParams:e}))}return o.a.createElement(d.Panel,{name:t||"publishing",collapsedByDefault:!1,isPersistable:!(M||O)},o.a.createElement(d.PanelTitle,null,Object(i.__)("Publishing","web-stories")),o.a.createElement(d.PanelContent,null,(null==S?void 0:S.publish)&&o.a.createElement(de,null),(null==S?void 0:S["assign-author"])&&n&&o.a.createElement(fe,null),o.a.createElement(ye,{isHighlighted:(null==O?void 0:O.showEffect)||(null==M?void 0:M.showEffect),onAnimationEnd:()=>_()},o.a.createElement(we,null,o.a.createElement(be,null,o.a.createElement(ve,{ref:e=>{e&&null!=O&&O.focus&&null!=O&&O.showEffect&&e.focus()},width:72,height:96,cropParams:{width:640,height:853},value:null==L?void 0:L.url,onChange:I,title:Object(i.__)("Select as poster image","web-stories"),buttonInsertText:Object(i.__)("Select as poster image","web-stories"),type:c,ariaLabel:Object(i.__)("Poster image","web-stories"),onChangeErrorText:Z,imgProps:L,canUpload:m})),o.a.createElement(he,null,o.a.createElement(ge,null,Object(i.__)("Poster image","web-stories")),o.a.createElement(d.Required,null))),o.a.createElement(_e,null,o.a.createElement(be,null,o.a.createElement(Q.a.DropDown,{options:D,primaryOptions:D,onChange:k,"aria-label":Object(i.__)("Publisher Logo","web-stories"),renderer:R,activeItemRenderer:()=>{const e=E.length?Object(i.__)("Select logo","web-stories"):Object(i.__)("No logo","web-stories");return x.id?o.a.createElement(xe,{src:x.url,alt:""}):o.a.createElement(b.a,{as:"span",size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},e)},selectedId:x.id,zIndex:10,disabled:!D.length,ref:e=>{e&&null!=M&&M.focus&&null!=M&&M.showEffect&&e.focus()}})),o.a.createElement(he,null,o.a.createElement(ge,null,Object(i.__)("Publisher Logo","web-stories")),o.a.createElement(d.Row,null,o.a.createElement(d.Required,null),h&&o.a.createElement(y.a,{rel:"noopener noreferrer",target:"_blank",href:u,size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},Object(i.__)("Manage","web-stories"))))))))},Se=n(12),Ie=n(224),ke=n(141),Pe=n(33);function ze(){return(ze=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const $e=w.f.li.withConfig({displayName:"status__StyledListItem",componentId:"sc-1pq370j-0"})(["position:relative;padding:6px 8px;margin:4px 8px;align-items:center;border-radius:4px;cursor:pointer;"," &:hover{background-color:",";}"],Se.c.focusableOutlineCSS,Se.b.colors.border.defaultNormal),Ye=Object(w.f)(Text).attrs({as:"span"}).withConfig({displayName:"status__LabelText",componentId:"sc-1pq370j-1"})(["font-size:14px;color:",";"],Se.b.colors.fg.primary),qe=Object(w.f)(Text).attrs({as:"span"}).withConfig({displayName:"status__HelperText",componentId:"sc-1pq370j-2"})(["color:",";"],Se.b.colors.fg.tertiary),Xe=Object(f.j)(((e,t)=>{let{option:n,isSelected:a,...r}=e;return o.a.createElement($e,ze({ref:t,active:a},r),o.a.createElement(Ye,null,n.label),o.a.createElement("br",null),o.a.createElement(qe,null,n.helper))}));var Qe=function StatusPanel(e){var t;let{nameOverride:n,popupZIndex:a,canCollapse:r,isPersistable:l,...C}=e;const{status:c="",password:s,updateStory:u,saveStory:p,capabilities:m,editLink:g,title:b,storyId:v,visibility:y}=Object(d.useStory)((e=>{let{state:{story:{status:t,password:n,editLink:a,title:r,storyId:l,visibility:o},capabilities:i},actions:{updateStory:C,saveStory:c}}=e;return{status:t,password:n,updateStory:C,saveStory:c,capabilities:i,editLink:a,title:r,storyId:l,visibility:o}})),E=Object(Pe.b)("enableUpdatedPublishStoryModal"),[w,O]=Object(f.I)(!1),M=Object(f.s)((()=>O(!1)),[]),{shouldReviewDialogBeSeen:_}=Object(d.useCheckpoint)((e=>{let{state:{shouldReviewDialogBeSeen:t}}=e;return{shouldReviewDialogBeSeen:t}})),L=Object(d.useIsUploadingToStory)();Object(f.y)((()=>{s?u({properties:{visibility:ie}}):c!==ce.PRIVATE?y||u({properties:{visibility:le}}):u({properties:{visibility:oe}})}),[s,c,u,y]);const x=[{value:le,label:Object(i.__)("Public","web-stories"),helper:Object(i.__)("Visible to everyone","web-stories")}];null!=m&&m.publish&&(x.push({value:oe,label:Object(i.__)("Private","web-stories"),helper:Object(i.__)("Visible to site admins & editors only","web-stories"),disabled:L&&y!==oe}),x.push({value:ie,label:Object(i.__)("Password Protected","web-stories"),helper:Object(i.__)("Visible only to those with the password.","web-stories")}));const j=Object(f.s)((e=>{u({properties:{password:e.target.value}})}),[u]),S=Object(d.useRefreshPostEditURL)(v,g),I=Object(f.s)((()=>{const e={status:ce.PRIVATE,password:"",visibility:oe};Object(h.g)("publish_story",{status:ce.PRIVATE,title_length:b.length}),S(),p(e)}),[b.length,S,p]),A=[ce.PUBLISH,ce.FUTURE,ce.PRIVATE].includes(c),k=Object(f.s)(((e,t)=>{const n=t;if(oe===n&&!A&&!window.confirm(Object(i.__)("Would you like to privately publish this story now?","web-stories")))return;const a={};switch(n){case le:a.status=y===oe?ce.DRAFT:c,a.password="",a.visibility=le;break;case oe:return void(E||!_||A?I():(O(!0),a.visibility=oe));case ie:a.status=y===oe?ce.DRAFT:c,a.password=s||"",a.visibility=ie}u({properties:a})}),[c,y,s,u,I,_,A,E]);return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.SimplePanel,ze({name:n||"status",title:Object(i.__)("Visibility","web-stories"),canCollapse:r,isPersistable:l,collapsedByDefault:!1},C),o.a.createElement(o.a.Fragment,null,o.a.createElement(d.Row,null,o.a.createElement(Ie.a,{options:x,selectedValue:y,onMenuItemClick:k,popupZIndex:a,disabled:x.length<=1,renderItem:Xe,hint:null===(t=x.find((e=>y===e.value)))||void 0===t?void 0:t.helper})),y===ie&&o.a.createElement(d.Row,null,o.a.createElement(ke.b,{"aria-label":Object(i.__)("Password","web-stories"),value:s,onChange:j,placeholder:Object(i.__)("Enter a password","web-stories")})))),o.a.createElement(d.ReviewChecklistDialog,{isOpen:w,onIgnore:I,onClose:M,onReview:M}))};function PublishModalDocumentPane(){return o.a.createElement(o.a.Fragment,null,o.a.createElement(je,{nameOverride:"storyDetailsPublishing"}),o.a.createElement(d.SlugPanel,{nameOverride:"storyDetailsExcerpt"}),o.a.createElement(d.PageAdvancementPanel,{nameOverride:"storyDetailsPageAdvancement"}),o.a.createElement(d.BackgroundAudioPanel,{nameOverride:"storyDetailsBackgroundAudio"}),o.a.createElement(d.TaxonomiesPanel,{nameOverride:"storyDetailsTaxonomies"}))}const et=Object(w.f)(Qe).withConfig({displayName:"documentPane__IsolatedPanel",componentId:"sc-3jx0y8-0"})(["padding:4px 4px 8px;"]);function IsolatedStatusPanel(){return o.a.createElement(et,{nameOverride:"storyDetailsStatus",canCollapse:!1,isPersistable:!1,popupZIndex:11})}var tt=function DocumentPane(){return o.a.createElement(o.a.Fragment,null,o.a.createElement(Qe,null),o.a.createElement(je,null),o.a.createElement(d.ExcerptPanel,null),o.a.createElement(d.SlugPanel,null),o.a.createElement(d.PageAdvancementPanel,null),o.a.createElement(d.BackgroundAudioPanel,null),o.a.createElement(d.TaxonomiesPanel,null))},nt=n(531);const at=w.f.div.withConfig({displayName:"videoOptimizationCheckbox__CheckboxContainer",componentId:"sc-mjnlj7-0"})(["display:flex;align-items:flex-start;"]),rt=w.f.div.withConfig({displayName:"videoOptimizationCheckbox__ButtonContainer",componentId:"sc-mjnlj7-1"})(["display:flex;align-items:center;justify-content:center;margin-top:16px;"]),lt=Object(w.f)(b.a).attrs({as:"span",isBold:!0}).withConfig({displayName:"videoOptimizationCheckbox__BoldText",componentId:"sc-mjnlj7-2"})(["color:",";"],(e=>{let{theme:t}=e;return t.colors.standard.white})),ot=Object(w.f)(b.a).attrs({size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL}).withConfig({displayName:"videoOptimizationCheckbox__DescriptionText",componentId:"sc-mjnlj7-3"})(["color:",";margin-bottom:16px;"],(e=>{let{theme:t}=e;return t.colors.fg.secondary})),it=Object(w.f)(ot).withConfig({displayName:"videoOptimizationCheckbox__CheckboxLabel",componentId:"sc-mjnlj7-4"})(["margin-left:8px;margin-bottom:0;line-height:20px;cursor:pointer;"]);var Ct=function VideoOptimizationCheckbox(){var e,t;const n=Object(d.useIsChecklistMounted)(),{capabilities:{hasUploadMediaAction:a}={},dashboardSettingsLink:r}=Object(d.useConfig)(),[l,C]=Object(f.I)(!1),c=Object(f.G)(),{currentUser:s,toggleWebStoriesMediaOptimization:u}=Object(d.useCurrentUser)((e=>{let{state:t,actions:n}=e;return{currentUser:t.currentUser,toggleWebStoriesMediaOptimization:n.toggleWebStoriesMediaOptimization}})),p=!(null==s||null===(e=s.meta)||void 0===e?void 0:e.web_stories_media_optimization)&&a,m=Object(f.s)((()=>{C(!0),u()}),[u]),{isSaving:g,saveStory:b}=Object(d.useStory)((e=>{let{state:t,actions:n}=e;return{isSaving:t.meta.isSaving,saveStory:n.saveStory}}));return Object(f.y)((()=>{l&&c.current.focus()}),[l]),(p||l)&&n?o.a.createElement(d.ChecklistCard,{title:Object(i.__)("Optimize all videos in the Story to ensure smooth playback.","web-stories"),footer:l?o.a.createElement(o.a.Fragment,null,o.a.createElement(d.DefaultFooterText,null,o.a.createElement(i.TranslateWithMarkup,{mapping:{b:o.a.createElement(lt,null)}},Object(i.__)("Automatic video optimization enabled. <b>Reload the page</b> to apply changes.","web-stories"))),o.a.createElement(rt,null,o.a.createElement(Z.a,{type:R.c.SECONDARY,size:R.a.SMALL,onClick:async()=>{await b(),window.location.reload(!0)},disabled:g,ref:c},Object(i.__)("Save & Reload","web-stories")))):o.a.createElement(at,null,o.a.createElement(nt.a,{id:"automatic-video-optimization-toggle",checked:null==s||null===(t=s.meta)||void 0===t?void 0:t.web_stories_media_optimization,onChange:m}),o.a.createElement(it,{forwardedAs:"label",htmlFor:"automatic-video-optimization-toggle"},o.a.createElement(i.TranslateWithMarkup,{mapping:{a:o.a.createElement(y.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL,onClick:e=>Object(h.e)(e,"click_video_optimization_settings"),href:r,isBold:!0})}},Object(i.__)("Enable automatic optimization. Change this any time in <a>Settings</a>.","web-stories"))))}):null};var ct=function Accessibility(){const{hasUploadMediaAction:e}=Object(d.useConfig)((e=>{let{capabilities:t}=e;return{hasUploadMediaAction:t.hasUploadMediaAction}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.PageBackgroundTextLowContrast,null),o.a.createElement(d.TextElementFontSizeTooSmall,null),o.a.createElement(d.VideoElementMissingDescription,null),e&&o.a.createElement(d.VideoElementMissingCaptions,null),o.a.createElement(d.ElementLinkTappableRegionTooSmall,null),o.a.createElement(d.ElementLinkTappableRegionTooBig,null),o.a.createElement(d.ImageElementMissingAlt,null),o.a.createElement(Ct,null))};var st=function Design(){const{hasUploadMediaAction:e}=Object(d.useConfig)((e=>{let{capabilities:t}=e;return{hasUploadMediaAction:t.hasUploadMediaAction}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.StoryPagesCount,null),o.a.createElement(d.PageTooMuchText,null),o.a.createElement(d.PageTooLittleText,null),o.a.createElement(d.PageTooManyLinks,null),e&&o.a.createElement(d.VideoElementResolution,null),e&&o.a.createElement(d.ImageElementResolution,null))};var ut=()=>{const e=Object(d.useIsChecklistMounted)(),{generalSettingsLink:t,publisherName:n}=Object(d.useConfig)((e=>{let{metadata:t,generalSettingsLink:n}=e;return{publisherName:null==t?void 0:t.publisher,generalSettingsLink:n}})),a=(null==n?void 0:n.trim().length)>0,{title:r}=d.CHECKLIST_PRIORITY_COPY.storyMissingPublisherName;return Object(d.useRegisterCheck)("StoryMissingPublisherName",!a),!a&&e&&o.a.createElement(d.ChecklistCard,{title:r,footer:o.a.createElement(d.DefaultFooterText,null,o.a.createElement(i.TranslateWithMarkup,{mapping:{a:o.a.createElement(y.a,{href:t,rel:"noreferrer",target:"_blank",size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL})}},Object(i.__)("Your site title is used when your Story appears on Google. You can set your site title by going to <a>General Settings</a>.","web-stories")))})};var dt=function Priority(){const{canManageSettings:e,hasUploadMediaAction:t}=Object(d.useConfig)((e=>{let{capabilities:t}=e;return{canManageSettings:t.canManageSettings,hasUploadMediaAction:t.hasUploadMediaAction}}));return o.a.createElement(o.a.Fragment,null,o.a.createElement(d.StoryMissingTitle,null),e&&o.a.createElement(ut,null),o.a.createElement(d.StoryTitleLength,null),o.a.createElement(d.StoryMissingExcerpt,null),t&&o.a.createElement(d.StoryPosterAttached,null),t&&o.a.createElement(d.StoryPosterSize,null),t&&o.a.createElement(d.PublisherLogoMissing,null),t&&o.a.createElement(d.PublisherLogoSize,null),t&&o.a.createElement(d.VideoElementMissingPoster,null),o.a.createElement(d.VideoOptimization,null),o.a.createElement(d.StoryAmpValidationErrors,null))};function pt(){return(pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const ft=w.f.div.withConfig({displayName:"footer__Panel",componentId:"sc-6wcfz2-0"})(["padding:16px 0 24px 0;border-top:1px solid ",";"],(e=>{let{theme:t}=e;return t.colors.bg.tertiary})),mt=w.f.ul.withConfig({displayName:"footer__Links",componentId:"sc-6wcfz2-1"})(["margin:8px 0 0 0;padding:0;list-style-position:inside;list-style-type:none;"]),ht=w.f.li.withConfig({displayName:"footer__ListItem",componentId:"sc-6wcfz2-2"})([""," &::before{content:'- ';}&,& > *{font-weight:700;}"],Se.c.expandTextPreset(((e,t)=>{let{paragraph:n}=e,{X_SMALL:a}=t;return n[a]})));function Link(e){let{children:t,...n}=e;return o.a.createElement(ht,null,o.a.createElement(y.a,pt({},n,{size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}),t))}const gt=Object(i.__)("https://wordpress.org/support/plugin/web-stories/","web-stories"),bt=Object(i.__)("https://youtube.com/playlist?list=PLfVPq9A6B0RNoQ3HTE9LQzgAdVzcb7tmt","web-stories");function Footer(){const e=Object(f.s)((e=>{Object(h.e)(e,"click_support_page")}),[]),t=Object(f.s)((e=>{Object(h.e)(e,"click_website_docs")}),[]),n=Object(f.s)((e=>{Object(h.e)(e,"click_storytime_channel")}),[]);return o.a.createElement(ft,null,o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},Object(i.__)("Discover more resources to get the most out of Web Stories. Read our start guide or visit our support forum to get answers to your questions.","web-stories")),o.a.createElement(mt,null,o.a.createElement(Link,{href:"https://wp.stories.google/docs/",target:"_blank",rel:"noreferrer",onClick:t},Object(i.__)("Read Start Guide","web-stories")),o.a.createElement(Link,{href:gt,target:"_blank",rel:"noreferrer",onClick:e},Object(i.__)("Visit Support Forums","web-stories")),o.a.createElement(Link,{href:bt,target:"_blank",rel:"noreferrer",onClick:n},Object(i.__)("Storytime YouTube Series","web-stories"))))}var vt=function Layout(){return o.a.createElement(K,null,o.a.createElement(d.InterfaceSkeleton,{header:o.a.createElement(T,null),footer:{secondaryMenu:{helpCenter:{Footer:Footer},checklist:{Priority:dt,Design:st,Accessibility:ct}}},inspectorTabs:{document:{title:Object(i.__)("Document","web-stories"),Pane:tt},publishModal:{DocumentPane:PublishModalDocumentPane,IsolatedStatusPanel:IsolatedStatusPanel}}},o.a.createElement(X,null)))},yt=n(44),Et=n.n(yt),wt=n(518);var Ot=(e,t)=>{const n=t.get("control"),a=Boolean(parseInt(n.params.flex_width)),r=Boolean(parseInt(n.params.flex_height)),l=e.get("width"),o=e.get("height");let i=parseInt(n.params.width),C=parseInt(n.params.height);const c=i/C,s=i,u=C;t.set("canSkipCrop",!n.mustBeCropped(a,r,i,C,l,o)),l/o>c?(C=o,i=C*c):(i=l,C=i/c);const d=(l-i)/2,p=(o-C)/2,f={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:l,imageHeight:o,minWidth:s>i?i:s,minHeight:u>C?C:u,x1:d,y1:p,x2:i+d,y2:C+p};return!1===r&&!1===a&&(f.aspectRatio=i+":"+C),!0===r&&(delete f.minHeight,f.maxWidth=l),!0===a&&(delete f.minWidth,f.maxHeight=o),f},Mt=n(569),_t=n(568);var Lt=e=>{const{src:t,url:n,mime:a,alt:r,date:l,id:o,featured_media:i,featured_media_src:{src:C,width:c,height:s,generated:u}="",media_details:{width:d,height:p,length:f,length_formatted:m,sizes:h={}}={},web_stories_media_source:b,web_stories_is_muted:v,web_stories_base_color:y,web_stories_blurhash:E,trim_data:w}=e,O=Object.entries(h).reduce(((e,t)=>{let[n,a]=t;return e[n]=Object(g.b)(a),e}),{});return Object(Mt.a)({baseColor:y,blurHash:E,mimeType:a,creationDate:l,src:n||t,...Object(_t.a)({width:d,height:p,posterGenerated:u,posterWidth:c,posterHeight:s}),poster:C,posterId:i,id:o,length:f,lengthFormatted:m,alt:r,sizes:O,local:!1,isExternal:!1,isOptimized:"video-optimization"===b,isMuted:v,trimData:w})};var xt,jt,St,It,At,kt=(e,t,n,a,r,l)=>(!0!==e||!0!==t)&&((!0!==e||a!==l)&&((!0!==t||n!==r)&&((n!==r||a!==l)&&!(Math.abs(n/a-r/l)<Number.EPSILON))));var Tt=null===(xt=window.wp)||void 0===xt||null===(jt=xt.media)||void 0===jt||null===(St=jt.controller)||void 0===St||null===(It=St.Cropper)||void 0===It||null===(At=It.extend)||void 0===At?void 0:At.call(It,{doCrop:function(e){const t=e.get("cropDetails"),n=this.get("control"),a=t.width/t.height;return n.params.flex_width&&n.params.flex_height?(t.dst_width=t.width,t.dst_height=t.height):(t.dst_width=n.params.flex_width?n.params.height*a:n.params.width,t.dst_height=n.params.flex_height?n.params.width/a:n.params.height),window.wp.ajax.post("crop-image",{nonce:e.get("nonces").edit,id:e.get("id"),context:n.id,cropDetails:t})}});const Pt={height:0,width:0,flex_width:!1,flex_height:!1};function Zt(e){let{title:t=Object(i.__)("Upload to Story","web-stories"),buttonInsertText:n=Object(i.__)("Insert into page","web-stories"),onSelect:a,onSelectErrorMessage:r=Object(i.__)("Unable to use this file type.","web-stories"),onClose:l,onPermissionError:o,type:C="",multiple:c=!1,cropParams:s}=e;const{actions:{updateMedia:u}}=Object(d.useAPI)(),{capabilities:{hasUploadMediaAction:p}}=Object(d.useConfig)(),{showSnackbar:m}=Object(wt.a)();Object(f.y)((()=>{try{window.wp.Uploader.prototype.success=e=>{let{attributes:t}=e;u(t.id,{web_stories_media_source:"editor",alt_text:t.alt||t.title})}}catch(e){}}),[u]);const g=Object(f.s)((e=>{if(Object(h.g)("open_media_modal"),!p)return o&&o(),void e.preventDefault();const i=window.wp.media({title:t,library:{type:C},button:{text:n},multiple:c});i.once("select",(()=>{const e=i.state().get("selection").first().toJSON();!Array.isArray(C)||C.includes(e.mime)?(e.alt=e.alt||e.title,a(Lt(e))):m({message:r})})),l&&i.once("close",l),i.once("content:activate:browse",(()=>{var e,t,n,a,r,l,o;null===(e=i.content)||void 0===e||null===(t=e.get())||void 0===t||null===(n=t.collection)||void 0===n||n._requery(!0),null===(a=i.content)||void 0===a||null===(r=a.get())||void 0===r||null===(l=r.options)||void 0===l||null===(o=l.selection)||void 0===o||o.reset()})),i.open(),e.preventDefault()}),[p,m,o,l,a,n,r,c,C,t]),b=Object(f.s)((e=>{if(Object(h.g)("open_media_crop_modal"),!p)return o&&o(),void e.preventDefault();const i={...Pt,...s},d={id:"control-id",params:i,mustBeCropped:kt},f={text:n,close:!1},g=window.wp.media({button:f,states:[new window.wp.media.controller.Library({title:t,library:window.wp.media.query({type:C}),button:f,multiple:c,suggestedWidth:i.width,suggestedHeight:i.height}),Tt&&new Tt({imgSelectOptions:Ot,control:d})]});g.once("cropped",(e=>{if(null!=e&&e.id){const t=e.alt||e.title;u(e.id,{web_stories_media_source:"editor",alt_text:t}),e.alt=t}a(Lt(e))})),g.once("skippedcrop",(()=>{const e=g.state().get("selection").first().toJSON();e.alt=e.alt||e.title,a(Lt(e))})),g.once("select",(()=>{const e=g.state().get("selection").first().toJSON();if(Array.isArray(C)&&!C.includes(e.mime))return g.close(),void m({message:r});d.params.width!==e.width||d.params.height!==e.height||d.params.flex_width||d.params.flex_height?g.setState("cropper"):(e.alt=e.alt||e.title,a(Lt(e)),g.close())})),l&&g.once("close",l),g.once("content:activate:browse",(()=>{var e,t,n,a,r,l,o;null===(e=g.content)||void 0===e||null===(t=e.get())||void 0===t||null===(n=t.collection)||void 0===n||n._requery(!0),null===(a=g.content)||void 0===a||null===(r=a.get())||void 0===r||null===(l=r.options)||void 0===l||null===(o=l.selection)||void 0===o||o.reset()})),g.open(),e.preventDefault()}),[p,s,n,t,C,c,a,l,o,u,m,r]);return Object(f.C)((()=>s?b:g),[s,b,g])}Zt.propTypes={title:Et.a.string,buttonInsertText:Et.a.string,onSelect:Et.a.func.isRequired,onSelectErrorMessage:Et.a.string,onClose:Et.a.func,onPermissionError:Et.a.func,type:Et.a.oneOfType([Et.a.string,Et.a.arrayOf(Et.a.string)]),cropParams:Et.a.object,multiple:Et.a.bool};var Rt=Zt;function Nt(e){let{render:t,...n}=e;return t(Rt(n))}Nt.propTypes={render:Et.a.func.isRequired,...Rt.propTypes};var Dt=Nt,zt=n(17);function Bt(e,t){const n=`${t}${e}/lock/`;return V()({path:n,method:"POST"})}const Ft=w.f.img.withConfig({displayName:"shared__Img",componentId:"sc-1djlecd-0"})(["float:left;margin:0px 10px 10px 0px;"]);var Ht=function PostLockDialog(e){let{isOpen:t,onClose:n,user:a,dashboardLink:r,previewLink:l,showTakeOver:C=!1}=e;const c=Object(i.__)("Story is locked","web-stories"),s=C?Object(i.sprintf)(
268
  /* translators: %s: user's name */
269
  Object(i.__)("%s is already editing this story. Do you want to take over?","web-stories"),null==a?void 0:a.name):Object(i.sprintf)(
270
  /* translators: %s: user's name */
271
  Object(i.__)("%s is already editing this story.","web-stories"),null==a?void 0:a.name);return o.a.createElement(d.Dialog,{isOpen:t,onClose:n,title:c,contentLabel:c,actions:o.a.createElement(o.a.Fragment,null,o.a.createElement(Z.a,{type:R.c.TERTIARY,size:R.a.SMALL,href:r},Object(i.__)("Dashboard","web-stories")),o.a.createElement(Z.a,{type:R.c.TERTIARY,size:R.a.SMALL,href:l,target:"_blank",rel:"noreferrer"},Object(i.__)("Preview","web-stories")),C&&o.a.createElement(Z.a,{type:R.c.TERTIARY,size:R.a.SMALL,onClick:n},Object(i.__)("Take over","web-stories")))},o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},(null==a?void 0:a.avatar)&&o.a.createElement(Ft,{src:a.avatar,alt:a.name,height:48,width:48,crossOrigin:"anonymous",decoding:"async"}),s))};var Ut=function PostTakeOverDialog(e){let{isOpen:t,user:n,dashboardLink:a,onClose:r}=e;const l=Object(i.__)("Someone else has taken over this story.","web-stories"),C=Object(i.sprintf)(
272
  /* translators: %s: user's name */
273
+ Object(i.__)("%s now has editing control of this story.","web-stories"),null==n?void 0:n.name);return o.a.createElement(d.Dialog,{isOpen:t,title:l,contentLabel:l,onClose:r,actions:o.a.createElement(Z.a,{type:R.c.QUATERNARY,size:R.a.SMALL,variant:R.d.RECTANGLE,href:a},Object(i.__)("Dashboard","web-stories"))},o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},n.avatar&&o.a.createElement(Ft,{src:n.avatar,alt:n.name,height:48,width:48,crossOrigin:"anonymous",decoding:"async"}),C))};var Gt=function PostLock(){const{currentUser:e}=Object(d.useCurrentUser)((e=>{let{state:t}=e;return{currentUser:t.currentUser}})),{storyId:t,dashboardLink:n,nonce:a,postLock:{interval:r,showLockedDialog:l},api:{stories:i,storyLocking:C}}=Object(d.useConfig)(),{previewLink:c,lockUser:s}=Object(d.useStory)((e=>{let{state:{story:{previewLink:t,extras:{lockUser:n={}}={}}}}=e;return{previewLink:t,lockUser:n}})),{enablePostLocking:u,enablePostLockingTakeOver:p}=Object(Pe.c)(),[m,g]=Object(f.I)(!0),[b,v]=Object(f.I)({}),[y,E]=Object(f.I)(a),w=Object(f.s)((()=>{p&&(v({}),Bt(t,i))}),[p,t,i]),O=Object(f.C)((()=>Boolean(Object.keys(e).length)),[e]),M=Object(f.s)((()=>{u&&l&&O&&function(e,t){const n=Object(zt.a)(`${t}${e}/lock/`,{_embed:"author"});return V()({path:n})}(t,i).then((n=>{var a,r,l,o,C,c,s;let{locked:u,nonce:d,_embedded:p}=n;const f={id:(null==p||null===(a=p.author)||void 0===a||null===(r=a[0])||void 0===r?void 0:r.id)||0,name:(null==p||null===(l=p.author)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.name)||"",avatar:(null==p||null===(C=p.author)||void 0===C||null===(c=C[0])||void 0===c||null===(s=c.avatar_urls)||void 0===s?void 0:s[96])||""};u&&null!=f&&f.id&&(null==f?void 0:f.id)!==e.id?v(f):Bt(t,i),E(d)})).catch((e=>{Object(h.f)("post_lock",e.message)}))}),[v,t,i,e,u,l,O]),_=Object(f.G)(M);return Object(f.y)((()=>{_.current=M}),[M,O]),Object(f.y)((()=>{u&&l&&O&&null!=s&&s.id&&(null==s?void 0:s.id)!==e.id&&v(s)}),[s,e,O,u,l]),Object(f.y)((()=>{function e(){u&&l&&null!=b&&b.id&&y&&function(e,t,n){var a,r;const l=new window.FormData;l.append("_wpnonce",t);const o=Object(zt.a)(n,{_method:"DELETE"});null===(a=(r=window.navigator).sendBeacon)||void 0===a||a.call(r,o,l)}(0,y,C)}return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}}),[t,u,l,b,y,C]),Object(f.y)((()=>{const e=setInterval((()=>{r&&O&&(_.current(),g(!1))}),1e3*r);return()=>clearInterval(e)}),[r,O]),u&&l&&b?m?o.a.createElement(Ht,{isOpen:Boolean(null==b?void 0:b.id),user:b,onClose:w,previewLink:c,dashboardLink:n,showTakeOver:p}):p?o.a.createElement(Ut,{isOpen:Boolean(null==b?void 0:b.id),user:b,dashboardLink:n,onClose:w}):null:null};const Vt=(e,t,n)=>{if("object"==typeof n)for(const a in n)Object.prototype.hasOwnProperty.call(n,a)&&Vt(e,`${t}[${a}]`,n[a]);else e.append(t,n)};var Wt=Vt;var $t=function(e){return"__WEB_STORIES_ENCODED__"+btoa(encodeURIComponent(e))},Yt=n(228);var qt=function(e){const{mime_type:t,web_stories_media_source:n}=e;return"gif-conversion"===n?function(e){const{id:t,date_gmt:n,media_details:{width:a,height:r},mime_type:l,featured_media:o,featured_media_src:{src:i,width:C,height:c,generated:s},alt_text:u,source_url:d,meta:{web_stories_base_color:p,web_stories_blurhash:f}}=e;return Object(Mt.a)({baseColor:p,blurHash:f,type:"gif",mimeType:"image/gif",creationDate:n,src:d,...Object(_t.a)({width:a,height:r,posterGenerated:s,posterWidth:C,posterHeight:c}),posterId:o,poster:i,id:t,alt:u,local:!1,isOptimized:!0,isExternal:!1,output:{mimeType:l,src:d}})}(e):"image"===Object(Yt.a)(t)?function(e){const{id:t,date_gmt:n,media_details:{width:a,height:r,sizes:l={}}={},mime_type:o,alt_text:i,source_url:C,meta:{web_stories_base_color:c,web_stories_blurhash:s}}=e,u=Object.entries(l).reduce(((e,t)=>{let[n,a]=t;return e[n]=Object(g.b)(a),e}),{});return Object(Mt.a)({baseColor:c,blurHash:s,mimeType:o,creationDate:n,src:C,width:a,height:r,id:t,alt:i,sizes:u,local:!1,isExternal:!1})}(e):function(e){const{id:t,date_gmt:n,media_details:{width:a,height:r,length:l,length_formatted:o},mime_type:i,featured_media:C,featured_media_src:{src:c,width:s,height:u,generated:d},web_stories_is_muted:p,alt_text:f,source_url:m,web_stories_media_source:h,meta:{web_stories_trim_data:g,web_stories_base_color:b,web_stories_blurhash:v}}=e;return Object(Mt.a)({baseColor:b,blurHash:v,mimeType:i,creationDate:n,src:m,...Object(_t.a)({width:a,height:r,posterGenerated:d,posterWidth:s,posterHeight:u}),poster:c,posterId:C,id:t,length:l,lengthFormatted:o,alt:f,local:!1,isExternal:!1,isOptimized:"video-optimization"===h,isMuted:p,trimData:g})}(e)};var Xt=function(e){var t,n,a,r,l,o,i,C,c,s,u,d,p,f,m,h,b,v,y,E,w,O,M,_,L;const{_embedded:x={},_links:j={},...S}=e,I={...Object(g.b)(S,["story_data"]),author:{id:(null==x||null===(t=x.author)||void 0===t?void 0:t[0].id)||0,name:(null==x||null===(n=x.author)||void 0===n?void 0:n[0].name)||""},capabilities:{},extras:{lockUser:{id:(null==x||null===(a=x["wp:lockuser"])||void 0===a?void 0:a[0].id)||0,name:(null==x||null===(r=x["wp:lockuser"])||void 0===r?void 0:r[0].name)||"",avatar:(null==x||null===(l=x["wp:lockuser"])||void 0===l||null===(o=l[0].avatar_urls)||void 0===o?void 0:o[96])||""}},featuredMedia:{id:(null==x||null===(i=x["wp:featuredmedia"])||void 0===i?void 0:i[0].id)||0,height:(null==x||null===(C=x["wp:featuredmedia"])||void 0===C||null===(c=C[0])||void 0===c||null===(s=c.media_details)||void 0===s?void 0:s.height)||0,width:(null==x||null===(u=x["wp:featuredmedia"])||void 0===u||null===(d=u[0])||void 0===d||null===(p=d.media_details)||void 0===p?void 0:p.width)||0,url:(null==x||null===(f=x["wp:featuredmedia"])||void 0===f||null===(m=f[0])||void 0===m?void 0:m.source_url)||""},publisherLogo:{id:(null==x||null===(h=x["wp:publisherlogo"])||void 0===h?void 0:h[0].id)||0,height:(null==x||null===(b=x["wp:publisherlogo"])||void 0===b||null===(v=b[0])||void 0===v||null===(y=v.media_details)||void 0===y?void 0:y.height)||0,width:(null==x||null===(E=x["wp:publisherlogo"])||void 0===E||null===(w=E[0])||void 0===w||null===(O=w.media_details)||void 0===O?void 0:O.width)||0,url:(null==x||null===(M=x["wp:publisherlogo"])||void 0===M||null===(_=M[0])||void 0===_?void 0:_.source_url)||""},taxonomies:(null==j||null===(L=j["wp:term"])||void 0===L?void 0:L.map((e=>{let{taxonomy:t}=e;return t})))||[],terms:(null==x?void 0:x["wp:term"])||[]};for(const e of Object.keys(j)){if(!e.startsWith("wp:action-"))continue;const t=e.replace("wp:action-","");I.capabilities[t]=!0}return I};const Kt=Object(i.__)("https://wordpress.org/support/plugin/web-stories/","web-stories");var Qt=function StatusCheckFailed(e){let{isOpen:t,onClose:n}=e;const a=Object(f.s)((e=>{Object(h.e)(e,"click_support_page")}),[]);return o.a.createElement(d.Dialog,{isOpen:t,onClose:n,title:Object(i.__)("Unable to save your story","web-stories"),contentLabel:Object(i.__)("Unable to save your story","web-stories"),onPrimary:n,primaryText:Object(i.__)("Dismiss","web-stories")},o.a.createElement(b.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL},o.a.createElement(i.TranslateWithMarkup,{mapping:{a:o.a.createElement(y.a,{size:v.b.TYPOGRAPHY.PRESET_SIZES.SMALL,href:Kt,target:"_blank",rel:"noopener noreferrer",onClick:a})}},Object(i.__)("We are currently unable to save your story, any changes you make may be lost. This may be due to temporary issues connecting to WordPress. <a>Submit a new support topic</a> for additional help.","web-stories"))))};var Jt=function StatusCheck(){const[e,t]=Object(f.I)(!1),n=Object(f.s)((()=>t(!1)),[]),{api:{statusCheck:a},encodeMarkup:r}=Object(d.useConfig)();return Object(f.y)((()=>{(function(e,t,n){return V()({path:t,data:{content:n?$t(e):e},method:"POST"})})(Object(d.getStoryMarkup)({storyId:1,title:"Story!",author:{id:1,name:"John Doe"},slug:"story",publisherLogo:{id:1,url:"https://example.com/logo.png",height:0,width:0},defaultPageDuration:7,status:"publish",date:"2020-04-10T07:06:26",modified:"",excerpt:"",featuredMedia:{id:123,url:"https://example.com/image.png",width:123,height:456},password:"",globalStoryStyles:""},[{type:"page",id:"2",elements:[]}],{publisher:"Web Stories"}),a,r).catch((e=>{t(!0),Object(h.f)("status_check",e.message)}))}),[r,a]),o.a.createElement(Qt,{isOpen:e,onClose:n})};function en(e,t){return V()({path:Object(zt.a)(e.api.users,{per_page:"100",who:"authors",search:t})}).then((e=>e.map((e=>(delete e._links,Object(g.b)(e))))))}var tn=n(48);const nn=["id","title","status","slug","date","modified","excerpt","link","story_data","preview_link","edit_link","embed_post_link","permalink_template","style_presets","password"].join(","),an="wp:featuredmedia,wp:lockuser,author,wp:publisherlogo,wp:term",rn=["id","date_gmt","media_details","mime_type","featured_media","featured_media_src","alt_text","source_url","meta","web_stories_media_source","web_stories_is_muted","body","status","headers"].join(",");function ln(e,t){const n=Object(zt.a)(`${e.api.stories}${t}/`,{context:"edit",_embed:an,_fields:nn});return V()({path:n}).then(Xt)}const on=(e,t)=>{let{pages:n,featuredMedia:a,globalStoryStyles:r,publisherLogo:l,autoAdvance:o,defaultPageDuration:i,currentStoryStyles:C,backgroundAudio:c,content:s,author:u,...d}=e;return{story_data:{version:tn.a,pages:n,autoAdvance:o,defaultPageDuration:i,currentStoryStyles:C,backgroundAudio:c},featured_media:a.id,style_presets:r,meta:{web_stories_publisher_logo:null==l?void 0:l.id},publisher_logo:l,content:t?$t(s):s,author:u.id,...d}};function Cn(e,t){const{storyId:n}=t,a=on(t,e.encodeMarkup),r=Object(zt.a)(`${e.api.stories}${n}/`,{_fields:["status","slug","link","preview_link","edit_link","embed_post_link"].join(","),_embed:an});return V()({path:r,data:a,method:"POST"}).then((e=>{var t,n,a,r,l,o,i,C,c;const{_embedded:s={},...u}=e;return{...Object(g.b)(u),featuredMedia:{id:(null==s||null===(t=s["wp:featuredmedia"])||void 0===t?void 0:t[0].id)||0,height:(null==s||null===(n=s["wp:featuredmedia"])||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.media_details)||void 0===r?void 0:r.height)||0,width:(null==s||null===(l=s["wp:featuredmedia"])||void 0===l||null===(o=l[0])||void 0===o||null===(i=o.media_details)||void 0===i?void 0:i.width)||0,url:(null==s||null===(C=s["wp:featuredmedia"])||void 0===C||null===(c=C[0])||void 0===c?void 0:c.source_url)||""}}}))}function cn(e,t){const{storyId:n}=t,a=on(t,e.encodeMarkup);return V()({path:`${e.api.stories}${n}/autosaves/`,data:a,method:"POST"}).then((e=>Object(g.b)(e,["story_data"])))}function sn(e,t){let{mediaType:n,searchTerm:a,pagingNum:r,cacheBust:l}=t,o=Object(zt.a)(e.api.media,{context:"edit",per_page:50,page:r,_web_stories_envelope:!0,_fields:rn});return n&&(o=Object(zt.a)(o,{media_type:n})),a&&(o=Object(zt.a)(o,{search:a})),l&&(o=Object(zt.a)(o,{cache_bust:!0})),V()({path:o}).then((e=>{let{body:t,headers:n}=e;return{data:t.map(qt),headers:{...n,totalItems:n["X-WP-Total"],totalPages:n["X-WP-TotalPages"]}}}))}function un(e,t){const n=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:rn});return V()({path:n}).then(qt)}async function dn(e,t){var n;const a=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:"meta.web_stories_muted_id"}),r=await V()({path:a});return null!=r&&null!==(n=r.meta)&&void 0!==n&&n.web_stories_muted_id?un(e,r.meta.web_stories_muted_id):null}async function pn(e,t){var n;const a=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:"meta.web_stories_optimized_id"}),r=await V()({path:a});return null!=r&&null!==(n=r.meta)&&void 0!==n&&n.web_stories_optimized_id?un(e,r.meta.web_stories_optimized_id):null}async function fn(e,t){const n=Object(zt.a)(`${e.api.media}${t}/`,{context:"edit",_fields:"featured_media"}),a=await V()({path:n});return null!=a&&a.featured_media?un(e,a.featured_media):null}function mn(e,t,n){const a=new window.FormData;return a.append("file",t,t.name||t.type.replace("/",".")),Object.entries(n).forEach((e=>{let[t,n]=e;return Wt(a,t,n)})),V()({path:e.api.media,body:a,method:"POST"}).then((e=>qt(e)))}function hn(e,t,n){return V()({path:`${e.api.media}${t}/`,data:n,method:"POST"}).then(qt)}function gn(e,t){V()({path:Object(zt.a)(`${e.api.media}${t}/`,{_method:"DELETE"}),data:{force:!0},method:"POST"})}function bn(e,t){const n=Object(zt.a)(e.api.link,{url:t});return V()({path:n})}const vn=["id","story_data","body","headers"],yn="wp:featuredmedia";function En(e){var t,n,a,r,l,o,i,C,c;const{_embedded:s={},id:u,story_data:d}=e;return{...d,templateId:u,image:{id:(null==s||null===(t=s["wp:featuredmedia"])||void 0===t?void 0:t[0].id)||0,height:(null==s||null===(n=s["wp:featuredmedia"])||void 0===n||null===(a=n[0])||void 0===a||null===(r=a.media_details)||void 0===r?void 0:r.height)||0,width:(null==s||null===(l=s["wp:featuredmedia"])||void 0===l||null===(o=l[0])||void 0===o||null===(i=o.media_details)||void 0===i?void 0:i.width)||0,url:(null==s||null===(C=s["wp:featuredmedia"])||void 0===C||null===(c=C[0])||void 0===c?void 0:c.source_url)||""}}}function wn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=100,a=Object(zt.a)(e.api.pageTemplates,{context:"edit",per_page:n,page:t,_web_stories_envelope:!0,_fields:vn,_embed:yn});return V()({path:a}).then((e=>{let{headers:n,body:a}=e;const r=parseInt(n["X-WP-TotalPages"]);return{templates:a.map(En),hasMore:r>t}}))}function On(e,t){return V()({path:`${e.api.pageTemplates}/`,data:{...t,status:"publish"},method:"POST"}).then(En)}function Mn(e,t,n){return V()({path:`${e.api.pageTemplates}${t}/`,data:{...n},method:"POST"}).then(En)}function Ln(e,t){return V()({path:Object(zt.a)(`${e.api.pageTemplates}${t}/`,{_method:"DELETE"}),data:{force:!0},method:"POST"})}function xn(e){return V()({path:e.api.currentUser})}function jn(e,t){return V()({path:e.api.currentUser,method:"POST",data:t}).then((e=>(delete e._links,Object(g.b)(e,["meta","capabilities","extra_capabilities"]))))}function Sn(e,t){const n=Object(zt.a)(e.api.hotlink,{url:t});return V()({path:n}).then(g.b)}function In(e,t){return Object(zt.a)(e.api.proxy,{url:t,_wpnonce:e.nonce})}async function An(e){const t=await V()({path:Object(zt.a)(e.api.taxonomies,{type:e.postType,context:"edit"})});return Object.values(t).map((e=>{var t,n,a;return e.restPath=null===(t=e._links)||void 0===t||null===(n=t["wp:items"])||void 0===n||null===(a=n[0])||void 0===a?void 0:a.href,delete e._links,Object(g.b)(e,["capabilities","visibility"])}))}function kn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return V()({url:Object(zt.a)(t,n)})}function Tn(e,t,n){return V()({url:Object(zt.a)(t,n),method:"POST"})}function Pn(e,t){let{include:n,search:a,service:r}=t,l=Object(zt.a)(`${e.api.fonts}`,{search:a,service:r});const o=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(",").filter(Boolean).map((e=>`include[]=${encodeURI(e)}`)).join("&")}(n);return o.length>0&&(l+=l.includes("?")?`&${o}`:`?${o}`),V()({path:l})}var Zn=n(148);const Rn=Object(w.d)([".","{top:","px !important;left:","px !important;}body.folded .","{left:","px !important;}"],Zn.c,32,160,Zn.c,36);window.webStories=window.webStories||{},window.webStories.domReady=u.a,window.webStories.initializeStoryEditor=(e,t,n)=>{const a=document.getElementById(e);Object(p.b)(a),Object(m.o)(t.locale),Object(h.d)("Editor"),n.story=n.story?Xt(n.story):null;const l={...t,apiCallbacks:Object(g.a)(r,t),additionalTips:re,MediaUpload:Dt,styleConstants:{topOffset:32,leftOffset:160}};Object(f.n)(o.a.createElement(f.c,null,o.a.createElement(d.StoryEditor,{config:l,initialEdits:n},o.a.createElement(Rn,null),o.a.createElement(vt,null),o.a.createElement(E,null),o.a.createElement(Jt,null),o.a.createElement(Gt,null))),a)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a={};n.r(a),n.d(a,"MenuButton",(function(){return g})),n.d(a,"MenuGroup",(function(){return v})),n.d(a,"MenuIcon",(function(){return L})),n.d(a,"MenuItem",(function(){return R})),n.d(a,"MenuItemSuffix",(function(){return k})),n.d(a,"MenuLabel",(function(){return N})),n.d(a,"MenuLink",(function(){return F})),n.d(a,"MenuSeparator",(function(){return U})),n.d(a,"MenuShortcut",(function(){return A})),n.d(a,"SubMenuTrigger",(function(){return $}));var r=n(0),l=n.n(r),o=n(3),i=n(157),C=n(1),c=n(169),s=n(534),u=n(12),d=n(27),p=n(28);const f=Object(o.e)(["",";display:flex;justify-content:space-between;align-items:center;padding:2px 16px;border:0;color:",";font-weight:500;text-align:left;transition:background-color ",";"],(e=>{let{theme:t}=e;return u.c.expandPresetStyles({preset:t.typography.presets.paragraph[d.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL],theme:t})}),(e=>{let{theme:t}=e;return t.colors.fg.primary}),p.b);function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const h=Object(o.f)(c.a).withConfig({displayName:"button__StyledButton",componentId:"sc-pequaj-0"})(["",";width:100%;",":disabled{background-color:transparent;span{color:",";}}:hover:not(:disabled){background-color:",";}:active:not(:disabled){background-color:",";}"],f,(e=>{let{isHorizontal:t,isIconMenu:n,forcePadding:a,theme:r}=e;return{height:t&&"32px",padding:!a&&(t||n)&&0,borderRadius:t||n?r.borders.radius.small:0}}),(e=>{let{theme:t}=e;return t.colors.fg.disable}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryHover}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryPress}));var g=Object(C.j)((function Button(e,t){let{id:n,onBlur:a,onClick:r,onFocus:o,forcePadding:c=!1,dismissOnClick:u=!0,...d}=e;const{focusedId:p,isIconMenu:f,isHorizontal:g,onDismiss:b,onMenuItemBlur:v,onMenuItemFocus:y}=Object(s.a)((e=>{let{state:t,actions:n}=e;return{focusedId:t.focusedId,isIconMenu:t.isIconMenu,isHorizontal:t.isHorizontal,onDismiss:n.onDismiss,onMenuItemBlur:n.onMenuItemBlur,onMenuItemFocus:n.onMenuItemFocus}})),E=Object(C.C)(i.a,[]),w=n||E;return l.a.createElement(h,m({ref:t,id:w,tabIndex:p===w?0:-1,role:"menuitem",isIconMenu:f,isHorizontal:g,forcePadding:c,onBlur:e=>{v(),null==a||a(e)},onClick:e=>{r(e),u&&b(e)},onFocus:e=>{y(w),null==o||o(e)}},d))}));function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var v=function Group(e){let{label:t,...n}=e;return l.a.createElement("div",b({role:"group","aria-label":t},n))},y=n(151),E=n(19),w=n(82);function O(){return(O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const M=o.f.div.withConfig({displayName:"icon__TooltipWrapper",componentId:"sc-scm7dy-0"})(["margin:0 auto;"]),_=o.f.div.withConfig({displayName:"icon__IconWrapper",componentId:"sc-scm7dy-1"})(["width:32px;height:32px;"]);var L=function Icon(e){let{children:t,placement:n=E.a.RIGHT,title:a,...r}=e;return l.a.createElement(l.a.Fragment,null,l.a.createElement(y.a,null,a),l.a.createElement(M,null,l.a.createElement(w.a,O({placement:n,title:a},r),l.a.createElement(_,null,t))))},x=n(6),j=n.n(x),S=n(97);const I=Object(o.f)(S.a).attrs({forwardedAs:"kbd",size:d.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}).withConfig({displayName:"shortcut__StyledText",componentId:"sc-74dfi9-0"})(["color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.secondary}));var A=function Shortcut(e){return l.a.createElement(I,e)};var k=o.f.div.withConfig({displayName:"suffix__Suffix",componentId:"sc-1l1uahg-0"})(["position:relative;svg{width:32px;color:",";position:absolute;right:-14px;top:-16px;}"],(e=>{let{theme:t}=e;return t.colors.fg.secondary}));function T(){return(T=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const P=Object(o.f)(g).withConfig({displayName:"item__StyledButton",componentId:"sc-p2jje0-0"})(["",""],(e=>{let{supportsIcon:t}=e;return t&&"\n svg {\n width: 32px;\n position: absolute;\n margin-left: -12px;\n }\n span {\n padding-left: 18px;\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n "}));const Z=Object(C.j)((function MenuItemWithRef(e,t){let{label:n,shortcut:a,icon:r,SuffixIcon:o,...i}=e;return l.a.createElement(P,T({ref:t},i),r,n,a&&l.a.createElement(A,null,a.display),o&&l.a.createElement(k,null,l.a.createElement(o,null)))}));Z.propTypes={label:j.a.oneOfType([j.a.string,j.a.object]),shortcut:j.a.shape({display:j.a.object.isRequired,title:j.a.string}),icon:j.a.node,SuffixIcon:j.a.object};var R=Z;var N=o.f.div.withConfig({displayName:"label__Label",componentId:"sc-wzcdl7-0"})(["",";"],f),D=n(150);function z(){return(z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const B=Object(o.f)(D.a).withConfig({displayName:"link__StyledLink",componentId:"sc-1q07ax2-0"})(["",";background-color:transparent;text-decoration:none;:active,:hover,:focus,:active *,:hover *,:focus *{color:"," !important;}:hover{background-color:",";}:active{background-color:",";}"],f,(e=>{let{theme:t}=e;return t.colors.fg.primary}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryHover}),(e=>{let{theme:t}=e;return t.colors.interactiveBg.secondaryPress}));var F=function Link(e){let{id:t,onBlur:n,onClick:a,onFocus:r,openNewTab:o,...c}=e;const{focusedId:u,onDismiss:d,onMenuItemBlur:p,onMenuItemFocus:f}=Object(s.a)((e=>{let{state:t,actions:n}=e;return{focusedId:t.focusedId,onDismiss:n.onDismiss,onMenuItemBlur:n.onMenuItemBlur,onMenuItemFocus:n.onMenuItemFocus}})),m=Object(C.C)(i.a,[]),h=t||m,g=o?{target:"_blank",rel:"noreferrer"}:{};return l.a.createElement(B,z({id:h,tabIndex:u===h?0:-1,role:"menuitem",onBlur:e=>{p(),null==n||n(e)},onClick:e=>{null==a||a(e),d(e)},onFocus:e=>{f(h),null==r||r(e)}},g,c))};const H=o.f.div.withConfig({displayName:"separator__Line",componentId:"sc-1s2s628-0"})(["display:block;flex-shrink:0;",""],(e=>{let{isHorizontal:t,isIconMenu:n,theme:a}=e;return t?`\n width: 1px;\n height: 89%; /* 32px out of 36px */\n margin: auto 2px; /* there's an extra 6px horizontal flexbox gap */\n background-color: ${a.colors.divider.secondary};\n `:`\n height: 1px;\n margin: 2px auto; /* there's an extra 6px vertical flexbox gap */\n width: ${n?40:100}%;\n background-color: ${a.colors.divider.primary};\n `}));var U=function Separator(){const e=Object(s.a)((e=>{let{state:{isIconMenu:t,isHorizontal:n}}=e;return{isIconMenu:t,isHorizontal:n}}));return l.a.createElement(H,e)},G=n(35),V=n(519);function W(){return(W=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var $=function SubMenuTrigger(e){let{openSubMenu:t,closeSubMenu:n,isSubMenuOpen:a,isRTL:r=!1,subMenuRef:o,parentMenuRef:i,...c}=e;const u=Object(C.G)(),d=Object(C.G)({}),{setFocusedId:p}=Object(s.a)((e=>{let{actions:t}=e;return{setFocusedId:t.setFocusedId}})),f=e=>{const{x:t,y:n,width:a,height:r}=e.getBoundingClientRect(),{x:l,y:o}=d.current;if(void 0===l||void 0===o)return!0;return l<t-2||l>t+a+2||o<n-2||o>n+r+2},m=Object(C.x)((()=>{var e;u.current&&null!==(e=o.current)&&void 0!==e&&e.firstChild&&f(u.current)&&f(o.current.firstChild)&&n()}),200);Object(C.y)((()=>{if(a&&o.current){const t=(e=o.current,Array.from(e.querySelectorAll(V.a.join(", "))));t[0].focus(),p(t[0].id)}var e}),[a,o,p]),Object(C.y)((()=>{var e;const t=null===(e=i.current)||void 0===e?void 0:e.querySelector('[role="dialog"]');if(!a||!t)return;const n=e=>{d.current.x=e.clientX,d.current.y=e.clientY,m()};return t.addEventListener("pointermove",n),()=>{t.removeEventListener("pointermove",n)}}),[a,i,m]);const h=Object(C.s)((e=>{const{code:l}=e;[V.b.SPACE,V.b.ENTER].includes(l)?a?n():t():(!r&&V.b.RIGHT===l||(r&&V.b.LEFT)===l)&&(a||t())}),[t,n,a,r]);return Object(G.h)(u,{key:["enter","space","left","right"]},h,[h]),l.a.createElement(R,W({},c,{ref:u,onPointerEnter:t,onPointerLeave:()=>{d.current={},m()},onClick:e=>e.preventDefault(),"aria-haspopup":!0,"aria-expanded":a,dismissOnClick:!1}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Menu}));var a=n(0),r=n.n(a),l=n(1),o=n(3),i=n(6),C=n.n(i),c=n(12);const s=208,u=["up","down","left","right"],d=["esc","tab"],p=["space","enter"],f={ARROW_RIGHT:"ArrowRight",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown"},m=o.f.div.withConfig({displayName:"components__MenuContainer",componentId:"sc-6cd425-0"})((e=>{let{dropDownHeight:t=s,styleOverride:n="",theme:a,isAbsolute:r}=e;return Object(o.e)(["position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:calc(100% - 2px);max-height:","px;overflow-x:visible;overflow-y:auto;overscroll-behavior:none auto;z-index:2;margin-top:16px;margin-bottom:8px;padding:4px 0;background-color:",";border-radius:",";border:1px solid ",";",";",";",";"],t,a.colors.bg.primary,a.borders.radius.small,a.colors.divider.primary,r&&Object(o.e)(["position:absolute;top:0;left:0;right:0;"]),n,c.c.scrollbarCSS)}));m.propTypes={dropDownHeight:C.a.number,styleOverride:C.a.oneOfType([C.a.object,C.a.array])};var h=e=>null==e||""===e,g=n(35);var b=n(27),v=n(97);const y=o.f.ul.withConfig({displayName:"components__ListGroup",componentId:"sc-15nu3w2-0"})(["list-style-type:none;margin:6px 0;display:block;padding-inline-start:0;margin-block-start:0;margin-block-end:0;width:100%;"]),E=o.f.li.withConfig({displayName:"components__ListItemLabel",componentId:"sc-15nu3w2-1"})(["display:flex;padding:6px 2px 6px 8px;margin:4px 8px;align-items:center;"]),w=o.f.li.withConfig({displayName:"components__ListItem",componentId:"sc-15nu3w2-2"})(["position:relative;display:grid;grid-template-columns:32px 1fr;padding:6px 8px;margin:4px 8px;align-items:center;",""],(e=>{let{disabled:t,theme:n}=e;return Object(o.e)(["border-radius:",";cursor:",";",";&:hover{background-color:",";}"," svg{color:",";}& > span{grid-column-start:2;}"],n.borders.radius.small,t?"default":"pointer",c.c.focusableOutlineCSS(n.colors.border.focus),n.colors.bg.tertiary,t&&Object(o.e)(["pointer-events:none;span{color:",";}"],n.colors.fg.secondary),n.colors.fg.primary)})),O=Object(o.f)(v.a).withConfig({displayName:"components__ListItemDisplayText",componentId:"sc-15nu3w2-3"})((e=>{let{theme:t}=e;return Object(o.e)(["color:",";"],t.colors.fg.primary)})),M=Object(o.f)(v.a).withConfig({displayName:"components__ListItemLabelDisplayText",componentId:"sc-15nu3w2-4"})((e=>{let{theme:t}=e;return Object(o.e)(["color:",";"],t.colors.form.dropDownSubtitle)})),_=o.f.div.withConfig({displayName:"components__NoOptionsContainer",componentId:"sc-15nu3w2-5"})(["display:flex;align-items:center;justify-items:center;width:100%;"]),L=Object(o.f)(v.a).withConfig({displayName:"components__NoOptionsMessage",componentId:"sc-15nu3w2-6"})(["padding:6px 16px;margin:4px auto;color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.secondary}));var x=e=>{let{emptyText:t}=e;return t?r.a.createElement(_,null,r.a.createElement(L,{size:b.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL},t)):null},j=n(73),S=n(2),I=n(130);function A(){return(A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const k=Object(o.f)(I.a).withConfig({displayName:"defaultListItem__ActiveIcon",componentId:"sc-ywsfnt-0"})(["position:absolute;left:4px;top:50%;transform:translateY(-50%);"]);var T=Object(l.j)(((e,t)=>{let{option:n,isSelected:a,...l}=e;return r.a.createElement(w,A({},l,{ref:t,isSelected:a,disabled:n.disabled,"aria-disabled":n.disabled}),a&&r.a.createElement(k,{"data-testid":"dropdownMenuItem_active_icon","aria-label":Object(S.__)("Selected","web-stories"),width:32,height:32}),r.a.createElement(O,{forwardedAs:"span",size:b.b.TYPOGRAPHY.PRESET_SIZES.SMALL},n.label))}));var P=e=>{let{label:t}=e;return t?r.a.createElement(E,{id:`dropDownMenuLabel-${t}`,role:"presentation"},r.a.createElement(M,{forwardedAs:"span",size:b.b.TYPOGRAPHY.TEXT_SIZES.EXTRA_SMALL},t)):null};function Z(){return(Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var R=e=>{let{isManyGroups:t,label:n,listId:a,children:l,role:o="group"}=e;const i=t?{"aria-label":n}:{"aria-labelledby":a};return r.a.createElement(y,Z({role:o,isNested:t},i),n&&r.a.createElement(P,{label:n}),l)};var N=e=>{let{options:t,activeValue:n,listLength:a,listId:l,hasMenuRole:o,handleMenuItemSelect:i,renderItem:C,optionsRef:c}=e;const s=C||T,u=(null==t?void 0:t.length)>1;return t.map(((e,C)=>{let{label:d,group:p}=e;return r.a.createElement(R,{key:d||`menuGroup_${C}`,isManyGroups:u,label:d,listId:l,role:o?"menu":"listbox"},p.map(((e,l)=>{const u=e.value===n,d=Object(j.a)(t,C,l);return r.a.createElement(s,{key:e.value,"aria-posinset":d+1,"aria-selected":u,"aria-setsize":a,id:`dropDownMenuItem-${e.value}`,isSelected:u,onClick:t=>!e.disabled&&i(t,e),option:e,role:o?"menuitem":"option",ref:e=>c.current[d]=e,tabIndex:0})})))}))};const Menu=e=>{let{dropDownHeight:t,emptyText:n,menuStylesOverride:a,hasMenuRole:o,handleReturnToParent:i,isMenuFocused:C=!0,isRTL:c,options:s=[],listId:b,onMenuItemClick:v,onDismissMenu:y,renderItem:E,activeValue:w,menuAriaLabel:O,parentId:M,isAbsolute:_=!1}=e;const L=Object(l.G)(),j=Object(l.G)([]),S=Object(l.s)(((e,t)=>{let{value:n}=t;return v(e,n)}),[v]),{focusedIndex:I,listLength:A}=function(e){let{activeValue:t,handleMenuItemSelect:n,handleReturnToParent:a,isRTL:r,options:o=[],listRef:i,onDismissMenu:C}=e;const c=Object(l.C)((()=>o.flatMap((e=>e.group))),[o]),s=c.length,[m,b]=Object(l.I)(t),v=Object(l.s)((()=>c.findIndex((e=>{var t;return(null==e||null===(t=e.value)||void 0===t?void 0:t.toString())===m.toString()}))),[c,m]);Object(l.y)((()=>{h(m)||-1===v()&&b(null)}),[m,v]);const y=Object(l.C)((()=>h(m)?0:v()),[m,v]),E=Object(l.s)((e=>b(c[y+e].value)),[c,y]),w=Object(l.s)((e=>{let{key:t}=e;[f.ARROW_UP,r?f.ARROW_RIGHT:f.ARROW_LEFT].includes(t)&&0!==y?E(-1):[f.ARROW_DOWN,r?f.ARROW_LEFT:f.ARROW_RIGHT].includes(t)&&y<s-1?E(1):[f.ARROW_UP,r?f.ARROW_RIGHT:f.ARROW_LEFT].includes(t)&&0===y&&(null==a||a())}),[y,E,a,r,s]),O=Object(l.s)((e=>{var t;if(null===(t=c[y])||void 0===t?void 0:t.disabled)return()=>{};const a=m||c[y].value;return n(e,{value:a})}),[c,y,m,n]);return Object(g.h)(i,{key:p,shift:!0},O,[O]),Object(g.h)(i,{key:d},(e=>null==C?void 0:C(e)),[C]),Object(g.h)(i,{key:u},w,[w]),Object(l.z)(i,(e=>null==C?void 0:C(e)),[]),Object(l.C)((()=>({focusedValue:m,focusedIndex:y,listLength:s})),[y,m,s])}({activeValue:w,handleMenuItemSelect:S,isRTL:c,options:s,listRef:L,onDismissMenu:y,handleReturnToParent:i});return Object(l.y)((()=>{var e;const t=null==L?void 0:L.current;if(!t||null===I||!C)return;if(-1===I)return void t.scrollTo(0,0);const n=j.current[I];n&&(n.focus(),null===(e=t.scrollTo)||void 0===e||e.call(t,0,n.offsetTop-t.clientHeight/2))}),[I,C]),r.a.createElement(m,{id:b,dropDownHeight:t,styleOverride:a,ref:L,"aria-label":O,"aria-labelledby":M,"aria-expanded":"true",isAbsolute:_},s&&0!==s.length?r.a.createElement(N,{options:s,activeValue:w,listId:b,listLength:A,hasMenuRole:o,handleMenuItemSelect:S,renderItem:E,optionsRef:j}):r.a.createElement(x,{emptyText:n}))}},function(e,t,n){"use strict";var a={};n.r(a),n.d(a,"List",(function(){return T})),n.d(a,"Group",(function(){return P})),n.d(a,"GroupLabel",(function(){return Z})),n.d(a,"Option",(function(){return R})),n.d(a,"Selected",(function(){return N})),n.d(a,"NoResult",(function(){return D})),n.d(a,"OverflowEllipses",(function(){return z}));var r=n(0),l=n.n(r),o=n(1),i=n(3),C=n(12),c=n(112),s=n(46),u=n(157),d=n(2),p=n(138),f=n(133),m=n(169),h=n(28),g=n(50);function b(){return(b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const v=i.f.div.withConfig({displayName:"searchInput__SearchContainer",componentId:"sc-ewszoh-0"})(["position:relative;width:100%;"]),y=Object(i.e)(["position:absolute;display:flex;justify-content:center;align-items:center;top:50%;width:30px;padding:0;margin:0;transform:translateY(-50%);background-color:transparent;border:none;> svg{height:100%;width:auto;color:",";fill:",";}"],(e=>{let{theme:t}=e;return t.colors.fg.primary}),(e=>{let{theme:t}=e;return t.colors.fg.primary})),E=i.f.div.withConfig({displayName:"searchInput__SearchIconContainer",componentId:"sc-ewszoh-1"})([""," left:0;height:28px;"],y),w=Object(i.f)(m.a).attrs({variant:h.d.ICON}).withConfig({displayName:"searchInput__ClearButton",componentId:"sc-ewszoh-2"})(["",";right:0;height:20.5px;opacity:0.4;"],y),O=i.f.input.attrs({type:"search",role:"combobox","aria-autocomplete":"list"}).withConfig({displayName:"searchInput__Input",componentId:"sc-ewszoh-3"})(["width:100%;padding:6px 20px 6px 30px;border-radius:",";background:",";border:1px solid ",";color:",";"," &::-ms-clear{display:none;}&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{appearance:none;}&:focus{border-color:",";}"],(e=>{let{theme:t}=e;return t.borders.radius.small}),(e=>{let{theme:t}=e;return t.colors.bg.primary}),(e=>{let{theme:t}=e;return t.colors.border.defaultActive}),(e=>{let{theme:t}=e;return t.colors.fg.primary}),C.c.expandTextPreset(((e,t)=>{let{paragraph:n}=e,{SMALL:a}=t;return n[a]})),(e=>{let{theme:t}=e;return t.colors.border.focus}));var M=Object(o.j)((function SearchInput(e,t){let{isExpanded:n,onClose:a,value:r,onChange:i,focusFontListFirstOption:C=g.a,...c}=e;const s=Object(o.s)((e=>{e.stopPropagation();const{key:t}=e;"Escape"===t?a():"ArrowDown"===t&&C()}),[a,C]);return l.a.createElement(v,null,l.a.createElement(O,b({ref:t,"aria-expanded":n,value:r,onKeyDown:s,placeholder:Object(d.__)("Search","web-stories"),onChange:i},c)),l.a.createElement(E,null,l.a.createElement(p.a,null)),r.trim().length>0&&l.a.createElement(w,{onClick:()=>i({target:{value:""}})},l.a.createElement(f.a,null)))}));const _=e=>t=>e.filter((e=>{let{name:n}=e;return n.toLowerCase().startsWith(t.toLowerCase())})),L=e=>e.trim().length>=2,x=(e,t,n)=>e.slice(0,t).map((e=>e.options.length)).reduce(((e,t)=>e+t),0)+n,j=i.f.div.withConfig({displayName:"container__Container",componentId:"sc-n7ncmi-0"})(["position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;min-width:120px;z-index:2;background-color:",";border-radius:",";padding:5px;margin-top:16px;"," ",""],(e=>{let{theme:t}=e;return t.colors.bg.primary}),(e=>{let{theme:t}=e;return t.borders.radius.small}),(e=>{let{isInline:t}=e;return t&&Object(i.e)(["position:absolute;margin-top:0;padding:0;min-width:initial;width:initial;"])}),(e=>{let{theme:t,hasDropDownBorder:n}=e;return n&&Object(i.e)(["border:1px solid ",";"],t.colors.border.defaultNormal)}));var S=Object(o.j)((function OptionsContainer(e,t){let{onClose:n,isOpen:a,getOptionsByQuery:r,hasSearch:i,renderContents:C,isInline:c,hasDropDownBorder:s=!1}=e;const d=Object(o.G)(),[p,f]=Object(o.I)(""),[m,h]=Object(o.I)(null),[g,b]=Object(o.I)(!0),[v,y]=Object(o.I)(0);Object(o.z)(d,n,[n]);const E=Object(o.s)((e=>{let{target:{value:t}}=e;return f(t)}),[]),w=Object(o.s)((()=>{r(p).then(h)}),[r,p]);Object(o.y)((()=>{r&&L(p)?w():h(null)}),[r,p,w]),Object(o.y)((()=>{var e;a&&(null==t||null===(e=t.current)||void 0===e||e.focus())}),[a,t]);const O=Object(o.C)((()=>`list-${Object(u.a)()}`),[]);return l.a.createElement(j,{role:"dialog",ref:d,isInline:c,hasDropDownBorder:s},i&&l.a.createElement(M,{ref:t,value:p,onChange:E,onClose:n,isExpanded:g,focusFontListFirstOption:()=>y((e=>e+1)),"aria-owns":O}),C({searchKeyword:p,setIsExpanded:b,trigger:v,queriedOptions:m,listId:O}))})),I=n(97),A=n(27),k=n(109);const T=i.f.div.withConfig({displayName:"styled__List",componentId:"sc-13zyw9u-0"})(["width:100%;overflow-x:visible;overflow-y:auto;overscroll-behavior:none auto;max-height:305px;padding:4px;margin:10px 0 0 0;font-size:14px;text-align:left;list-style:none;border-radius:",";",""],(e=>{let{theme:t}=e;return t.borders.radius.small}),C.c.focusableOutlineCSS),P=i.f.ul.withConfig({displayName:"styled__Group",componentId:"sc-13zyw9u-1"})(["margin:0;"]),Z=i.f.li.withConfig({displayName:"styled__GroupLabel",componentId:"sc-13zyw9u-2"})(["background:transparent;padding:8px;margin:0;"]),R=i.f.li.attrs((e=>{let{fontFamily:t}=e;return{style:{fontFamily:t}}})).withConfig({displayName:"styled__Option",componentId:"sc-13zyw9u-3"})(["display:flex;align-items:center;position:relative;padding:8px 16px;margin:6px 0 0 0;line-height:1;cursor:pointer;background-clip:padding-box;color:",";border-radius:",";"," ",":first-of-type{margin-top:0;}:hover{background-color:",";}:focus{outline:none;}"],(e=>{let{theme:t}=e;return t.colors.fg.primary}),(e=>{let{theme:t}=e;return t.borders.radius.small}),C.c.expandTextPreset(((e,t)=>{let{label:n}=e,{SMALL:a}=t;return n[a]})),C.c.focusableOutlineCSS,(e=>{let{theme:t}=e;return t.colors.interactiveBg.tertiaryHover})),N=Object(i.f)(k.a).withConfig({displayName:"styled__Selected",componentId:"sc-13zyw9u-4"})(["width:16px;min-width:16px;height:auto;margin-right:4px;color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.primary})),D=Object(i.f)(I.a).attrs((()=>({size:A.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}))).withConfig({displayName:"styled__NoResult",componentId:"sc-13zyw9u-5"})(["width:100%;padding:13px 11px;margin:0;text-align:center;color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.secondary})),z=i.f.span.withConfig({displayName:"styled__OverflowEllipses",componentId:"sc-13zyw9u-6"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"]);function B(){return(B=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}var F=Object(o.j)((function DefaultRenderer(e,t){let{option:n,value:a,...r}=e;return l.a.createElement(R,B({key:n.id},r,{ref:t}),a===n.id&&l.a.createElement(N,{"aria-label":Object(d.__)("Selected","web-stories")}),l.a.createElement(z,null,n.name))}));const H=Object(i.f)(I.a).attrs({forwardedAs:"span",size:A.b.TYPOGRAPHY.PRESET_SIZES.X_SMALL}).withConfig({displayName:"list__StyledLabel",componentId:"sc-1c2a66-0"})(["color:",";"],(e=>{let{theme:t}=e;return t.colors.fg.tertiary})),U=Object(o.j)((function OptionList(e,t){let{keyword:n="",value:a="",onSelect:r=g.a,onClose:i=g.a,onExpandedChange:C=g.a,focusTrigger:c=0,options:s=[],primaryOptions:p,primaryLabel:f,priorityOptionGroups:m=[],searchResultsLabel:h,renderer:b=F,onObserve:v,focusSearch:y=g.a,listId:E}=e;const w=b,O=Object(o.G)([]),[M,j]=Object(o.I)(-1),S=Object(o.G)([]),I=Object(o.C)((()=>L(n)&&s?[{label:h,options:_(s)(n)}]:[...null!=m&&m.length?m:[],{label:f,options:p}]),[n,s,m,p,f,h]),A=Object(o.C)((()=>new window.IntersectionObserver((e=>{if(v){const t=e.filter((e=>e.isIntersecting)).map((e=>e.target.dataset.option));S.current=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return[...new Set(e.concat(n))]}(S.current,...t),v(S.current)}}),{root:t.current,rootMargin:"60px"})),[v,t]);Object(o.B)((()=>{const e=O.current;return v&&e.forEach((e=>e&&A.observe(e))),()=>{v&&e.forEach((e=>e&&A.unobserve(e))),O.current=[]}}),[A,v,I,b]);const k=Object(o.C)((()=>I.flatMap((e=>{let{options:t}=e;return t}))),[I]),R=Object(o.s)((e=>{const{key:t}=e;e.stopPropagation(),e.preventDefault(),"Tab"===t&&e.shiftKey&&y(),"Escape"===t?i():"Enter"===t?k[M]&&r(k[M]):"ArrowUp"===t?j((e=>Math.max(0,e-1))):"ArrowDown"===t&&j((e=>Math.min(k.length-1,e+1)))}),[M,k,i,r,y]);Object(o.z)(t,(()=>j(-1)),[]),Object(o.y)((()=>{const e=t.current;if(!e)return;if(-1===M)return void e.scrollTo(0,0);const n=O.current[M];n&&(n.focus(),e.scrollTo(0,n.offsetTop-e.clientHeight/2))}),[M,k,n,i,t]);const N=k.length>0;return Object(o.y)((()=>C(N)),[C,N]),Object(o.y)((()=>{c>0&&j(0)}),[c]),k.length<=0?l.a.createElement(D,null,Object(d.__)("No matches found","web-stories")):l.a.createElement(T,{ref:t,tabIndex:0,id:E,role:"listbox",onKeyDown:R,"aria-label":Object(d.__)("Option List Selector","web-stories"),"aria-required":!1},I.map(((e,t)=>{const n=`group-${Object(u.a)()}`;return e.options.length>0&&l.a.createElement(P,{key:n,role:"group","aria-labelledby":n},e.label&&l.a.createElement(Z,{id:n,role:"presentation"},l.a.createElement(H,null,e.label)),e.options.map(((e,n)=>l.a.createElement(w,{key:e.id||"",role:"option",tabIndex:"-1","aria-selected":a===e.id,"aria-posinset":x(I,t,n),"aria-setsize":k.length,"data-option":e.id,onClick:()=>r(e),ref:e=>O.current[x(I,t,n)]=e,option:e,value:a}))))})))}));var G=Object(o.m)(U);function V(){return(V=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const W=Object(i.e)(["",";"],(e=>{let{theme:t}=e;return C.c.focusableOutlineCSS(t.colors.border.focus,t.colors.bg.secondary)})),$=i.f.div.withConfig({displayName:"datalist__Container",componentId:"sc-quu1n3-0"})(["display:flex;flex-direction:column;flex-grow:1;"]);var Y=Object(o.j)((function Datalist(e,t){let{onChange:n,disabled:a=!1,selectedId:r,options:i,hasSearch:C=!1,getOptionsByQuery:u,onObserve:d,primaryOptions:p,primaryLabel:f,priorityOptionGroups:m,searchResultsLabel:h,renderer:g,activeItemRenderer:b,isInline:v=!1,dropDownLabel:y="",highlightStylesOverride:E,hasDropDownBorder:w=!1,zIndex:O,...M}=e;const _=Object(o.G)(),L=Object(o.G)();if(!i&&!u)throw new Error("Dropdown initiated with invalid params: options or getOptionsByQuery has to be set");C||(p=i);const x=Object(o.G)(),[j,I]=Object(o.I)(!1),A=Object(o.s)((()=>{var e;I(!1),null===(e=x.current)||void 0===e||e.focus()}),[x]),k=Object(o.s)((()=>I((e=>!e))),[]),T=Object(o.x)(A,100),P=Object(o.s)((e=>{var t;n(e),I(!1),null===(t=x.current)||void 0===t||t.focus()}),[n,x]),Z=Object(o.s)((()=>{var e;null===(e=_.current)||void 0===e||e.focus()}),[]),R=l.a.createElement(S,{ref:_,isOpen:j,onClose:T,getOptionsByQuery:u,hasSearch:C,isInline:v,hasDropDownBorder:w,renderContents:e=>{let{searchKeyword:t,setIsExpanded:n,trigger:a,queriedOptions:o,listId:C}=e;return l.a.createElement(G,{ref:L,listId:C,value:r,keyword:t,onSelect:P,onClose:T,onExpandedChange:n,focusTrigger:a,onObserve:d,options:i||o,primaryOptions:p,primaryLabel:f,priorityOptionGroups:m,searchResultsLabel:h,focusSearch:Z,renderer:g})}}),N=Object(o.s)((e=>{"function"==typeof t?t(e):t&&(t.current=e),x.current=e}),[t]),D=p.find((e=>{let{id:t}=e;return t===r}));return l.a.createElement($,null,l.a.createElement(c.a,V({"aria-pressed":j,"aria-haspopup":!0,"aria-expanded":j,ref:N,activeItemLabel:null==D?void 0:D.name,activeItemRenderer:b,dropDownLabel:y,onSelectClick:k,selectButtonStylesOverride:E||W},M)),j&&!a&&v&&R,!a&&!v&&l.a.createElement(s.a,{anchor:x,isOpen:j,fillWidth:240,zIndex:O},R))}));t.a={DropDown:Y,...a}},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var a=n(65),r=n(13),l=n(10);function o(e,t){Object(l.a)(2,arguments);var n=Object(r.a)(e),a=Object(r.a)(t),o=n.getFullYear()-a.getFullYear(),i=n.getMonth()-a.getMonth();return 12*o+i}function i(e){Object(l.a)(1,arguments);var t=Object(r.a)(e);return t.setHours(23,59,59,999),t}function C(e){Object(l.a)(1,arguments);var t=Object(r.a)(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function c(e){Object(l.a)(1,arguments);var t=Object(r.a)(e);return i(t).getTime()===C(t).getTime()}function s(e,t){Object(l.a)(2,arguments);var n,i=Object(r.a)(e),C=Object(r.a)(t),s=Object(a.a)(i,C),u=Math.abs(o(i,C));if(u<1)n=0;else{1===i.getMonth()&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-s*u);var d=Object(a.a)(i,C)===-s;c(Object(r.a)(e))&&1===u&&1===Object(a.a)(e,C)&&(d=!1),n=s*(u-Number(d))}return 0===n?0:n}var u=n(154),d=n(93),p=n(94),f=n(45),m=1440,h=43200;function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(l.a)(2,arguments);var o=n.locale||d.a;if(!o.formatDistance)throw new RangeError("locale must contain formatDistance property");var i=Object(a.a)(e,t);if(isNaN(i))throw new RangeError("Invalid time value");var C,c,g=Object(p.a)(n);g.addSuffix=Boolean(n.addSuffix),g.comparison=i,i>0?(C=Object(r.a)(t),c=Object(r.a)(e)):(C=Object(r.a)(e),c=Object(r.a)(t));var b,v=Object(u.a)(c,C),y=(Object(f.a)(c)-Object(f.a)(C))/1e3,E=Math.round((v-y)/60);if(E<2)return n.includeSeconds?v<5?o.formatDistance("lessThanXSeconds",5,g):v<10?o.formatDistance("lessThanXSeconds",10,g):v<20?o.formatDistance("lessThanXSeconds",20,g):v<40?o.formatDistance("halfAMinute",null,g):v<60?o.formatDistance("lessThanXMinutes",1,g):o.formatDistance("xMinutes",1,g):0===E?o.formatDistance("lessThanXMinutes",1,g):o.formatDistance("xMinutes",E,g);if(E<45)return o.formatDistance("xMinutes",E,g);if(E<90)return o.formatDistance("aboutXHours",1,g);if(E<m){var w=Math.round(E/60);return o.formatDistance("aboutXHours",w,g)}if(E<2520)return o.formatDistance("xDays",1,g);if(E<h){var O=Math.round(E/m);return o.formatDistance("xDays",O,g)}if(E<86400)return b=Math.round(E/h),o.formatDistance("aboutXMonths",b,g);if((b=s(c,C))<12){var M=Math.round(E/h);return o.formatDistance("xMonths",M,g)}var _=b%12,L=Math.floor(b/12);return _<3?o.formatDistance("aboutXYears",L,g):_<9?o.formatDistance("overXYears",L,g):o.formatDistance("almostXYears",L+1,g)}function b(e,t){return Object(l.a)(1,arguments),g(e,Date.now(),t)}},function(e,t,n){"use strict";var a=n(22),r=n(62),l=n(53);n(29);function o(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var i=n(0),C=n.n(i),c=n(156),CSSTransition_removeClass=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return a=t,void((n=e).classList?n.classList.remove(a):"string"==typeof n.className?n.className=o(n.className,a):n.setAttribute("class",o(n.className&&n.className.baseVal||"",a)));var n,a}))},s=function(e){function CSSTransition(){for(var t,n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return(t=e.call.apply(e,[this].concat(a))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var a=t.resolveArguments(e,n),r=a[0],l=a[1];t.removeClasses(r,"exit"),t.addClass(r,l?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var a=t.resolveArguments(e,n),r=a[0],l=a[1]?"appear":"enter";t.addClass(r,l,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var a=t.resolveArguments(e,n),r=a[0],l=a[1]?"appear":"enter";t.removeClasses(r,l),t.addClass(r,l,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,a="string"==typeof n,r=a?""+(a&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:a?r+"-active":n[e+"Active"],doneClassName:a?r+"-done":n[e+"Done"]}},t}Object(l.a)(CSSTransition,e);var t=CSSTransition.prototype;return t.addClass=function(e,t,n){var a=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(a+=" "+r),"active"===n&&e&&e.scrollTop,a&&(this.appliedClasses[t][n]=a,function(e,t){e&&t&&t.split(" ").forEach((function(t){return a=t,void((n=e).classList?n.classList.add(a):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,a)||("string"==typeof n.className?n.className=n.className+" "+a:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+a)));var n,a}))}(e,a))},t.removeClasses=function(e,t){var n=this.appliedClasses[t],a=n.base,r=n.active,l=n.done;this.appliedClasses[t]={},a&&CSSTransition_removeClass(e,a),r&&CSSTransition_removeClass(e,r),l&&CSSTransition_removeClass(e,l)},t.render=function(){var e=this.props,t=(e.classNames,Object(r.a)(e,["classNames"]));return C.a.createElement(c.a,Object(a.a)({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},CSSTransition}(C.a.Component);s.defaultProps={classNames:""},s.propTypes={};t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(152);function r(e,t,n){var a=function(e,t,n){if(n&&!n.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return a.formatToParts?function(e,t){var n=e.formatToParts(t);return n[n.length-1].value}(a,t):function(e,t){var n=e.format(t).replace(/\u200E/g,""),a=/ [\w-+ ]+$/.exec(n);return a?a[0].substr(1):""}(a,t)}var l=n(54),o=6e4;function i(e,t){for(var n=e<0?"-":"",a=Math.abs(e).toString();a.length<t;)a="0"+a;return n+a}function C(e,t){var n=t||"",a=e>0?"-":"+",r=Math.abs(e);return a+i(Math.floor(r/60),2)+n+i(r%60,2)}function c(e,t){return e%60==0?(e>0?"-":"+")+i(Math.abs(e)/60,2):C(e,t)}var s={X:function(e,t,n,a){var r=a._originalDate||e,i=a.timeZone?Object(l.a)(a.timeZone,r,!0)/o:r.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return c(i);case"XXXX":case"XX":return C(i);case"XXXXX":case"XXX":default:return C(i,":")}},x:function(e,t,n,a){var r=a._originalDate||e,i=a.timeZone?Object(l.a)(a.timeZone,r,!0)/o:r.getTimezoneOffset();switch(t){case"x":return c(i);case"xxxx":case"xx":return C(i);case"xxxxx":case"xxx":default:return C(i,":")}},O:function(e,t,n,a){var r=a._originalDate||e,c=a.timeZone?Object(l.a)(a.timeZone,r,!0)/o:r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+function(e,t){var n=e>0?"-":"+",a=Math.abs(e),r=Math.floor(a/60),l=a%60;if(0===l)return n+String(r);var o=t||"";return n+String(r)+o+i(l,2)}(c,":");case"OOOO":default:return"GMT"+C(c,":")}},z:function(e,t,n,a){var l=a._originalDate||e;switch(t){case"z":case"zz":case"zzz":return r("short",l,a);case"zzzz":default:return r("long",l,a)}}},u=n(74),d=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function p(e,t,n){var r=String(t),l=n||{},o=r.match(d);if(o){var i=Object(u.a)(e,l);r=o.reduce((function(e,t){if("'"===t[0])return e;var n=e.indexOf(t),a="'"===e[n-1],r=e.replace(t,"'"+s[t[0]](i,t,null,l)+"'");return a?r.substring(0,n-1)+r.substring(n+1):r}),r)}return Object(a.a)(e,r,l)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(91),r=n(24),l=n(13),o=n(10);function i(e,t){Object(o.a)(2,arguments);var n=Object(l.a)(e),a=Object(r.a)(t);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}function C(e,t){Object(o.a)(2,arguments);var n=Object(r.a)(t);return i(e,-n)}function c(e){return Object(o.a)(1,arguments),Object(a.a)(e,C(Date.now(),1))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return N}));var a=n(0),r=n.n(a),l=n(1),o=n(6),i=n.n(o),C=n(3),c=n(558),s=n(551),u=n(157),d=n(50),p=n(532),f=n(19),m=n(15),h=n(2),g=n(27),b=n(169),v=n(130),y=n(135),E=n(133),w=n(97),O=n(85),M=n(36);function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}const L=C.f.div.withConfig({displayName:"snackbarMessage__MessageContainer",componentId:"sc-fjv091-0"})(["display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:10px 16px;margin-top:20px;background-color:",";color:",";border:",";border-radius:",";z-index:",";pointer-events:auto;"],(e=>{let{theme:t}=e;return t.colors.inverted.bg.primary}),(e=>{let{theme:t}=e;return t.colors.inverted.fg.primary}),(e=>{let{theme:t}=e;return`1px solid ${Object(m.c)(t.colors.standard.white,.24)}`}),(e=>{let{theme:t}=e;return t.borders.radius.medium}),(e=>{let{customZIndex:t}=e;return t||M.c}));L.propTypes={customZIndex:i.a.number};const x=Object(C.f)(w.a).withConfig({displayName:"snackbarMessage__Message",componentId:"sc-fjv091-1"})(["color:",";max-width:430px;padding-right:",";"],(e=>{let{theme:t}=e;return t.colors.inverted.fg.primary}),(e=>{let{hasAction:t,hasThumbnail:n}=e;return n?"16px":t?"52px":"0px"})),j=C.f.div.withConfig({displayName:"snackbarMessage__ActionContainer",componentId:"sc-fjv091-2"})(["display:flex;align-items:center;justify-content:flex-end;"]),S=C.f.div.withConfig({displayName:"snackbarMessage__ThumbnailWrapper",componentId:"sc-fjv091-3"})(["position:relative;margin-left:16px;margin-right:","px;"],(e=>{let{hasAction:t}=e;return t?16:0})),I=C.f.img.withConfig({displayName:"snackbarMessage__Thumbnail",componentId:"sc-fjv091-4"})(["max-height:45px;max-width:45px;min-height:","px;min-width:","px;background-color:",";border-radius:",";",";"],30,30,(e=>{let{theme:t}=e;return t.colors.fg.tertiary}),(e=>{let{theme:t}=e;return t.borders.radius.small}),(e=>{let{theme:t,status:n}=e;return n===M.d.SUCCESS?Object(C.e)(["border:1px solid ",";"],t.colors.green[20]):n===M.d.ERROR?Object(C.e)(["border:1px solid ",";"],t.colors.red[20]):void 0})),A=C.f.div.withConfig({displayName:"snackbarMessage__ThumbnailIcon",componentId:"sc-fjv091-5"})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);",";svg{width:100%;height:auto;}"],(e=>{let{theme:t,status:n}=e;return n===M.d.SUCCESS?Object(C.e)(["width:30px;color:",";"],t.colors.fg.positive):n===M.d.ERROR?Object(C.e)(["width:20px;color:",";"],t.colors.fg.negative):void 0})),k=Object(C.f)(b.a).withConfig({displayName:"snackbarMessage__ActionButton",componentId:"sc-fjv091-6"})(["align-self:flex-end;min-width:1px;height:2em;padding:0;color:",";font-weight:",";"," &:hover,&:active{color:",";}"],(e=>{let{theme:t}=e;return t.colors.inverted.fg.linkNormal}),(e=>{let{theme:t}=e;return t.typography.weight.bold}),(e=>{let{theme:t}=e;return Object(O.b)(t.colors.border.focus,t.colors.inverted.bg.primary)}),(e=>{let{theme:t}=e;return t.colors.inverted.fg.linkHover})),T=Object(C.f)(b.a).withConfig({displayName:"snackbarMessage__CloseButton",componentId:"sc-fjv091-7"})(["height:2em;padding:0;margin-left:16px;color:",";"," svg{height:32px;}"],(e=>{let{theme:t}=e;return t.colors.inverted.fg.primary}),(e=>{let{theme:t}=e;return Object(O.b)(t.colors.border.focus,t.colors.inverted.bg.primary)})),SnackbarMessage=e=>{let{"aria-label":t,actionLabel:n,onAction:a=d.a,onDismiss:o=d.a,isPreventAutoDismiss:i,isPreventActionDismiss:C,thumbnail:c,message:s,removeMessageTimeInterval:u,showCloseButton:p,placement:f="bottom",actionHelpText:m,...b}=e;const w=Object(l.G)();w.current=i?d.a:o;const O=Object(l.G)("number"==typeof u&&u<=M.a&&u>=M.b?u:M.a);Object(l.y)((()=>{if(!w.current)return d.a;const e=setTimeout((()=>w.current()),O.current);return()=>clearTimeout(e)}),[]);const P=Object(l.s)((e=>{a(e),!C&&o()}),[a,o,C]),Z=Boolean(n),R=Boolean(n);return r.a.createElement(L,_({role:"alert",hasAction:Z,placement:f},b),r.a.createElement(x,{"aria-label":t,size:g.b.TYPOGRAPHY.PRESET_SIZES.SMALL,hasAction:Z,hasThumbnail:R},s),c&&r.a.createElement(S,{hasAction:Z},r.a.createElement(I,{src:c.src,alt:c.alt,status:c.status}),r.a.createElement(A,{status:c.status},c.status===M.d.SUCCESS&&r.a.createElement(v.a,null),c.status===M.d.ERROR&&r.a.createElement(y.a,null))),(n||p)&&r.a.createElement(j,null,n&&r.a.createElement(k,{onClick:P},n),p&&r.a.createElement(T,{onClick:o,"aria-label":Object(h.__)("Close","web-stories"),tabIndex:-1},r.a.createElement(E.a,{"aria-hidden":!0}))))};function P(){return(P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}SnackbarMessage.defaultProps={showCloseButton:!0};const Z=C.f.div.withConfig({displayName:"snackbarContainer__StyledContainer",componentId:"sc-7yig0q-0"})(["position:fixed;top:",";bottom:",";",";margin-bottom:33px;display:flex;flex-direction:column;align-items:",";width:100%;z-index:2147483647;pointer-events:none;"],(e=>{let{placement:t}=e;return 0===t.indexOf("top")?0:"inherit"}),(e=>{let{placement:t}=e;return 0===t.indexOf("bottom")?0:"inherit"}),(function(e){let{placement:t}=e;switch(t){case"top":case"bottom":return"\n left: calc(50% + 4rem);\n transform: translateX(-50%);\n width: auto;\n ";case"top-left":case"bottom-left":return"left: 60px;";case"top-right":case"bottom-right":return"right: 60px;";default:return"left: 60px;"}}),(e=>{let{alignItems:t}=e;return t}));Z.propTypes={alignItems:i.a.string},Z.defaultProps={alignItems:"center"};const R=C.f.div.withConfig({displayName:"snackbarContainer__ChildContainer",componentId:"sc-7yig0q-1"})(["&.react-snackbar-alert__snackbar-container-enter{max-height:0px;opacity:0;transition:all 300ms ease-out;}&.react-snackbar-alert__snackbar-container-enter-active{opacity:1;max-height:100px;transition:all 300ms ease-out;}&.react-snackbar-alert__snackbar-container-exit{opacity:1;transition:all 300ms ease-out;}&.react-snackbar-alert__snackbar-container-exit-active{opacity:0;transition:all 300ms ease-out;}"]),N={Container:e=>{let{component:t=SnackbarMessage,notifications:n=[],onRemove:a=d.a,placement:o=f.a.BOTTOM,max:i=10}=e;const C=Object(p.a)("assertive"),m=Object(l.G)(new Set),h=Object(l.C)((()=>n.map((()=>Object(u.a)()))),[n]),g=0===o.indexOf("top")?[...n].reverse():n,b=Object(l.s)((e=>()=>{var t;a(e),null===(t=e.onDismiss)||void 0===t||t.call(e)}),[a]);Object(l.y)((()=>{"number"==typeof i&&n.length>i&&setTimeout((()=>{a(n.slice(0,n.length-i))}),300)}),[i,n,a]),Object(l.y)((()=>{n.forEach((e=>{if(!m.current.has(e)){const t=`${e.message} ${e.actionHelpText||""}`.trim();C(t),m.current.add(e)}}))}),[n,C]);const v=Object(l.G)();return r.a.createElement(Z,{placement:o},r.a.createElement(c.a,null,g.map(((e,n)=>{const{actionLabel:a,dismissible:l,message:i,onAction:C,preventActionDismiss:c,preventAutoDismiss:u,timeout:d,...p}=e;return r.a.createElement(s.a,{in:!0,key:e.id||h[n],timeout:300,unmountOnExit:!0,nodeRef:v,classNames:"react-snackbar-alert__snackbar-container"},r.a.createElement(R,{ref:v,placement:o},r.a.createElement(t,P({},p,{"aria-hidden":!0,placement:o,onDismiss:b(e),onAction:C,actionLabel:a,message:i,showCloseButton:l,removeMessageTimeInterval:d,isPreventAutoDismiss:u,isPreventActionDismiss:c}))))}))))},Message:SnackbarMessage}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(24),r=n(88),l=n(10);function o(e,t){Object(l.a)(2,arguments);var n=Object(a.a)(t);return Object(r.a)(e,6e4*n)}function i(e,t){Object(l.a)(2,arguments);var n=Object(a.a)(t);return o(e,-n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(13),r=n(45),l=n(64),o=n(10),i=864e5;function C(e,t){Object(o.a)(2,arguments);var n=Object(l.a)(e),a=Object(l.a)(t),C=n.getTime()-Object(r.a)(n),c=a.getTime()-Object(r.a)(a);return Math.round((C-c)/i)}function c(e,t){var n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function s(e,t){Object(o.a)(2,arguments);var n=Object(a.a)(e),r=Object(a.a)(t),l=c(n,r),i=Math.abs(C(n,r));n.setDate(n.getDate()-l*i);var s=Number(c(n,r)===-l),u=l*(i-s);return 0===u?0:u}},function(e,t,n){"use strict";var a=n(1),r=n(35);function l(e){var t;const n=null==e||null===(t=e.querySelectorAll(["button","a"]))||void 0===t?void 0:t[0];n&&n.focus()}function o(e,t,n,a){const r=a?-1:1;return e===t?r:e===n?-1*r:0}function i(e,t){let n,a=0;for(const t of e.children){const{x:e}=t.getBoundingClientRect();if(null!=n&&e<n)break;n=e,a++}return{rows:Math.ceil(t/a),columns:a}}function C(e,t){return Math.ceil((e+1)/t)}function c(e,t){return e%t+1}function s(e){let{row:t,column:n,numRows:a,numColumns:r,numItems:l}=e;if(t>a||t<=0||n>r||n<=0)return-1;const o=r*(t-1)+(n-1);return o>=l?l-1:o}t.a=function(e){const{currentItemId:t,items:n,containerRef:u,gridRef:d,itemRefs:p,isRTL:f,arrangeItem:m}=e,[h,g]=Object(a.I)(),b=Object(a.C)((()=>n.map((e=>{let{id:t}=e;return t}))),[n]);Object(a.y)((()=>{g(t)}),[t]),Object(r.h)(u,{key:["up","down","left","right"]},(e=>{let{key:t}=e;switch(t){case"ArrowLeft":case"ArrowRight":{var n;const e=o(t,"ArrowRight","ArrowLeft",f);if(0===e)return;const a=b.indexOf(h)+e;if(a<0||a===b.length)return;const r=b[a];g(r);l(null==p||null===(n=p.current)||void 0===n?void 0:n[r]);break}case"ArrowUp":case"ArrowDown":{var a;const{rows:e,columns:n}=i(null==d?void 0:d.current,b.length),r=b.indexOf(h),o="ArrowDown"===t?1:-1,u=s({row:C(r,n)+o,column:c(r,n),numRows:e,numColumns:n,numItems:b.length});if(u<0)return;const f=b[u];g(f);l(null==p||null===(a=p.current)||void 0===a?void 0:a[f]);break}}}),[h,f,b,p,d,t]),Object(r.h)(u,{key:["mod+up","mod+down","mod+left","mod+right"],shift:!0},(e=>{const{key:t,shiftKey:n}=e;switch(e.preventDefault(),t){case"ArrowLeft":case"ArrowRight":{const e=o(t,"ArrowRight","ArrowLeft",f);if(0===e)return;const r=b.indexOf(h);let i=r;n?i=e<0?0:b.length-1:i+=e;if(i!==r&&i>=0&&i<=b.length-1){var a;m&&m(h,i);l(null==p||null===(a=p.current)||void 0===a?void 0:a[b[i]])}break}case"ArrowUp":case"ArrowDown":{const{rows:e,columns:n}=i(d.current,b.length),a=b.indexOf(h),o="ArrowDown"===t?1:-1,u=s({row:C(a,n)+o,column:c(a,n),numRows:e,numColumns:n,numItems:b.length});if(u<0)return;if(u!==a&&u>=0&&u<=b.length-1){var r;m&&m(h,u);l(null==p||null===(r=p.current)||void 0===r?void 0:r[b[u]])}break}}}),[t,b,f,d,p,h,m])}},function(e,t,n){"use strict";var a=n(62),r=n(22),l=n(84),o=n(53),i=(n(29),n(0)),C=n.n(i),c=n(63);function s(e,t){var n=Object.create(null);return e&&i.Children.map(e,(function(e){return e})).forEach((function(e){n[e.key]=function(e){return t&&Object(i.isValidElement)(e)?t(e):e}(e)})),n}function u(e,t,n){return null!=n[t]?n[t]:e.props[t]}function d(e,t,n){var a=s(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var a,r=Object.create(null),l=[];for(var o in e)o in t?l.length&&(r[o]=l,l=[]):l.push(o);var i={};for(var C in t){if(r[C])for(a=0;a<r[C].length;a++){var c=r[C][a];i[r[C][a]]=n(c)}i[C]=n(C)}for(a=0;a<l.length;a++)i[l[a]]=n(l[a]);return i}(t,a);return Object.keys(r).forEach((function(l){var o=r[l];if(Object(i.isValidElement)(o)){var C=l in t,c=l in a,s=t[l],d=Object(i.isValidElement)(s)&&!s.props.in;!c||C&&!d?c||!C||d?c&&C&&Object(i.isValidElement)(s)&&(r[l]=Object(i.cloneElement)(o,{onExited:n.bind(null,o),in:s.props.in,exit:u(o,"exit",e),enter:u(o,"enter",e)})):r[l]=Object(i.cloneElement)(o,{in:!1}):r[l]=Object(i.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:u(o,"exit",e),enter:u(o,"enter",e)})}})),r}var p=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},f=function(e){function TransitionGroup(t,n){var a,r=(a=e.call(this,t,n)||this).handleExited.bind(Object(l.a)(a));return a.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},a}Object(o.a)(TransitionGroup,e);var t=TransitionGroup.prototype;return t.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},t.componentWillUnmount=function(){this.mounted=!1},TransitionGroup.getDerivedStateFromProps=function(e,t){var n,a,r=t.children,l=t.handleExited;return{children:t.firstRender?(n=e,a=l,s(n.children,(function(e){return Object(i.cloneElement)(e,{onExited:a.bind(null,e),in:!0,appear:u(e,"appear",n),enter:u(e,"enter",n),exit:u(e,"exit",n)})}))):d(e,r,l),firstRender:!1}},t.handleExited=function(e,t){var n=s(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var n=Object(r.a)({},t.children);return delete n[e.key],{children:n}})))},t.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=Object(a.a)(e,["component","childFactory"]),l=this.state.contextValue,o=p(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?C.a.createElement(c.a.Provider,{value:l},o):C.a.createElement(c.a.Provider,{value:l},C.a.createElement(t,r,o))},TransitionGroup}(C.a.Component);f.propTypes={},f.defaultProps={component:"div",childFactory:function(e){return e}};t.a=f},,,,,,,,,,function(e,t,n){"use strict";var a=n(68);t.a=function(e){let{width:t,height:n,posterGenerated:r,posterWidth:l,posterHeight:o}=e;return r&&l&&o?{width:l,height:o}:t||n?{width:t,height:n}:{width:a.h,height:a.d}}},function(e,t,n){"use strict";var a=n(228);var src_normalizeResourceSizes=function(e){const t={};if(!e)return t;for(const n of Object.keys(e)){const a=e[n];t[n]={...a,width:Number(a.width),height:Number(a.height)}}return t};t.a=function(e){let{baseColor:t,blurHash:n,type:r,mimeType:l,creationDate:o,src:i,width:C,height:c,poster:s,posterId:u,id:d,length:p,lengthFormatted:f,alt:m,sizes:h,attribution:g,output:b,isPlaceholder:v=!1,isOptimized:y=!1,isMuted:E=!1,isExternal:w=!1,trimData:O,needsProxy:M=!1}=e;return{baseColor:t,blurHash:n,type:r||Object(a.a)(l),mimeType:l,creationDate:o,src:i,width:Number(C||0),height:Number(c||0),poster:s,posterId:u,id:d,length:p,lengthFormatted:f,alt:m,sizes:src_normalizeResourceSizes(h),attribution:g,output:b,isPlaceholder:v,isOptimized:y,isMuted:E,isExternal:w,trimData:O,needsProxy:M}}}]);
includes/vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit92c02fe0dbc1d4a1c6b3f3200f100ec1::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit485695153f56843a6757aa6fce49fe93::getLoader();
includes/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit92c02fe0dbc1d4a1c6b3f3200f100ec1
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit92c02fe0dbc1d4a1c6b3f3200f100ec1
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit92c02fe0dbc1d4a1c6b3f3200f100ec1', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Google_Web_Stories_Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInit92c02fe0dbc1d4a1c6b3f3200f100ec1', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Google_Web_Stories_Composer\Autoload\ComposerStaticInit92c02fe0dbc1d4a1c6b3f3200f100ec1::getInitializer($loader));
34
  } else {
35
  $classMap = require __DIR__ . '/autoload_classmap.php';
36
  if ($classMap) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit485695153f56843a6757aa6fce49fe93
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit485695153f56843a6757aa6fce49fe93', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Google_Web_Stories_Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit485695153f56843a6757aa6fce49fe93', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Google_Web_Stories_Composer\Autoload\ComposerStaticInit485695153f56843a6757aa6fce49fe93::getInitializer($loader));
34
  } else {
35
  $classMap = require __DIR__ . '/autoload_classmap.php';
36
  if ($classMap) {
includes/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Google_Web_Stories_Composer\Autoload;
6
 
7
- class ComposerStaticInit92c02fe0dbc1d4a1c6b3f3200f100ec1
8
  {
9
  public static $classMap = array (
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -176,7 +176,7 @@ class ComposerStaticInit92c02fe0dbc1d4a1c6b3f3200f100ec1
176
  public static function getInitializer(ClassLoader $loader)
177
  {
178
  return \Closure::bind(function () use ($loader) {
179
- $loader->classMap = ComposerStaticInit92c02fe0dbc1d4a1c6b3f3200f100ec1::$classMap;
180
 
181
  }, null, ClassLoader::class);
182
  }
4
 
5
  namespace Google_Web_Stories_Composer\Autoload;
6
 
7
+ class ComposerStaticInit485695153f56843a6757aa6fce49fe93
8
  {
9
  public static $classMap = array (
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
176
  public static function getInitializer(ClassLoader $loader)
177
  {
178
  return \Closure::bind(function () use ($loader) {
179
+ $loader->classMap = ComposerStaticInit485695153f56843a6757aa6fce49fe93::$classMap;
180
 
181
  }, null, ClassLoader::class);
182
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@
3
  Contributors: google
4
  Tested up to: 5.9
5
  Requires at least: 5.5
6
- Stable tag: 1.17.0
7
  License: Apache License 2.0
8
  License URI: https://www.apache.org/licenses/LICENSE-2.0
9
  Tags: web stories, stories, amp, storytelling, google
@@ -109,6 +109,12 @@ Web Stories are powered by [AMP](https://amp.dev/), which adds some restrictions
109
 
110
  For the plugin's full changelog, please see [the Releases page on GitHub](https://github.com/googleforcreators/web-stories-wp/releases).
111
 
 
 
 
 
 
 
112
  = 1.18.0 =
113
 
114
  **Release Date:** March 1, 2022.
@@ -129,18 +135,11 @@ For the plugin's full changelog, please see [the Releases page on GitHub](https:
129
  * Enhancement: improved element resizing handling.
130
  * Bug fixes and performance improvements.
131
 
132
- = 1.16.0 =
133
 
134
- **Release Date:** January 18, 2022.
135
 
136
- * Compatibility with WordPress 5.9
137
- * New feature: improved video captions appearance in the editor.
138
- * New feature: duplicate elements via right-click menu.
139
- * Enhancement: use static images for displaying saved templates in the editor.
140
- * Enhancement: improved appearance when exploring templates in the dashboard.
141
- * Bug fixes and performance improvements.
142
-
143
- == Upgrade Notice ==
144
 
145
  = 1.18.0 =
146
 
@@ -149,7 +148,3 @@ New pre-publish confirmation dialog, semantic headings, and several bug fixes an
149
  = 1.17.0 =
150
 
151
  Various smaller enhancements throughout the editor, plus several bug fixes and performance improvements.
152
-
153
- = 1.16.0 =
154
-
155
- WordPress 5.9 compatibility, various UI refinements, right-click menu element duplication, and several bug fixes and performance improvements.
3
  Contributors: google
4
  Tested up to: 5.9
5
  Requires at least: 5.5
6
+ Stable tag: 1.18.0
7
  License: Apache License 2.0
8
  License URI: https://www.apache.org/licenses/LICENSE-2.0
9
  Tags: web stories, stories, amp, storytelling, google
109
 
110
  For the plugin's full changelog, please see [the Releases page on GitHub](https://github.com/googleforcreators/web-stories-wp/releases).
111
 
112
+ = 1.18.1 =
113
+
114
+ **Release Date:** March 8, 2022.
115
+
116
+ * Fixes an issue where adding video captions did not work.
117
+
118
  = 1.18.0 =
119
 
120
  **Release Date:** March 1, 2022.
135
  * Enhancement: improved element resizing handling.
136
  * Bug fixes and performance improvements.
137
 
138
+ == Upgrade Notice ==
139
 
140
+ = 1.18.1 =
141
 
142
+ This release fixes an issue where adding video captions did not work.
 
 
 
 
 
 
 
143
 
144
  = 1.18.0 =
145
 
148
  = 1.17.0 =
149
 
150
  Various smaller enhancements throughout the editor, plus several bug fixes and performance improvements.
 
 
 
 
third-party/vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitf5fe09b98be2fbd717a95ec3d658ae1a::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit638fe750aa978b643066ed736e8eb19e::getLoader();
third-party/vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitf5fe09b98be2fbd717a95ec3d658ae1a
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitf5fe09b98be2fbd717a95ec3d658ae1a
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitf5fe09b98be2fbd717a95ec3d658ae1a', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Google_Web_Stories_Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
- spl_autoload_unregister(array('ComposerAutoloaderInitf5fe09b98be2fbd717a95ec3d658ae1a', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Google_Web_Stories_Composer\Autoload\ComposerStaticInitf5fe09b98be2fbd717a95ec3d658ae1a::getInitializer($loader));
34
  } else {
35
  $classMap = require __DIR__ . '/autoload_classmap.php';
36
  if ($classMap) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit638fe750aa978b643066ed736e8eb19e
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit638fe750aa978b643066ed736e8eb19e', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Google_Web_Stories_Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit638fe750aa978b643066ed736e8eb19e', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Google_Web_Stories_Composer\Autoload\ComposerStaticInit638fe750aa978b643066ed736e8eb19e::getInitializer($loader));
34
  } else {
35
  $classMap = require __DIR__ . '/autoload_classmap.php';
36
  if ($classMap) {
third-party/vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Google_Web_Stories_Composer\Autoload;
6
 
7
- class ComposerStaticInitf5fe09b98be2fbd717a95ec3d658ae1a
8
  {
9
  public static $classMap = array (
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
@@ -1198,7 +1198,7 @@ class ComposerStaticInitf5fe09b98be2fbd717a95ec3d658ae1a
1198
  public static function getInitializer(ClassLoader $loader)
1199
  {
1200
  return \Closure::bind(function () use ($loader) {
1201
- $loader->classMap = ComposerStaticInitf5fe09b98be2fbd717a95ec3d658ae1a::$classMap;
1202
 
1203
  }, null, ClassLoader::class);
1204
  }
4
 
5
  namespace Google_Web_Stories_Composer\Autoload;
6
 
7
+ class ComposerStaticInit638fe750aa978b643066ed736e8eb19e
8
  {
9
  public static $classMap = array (
10
  'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
1198
  public static function getInitializer(ClassLoader $loader)
1199
  {
1200
  return \Closure::bind(function () use ($loader) {
1201
+ $loader->classMap = ComposerStaticInit638fe750aa978b643066ed736e8eb19e::$classMap;
1202
 
1203
  }, null, ClassLoader::class);
1204
  }
web-stories.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin URI: https://wp.stories.google/
10
  * Author: Google
11
  * Author URI: https://opensource.google.com/
12
- * Version: 1.18.0
13
  * Requires at least: 5.5
14
  * Requires PHP: 7.2
15
  * Text Domain: web-stories
@@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) {
40
  exit;
41
  }
42
 
43
- define( 'WEBSTORIES_VERSION', '1.18.0' );
44
  define( 'WEBSTORIES_DB_VERSION', '3.0.14' );
45
  define( 'WEBSTORIES_AMP_VERSION', '2.3.0-alpha' ); // Version of the AMP library included in the plugin.
46
  define( 'WEBSTORIES_PLUGIN_FILE', __FILE__ );
9
  * Plugin URI: https://wp.stories.google/
10
  * Author: Google
11
  * Author URI: https://opensource.google.com/
12
+ * Version: 1.18.1
13
  * Requires at least: 5.5
14
  * Requires PHP: 7.2
15
  * Text Domain: web-stories
40
  exit;
41
  }
42
 
43
+ define( 'WEBSTORIES_VERSION', '1.18.1' );
44
  define( 'WEBSTORIES_DB_VERSION', '3.0.14' );
45
  define( 'WEBSTORIES_AMP_VERSION', '2.3.0-alpha' ); // Version of the AMP library included in the plugin.
46
  define( 'WEBSTORIES_PLUGIN_FILE', __FILE__ );