View file File name : introductions-2280.min.js Content :(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.domReady;var s=e.n(t);const a=window.wp.hooks,r=window.lodash,i=window.yoast.reduxJsToolkit,n="adminUrl",o=(0,i.createSlice)({name:n,initialState:"",reducers:{setAdminUrl:(e,{payload:t})=>t}}),l=(o.getInitialState,{selectAdminUrl:e=>(0,r.get)(e,n,"")});l.selectAdminLink=(0,i.createSelector)([l.selectAdminUrl,(e,t)=>t],((e,t)=>{try{return new URL(t,e).href}catch(t){return e}})),o.actions,o.reducer;const c=window.wp.apiFetch;var m=e.n(c);const d="hasConsent",u=`${d}/storeConsent`,y=(0,i.createSlice)({name:d,initialState:!1,reducers:{giveAiGeneratorConsent:(e,{payload:t})=>t}}),p=y.getInitialState,w={selectHasAiGeneratorConsent:e=>(0,r.get)(e,d,!1)},g={...y.actions,storeAiGeneratorConsent:function*(e){try{yield{type:u,payload:e}}catch(e){return!1}return yield{type:`${d}/giveAiGeneratorConsent`,payload:e},!0}},h={[u]:({payload:e})=>m()({path:"yoast/v1/ai_generator/consent",method:"POST",data:{consent:e},parse:!1})},v=y.reducer,f="pluginUrl",b=(0,i.createSlice)({name:f,initialState:"",reducers:{setPluginUrl:(e,{payload:t})=>t}}),E=b.getInitialState,k={selectPluginUrl:e=>(0,r.get)(e,f,"")};k.selectImageLink=(0,i.createSelector)([k.selectPluginUrl,(e,t,s="assets/images")=>s,(e,t)=>t],((e,t,s)=>[(0,r.trimEnd)(e,"/"),(0,r.trim)(t,"/"),(0,r.trimStart)(s,"/")].join("/")));const x=b.actions,S=b.reducer,P=window.wp.url,_="linkParams",N=(0,i.createSlice)({name:_,initialState:{},reducers:{setLinkParams:(e,{payload:t})=>t}}),C=(N.getInitialState,{selectLinkParam:(e,t,s={})=>(0,r.get)(e,`${_}.${t}`,s),selectLinkParams:e=>(0,r.get)(e,_,{})});C.selectLink=(0,i.createSelector)([C.selectLinkParams,(e,t)=>t],((e,t)=>(0,P.addQueryArgs)(t,e))),N.actions,N.reducer;const R="loading",L="showPlay",I="askPermission",q="isPlaying",A="wistiaEmbedPermission",$=(0,i.createSlice)({name:A,initialState:{value:!1,status:"idle",error:{}},reducers:{setWistiaEmbedPermissionValue:(e,{payload:t})=>{e.value=Boolean(t)}},extraReducers:e=>{e.addCase(`${A}/request`,(e=>{e.status=R})),e.addCase(`${A}/success`,((e,{payload:t})=>{e.status="success",e.value=Boolean(t&&t.value)})),e.addCase(`${A}/error`,((e,{payload:t})=>{e.status="error",e.value=Boolean(t&&t.value),e.error={code:(0,r.get)(t,"error.code",500),message:(0,r.get)(t,"error.message","Unknown")}}))}}),O=($.getInitialState,$.actions,$.reducer,window.React),U=window.wp.data,B=window.wp.element,G=O.forwardRef((function(e,t){return O.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),O.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))})),T=window.wp.i18n,M=window.yoast.uiLibrary,j=window.yoast.propTypes;var W=e.n(j);const Y=({onGiveConsent:e,learnMoreLink:t,privacyPolicyLink:s,termsOfServiceLink:a,thumbnail:r,wistiaEmbedPermission:i})=>{const{onClose:n,initialFocus:o}=(0,M.useModalContext)(),[l,c]=(0,M.useToggleState)(!1),m=(0,B.useCallback)((()=>{n(),e(!0)}),[e,n]),d=(0,B.createInterpolateElement)((0,T.sprintf)(/* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ /* translators: %1$s and %2$s are a set of anchor tags and %3$s and %4$s are a set of anchor tags. */ (0,T.__)("I approve the %1$sTerms of Service%2$s & %3$sPrivacy Policy%4$s of the Yoast AI service. This includes consenting to the collection and use of data to improve user experience.","wordpress-seo-premium"),"<a1>","</a1>","<a2>","</a2>"),{a1:(0,O.createElement)(F,{href:a}),a2:(0,O.createElement)(F,{href:s})});return(0,O.createElement)("div",{className:"yst-flex yst-flex-col yst-items-center yst-p-10"},(0,O.createElement)("div",{className:"yst-relative yst-w-full"},(0,O.createElement)(H,{videoId:"vmrahpfjxp",thumbnail:r,wistiaEmbedPermission:i}),(0,O.createElement)(M.Badge,{className:"yst-absolute yst-top-0 yst-right-2 yst-mt-2 yst-ml-2",variant:"info"},"Beta")),(0,O.createElement)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium"},(0,O.createElement)("span",{className:"yst-introduction-modal-uppercase"},(0,T.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */ (0,T.__)("New to %1$s","wordpress-seo-premium"),"Yoast SEO Premium"))," ",(0,O.createElement)("span",{className:"yst-uppercase yst-text-slate-700"},"21.0")),(0,O.createElement)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center"},(0,O.createElement)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium"},(0,T.__)("Generate titles & descriptions with Yoast AI!","wordpress-seo-premium")),(0,O.createElement)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm"},(0,B.createInterpolateElement)((0,T.sprintf)(/* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tag; %3$s is the arrow icon. */ (0,T.__)("Speed up your workflow with generative AI. Get high-quality title and description suggestions for your search and social appearance. %1$sLearn more%2$s%3$s","wordpress-seo-premium"),"<a>","<ArrowNarrowRightIcon />","</a>"),{a:(0,O.createElement)(F,{href:t,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,O.createElement)(G,{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})}))),(0,O.createElement)("div",{className:"yst-flex yst-w-full yst-mt-6"},(0,O.createElement)("hr",{className:"yst-w-full yst-text-gray-200"})),(0,O.createElement)("div",{className:"yst-flex yst-items-start yst-mt-4"},(0,O.createElement)("input",{type:"checkbox",id:"yst-ai-consent-checkbox",name:"yst-ai-consent-checkbox",checked:l,value:l?"true":"false",onChange:c,className:"yst-checkbox__input",ref:o}),(0,O.createElement)("label",{htmlFor:"yst-ai-consent-checkbox",className:"yst-label yst-checkbox__label yst-text-xs yst-font-normal yst-text-slate-500"},d)),(0,O.createElement)("div",{className:"yst-w-full yst-flex yst-mt-4"},(0,O.createElement)(M.Button,{as:"button",className:"yst-grow",size:"large",disabled:!l,onClick:m},(0,T.__)("Start generating","wordpress-seo-premium"))),(0,O.createElement)(M.Button,{as:"button",className:"yst-mt-4",variant:"tertiary",onClick:n},(0,T.__)("Close","wordpress-seo-premium")))};Y.propTypes={onGiveConsent:W().func.isRequired,learnMoreLink:W().string.isRequired,privacyPolicyLink:W().string.isRequired,termsOfServiceLink:W().string.isRequired,thumbnail:W().shape({src:W().string.isRequired,width:W().string,height:W().string}).isRequired,wistiaEmbedPermission:W().shape({value:W().bool.isRequired,status:W().string.isRequired,set:W().func.isRequired}).isRequired};const F=({href:e,children:t,...s})=>(0,O.createElement)(M.Link,{target:"_blank",rel:"noopener noreferrer",...s,href:e},t,(0,O.createElement)("span",{className:"yst-sr-only"},/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */ (0,T.__)("(Opens in a new browser tab)","wordpress-seo-premium")));F.propTypes={href:W().string.isRequired,children:W().node},F.defaultProps={children:null};const z=window.yoast.reactHelmet,H=({videoId:e,thumbnail:t,wistiaEmbedPermission:s})=>{const[a,r]=(0,B.useState)(s.value?q:L),i=(0,B.useCallback)((()=>r(q)),[r]),n=(0,B.useCallback)((()=>{s.value?i():r(I)}),[s.value,i,r]),o=(0,B.useCallback)((()=>r(L)),[r]),l=(0,B.useCallback)((()=>{s.set(!0),i()}),[s.set,i]);return(0,O.createElement)(B.Fragment,null,s.value&&(0,O.createElement)(z.Helmet,null,(0,O.createElement)("script",{src:"https://fast.wistia.com/assets/external/E-v1.js",async:!0})),(0,O.createElement)("div",{className:"yst-relative yst-w-full yst-h-0 yst-pt-[56.25%] yst-overflow-hidden yst-rounded-md yst-drop-shadow-md yst-bg-white"},a===L&&(0,O.createElement)("button",{className:"yst-absolute yst-inset-0 yst-button yst-p-0 yst-border-none yst-bg-white yst-transition-opacity yst-duration-1000 yst-opacity-100",onClick:n},(0,O.createElement)("img",{className:"yst-w-full yst-h-auto",alt:"",loading:"lazy",decoding:"async",...t})),a===I&&(0,O.createElement)("div",{className:"yst-absolute yst-inset-0 yst-flex yst-flex-col yst-items-center yst-justify-center yst-bg-white"},(0,O.createElement)("p",{className:"yst-max-w-xs yst-mx-auto yst-text-center"},s.status===R&&(0,O.createElement)(M.Spinner,null),s.status!==R&&(0,T.sprintf)(/* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ /* translators: %1$s expands to Yoast SEO. %2$s expands to Wistia. */ (0,T.__)("To see this video, you need to allow %1$s to load embedded videos from %2$s.","wordpress-seo-premium"),"Yoast SEO","Wistia")),(0,O.createElement)("div",{className:"yst-flex yst-mt-6 yst-gap-x-4"},(0,O.createElement)(M.Button,{type:"button",variant:"secondary",onClick:o,disabled:s.status===R},(0,T.__)("Deny","wordpress-seo-premium")),(0,O.createElement)(M.Button,{type:"button",variant:"primary",onClick:l,disabled:s.status===R},(0,T.__)("Allow","wordpress-seo-premium")))),s.value&&a===q&&(0,O.createElement)("div",{className:"yst-absolute yst-w-full yst-h-full yst-top-0 yst-left-0"},null===e&&(0,O.createElement)(M.Spinner,{className:"yst-h-full yst-mx-auto"}),null!==e&&(0,O.createElement)("div",{className:`wistia_embed wistia_async_${e} videoFoam=true`}))))};H.propTypes={videoId:W().string.isRequired,thumbnail:W().shape({src:W().string.isRequired,width:W().string,height:W().string}).isRequired,wistiaEmbedPermission:W().shape({value:W().bool.isRequired,status:W().string.isRequired,set:W().func.isRequired}).isRequired};const D="yoast-seo/introductions",V="yoast-seo-premium/introductions",J=()=>{const e=(0,U.useSelect)((e=>e(D).selectLink("https://yoa.st/ai-generator-learn-more")),[]),t=(0,U.useSelect)((e=>e(D).selectLink("https://yoa.st/ai-generator-privacy-policy")),[]),s=(0,U.useSelect)((e=>e(D).selectLink("https://yoa.st/ai-generator-terms-of-service")),[]),{storeAiGeneratorConsent:a}=(0,U.useDispatch)(V),r=(0,U.useSelect)((e=>e(D).selectImageLink("ai-generator-preview.png")),[]),i=(0,B.useMemo)((()=>({src:r,width:"432",height:"244"})),[r]),n=(0,U.useSelect)((e=>e(D).selectWistiaEmbedPermissionValue()),[]),o=(0,U.useSelect)((e=>e(D).selectWistiaEmbedPermissionStatus()),[]),{setWistiaEmbedPermission:l}=(0,U.useDispatch)(D),c=(0,B.useMemo)((()=>({value:n,status:o,set:l})),[n,o,l]);return(0,O.createElement)(Y,{onGiveConsent:a,learnMoreLink:e,privacyPolicyLink:t,termsOfServiceLink:s,thumbnail:i,wistiaEmbedPermission:c})},Q=()=>{const e=(0,r.get)(window,"YoastSEO._registerIntroductionComponent",null);null!==e?(((e={})=>{(0,U.register)((e=>(0,U.createReduxStore)(V,{actions:{...g,...x},selectors:{...w,...k},initialState:(0,r.merge)({},{[d]:p(),[f]:E()},e),reducer:(0,U.combineReducers)({[d]:v,[f]:S}),controls:{...h}}))(e))})({[f]:(0,r.get)(window,"wpseoPremiumIntroductions.pluginUrl","")}),e("ai-generate-titles-and-descriptions",J)):console.error("Warning: Premium introductions expected window.YoastSEO._registerIntroductionComponent to exist.")};s()((()=>{(0,a.didAction)("yoast.introductions.ready")?Q():(0,a.addAction)("yoast.introductions.ready","yoast/yoast-seo-premium/initializeIntroductions",Q)}))})();