PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | js/dist/ai-content-planner.js +10 -10 28.1 → trunk View file →
@@ -92,9 +92,9 @@
92 92 fill: currentcolor;
93 93 display: flex;
94 94 flex-direction: row;
95 95 align-items: flex-end;
96 -`,c=e=>(0,a.jsx)(l,{children:(0,a.jsx)("span",{children:e.siteUrl})});c.propTypes={siteUrl:i().string.isRequired};const d=c},4289(e,t,s){"use strict";s.d(t,{h:()=>i});var r,n=s(1609);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},o.apply(null,arguments)}const i=e=>n.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 16 12"},e),r||(r=n.createElement("path",{fill:"#CD82AB",d:"M10.989 6.74 7.885.98v.002L7.882.98 4.778 6.74 0 3.32l1.126 7.702H14.64l1.126-7.703L10.99 6.74z"})))},4370(e,t,s){"use strict";s.d(t,{h:()=>we});var r,n,o,i,a,l,c,d,u,p,m,y,h,g,f,x,v,w,b,j,C,_,S,k,E,N,R,M,L,T,A,O,I,P,$,H,F,U,B,D,z,q,W,G,V,Y,K,Z,X,J,Q,ee,te,se,re,ne,oe,ie,ae,le,ce,de,ue,pe,me,ye,he,ge,fe,xe=s(1609);function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ve.apply(null,arguments)}const we=e=>xe.createElement("svg",ve({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",fill:"none","aria-hidden":"true",viewBox:"0 0 252 60"},e),r||(r=xe.createElement("linearGradient",{id:"yoast-connect-google-site-kit_svg__a"},xe.createElement("stop",{offset:0,stopColor:"#570732"}),xe.createElement("stop",{offset:.04,stopColor:"#610b39"}),xe.createElement("stop",{offset:.15,stopColor:"#79164b"}),xe.createElement("stop",{offset:.29,stopColor:"#8c1e59"}),xe.createElement("stop",{offset:.44,stopColor:"#9a2463"}),xe.createElement("stop",{offset:.63,stopColor:"#a22768"}),xe.createElement("stop",{offset:1,stopColor:"#a4286a"}))),n||(n=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__b",x1:49.556,x2:49.556,y1:36.267,y2:23.152,gradientUnits:"userSpaceOnUse"})),o||(o=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__c",x1:82.801,x2:82.801,y1:38.819,y2:20.113,gradientUnits:"userSpaceOnUse"})),i||(i=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__d",x1:62.504,x2:62.504,y1:36.222,y2:23.113,gradientUnits:"userSpaceOnUse"})),a||(a=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__e",x1:73.951,x2:73.951,y1:36.276,y2:23.046,gradientUnits:"userSpaceOnUse"})),l||(l=xe.createElement("linearGradient",{id:"yoast-connect-google-site-kit_svg__f",x1:25.237,x2:25.237,y1:16.169,y2:36.914,gradientUnits:"userSpaceOnUse"},xe.createElement("stop",{offset:0,stopColor:"#77b227"}),xe.createElement("stop",{offset:.47,stopColor:"#75b027"}),xe.createElement("stop",{offset:.64,stopColor:"#6eab27"}),xe.createElement("stop",{offset:.75,stopColor:"#63a027"}),xe.createElement("stop",{offset:.85,stopColor:"#529228"}),xe.createElement("stop",{offset:.93,stopColor:"#3c8028"}),xe.createElement("stop",{offset:1,stopColor:"#246b29"}))),c||(c=xe.createElement("clipPath",{id:"yoast-connect-google-site-kit_svg__g"},xe.createElement("path",{d:"M169.334 22h14.973v15.909h-14.973z"}))),d||(d=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__b)",fillRule:"evenodd",d:"M36.765 29.643c0-3.42 1.83-6.49 6.405-6.49 4.402 0 6.375 2.8 6.386 6.698.008 3.2-1.785 6.416-6.386 6.416-4.602 0-6.405-3.072-6.405-6.624zm8.432-2.74c-1.174-1.64-4.688-1.64-4.8 2.932.046 2.582 1.245 3.614 2.773 3.63 3.316.039 3.092-5.067 2.027-6.562z",clipRule:"evenodd"})),u||(u=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__c)",d:"M80.278 33.094v-6.631h2.368v-2.874h-2.368v-3.476h-3.66v3.476h-1.856v2.876h1.857v6.258c0 3.553 2.477 5.665 5.092 6.102l1.092-2.949c-1.524-.192-2.51-1.332-2.525-2.782z"})),p||(p=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__d)",fillRule:"evenodd",d:"M61.81 27.062v4.981c0 .7.196 1.67.426 2.803.088.436.182.897.27 1.376h-3.523l-.611-1.472c-4.118 2.994-8.053.974-8.053-2.168 0-4.131 4.01-4.632 7.777-4.632l.003-.249c.01-.465.02-.985-.24-1.336v-.007l-.034-.04-.011-.013c-.602-.675-2.327-1.028-5.21.341l-1.283-2.575c4.428-1.546 10.143-1.555 10.46 2.47.019.174.028.347.03.52zm-6.52 3.81c-2.718 1.331-.064 4.384 2.835 1.14v-1.425c-.949 0-2.035.012-2.835.284z",clipRule:"evenodd"})),m||(m=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__e)",d:"M67.439 26.794c0-1.227 1.966-1.8 5.064-.386l1.072-2.605c-4.17-1.262-9.866-1.371-9.904 2.991-.017 2.091 1.324 3.216 3.255 3.934 1.337.497 3.268.754 3.262 1.82-.007 1.391-3 1.604-5.725-.268l-1.101 2.823c3.716 1.85 10.627 1.902 10.59-2.734-.03-4.583-6.513-3.798-6.513-5.575z"})),y||(y=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__f)",d:"m35.218 16.875-5.305 14.734-2.54-7.956h-3.779l4.23 10.866a3.956 3.956 0 0 1 0 2.877c-.474 1.213-1.26 2.25-3.177 2.508v3.221c3.734 0 5.753-2.295 7.554-7.326l7.06-18.924z"})),h||(h=xe.createElement("path",{fill:"#f0ecf0",d:"M124.088 57.357c15.427 0 27.934-12.506 27.934-27.933S139.515 1.49 124.088 1.49 96.155 13.997 96.155 29.424s12.506 27.933 27.933 27.933z"})),g||(g=xe.createElement("path",{fill:"#9e005d",d:"M122.68 23.422c5.075-5.662 3.282-.196 13.081-2.26 2.792-.587 7.802-1.905 9.067.833 1.427 3.092 4.014 3.471 3.211 5.47-1.412 3.512-6.46 4.52-7.887.556-1.819-1.232-8.98 2.24-11.167 2.775-.813.198-.868-2.038-1.675-2.168-.529-.085-.462-.17-.939-.575-4.613-3.918-4.904-3.277-5.22-4.126.482-.115.95-.396 1.531-.503z"})),f||(f=xe.createElement("path",{fill:"#6c2548",d:"M145.465 25.27c-1.744-.556-3.859.788-3.015 2.668.204.456 1.233 2.392 1.665 2.536 1.633.552 5.651-2.227 1.35-5.204z"})),x||(x=xe.createElement("path",{fill:"#ffc399",d:"M145.972 26.652c-.452-.226-2.526.313-2.3 1.188.281 1.084.758 1.655 1.395 1.998 1.627.875 1.365 2.531 3.684 2.5 1.12-.015 4.022-1.557 4.118-.456.157 1.823.464 3.564.792 3.17.792-.951 1.109-1.03 1.188-4.2.021-.887-2.14-1.506-3.013-2.854-.473-.733-2.932-.714-5.866-1.348z"})),v||(v=xe.createElement("path",{fill:"#be1e2d",d:"M109.348 16.345c-2.102-1.797-8.454 4.23-7.974 6.137.479-.51 1.186-1.505 1.973-1.316-2.719 1.838-3.191 6.484-1.784 9.259.158-.735.439-1.525.897-2.123-.778 3.037.466 8.256 4.271 10.873-.26-1.915-1.201-5.028.477-6.267 2.485-1.836 5.651-2.398 7.153-5.43 3.716-7.506-7.675-12.913-5.013-11.135z"})),w||(w=xe.createElement("path",{fill:"#9e005d",d:"M111.503 27.227c-1.65.136-7.152 11.633.475 20.361 1.067 1.223 2.372 3.57 3.92 3.78 3.256.443 11.848-1.812 15.059-3.188 12.146-5.202 1.267-10.842-.308-16.792-1.421-5.366-1.725-8.762-7.928-8.997-2.92-.11-11.15 1.768-11.95 5.058-.224.108-.109-.08.732-.224z"})),b||(b=xe.createElement("path",{fill:"#6c2548",d:"M123.196 23.817c3.828 1.233 6.256 5.375 7.755 8.771-1.38-4.316-2.059-8.262-7.932-8.95-.013-.072.419-.694.177.18z"})),j||(j=xe.createElement("path",{fill:"#6c2548",d:"M127.718 23.362c1.071.893 1.961 2.794 2.438 3.984.522 1.306.088 3.329.571 4.638-1.292-3.232-1.307-5.14-3.007-8.622z"})),C||(C=xe.createElement("path",{fill:"#ffc399",d:"M125.772 33.468c-1.058.375-2.898.677-4.103 1.248-2.187 1.037-4.936-1.725-7.313-1.188-.858.194-3.845-.873-4.082-1.942-.293-1.325-.745-1.352-.078-2.22 2.619-3.402 2.815-1.566 2.932-6.896.019-.886-.2-1.312.079-2.061.279-.75.21.017 1.09-.143.879-.16 2.996-1.05 3.869-.652 1.533.699.513 3.972 1.61 5.107 1.139 1.177 3.841-.028 4.989 1.128 1.439 1.45 1.324 6.848 1.005 7.621z"})),_||(_=xe.createElement("path",{fill:"#e57c57",d:"M123.021 27.88c.285-.57.221-1.564-.026-2.586-1.175-.034-2.504.164-3.217-.575-.65-.671-.558-2.085-.692-3.277a3.502 3.502 0 0 1-.607-.122c-1.263-.372-2.67-.835-4.069-1.077-.039.008-.077.017-.111.023-.405.075-.605-.057-.733-.143l-.213-.017c-.04.05-.085.141-.144.303-.271.728-.073 1.156-.079 1.995 1.386 3.614 6.644 11.98 9.895 5.477z"})),S||(S=xe.createElement("path",{fill:"#f1f2f2",d:"M116.06 33.648c7.293 3.488 11.969 5.47 13.635 9.989-1.031-4.757-.893-8.622-4.459-15.161.675 7.425-8.761 5.37-9.176 5.172z"})),k||(k=xe.createElement("path",{fill:"#6c2548",d:"M129.697 43.002c.157-3.884-1.057-18.564-4.44-20.057-1.056-.466-10.726 1.174-7.768 1.348 4.625.27 7.293 2.775 7.928 4.28.792 1.11 3.081 8.599 4.28 14.427z"})),E||(E=xe.createElement("path",{fill:"#9e005d",d:"M129.616 43.001c.157-3.884-1.93-18.724-5.311-20.214-1.056-.467-9.776 1.333-6.819 1.505 4.626.27 7.294 2.775 7.928 4.28.792 1.11 3.003 8.599 4.202 14.427z"})),N||(N=xe.createElement("path",{fill:"#ffc399",d:"M126.288 12.877c.555 2.457-.397 1.902.078 3.488.375 1.25.729 2.066.635 3.488-.241 3.656-2.983 6.876-3.086 6.978-1.45 1.45-3.132 1.295-5.476.077-4.364-2.266-6.898-4.994-7.532-11.823-.471-5.072 3.763-8.847 9.014-8.313 3.249.332 5.449 2.04 6.367 6.103z"})),R||(R=xe.createElement("path",{fill:"#be1e2d",d:"M114.461 9.389c3.944-.179 3.02 1.925 6.539 2.973 2.794.832 5.707-1.012 5.173 3.745-.475 4.212 9.401-4.116 1.46-7.591-1.269-.556-1.137-1.414-2.378-3.013-2.598-3.343-11.337-7.055-15.061-.873-.944 1.567 2.657 4.101 4.265 4.757z"})),M||(M=xe.createElement("path",{fill:"#be1e2d",d:"M114.282 9.508c.912 3.597-.161 4.23-.653 5.47-.541 1.364-.803 2.65-1.487 3.925-.992-2.07-2.184-.317-5.276-4.36-5.537-7.24 9.782-16.915 7.416-5.035z"})),L||(L=xe.createElement("path",{fill:"#ffc399",d:"M112.336 19.497c.617-1.633-4.029-4.43-3.599-1.043.209 1.642 1.516 2.574 2.913 3.151 2.294.946 1.195-1.675.569-3.057l.119.952z"})),T||(T=xe.createElement("path",{fill:"#be1e2d",d:"M113.168 14.026c.309 1.25-.03 6.814 1.785 8.997-3.152-1.714-2.37-5.13-1.785-8.997z"})),A||(A=xe.createElement("path",{fill:"#be1e2d",d:"M112.691 15.573c-.728.415-1.441 3.388-.323 5.705.006-.021.483-4.91.323-5.705z"})),O||(O=xe.createElement("path",{fill:"#9e005d",d:"M117.012 34.121c-2.877-1.74-5.509-2.068-4.725-7.2.867-1.004.747-1.897.807-3.383-1.109.396-4.086 1.948-5.434 2.655-1.985 1.04-4.361 3.41-2.458 5.39.703.73-1.758 1.923.937 6.759 1.506-2.617 2.711-4.855 3.661-4.934 3.33-.079 4.431 1.667 7.372 2.378 7.214 1.744 11.654 6.501 12.525 8.164.036-1.051-1.269-4.914-12.683-9.829z"})),I||(I=xe.createElement("path",{fill:"#9e005d",d:"M108.45 34.202c-8.258 11.429 2.709 12.432 5.351 22.998.119.48.656 1.17 1.503 1.322 5.051.903 10.884-1.744 15.862-6.92 1.408-1.463.247-4.902-1.546-5.648-2.319-1.546-7.378 4.023-13.006 2.992-.677-1.02-1.505-13.477-8.164-14.744z"})),P||(P=xe.createElement("path",{fill:"#a0c9cb",d:"m155.213 40.425-.27 9.99-6.399-1.368-.094-9.712z"})),$||($=xe.createElement("path",{fill:"#75b0b3",d:"m155.48 50.235-.509.238c.085-11.096-.171-10.3.509-10.166v9.93z"})),H||(H=xe.createElement("path",{fill:"#66a7ab",d:"M150.965 40.959c2.473.277 3.211 6.54 2.498 9.037-.119-.12-3.567-.833-3.686-.713-1.718-1.964-.992-8.57 1.188-8.324z"})),F||(F=xe.createElement("path",{fill:"#467d7f",d:"M154.983 40.783s.153-1.902 0-2.02c-.153-.12-6.641-.655-6.641-.655-.776 1.706-.431 1.282 6.641 2.675z"})),U||(U=xe.createElement("path",{fill:"#67a8ac",d:"m152.371 30.436 2.881 8.443-6.729-1.15-3.307-9.016z"})),B||(B=xe.createElement("path",{fill:"#55989b",d:"m152.988 32.518.101.02-.716-2.1-7.155-1.725.656 1.786z"})),D||(D=xe.createElement("path",{fill:"#519093",d:"m148.766 37.79-1.127.713-2.679-8.541 1.25-.893z"})),z||(z=xe.createElement("path",{fill:"#b1d3d4",d:"m152.794 30.08-.922 1.069-6.552-1.01.869-1.011z"})),q||(q=xe.createElement("path",{fill:"#a0c9cb",d:"M155.648 39.988c0 1.052-1.046 1.052-1.046 0s1.046-1.052 1.046 0z"})),W||(W=xe.createElement("path",{fill:"#a0c9cb",d:"M147.639 38.502c1.501-.95.058-.881 7.713.317-1.38 1.189-.053 1.07-7.713-.317z"})),G||(G=xe.createElement("path",{fill:"#75b0b3",d:"m155.354 38.879-1.037.832-2.444-8.681.922-1.07z"})),V||(V=xe.createElement("path",{fill:"#6b1523",d:"M117.374 55.11c1.071-.299.06-1.962.713-4.862-1.972 4.042-1.699 5.134-.713 4.862z"})),Y||(Y=xe.createElement("path",{fill:"#6b1523",d:"M119.989 48.095c.059-.594-2.913-8.918-9.097-9.276 3.448.12 10.494 9.176 8.452 9.395-1.853.535-6.076 2.32-4.41 3.925 1.307.773 1.605-3.152 4.627-3.895 4.567.882 7.438-3.94 10.415-1.874-2.809-3.503-5.362 2.14-9.989 1.725z"})),K||(K=xe.createElement("path",{fill:"#6c2548",d:"M127.793 46.647c.309-.639 1.427-.396 2.336-1.56.449-.576.948-.203 1.687-.222 1.541-.043 2.544 2.996 1.737 4.15-.445.635-2.745 1.297-3.62 1.518-1.771.445-3.511-3.036-2.14-3.884z"})),Z||(Z=xe.createElement("path",{fill:"#c44c31",d:"M123.081 15.099c-.993 1.109 1.35 4.64.988 6.262-.284 1.27-1.827.705-2.617-.157.694.027 1.78.445 1.982.078.76-1.384-1.539-4.914-.353-6.183z"})),X||(X=xe.createElement("path",{fill:"#be1e2d",d:"M124.031 23.074c-2.5.504-4.483.504-5.69-.194.579.55 1.976 1.906 3.268 1.887 1.293-.02 1.235-.569 1.355-1.11.076-.206.528-.326 1.064-.586z"})),J||(J=xe.createElement("path",{fill:"#e57c57",d:"M117.389 23.045c0-.616.545-.83 1.075-.93-.441.295-.092.88-.098.904-.481-.272-.62-.174-.977.026z"})),Q||(Q=xe.createElement("path",{fill:"#35602c",d:"m150.614 40.5-2.973-.396.428 8.839 2.736-.024c2.241-.23 2.479-8.077-.191-8.42z"})),ee||(ee=xe.createElement("path",{fill:"#569d48",d:"M149.867 44.427c.285 5.88-3.738 6.075-4.023.194-.285-5.88 3.737-6.075 4.023-.194z"})),te||(te=xe.createElement("path",{fill:"#e57c57",d:"M136.434 42.288c5.055-.658 5.866-2.932 6.341-1.11.315.786-1.069 1.442-1.903 1.755-.443.164-1.044-.055-1.551-.104-1.12-.109-1.822.562-2.885.65-.123-.631.296-1.046 0-1.189z"})),se||(se=xe.createElement("path",{fill:"#35602c",d:"M139.873 43.184c.168-.905 5.647-1.784 7.051-1.867 1.803-.107 2.161 6.066.475 6.184-2.362.164-4.487.357-6.872-.392-1.388-.435-1.904-.588-1.927-2.106-.017-1.12.749-2.068 1.273-1.819z"})),re||(re=xe.createElement("g",{fill:"#ffc399"},xe.createElement("path",{d:"M131.123 45.597c3.759-1.073 7.006-4.783 7.689-4.023 1.091 1.212-.543 2.16-1.06 3.489-.698 1.797 1.054-.037-.403 1.784-.634.792-1.961.179-2.793.179-.556.157-1.863 1.328-2.498 1.486-1.031-.158-2.364-2.042-.937-2.913z"}),xe.createElement("path",{d:"M138.898 41.243c3.239.682 4.923-.098 5.189 1.152.181.856 1.606 3.358 1.559 4.323-1.725.462-2.504-2.683-3.13-3.156-.426-.321-2.909.188-3.733.077-.824-.111-1.378-2.191.115-2.396z"}),xe.createElement("path",{d:"M141.004 43.042c.573 1.983 2.144 3.145 1.51 3.79-.848.863-1.691 1.404-2.013 1.263-1.976-.87.322-1.169-.004-1.496-.326-.328-1.995-2.12-2.34-2.198.24-.924-.094-1.263-.303-2.212.211.07 2.865.35 3.152.853z"}),xe.createElement("path",{d:"M137.707 42.446c.958-.115 1.457 1.48 1.546 1.784.166.567 1.348 1.806 1.427 2.379.179 1.277-1.071 1.188-1.755 1.456-.564.298-1.991-.743-.683-1.576-.935-.019-3.073-1.497-2.694-2.016.241-.004 1.148-2.383 2.157-2.025z"}),xe.createElement("path",{d:"M137.599 43.08c.556 1.11 1.03 3.964.873 4.28-.271.544-.865 1.07-1.51 1.34s-1.026-.943-1.978-1.893c.792-.713 1.691-.128 1.665.239-.03.438.079-.318.396-.239-.238-.317-.884-1.365-1.188-1.982-.434-.88.635-2.536 1.744-1.744zm6.311-14.765c.475 1.744-.187 2.5-.238 3.092-.085.99.758 1.205 1.348 1.901.873 1.031.792 2.22 1.505 2.775 1.983-.873.015-3.264-.193-3.786-.158-.396.034-2.875 2.016-3.032-1.348-1.665-3.249-2.22-4.44-.952z"}))),ne||(ne=xe.createElement("path",{fill:"#6b1523",d:"M112.653 25.483c-1.903.93-5.883 2.474-6.737 4.518-.599 1.431 5.707 1.11 13.081 5.31-3.805-2.774-9.996-4.01-10.307-4.992-.106-.335 2.715-4.87 3.963-4.836zm-7.374 6.024c.839 1.118 2.3 1.11 4.202 1.586-.878-.434-4.779.837-4.361 0 .157-.317-.167-.875.157-1.586z"})),oe||(oe=xe.createElement("path",{fill:"#f1f2f2",d:"M116.341 17.639c.007-.03.462-.848 2.206-1.014.678-.064 1.896.509 1.795 1.169-1.007.43-1.888.675-4.001-.155z"})),ie||(ie=xe.createElement("path",{fill:"#231f20",d:"M120.347 17.688c-.062-.337-.441-.754-.918-.767-.526-.015-1.035.55-1.044.897-.004.153.086.276.224.37.684.015 1.19-.162 1.733-.394a.422.422 0 0 0 .005-.106z"})),ae||(ae=xe.createElement("path",{fill:"#231f20",d:"M120.368 17.667c-.102-.768-1.512-1.3-2.404-1.303-1.244 0-1.491 1.171-2.272.735.177.703 1.141.928 1.801.933-2.327-.695 2.14-2.302 2.875-.365z"})),le||(le=xe.createElement("path",{fill:"#f1f2f2",d:"M123.27 17.549c.977.332 2.076-.19 2.44-.741.592-.899-1.629-2.066-2.44.74z"})),ce||(ce=xe.createElement("path",{fill:"#231f20",d:"M124.226 17.238a.33.33 0 0 0 .122.373c.604-.115 1.132-.452 1.365-.803a.576.576 0 0 0 .093-.245c-.323-.585-1.245-.539-1.58.675z"})),de||(de=xe.createElement("path",{fill:"#231f20",d:"M123.249 17.568c.092-.724.417-1.478 1.329-1.887 1.175-.528 1.537.92 1.938-.268-.147 1.467-.592 1.476-1.523 1.987 1.022-.356.958-1.906-.373-1.403-1.062.402-1.196 1.152-1.369 1.571z"})),ue||(ue=xe.createElement("path",{fill:"#be1e2d",d:"M126.024 14.621c.517.586-.337-.17-1.304-.06-.321.039-.841.352-1.122.365.554-1.076 1.663-1.17 2.426-.305zm-6.316.317c-3.103-.775-3.531.177-4.685 1.791 2.238-2.446 3.518-.587 5.132-1.94-.245.024-.473.103-.447.15z"})),pe||(pe=xe.createElement("path",{fill:"#6b1523",d:"M106.375 37.808c.416-1.427 1.651-3.48 2.315-3.607 4.108-.792 14.097 5.034 17.246 5.866-5.053-1.248-12.544-5.41-17.122-4.876-.586.192-2.081 1.901-2.439 2.617z"})),me||(me=xe.createElement("path",{fill:"#642243",d:"M140.501 28.713c-.421-1.256-1.179-2.587-.805-4.042.379-1.475 2.232-2.05 2.815-3.43-1.65-.713-1.58 1.923-2.468 2.349-.038-.782-.142-1.516-.129-2.324-1.54 2.028-.703 4.913.589 7.45zm-13.317-7.491c7.849.713 7.253 7.135 12.485 6.303-5.471 1.426-7.017-6.303-12.485-6.303z"})),ye||(ye=xe.createElement("path",{fill:"#c44c31",d:"M120.525 19.497c0 .236-.594.236-.594 0s.594-.237.594 0zm-1.903.355c0 .236-.358.236-.358 0s.358-.236.358 0zm5.768-.832c0 .316-.474.316-.474 0 0-.315.474-.315.474 0zm.89.952c0 .237-.475.237-.475 0s.475-.236.475 0zm.358-1.188c0 .236-.474.236-.474 0 0-.237.474-.237.474 0zm-5.232 1.901c0 .236-.475.236-.475 0s.475-.236.475 0z"})),he||(he=xe.createElement("path",{fill:"#569d48",d:"M136.975 46.802c-.364-.268-.53-.656-.498-1.16-4.862.762-12.996 10.236-26.102 8.07.919.613 1.743 1.082 2.706 1.382 10.638 1.337 19.676-7.332 23.896-8.292z"})),ge||(ge=xe.createElement("path",{fill:"#5f6368",d:"M238.632 23.564h2.267v.075l-5.066 5.844 5.405 7.63v.075h-2.151l-4.437-6.357-2.094 2.419v3.94h-1.754V23.563h1.754v7.028h.074zm5.892 1.085c0 .339-.124.637-.364.877s-.529.364-.877.364c-.34 0-.638-.124-.877-.364a1.198 1.198 0 0 1-.365-.877c0-.348.124-.637.365-.878.239-.24.53-.364.877-.364.339 0 .637.124.877.364.248.249.364.538.364.878zm-.355 3.22v9.327h-1.755v-9.328zm5.604 9.477c-.762 0-1.392-.232-1.896-.704-.505-.472-.762-1.126-.77-1.962v-5.215h-1.639v-1.597h1.639v-2.856h1.754v2.856h2.285v1.597h-2.284v4.644c0 .62.124 1.043.364 1.266.24.224.513.332.819.332.141 0 .273-.017.414-.05a2.19 2.19 0 0 0 .373-.124l.554 1.564c-.471.166-1.001.249-1.613.249zm-55.489-.878c-.969-.704-1.631-1.697-1.995-2.972l2.151-.878c.216.803.597 1.448 1.151 1.962.547.505 1.209.761 1.978.761.721 0 1.324-.182 1.829-.554.505-.373.754-.886.754-1.531 0-.596-.224-1.085-.662-1.474-.439-.389-1.209-.778-2.31-1.167l-.91-.323c-.977-.338-1.796-.827-2.459-1.464-.662-.637-.992-1.473-.992-2.515 0-.721.198-1.383.587-1.995.389-.613.935-1.093 1.639-1.458.695-.355 1.482-.538 2.367-.538 1.275 0 2.293.306 3.046.927.761.621 1.266 1.308 1.522 2.087l-2.051.868c-.15-.464-.43-.87-.853-1.217-.421-.356-.96-.53-1.622-.53s-1.224.166-1.68.505c-.455.34-.679.77-.679 1.3 0 .504.207.91.612 1.241.406.323 1.043.638 1.913.935l.911.306c1.249.431 2.209 1.002 2.896 1.698.687.695 1.027 1.63 1.027 2.797 0 .952-.241 1.747-.729 2.383a4.482 4.482 0 0 1-1.862 1.433 5.981 5.981 0 0 1-2.326.463c-1.209 0-2.293-.348-3.253-1.05zm9.924-11.571a1.45 1.45 0 0 1-.439-1.067c0-.423.149-.779.439-1.069a1.444 1.444 0 0 1 1.067-.439c.422 0 .778.15 1.067.44.291.289.439.645.439 1.067 0 .422-.149.778-.438 1.067a1.455 1.455 0 0 1-1.067.44c-.423-.01-.779-.15-1.068-.44zm-.05 1.937h2.234v10.362h-2.234zm7.093 10.304a2.898 2.898 0 0 1-.993-.588c-.579-.579-.878-1.373-.878-2.375v-5.372h-1.812v-1.97h1.812v-2.92h2.235v2.93h2.517v1.97h-2.517v4.874c0 .555.108.952.323 1.176.207.273.555.405 1.06.405.231 0 .43-.033.612-.091.174-.058.364-.157.571-.298v2.177c-.447.207-.985.306-1.622.306a3.735 3.735 0 0 1-1.308-.224zm6.133-.33a4.946 4.946 0 0 1-1.887-1.962c-.455-.836-.679-1.771-.679-2.814 0-.994.224-1.904.662-2.756.439-.845 1.052-1.523 1.838-2.02s1.68-.754 2.682-.754c1.043 0 1.945.232 2.714.688a4.572 4.572 0 0 1 1.747 1.887c.397.803.596 1.697.596 2.707 0 .19-.017.43-.058.711h-7.946c.083.96.423 1.706 1.026 2.227.58.512 1.33.79 2.103.778.637 0 1.192-.141 1.655-.439a3.185 3.185 0 0 0 1.126-1.192l1.887.894a5.577 5.577 0 0 1-1.912 2.011c-.786.489-1.73.729-2.823.729-1.018.016-1.927-.215-2.731-.695zm5.397-6.01a2.497 2.497 0 0 0-.348-1.084 2.486 2.486 0 0 0-.927-.902c-.413-.24-.918-.364-1.515-.364-.72 0-1.324.215-1.821.637-.496.422-.836 1.001-1.026 1.714z"})),fe||(fe=xe.createElement("g",{fillRule:"evenodd",clipPath:"url(#yoast-connect-google-site-kit_svg__g)",clipRule:"evenodd"},xe.createElement("path",{fill:"#fbbc05",d:"m170.119 26.56 2.576 1.97a4.563 4.563 0 0 0 0 2.85l-2.576 1.97a7.667 7.667 0 0 1-.785-3.395c0-1.22.283-2.373.785-3.394z"}),xe.createElement("path",{fill:"#ea4335",d:"m172.696 28.53-2.577-1.97a7.64 7.64 0 0 1 6.877-4.266c1.95 0 3.691.731 5.049 1.915l-2.229 2.229a4.428 4.428 0 0 0-2.82-1.01 4.518 4.518 0 0 0-4.3 3.103z"}),xe.createElement("path",{fill:"#34a853",d:"m170.118 33.347 2.576-1.975a4.514 4.514 0 0 0 4.301 3.11c2.124 0 3.726-1.08 4.109-2.96h-4.109v-2.96h7.139c.104.452.174.94.174 1.392 0 4.875-3.482 7.661-7.313 7.661a7.637 7.637 0 0 1-6.877-4.268z"}),xe.createElement("path",{fill:"#4285f4",d:"m181.988 35.707-2.446-1.893c.8-.505 1.357-1.284 1.562-2.293h-4.109v-2.96h7.138c.105.453.175.94.175 1.393 0 2.497-.914 4.446-2.32 5.753z"}))))},4432(e,t,s){"use strict";var r=s(1802),n=s.n(r);s(3657),s(790),n().string.isRequired,n().object.isRequired,n().string.isRequired,n().func.isRequired,n().bool.isRequired},4578(e,t,s){"use strict";s.d(t,{K:()=>c});var r=s(5831),n=s(1802),o=s.n(n),i=s(5431),a=s(8572),l=s(790);const c=({linkStoreName:e=i.sH,className:t=""})=>(0,l.jsxs)(r.Alert,{variant:"error",className:t,children:[(0,l.jsx)("span",{className:"yst-block yst-font-medium",children:a.D}),(0,l.jsx)(a.n,{linkStoreName:e})]});c.propTypes={linkStoreName:o().string,className:o().string}},4658(e,t,s){"use strict";s.d(t,{En:()=>p,Jn:()=>m,Kw:()=>y,ZF:()=>h,mw:()=>u});var r=s(5074),n=s.n(r),o=s(7723),i=s(5831),a=s(8468),l=s(1802),c=s.n(l),d=s(790);const u=({children:e})=>(0,d.jsx)("div",{className:"yst-mt-1 yst-text-sm yst-text-slate-500",children:e});u.propTypes={children:c().node.isRequired};const p=({children:e})=>(0,d.jsx)("div",{className:"yst-mt-6 yst-flex yst-flex-row yst-justify-end yst-gap-3",children:e});p.propTypes={children:c().node.isRequired};const m=({onClose:e})=>(0,d.jsx)(i.Button,{variant:"secondary",onClick:e,children:(0,o.__)("Close","wordpress-seo")});m.propTypes={onClose:c().func.isRequired};const y=({showActions:e=!1,onRetry:t,onClose:s})=>(0,d.jsxs)(p,{children:[(0,d.jsx)(m,{onClose:s}),e&&(0,d.jsx)(i.Button,{variant:"primary",onClick:t,children:(0,o.__)("Try again","wordpress-seo")})]});y.propTypes={showActions:c().bool,onRetry:c().func.isRequired,onClose:c().func.isRequired};const h=({isOpen:e,title:t,onClose:s=a.noop,children:r})=>{const l=(0,i.useSvgAria)();return(0,d.jsx)(i.Modal,{isOpen:e,onClose:s,children:(0,d.jsx)(i.Modal.Panel,{className:"yst-max-w-lg",closeButtonScreenReaderText:(0,o.__)("Dismiss","wordpress-seo"),children:(0,d.jsxs)("div",{className:"yst-flex yst-items-start yst-gap-4",children:[(0,d.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,d.jsx)(n(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...l})}),(0,d.jsxs)("div",{className:"yst-text-start yst-flex-1 yst-min-w-0",children:[(0,d.jsx)(i.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900",children:t}),r]})]})})})};h.propTypes={isOpen:c().bool.isRequired,title:c().string.isRequired,onClose:c().func,children:c().node.isRequired}},4719(e,t,s){const r=s(1609),n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.exports=n},4730(e,t,s){"use strict";s.d(t,{v:()=>C});var r=s(7143),n=s(7723),o=s(818),i=s.n(o),a=s(6702),l=s.n(a),c=s(5831),d=s(8468),u=s(1802),p=s.n(u),m=s(2458),y=s(3657),h=s(5431),g=s(7753),f=s(2027),x=s(4658),v=s(790);const w=({learnMoreUrl:e=""})=>(0,v.jsx)(f.f,{children:(0,m.x)((0,n.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
96 +`,c=e=>(0,a.jsx)(l,{children:(0,a.jsx)("span",{children:e.siteUrl})});c.propTypes={siteUrl:i().string.isRequired};const d=c},4289(e,t,s){"use strict";s.d(t,{h:()=>i});var r,n=s(1609);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},o.apply(null,arguments)}const i=e=>n.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",fill:"none","aria-hidden":"true",viewBox:"0 0 16 12"},e),r||(r=n.createElement("path",{fill:"#CD82AB",d:"M10.989 6.74 7.885.98v.002L7.882.98 4.778 6.74 0 3.32l1.126 7.702H14.64l1.126-7.703L10.99 6.74z"})))},4370(e,t,s){"use strict";s.d(t,{h:()=>we});var r,n,o,i,a,l,c,d,u,p,m,y,h,g,f,x,v,w,b,j,C,_,S,k,E,N,R,M,L,T,A,O,I,P,$,H,F,U,D,B,z,q,W,G,V,Y,Z,K,J,X,Q,ee,te,se,re,ne,oe,ie,ae,le,ce,de,ue,pe,me,ye,he,ge,fe,xe=s(1609);function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)({}).hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},ve.apply(null,arguments)}const we=e=>xe.createElement("svg",ve({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",fill:"none","aria-hidden":"true",viewBox:"0 0 252 60"},e),r||(r=xe.createElement("linearGradient",{id:"yoast-connect-google-site-kit_svg__a"},xe.createElement("stop",{offset:0,stopColor:"#570732"}),xe.createElement("stop",{offset:.04,stopColor:"#610b39"}),xe.createElement("stop",{offset:.15,stopColor:"#79164b"}),xe.createElement("stop",{offset:.29,stopColor:"#8c1e59"}),xe.createElement("stop",{offset:.44,stopColor:"#9a2463"}),xe.createElement("stop",{offset:.63,stopColor:"#a22768"}),xe.createElement("stop",{offset:1,stopColor:"#a4286a"}))),n||(n=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__b",x1:49.556,x2:49.556,y1:36.267,y2:23.152,gradientUnits:"userSpaceOnUse"})),o||(o=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__c",x1:82.801,x2:82.801,y1:38.819,y2:20.113,gradientUnits:"userSpaceOnUse"})),i||(i=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__d",x1:62.504,x2:62.504,y1:36.222,y2:23.113,gradientUnits:"userSpaceOnUse"})),a||(a=xe.createElement("linearGradient",{xlinkHref:"#yoast-connect-google-site-kit_svg__a",id:"yoast-connect-google-site-kit_svg__e",x1:73.951,x2:73.951,y1:36.276,y2:23.046,gradientUnits:"userSpaceOnUse"})),l||(l=xe.createElement("linearGradient",{id:"yoast-connect-google-site-kit_svg__f",x1:25.237,x2:25.237,y1:16.169,y2:36.914,gradientUnits:"userSpaceOnUse"},xe.createElement("stop",{offset:0,stopColor:"#77b227"}),xe.createElement("stop",{offset:.47,stopColor:"#75b027"}),xe.createElement("stop",{offset:.64,stopColor:"#6eab27"}),xe.createElement("stop",{offset:.75,stopColor:"#63a027"}),xe.createElement("stop",{offset:.85,stopColor:"#529228"}),xe.createElement("stop",{offset:.93,stopColor:"#3c8028"}),xe.createElement("stop",{offset:1,stopColor:"#246b29"}))),c||(c=xe.createElement("clipPath",{id:"yoast-connect-google-site-kit_svg__g"},xe.createElement("path",{d:"M169.334 22h14.973v15.909h-14.973z"}))),d||(d=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__b)",fillRule:"evenodd",d:"M36.765 29.643c0-3.42 1.83-6.49 6.405-6.49 4.402 0 6.375 2.8 6.386 6.698.008 3.2-1.785 6.416-6.386 6.416-4.602 0-6.405-3.072-6.405-6.624zm8.432-2.74c-1.174-1.64-4.688-1.64-4.8 2.932.046 2.582 1.245 3.614 2.773 3.63 3.316.039 3.092-5.067 2.027-6.562z",clipRule:"evenodd"})),u||(u=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__c)",d:"M80.278 33.094v-6.631h2.368v-2.874h-2.368v-3.476h-3.66v3.476h-1.856v2.876h1.857v6.258c0 3.553 2.477 5.665 5.092 6.102l1.092-2.949c-1.524-.192-2.51-1.332-2.525-2.782z"})),p||(p=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__d)",fillRule:"evenodd",d:"M61.81 27.062v4.981c0 .7.196 1.67.426 2.803.088.436.182.897.27 1.376h-3.523l-.611-1.472c-4.118 2.994-8.053.974-8.053-2.168 0-4.131 4.01-4.632 7.777-4.632l.003-.249c.01-.465.02-.985-.24-1.336v-.007l-.034-.04-.011-.013c-.602-.675-2.327-1.028-5.21.341l-1.283-2.575c4.428-1.546 10.143-1.555 10.46 2.47.019.174.028.347.03.52zm-6.52 3.81c-2.718 1.331-.064 4.384 2.835 1.14v-1.425c-.949 0-2.035.012-2.835.284z",clipRule:"evenodd"})),m||(m=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__e)",d:"M67.439 26.794c0-1.227 1.966-1.8 5.064-.386l1.072-2.605c-4.17-1.262-9.866-1.371-9.904 2.991-.017 2.091 1.324 3.216 3.255 3.934 1.337.497 3.268.754 3.262 1.82-.007 1.391-3 1.604-5.725-.268l-1.101 2.823c3.716 1.85 10.627 1.902 10.59-2.734-.03-4.583-6.513-3.798-6.513-5.575z"})),y||(y=xe.createElement("path",{fill:"url(#yoast-connect-google-site-kit_svg__f)",d:"m35.218 16.875-5.305 14.734-2.54-7.956h-3.779l4.23 10.866a3.956 3.956 0 0 1 0 2.877c-.474 1.213-1.26 2.25-3.177 2.508v3.221c3.734 0 5.753-2.295 7.554-7.326l7.06-18.924z"})),h||(h=xe.createElement("path",{fill:"#f0ecf0",d:"M124.088 57.357c15.427 0 27.934-12.506 27.934-27.933S139.515 1.49 124.088 1.49 96.155 13.997 96.155 29.424s12.506 27.933 27.933 27.933z"})),g||(g=xe.createElement("path",{fill:"#9e005d",d:"M122.68 23.422c5.075-5.662 3.282-.196 13.081-2.26 2.792-.587 7.802-1.905 9.067.833 1.427 3.092 4.014 3.471 3.211 5.47-1.412 3.512-6.46 4.52-7.887.556-1.819-1.232-8.98 2.24-11.167 2.775-.813.198-.868-2.038-1.675-2.168-.529-.085-.462-.17-.939-.575-4.613-3.918-4.904-3.277-5.22-4.126.482-.115.95-.396 1.531-.503z"})),f||(f=xe.createElement("path",{fill:"#6c2548",d:"M145.465 25.27c-1.744-.556-3.859.788-3.015 2.668.204.456 1.233 2.392 1.665 2.536 1.633.552 5.651-2.227 1.35-5.204z"})),x||(x=xe.createElement("path",{fill:"#ffc399",d:"M145.972 26.652c-.452-.226-2.526.313-2.3 1.188.281 1.084.758 1.655 1.395 1.998 1.627.875 1.365 2.531 3.684 2.5 1.12-.015 4.022-1.557 4.118-.456.157 1.823.464 3.564.792 3.17.792-.951 1.109-1.03 1.188-4.2.021-.887-2.14-1.506-3.013-2.854-.473-.733-2.932-.714-5.866-1.348z"})),v||(v=xe.createElement("path",{fill:"#be1e2d",d:"M109.348 16.345c-2.102-1.797-8.454 4.23-7.974 6.137.479-.51 1.186-1.505 1.973-1.316-2.719 1.838-3.191 6.484-1.784 9.259.158-.735.439-1.525.897-2.123-.778 3.037.466 8.256 4.271 10.873-.26-1.915-1.201-5.028.477-6.267 2.485-1.836 5.651-2.398 7.153-5.43 3.716-7.506-7.675-12.913-5.013-11.135z"})),w||(w=xe.createElement("path",{fill:"#9e005d",d:"M111.503 27.227c-1.65.136-7.152 11.633.475 20.361 1.067 1.223 2.372 3.57 3.92 3.78 3.256.443 11.848-1.812 15.059-3.188 12.146-5.202 1.267-10.842-.308-16.792-1.421-5.366-1.725-8.762-7.928-8.997-2.92-.11-11.15 1.768-11.95 5.058-.224.108-.109-.08.732-.224z"})),b||(b=xe.createElement("path",{fill:"#6c2548",d:"M123.196 23.817c3.828 1.233 6.256 5.375 7.755 8.771-1.38-4.316-2.059-8.262-7.932-8.95-.013-.072.419-.694.177.18z"})),j||(j=xe.createElement("path",{fill:"#6c2548",d:"M127.718 23.362c1.071.893 1.961 2.794 2.438 3.984.522 1.306.088 3.329.571 4.638-1.292-3.232-1.307-5.14-3.007-8.622z"})),C||(C=xe.createElement("path",{fill:"#ffc399",d:"M125.772 33.468c-1.058.375-2.898.677-4.103 1.248-2.187 1.037-4.936-1.725-7.313-1.188-.858.194-3.845-.873-4.082-1.942-.293-1.325-.745-1.352-.078-2.22 2.619-3.402 2.815-1.566 2.932-6.896.019-.886-.2-1.312.079-2.061.279-.75.21.017 1.09-.143.879-.16 2.996-1.05 3.869-.652 1.533.699.513 3.972 1.61 5.107 1.139 1.177 3.841-.028 4.989 1.128 1.439 1.45 1.324 6.848 1.005 7.621z"})),_||(_=xe.createElement("path",{fill:"#e57c57",d:"M123.021 27.88c.285-.57.221-1.564-.026-2.586-1.175-.034-2.504.164-3.217-.575-.65-.671-.558-2.085-.692-3.277a3.502 3.502 0 0 1-.607-.122c-1.263-.372-2.67-.835-4.069-1.077-.039.008-.077.017-.111.023-.405.075-.605-.057-.733-.143l-.213-.017c-.04.05-.085.141-.144.303-.271.728-.073 1.156-.079 1.995 1.386 3.614 6.644 11.98 9.895 5.477z"})),S||(S=xe.createElement("path",{fill:"#f1f2f2",d:"M116.06 33.648c7.293 3.488 11.969 5.47 13.635 9.989-1.031-4.757-.893-8.622-4.459-15.161.675 7.425-8.761 5.37-9.176 5.172z"})),k||(k=xe.createElement("path",{fill:"#6c2548",d:"M129.697 43.002c.157-3.884-1.057-18.564-4.44-20.057-1.056-.466-10.726 1.174-7.768 1.348 4.625.27 7.293 2.775 7.928 4.28.792 1.11 3.081 8.599 4.28 14.427z"})),E||(E=xe.createElement("path",{fill:"#9e005d",d:"M129.616 43.001c.157-3.884-1.93-18.724-5.311-20.214-1.056-.467-9.776 1.333-6.819 1.505 4.626.27 7.294 2.775 7.928 4.28.792 1.11 3.003 8.599 4.202 14.427z"})),N||(N=xe.createElement("path",{fill:"#ffc399",d:"M126.288 12.877c.555 2.457-.397 1.902.078 3.488.375 1.25.729 2.066.635 3.488-.241 3.656-2.983 6.876-3.086 6.978-1.45 1.45-3.132 1.295-5.476.077-4.364-2.266-6.898-4.994-7.532-11.823-.471-5.072 3.763-8.847 9.014-8.313 3.249.332 5.449 2.04 6.367 6.103z"})),R||(R=xe.createElement("path",{fill:"#be1e2d",d:"M114.461 9.389c3.944-.179 3.02 1.925 6.539 2.973 2.794.832 5.707-1.012 5.173 3.745-.475 4.212 9.401-4.116 1.46-7.591-1.269-.556-1.137-1.414-2.378-3.013-2.598-3.343-11.337-7.055-15.061-.873-.944 1.567 2.657 4.101 4.265 4.757z"})),M||(M=xe.createElement("path",{fill:"#be1e2d",d:"M114.282 9.508c.912 3.597-.161 4.23-.653 5.47-.541 1.364-.803 2.65-1.487 3.925-.992-2.07-2.184-.317-5.276-4.36-5.537-7.24 9.782-16.915 7.416-5.035z"})),L||(L=xe.createElement("path",{fill:"#ffc399",d:"M112.336 19.497c.617-1.633-4.029-4.43-3.599-1.043.209 1.642 1.516 2.574 2.913 3.151 2.294.946 1.195-1.675.569-3.057l.119.952z"})),T||(T=xe.createElement("path",{fill:"#be1e2d",d:"M113.168 14.026c.309 1.25-.03 6.814 1.785 8.997-3.152-1.714-2.37-5.13-1.785-8.997z"})),A||(A=xe.createElement("path",{fill:"#be1e2d",d:"M112.691 15.573c-.728.415-1.441 3.388-.323 5.705.006-.021.483-4.91.323-5.705z"})),O||(O=xe.createElement("path",{fill:"#9e005d",d:"M117.012 34.121c-2.877-1.74-5.509-2.068-4.725-7.2.867-1.004.747-1.897.807-3.383-1.109.396-4.086 1.948-5.434 2.655-1.985 1.04-4.361 3.41-2.458 5.39.703.73-1.758 1.923.937 6.759 1.506-2.617 2.711-4.855 3.661-4.934 3.33-.079 4.431 1.667 7.372 2.378 7.214 1.744 11.654 6.501 12.525 8.164.036-1.051-1.269-4.914-12.683-9.829z"})),I||(I=xe.createElement("path",{fill:"#9e005d",d:"M108.45 34.202c-8.258 11.429 2.709 12.432 5.351 22.998.119.48.656 1.17 1.503 1.322 5.051.903 10.884-1.744 15.862-6.92 1.408-1.463.247-4.902-1.546-5.648-2.319-1.546-7.378 4.023-13.006 2.992-.677-1.02-1.505-13.477-8.164-14.744z"})),P||(P=xe.createElement("path",{fill:"#a0c9cb",d:"m155.213 40.425-.27 9.99-6.399-1.368-.094-9.712z"})),$||($=xe.createElement("path",{fill:"#75b0b3",d:"m155.48 50.235-.509.238c.085-11.096-.171-10.3.509-10.166v9.93z"})),H||(H=xe.createElement("path",{fill:"#66a7ab",d:"M150.965 40.959c2.473.277 3.211 6.54 2.498 9.037-.119-.12-3.567-.833-3.686-.713-1.718-1.964-.992-8.57 1.188-8.324z"})),F||(F=xe.createElement("path",{fill:"#467d7f",d:"M154.983 40.783s.153-1.902 0-2.02c-.153-.12-6.641-.655-6.641-.655-.776 1.706-.431 1.282 6.641 2.675z"})),U||(U=xe.createElement("path",{fill:"#67a8ac",d:"m152.371 30.436 2.881 8.443-6.729-1.15-3.307-9.016z"})),D||(D=xe.createElement("path",{fill:"#55989b",d:"m152.988 32.518.101.02-.716-2.1-7.155-1.725.656 1.786z"})),B||(B=xe.createElement("path",{fill:"#519093",d:"m148.766 37.79-1.127.713-2.679-8.541 1.25-.893z"})),z||(z=xe.createElement("path",{fill:"#b1d3d4",d:"m152.794 30.08-.922 1.069-6.552-1.01.869-1.011z"})),q||(q=xe.createElement("path",{fill:"#a0c9cb",d:"M155.648 39.988c0 1.052-1.046 1.052-1.046 0s1.046-1.052 1.046 0z"})),W||(W=xe.createElement("path",{fill:"#a0c9cb",d:"M147.639 38.502c1.501-.95.058-.881 7.713.317-1.38 1.189-.053 1.07-7.713-.317z"})),G||(G=xe.createElement("path",{fill:"#75b0b3",d:"m155.354 38.879-1.037.832-2.444-8.681.922-1.07z"})),V||(V=xe.createElement("path",{fill:"#6b1523",d:"M117.374 55.11c1.071-.299.06-1.962.713-4.862-1.972 4.042-1.699 5.134-.713 4.862z"})),Y||(Y=xe.createElement("path",{fill:"#6b1523",d:"M119.989 48.095c.059-.594-2.913-8.918-9.097-9.276 3.448.12 10.494 9.176 8.452 9.395-1.853.535-6.076 2.32-4.41 3.925 1.307.773 1.605-3.152 4.627-3.895 4.567.882 7.438-3.94 10.415-1.874-2.809-3.503-5.362 2.14-9.989 1.725z"})),Z||(Z=xe.createElement("path",{fill:"#6c2548",d:"M127.793 46.647c.309-.639 1.427-.396 2.336-1.56.449-.576.948-.203 1.687-.222 1.541-.043 2.544 2.996 1.737 4.15-.445.635-2.745 1.297-3.62 1.518-1.771.445-3.511-3.036-2.14-3.884z"})),K||(K=xe.createElement("path",{fill:"#c44c31",d:"M123.081 15.099c-.993 1.109 1.35 4.64.988 6.262-.284 1.27-1.827.705-2.617-.157.694.027 1.78.445 1.982.078.76-1.384-1.539-4.914-.353-6.183z"})),J||(J=xe.createElement("path",{fill:"#be1e2d",d:"M124.031 23.074c-2.5.504-4.483.504-5.69-.194.579.55 1.976 1.906 3.268 1.887 1.293-.02 1.235-.569 1.355-1.11.076-.206.528-.326 1.064-.586z"})),X||(X=xe.createElement("path",{fill:"#e57c57",d:"M117.389 23.045c0-.616.545-.83 1.075-.93-.441.295-.092.88-.098.904-.481-.272-.62-.174-.977.026z"})),Q||(Q=xe.createElement("path",{fill:"#35602c",d:"m150.614 40.5-2.973-.396.428 8.839 2.736-.024c2.241-.23 2.479-8.077-.191-8.42z"})),ee||(ee=xe.createElement("path",{fill:"#569d48",d:"M149.867 44.427c.285 5.88-3.738 6.075-4.023.194-.285-5.88 3.737-6.075 4.023-.194z"})),te||(te=xe.createElement("path",{fill:"#e57c57",d:"M136.434 42.288c5.055-.658 5.866-2.932 6.341-1.11.315.786-1.069 1.442-1.903 1.755-.443.164-1.044-.055-1.551-.104-1.12-.109-1.822.562-2.885.65-.123-.631.296-1.046 0-1.189z"})),se||(se=xe.createElement("path",{fill:"#35602c",d:"M139.873 43.184c.168-.905 5.647-1.784 7.051-1.867 1.803-.107 2.161 6.066.475 6.184-2.362.164-4.487.357-6.872-.392-1.388-.435-1.904-.588-1.927-2.106-.017-1.12.749-2.068 1.273-1.819z"})),re||(re=xe.createElement("g",{fill:"#ffc399"},xe.createElement("path",{d:"M131.123 45.597c3.759-1.073 7.006-4.783 7.689-4.023 1.091 1.212-.543 2.16-1.06 3.489-.698 1.797 1.054-.037-.403 1.784-.634.792-1.961.179-2.793.179-.556.157-1.863 1.328-2.498 1.486-1.031-.158-2.364-2.042-.937-2.913z"}),xe.createElement("path",{d:"M138.898 41.243c3.239.682 4.923-.098 5.189 1.152.181.856 1.606 3.358 1.559 4.323-1.725.462-2.504-2.683-3.13-3.156-.426-.321-2.909.188-3.733.077-.824-.111-1.378-2.191.115-2.396z"}),xe.createElement("path",{d:"M141.004 43.042c.573 1.983 2.144 3.145 1.51 3.79-.848.863-1.691 1.404-2.013 1.263-1.976-.87.322-1.169-.004-1.496-.326-.328-1.995-2.12-2.34-2.198.24-.924-.094-1.263-.303-2.212.211.07 2.865.35 3.152.853z"}),xe.createElement("path",{d:"M137.707 42.446c.958-.115 1.457 1.48 1.546 1.784.166.567 1.348 1.806 1.427 2.379.179 1.277-1.071 1.188-1.755 1.456-.564.298-1.991-.743-.683-1.576-.935-.019-3.073-1.497-2.694-2.016.241-.004 1.148-2.383 2.157-2.025z"}),xe.createElement("path",{d:"M137.599 43.08c.556 1.11 1.03 3.964.873 4.28-.271.544-.865 1.07-1.51 1.34s-1.026-.943-1.978-1.893c.792-.713 1.691-.128 1.665.239-.03.438.079-.318.396-.239-.238-.317-.884-1.365-1.188-1.982-.434-.88.635-2.536 1.744-1.744zm6.311-14.765c.475 1.744-.187 2.5-.238 3.092-.085.99.758 1.205 1.348 1.901.873 1.031.792 2.22 1.505 2.775 1.983-.873.015-3.264-.193-3.786-.158-.396.034-2.875 2.016-3.032-1.348-1.665-3.249-2.22-4.44-.952z"}))),ne||(ne=xe.createElement("path",{fill:"#6b1523",d:"M112.653 25.483c-1.903.93-5.883 2.474-6.737 4.518-.599 1.431 5.707 1.11 13.081 5.31-3.805-2.774-9.996-4.01-10.307-4.992-.106-.335 2.715-4.87 3.963-4.836zm-7.374 6.024c.839 1.118 2.3 1.11 4.202 1.586-.878-.434-4.779.837-4.361 0 .157-.317-.167-.875.157-1.586z"})),oe||(oe=xe.createElement("path",{fill:"#f1f2f2",d:"M116.341 17.639c.007-.03.462-.848 2.206-1.014.678-.064 1.896.509 1.795 1.169-1.007.43-1.888.675-4.001-.155z"})),ie||(ie=xe.createElement("path",{fill:"#231f20",d:"M120.347 17.688c-.062-.337-.441-.754-.918-.767-.526-.015-1.035.55-1.044.897-.004.153.086.276.224.37.684.015 1.19-.162 1.733-.394a.422.422 0 0 0 .005-.106z"})),ae||(ae=xe.createElement("path",{fill:"#231f20",d:"M120.368 17.667c-.102-.768-1.512-1.3-2.404-1.303-1.244 0-1.491 1.171-2.272.735.177.703 1.141.928 1.801.933-2.327-.695 2.14-2.302 2.875-.365z"})),le||(le=xe.createElement("path",{fill:"#f1f2f2",d:"M123.27 17.549c.977.332 2.076-.19 2.44-.741.592-.899-1.629-2.066-2.44.74z"})),ce||(ce=xe.createElement("path",{fill:"#231f20",d:"M124.226 17.238a.33.33 0 0 0 .122.373c.604-.115 1.132-.452 1.365-.803a.576.576 0 0 0 .093-.245c-.323-.585-1.245-.539-1.58.675z"})),de||(de=xe.createElement("path",{fill:"#231f20",d:"M123.249 17.568c.092-.724.417-1.478 1.329-1.887 1.175-.528 1.537.92 1.938-.268-.147 1.467-.592 1.476-1.523 1.987 1.022-.356.958-1.906-.373-1.403-1.062.402-1.196 1.152-1.369 1.571z"})),ue||(ue=xe.createElement("path",{fill:"#be1e2d",d:"M126.024 14.621c.517.586-.337-.17-1.304-.06-.321.039-.841.352-1.122.365.554-1.076 1.663-1.17 2.426-.305zm-6.316.317c-3.103-.775-3.531.177-4.685 1.791 2.238-2.446 3.518-.587 5.132-1.94-.245.024-.473.103-.447.15z"})),pe||(pe=xe.createElement("path",{fill:"#6b1523",d:"M106.375 37.808c.416-1.427 1.651-3.48 2.315-3.607 4.108-.792 14.097 5.034 17.246 5.866-5.053-1.248-12.544-5.41-17.122-4.876-.586.192-2.081 1.901-2.439 2.617z"})),me||(me=xe.createElement("path",{fill:"#642243",d:"M140.501 28.713c-.421-1.256-1.179-2.587-.805-4.042.379-1.475 2.232-2.05 2.815-3.43-1.65-.713-1.58 1.923-2.468 2.349-.038-.782-.142-1.516-.129-2.324-1.54 2.028-.703 4.913.589 7.45zm-13.317-7.491c7.849.713 7.253 7.135 12.485 6.303-5.471 1.426-7.017-6.303-12.485-6.303z"})),ye||(ye=xe.createElement("path",{fill:"#c44c31",d:"M120.525 19.497c0 .236-.594.236-.594 0s.594-.237.594 0zm-1.903.355c0 .236-.358.236-.358 0s.358-.236.358 0zm5.768-.832c0 .316-.474.316-.474 0 0-.315.474-.315.474 0zm.89.952c0 .237-.475.237-.475 0s.475-.236.475 0zm.358-1.188c0 .236-.474.236-.474 0 0-.237.474-.237.474 0zm-5.232 1.901c0 .236-.475.236-.475 0s.475-.236.475 0z"})),he||(he=xe.createElement("path",{fill:"#569d48",d:"M136.975 46.802c-.364-.268-.53-.656-.498-1.16-4.862.762-12.996 10.236-26.102 8.07.919.613 1.743 1.082 2.706 1.382 10.638 1.337 19.676-7.332 23.896-8.292z"})),ge||(ge=xe.createElement("path",{fill:"#5f6368",d:"M238.632 23.564h2.267v.075l-5.066 5.844 5.405 7.63v.075h-2.151l-4.437-6.357-2.094 2.419v3.94h-1.754V23.563h1.754v7.028h.074zm5.892 1.085c0 .339-.124.637-.364.877s-.529.364-.877.364c-.34 0-.638-.124-.877-.364a1.198 1.198 0 0 1-.365-.877c0-.348.124-.637.365-.878.239-.24.53-.364.877-.364.339 0 .637.124.877.364.248.249.364.538.364.878zm-.355 3.22v9.327h-1.755v-9.328zm5.604 9.477c-.762 0-1.392-.232-1.896-.704-.505-.472-.762-1.126-.77-1.962v-5.215h-1.639v-1.597h1.639v-2.856h1.754v2.856h2.285v1.597h-2.284v4.644c0 .62.124 1.043.364 1.266.24.224.513.332.819.332.141 0 .273-.017.414-.05a2.19 2.19 0 0 0 .373-.124l.554 1.564c-.471.166-1.001.249-1.613.249zm-55.489-.878c-.969-.704-1.631-1.697-1.995-2.972l2.151-.878c.216.803.597 1.448 1.151 1.962.547.505 1.209.761 1.978.761.721 0 1.324-.182 1.829-.554.505-.373.754-.886.754-1.531 0-.596-.224-1.085-.662-1.474-.439-.389-1.209-.778-2.31-1.167l-.91-.323c-.977-.338-1.796-.827-2.459-1.464-.662-.637-.992-1.473-.992-2.515 0-.721.198-1.383.587-1.995.389-.613.935-1.093 1.639-1.458.695-.355 1.482-.538 2.367-.538 1.275 0 2.293.306 3.046.927.761.621 1.266 1.308 1.522 2.087l-2.051.868c-.15-.464-.43-.87-.853-1.217-.421-.356-.96-.53-1.622-.53s-1.224.166-1.68.505c-.455.34-.679.77-.679 1.3 0 .504.207.91.612 1.241.406.323 1.043.638 1.913.935l.911.306c1.249.431 2.209 1.002 2.896 1.698.687.695 1.027 1.63 1.027 2.797 0 .952-.241 1.747-.729 2.383a4.482 4.482 0 0 1-1.862 1.433 5.981 5.981 0 0 1-2.326.463c-1.209 0-2.293-.348-3.253-1.05zm9.924-11.571a1.45 1.45 0 0 1-.439-1.067c0-.423.149-.779.439-1.069a1.444 1.444 0 0 1 1.067-.439c.422 0 .778.15 1.067.44.291.289.439.645.439 1.067 0 .422-.149.778-.438 1.067a1.455 1.455 0 0 1-1.067.44c-.423-.01-.779-.15-1.068-.44zm-.05 1.937h2.234v10.362h-2.234zm7.093 10.304a2.898 2.898 0 0 1-.993-.588c-.579-.579-.878-1.373-.878-2.375v-5.372h-1.812v-1.97h1.812v-2.92h2.235v2.93h2.517v1.97h-2.517v4.874c0 .555.108.952.323 1.176.207.273.555.405 1.06.405.231 0 .43-.033.612-.091.174-.058.364-.157.571-.298v2.177c-.447.207-.985.306-1.622.306a3.735 3.735 0 0 1-1.308-.224zm6.133-.33a4.946 4.946 0 0 1-1.887-1.962c-.455-.836-.679-1.771-.679-2.814 0-.994.224-1.904.662-2.756.439-.845 1.052-1.523 1.838-2.02s1.68-.754 2.682-.754c1.043 0 1.945.232 2.714.688a4.572 4.572 0 0 1 1.747 1.887c.397.803.596 1.697.596 2.707 0 .19-.017.43-.058.711h-7.946c.083.96.423 1.706 1.026 2.227.58.512 1.33.79 2.103.778.637 0 1.192-.141 1.655-.439a3.185 3.185 0 0 0 1.126-1.192l1.887.894a5.577 5.577 0 0 1-1.912 2.011c-.786.489-1.73.729-2.823.729-1.018.016-1.927-.215-2.731-.695zm5.397-6.01a2.497 2.497 0 0 0-.348-1.084 2.486 2.486 0 0 0-.927-.902c-.413-.24-.918-.364-1.515-.364-.72 0-1.324.215-1.821.637-.496.422-.836 1.001-1.026 1.714z"})),fe||(fe=xe.createElement("g",{fillRule:"evenodd",clipPath:"url(#yoast-connect-google-site-kit_svg__g)",clipRule:"evenodd"},xe.createElement("path",{fill:"#fbbc05",d:"m170.119 26.56 2.576 1.97a4.563 4.563 0 0 0 0 2.85l-2.576 1.97a7.667 7.667 0 0 1-.785-3.395c0-1.22.283-2.373.785-3.394z"}),xe.createElement("path",{fill:"#ea4335",d:"m172.696 28.53-2.577-1.97a7.64 7.64 0 0 1 6.877-4.266c1.95 0 3.691.731 5.049 1.915l-2.229 2.229a4.428 4.428 0 0 0-2.82-1.01 4.518 4.518 0 0 0-4.3 3.103z"}),xe.createElement("path",{fill:"#34a853",d:"m170.118 33.347 2.576-1.975a4.514 4.514 0 0 0 4.301 3.11c2.124 0 3.726-1.08 4.109-2.96h-4.109v-2.96h7.139c.104.452.174.94.174 1.392 0 4.875-3.482 7.661-7.313 7.661a7.637 7.637 0 0 1-6.877-4.268z"}),xe.createElement("path",{fill:"#4285f4",d:"m181.988 35.707-2.446-1.893c.8-.505 1.357-1.284 1.562-2.293h-4.109v-2.96h7.138c.105.453.175.94.175 1.393 0 2.497-.914 4.446-2.32 5.753z"}))))},4432(e,t,s){"use strict";var r=s(1802),n=s.n(r);s(3657),s(790),n().string.isRequired,n().object.isRequired,n().string.isRequired,n().func.isRequired,n().bool.isRequired},4578(e,t,s){"use strict";s.d(t,{K:()=>c});var r=s(5831),n=s(1802),o=s.n(n),i=s(5431),a=s(8572),l=s(790);const c=({linkStoreName:e=i.sH,className:t=""})=>(0,l.jsxs)(r.Alert,{variant:"error",className:t,children:[(0,l.jsx)("span",{className:"yst-block yst-font-medium",children:a.D}),(0,l.jsx)(a.n,{linkStoreName:e})]});c.propTypes={linkStoreName:o().string,className:o().string}},4658(e,t,s){"use strict";s.d(t,{En:()=>r.En,Jn:()=>r.Jn,Kw:()=>c,ZF:()=>r.ZF,mw:()=>r.mw});var r=s(5750),n=s(7723),o=s(5831),i=s(1802),a=s.n(i),l=s(790);const c=({showActions:e=!1,onRetry:t,onClose:s})=>(0,l.jsxs)(r.En,{children:[(0,l.jsx)(r.Jn,{onClose:s}),e&&(0,l.jsx)(o.Button,{variant:"primary",onClick:t,children:(0,n.__)("Try again","wordpress-seo")})]});c.propTypes={showActions:a().bool,onRetry:a().func.isRequired,onClose:a().func.isRequired}},4719(e,t,s){const r=s(1609),n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.exports=n},4730(e,t,s){"use strict";s.d(t,{v:()=>C});var r=s(7143),n=s(7723),o=s(818),i=s.n(o),a=s(6702),l=s.n(a),c=s(5831),d=s(8468),u=s(1802),p=s.n(u),m=s(2458),y=s(3657),h=s(5431),g=s(7753),f=s(2027),x=s(4658),v=s(790);const w=({learnMoreUrl:e=""})=>(0,v.jsx)(f.f,{children:(0,m.x)((0,n.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
97 97 (0,n.__)("%1$sLearn more about connecting with MyYoast.%2$s","wordpress-seo"),"<a>","</a>"),{a:(0,v.jsx)(y.rd,{variant:"error",href:e})})});w.propTypes={learnMoreUrl:p().string};const b=()=>{const e=(0,c.useSvgAria)(),{commonErrorsLink:t,supportLink:s}=(0,r.useSelect)(e=>{const t=e(h.sH);return{commonErrorsLink:t.selectLink("https://yoa.st/ai-common-errors"),supportLink:t.selectAdminLink("?page=wpseo_page_support")}},[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(x.mw,{children:(0,v.jsx)(f.f,{children:(0,n.__)("This feature requires a publicly accessible site. Check that your site (including any password-protected REST APIs or test environments) is visible to the public, then try again.","wordpress-seo")})}),(0,v.jsxs)(x.En,{children:[(0,v.jsxs)(c.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"secondary",children:[(0,n.__)("Still need help?","wordpress-seo"),(0,v.jsx)(l(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 yst-text-slate-400 rtl:yst-rotate-[270deg]",...e}),(0,v.jsx)("span",{className:"yst-sr-only",children:(0,n.__)("(Opens in a new browser tab)","wordpress-seo")})]}),(0,v.jsxs)(c.Button,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,n.__)("Learn more","wordpress-seo"),(0,v.jsx)(i(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-180",...e})]})]})]})},j=({isAvailable:e,canConnect:t,connectUrl:s,learnMoreUrl:r},o,i)=>e&&t&&s?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(x.mw,{children:[(0,v.jsx)(f.f,{children:(0,n.__)("This feature requires a publicly accessible site. Connect to MyYoast to use Yoast AI even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,v.jsx)(w,{learnMoreUrl:r})]}),(0,v.jsxs)(x.En,{children:[(0,v.jsx)(x.Jn,{onClose:o}),(0,v.jsxs)(c.Button,{as:"a",href:s,target:"_blank",rel:"noopener noreferrer",variant:"primary",children:[(0,n.__)("Connect to MyYoast","wordpress-seo"),(0,v.jsx)(l(),{className:"yst--me-1 yst-ms-1 yst-h-4 yst-w-4 rtl:yst-rotate-[270deg]",...i}),(0,v.jsx)("span",{className:"yst-sr-only",children:(0,n.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]}):e&&!t?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(x.mw,{children:[(0,v.jsx)(f.f,{children:(0,n.__)("Your site isn't publicly accessible. Ask your site administrator to connect to MyYoast. They can find it on the Integrations page in Yoast SEO. This allows Yoast AI to work even when your site is offline, behind a firewall, or with the REST API disabled.","wordpress-seo")}),(0,v.jsx)(w,{learnMoreUrl:r})]}),(0,v.jsx)(x.En,{children:(0,v.jsx)(x.Jn,{onClose:o})})]}):(0,v.jsx)(b,{}),C=({isOpen:e=!0,onClose:t=d.noop})=>{const s=(0,c.useSvgAria)(),n=(0,r.useSelect)(e=>e(h.XA).selectMyyoastConnection(),[]);return(0,v.jsx)(x.ZF,{isOpen:e,title:g.D,onClose:t,children:j(n,t,s)})};C.propTypes={isOpen:p().bool,onClose:p().func}},4739(e,t,s){"use strict";s.d(t,{f:()=>i});var r=s(5831),n=s(1721),o=s(790);const i=()=>(0,o.jsxs)(r.Alert,{variant:"error",children:[(0,o.jsx)("span",{className:"yst-block yst-font-medium",children:n.D}),(0,o.jsx)(n.n,{})]})},4788(e,t,s){"use strict";s.d(t,{D:()=>p,n:()=>m});var r=s(7143),n=s(7723),o=s(1802),i=s.n(o),a=s(2458),l=s(3657),c=s(5431),d=s(2027),u=s(790);const p=(0,n.__)("Something went wrong","wordpress-seo"),m=({errorMessage:e=""})=>{const t=(0,r.useSelect)(e=>e(c.sH).selectAdminLink("?page=wpseo_page_support"),[]);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(d.f,{children:(0,n.sprintf)(/* translators: %s is the error response of the request. */ /* translators: %s is the error response of the request. */
98 98 (0,n.__)("The request came back with the following error: '%s'.","wordpress-seo"),e)}),(0,u.jsx)(d.f,{children:(0,a.x)((0,n.sprintf)(/* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */ /* translators: %1$s expands to an opening tag. %2$s expands to a closing tag. */
99 99 (0,n.__)("Please try again later. If the issue persists, please %1$scontact our support team%2$s.","wordpress-seo"),"<a>","</a>"),{a:(0,u.jsx)(l.rd,{variant:"error",href:t})})})]})};m.propTypes={errorMessage:i().string}},4976(e,t,s){"use strict";s.d(t,{N_:()=>u});var r=s(1609),n=s(5795),o=s(7767),i=s(5588);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},a.apply(this,arguments)}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const l=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch(e){}new Map,r.startTransition,n.flushSync,r.useId;const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,d=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,u=r.forwardRef(function(e,t){let s,{onClick:n,relative:u,reloadDocument:p,replace:m,state:y,target:h,to:g,preventScrollReset:f,unstable_viewTransition:x}=e,v=function(e,t){if(null==e)return{};var s,r,n={},o=Object.keys(e);for(r=0;r<o.length;r++)s=o[r],t.indexOf(s)>=0||(n[s]=e[s]);return n}(e,l),{basename:w}=r.useContext(o.jb),b=!1;if("string"==typeof g&&d.test(g)&&(s=g,c))try{let e=new URL(window.location.href),t=g.startsWith("//")?new URL(e.protocol+g):new URL(g),s=(0,i.pb)(t.pathname,w);t.origin===e.origin&&null!=s?g=s+t.search+t.hash:b=!0}catch(e){}let j=(0,o.$P)(g,{relative:u}),C=function(e,t){let{target:s,replace:n,state:a,preventScrollReset:l,relative:c,unstable_viewTransition:d}=void 0===t?{}:t,u=(0,o.Zp)(),p=(0,o.zy)(),m=(0,o.x$)(e,{relative:c});return r.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,s)){t.preventDefault();let s=void 0!==n?n:(0,i.AO)(p)===(0,i.AO)(m);u(e,{replace:s,state:a,preventScrollReset:l,relative:c,unstable_viewTransition:d})}},[p,u,m,n,a,s,e,l,c,d])}(g,{replace:m,state:y,target:h,preventScrollReset:f,relative:u,unstable_viewTransition:x});return r.createElement("a",a({},v,{href:s||j,onClick:b||p?n:function(e){n&&n(e),e.defaultPrevented||C(e)},ref:t,target:h}))});var p,m;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(p||(p={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(m||(m={}))},4997(e){"use strict";e.exports=window.wp.blocks},5011(e,t,s){const r=s(1609),n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"}))});e.exports=n},5074(e,t,s){const r=s(1609),n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))});e.exports=n},5103(e,t,s){"use strict";s.d(t,{A:()=>u});var r=s(1609),n=s(1679),o=s.n(n),i=s(1802),a=s.n(i),l=s(790);const c=o().p`
100 100 color: #606770;
@@ -129,9 +129,9 @@
129 129 align-items: center;
130 130 text-decoration: underline;
131 131 font-size: 14px;
132 132 cursor: pointer;
133 -`;class f extends r.Component{constructor(e){super(e),this.state={imageProperties:null,status:"loading"},this.socialMedium="Facebook",this.handleFacebookImage=this.handleFacebookImage.bind(this),this.setState=this.setState.bind(this)}async handleFacebookImage(){try{const e=await(0,m.cP)(this.props.src,this.socialMedium);this.setState(e),this.props.onImageLoaded(e.imageProperties.mode||"landscape")}catch(e){this.setState(e),this.props.onImageLoaded("landscape")}}componentDidUpdate(e){e.src!==this.props.src&&this.handleFacebookImage()}componentDidMount(){this.handleFacebookImage()}retrieveContainerDimensions(e){switch(e){case"square":return{height:d.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:d.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:d.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,y.jsx)(g,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,l.__)("Select image","wordpress-seo")});const s=this.retrieveContainerDimensions(e.mode);return(0,y.jsx)(h,{mode:e.mode,dimensions:s,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,y.jsx)(p.N,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:d.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}f.propTypes={src:a().string,alt:a().string,onImageLoaded:a().func,onImageClick:a().func,onMouseEnter:a().func,onMouseLeave:a().func},f.defaultProps={src:"",alt:"",onImageLoaded:c.noop,onImageClick:c.noop,onMouseEnter:c.noop,onMouseLeave:c.noop};const x=f},5687(e,t,s){const r=s(1609),n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=n},5704(e,t,s){"use strict";s.d(t,{A:()=>y});var r=s(1455),n=s.n(r),o=s(7143),i=s(6087),a=s(7723),l=s(5831),c=s(1802),d=s.n(c),u=s(5431),p=s(6240),m=s(790);const y=({invalidSubscriptions:e=[]})=>{const t=(0,o.useSelect)(e=>e(u.XA).selectBustSubscriptionCacheEndpoint(),[]),{onClose:s}=(0,l.useModalContext)(),r=(0,i.useCallback)(async()=>{try{await n()({path:t,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);return(0,m.jsxs)(i.Fragment,{children:[(0,m.jsxs)(l.Alert,{variant:"error",children:[(0,m.jsx)("span",{className:"yst-block yst-font-medium",children:p.D}),(0,m.jsx)(p.n,{invalidSubscriptions:e})]}),(0,m.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,m.jsx)(l.Button,{variant:"secondary",onClick:s,children:(0,a.__)("Close","wordpress-seo")}),(0,m.jsx)(l.Button,{variant:"primary",onClick:r,children:(0,a.__)("Refresh page","wordpress-seo")})]})]})};y.propTypes={invalidSubscriptions:d().arrayOf(d().string)}},5768(e,t,s){"use strict";s.d(t,{e:()=>p});var r=s(6702),n=s.n(r),o=s(6087),i=s(2458),a=s(7723),l=s(5831),c=s(1802),d=s.n(c),u=s(790);const p=({link:e})=>{const t=(0,o.useMemo)(()=>(0,i.x)((0,a.sprintf)(/* translators: %1$s expands to "Yoast SEO" academy, which is a clickable link. */ /* translators: %1$s expands to "Yoast SEO" academy, which is a clickable link. */
133 +`;class f extends r.Component{constructor(e){super(e),this.state={imageProperties:null,status:"loading"},this.socialMedium="Facebook",this.handleFacebookImage=this.handleFacebookImage.bind(this),this.setState=this.setState.bind(this)}async handleFacebookImage(){try{const e=await(0,m.cP)(this.props.src,this.socialMedium);this.setState(e),this.props.onImageLoaded(e.imageProperties.mode||"landscape")}catch(e){this.setState(e),this.props.onImageLoaded("landscape")}}componentDidUpdate(e){e.src!==this.props.src&&this.handleFacebookImage()}componentDidMount(){this.handleFacebookImage()}retrieveContainerDimensions(e){switch(e){case"square":return{height:d.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:d.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:d.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){const{imageProperties:e,status:t}=this.state;if("loading"===t||""===this.props.src||"errored"===t)return(0,y.jsx)(g,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,children:(0,l.__)("Select image","wordpress-seo")});const s=this.retrieveContainerDimensions(e.mode);return(0,y.jsx)(h,{mode:e.mode,dimensions:s,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick,children:(0,y.jsx)(p.N,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:d.FACEBOOK_IMAGE_SIZES.aspectRatio},width:e.width,height:e.height,imageMode:e.mode})})}}f.propTypes={src:a().string,alt:a().string,onImageLoaded:a().func,onImageClick:a().func,onMouseEnter:a().func,onMouseLeave:a().func},f.defaultProps={src:"",alt:"",onImageLoaded:c.noop,onImageClick:c.noop,onMouseEnter:c.noop,onMouseLeave:c.noop};const x=f},5687(e,t,s){const r=s(1609),n=r.forwardRef(function(e,t){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),r.createElement("path",{fillRule:"evenodd",d:"M10.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L12.586 11H5a1 1 0 110-2h7.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))});e.exports=n},5704(e,t,s){"use strict";s.d(t,{A:()=>y});var r=s(1455),n=s.n(r),o=s(7143),i=s(6087),a=s(7723),l=s(5831),c=s(1802),d=s.n(c),u=s(5431),p=s(6240),m=s(790);const y=({invalidSubscriptions:e=[]})=>{const t=(0,o.useSelect)(e=>e(u.XA).selectBustSubscriptionCacheEndpoint(),[]),{onClose:s}=(0,l.useModalContext)(),r=(0,i.useCallback)(async()=>{try{await n()({path:t,method:"POST",parse:!1})}catch(e){console.error(e)}window.location.reload()},[]);return(0,m.jsxs)(i.Fragment,{children:[(0,m.jsxs)(l.Alert,{variant:"error",children:[(0,m.jsx)("span",{className:"yst-block yst-font-medium",children:p.D}),(0,m.jsx)(p.n,{invalidSubscriptions:e})]}),(0,m.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,m.jsx)(l.Button,{variant:"secondary",onClick:s,children:(0,a.__)("Close","wordpress-seo")}),(0,m.jsx)(l.Button,{variant:"primary",onClick:r,children:(0,a.__)("Refresh page","wordpress-seo")})]})]})};y.propTypes={invalidSubscriptions:d().arrayOf(d().string)}},5750(e,t,s){"use strict";s.d(t,{En:()=>d,Jn:()=>u,ZF:()=>p,mw:()=>c});var r=s(5074),n=s.n(r),o=s(7723),i=s(5831),a=s(8468),l=s(790);const c=({children:e})=>(0,l.jsx)(i.Modal.Description,{as:"div",className:"yst-mt-2 yst-text-sm yst-text-slate-500",children:e}),d=({children:e})=>(0,l.jsx)("div",{className:"yst-mt-6 yst-flex yst-flex-row yst-justify-end yst-gap-3",children:e}),u=({onClose:e,...t})=>(0,l.jsx)(i.Button,{variant:"secondary",onClick:e,...t,children:(0,o.__)("Close","wordpress-seo")}),p=({isOpen:e,title:t,onClose:s=a.noop,children:r})=>{const c=(0,i.useSvgAria)();return(0,l.jsx)(i.Modal,{isOpen:e,onClose:s,children:(0,l.jsx)(i.Modal.Panel,{className:"yst-max-w-lg",closeButtonScreenReaderText:(0,o.__)("Dismiss","wordpress-seo"),children:(0,l.jsxs)("div",{className:"yst-flex yst-items-start yst-gap-4",children:[(0,l.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,l.jsx)(n(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...c})}),(0,l.jsxs)("div",{className:"yst-text-start yst-flex-1 yst-min-w-0",children:[(0,l.jsx)(i.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900",children:t}),r]})]})})})}},5768(e,t,s){"use strict";s.d(t,{e:()=>p});var r=s(6702),n=s.n(r),o=s(6087),i=s(2458),a=s(7723),l=s(5831),c=s(1802),d=s.n(c),u=s(790);const p=({link:e})=>{const t=(0,o.useMemo)(()=>(0,i.x)((0,a.sprintf)(/* translators: %1$s expands to "Yoast SEO" academy, which is a clickable link. */ /* translators: %1$s expands to "Yoast SEO" academy, which is a clickable link. */
134 134 (0,a.__)("Want to learn SEO from Team Yoast? Check out our %1$s!","wordpress-seo"),"<link/>"),{link:(0,u.jsx)("a",{href:e,target:"_blank",rel:"noopener",children:"Yoast SEO academy"})}),[]);return(0,u.jsxs)(l.Paper,{as:"div",className:"yst-p-6 yst-space-y-3",children:[(0,u.jsx)(l.Title,{as:"h2",size:"4",className:"yst-text-base yst-text-primary-500",children:(0,a.__)("Learn SEO","wordpress-seo")}),(0,u.jsxs)("p",{children:[t,(0,u.jsx)("br",{}),(0,a.__)("We have both free and premium online courses to learn everything you need to know about SEO.","wordpress-seo")]}),(0,u.jsxs)(l.Link,{href:e,className:"yst-block yst-font-medium",target:"_blank",rel:"noopener",children:[(0,a.sprintf)(/* translators: %1$s expands to "Yoast SEO academy". */ /* translators: %1$s expands to "Yoast SEO academy". */
135 135 (0,a.__)("Check out %1$s","wordpress-seo"),"Yoast SEO academy"),(0,u.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
136 136 (0,a.__)("(Opens in a new browser tab)","wordpress-seo")}),(0,u.jsx)(n(),{className:"yst-w-3 yst-h-3 yst-mb-[1px] yst-icon-rtl yst-inline-block"})]})]})};p.propTypes={link:d().string.isRequired}},5795(e){"use strict";e.exports=window.ReactDOM},5831(e){"use strict";e.exports=window.yoast.uiLibrary},5979(e,t,s){"use strict";s.d(t,{applyReplaceUsingPlugin:()=>i});var r=s(8468),n=(s(2310),s(9183),s(6250),s(3335));const{stripHTMLTags:o}=n.strings,i=function(e){const t=(0,r.get)(window,["YoastSEO","app","pluggable"],!1);if(!t||!(0,r.get)(window,["YoastSEO","app","pluggable","loaded"],!1))return function(e){const t=(0,r.get)(window,["YoastSEO","wp","replaceVarsPlugin","replaceVariables"],r.identity);return{url:e.url,title:o(t(e.title)),description:o(t(e.description)),filteredSEOTitle:e.filteredSEOTitle?o(t(e.filteredSEOTitle)):""}}(e);const s=t._applyModifications.bind(t);return{url:e.url,title:o(s("data_page_title",e.title)),description:o(s("data_meta_desc",e.description)),filteredSEOTitle:e.filteredSEOTitle?o(s("data_page_title",e.filteredSEOTitle)):""}}},5986(e){"use strict";e.exports=window.yoast.externals.contexts},6087(e){"use strict";e.exports=window.wp.element},6093(e,t,s){"use strict";s.d(t,{A:()=>o,Y:()=>n});var r=s(1679);const n=20,o=s.n(r)().span`
137 137 line-height: ${n}px;
@@ -271,11 +271,11 @@
271 271 /* translators: %1$s and %4$s are opening and closing paragraph HTML tags respectively.
272 272 %2$s and %3$s are opening and closing italic HTML tags respectively. */
273 273 (0,i.__)("The Yoast AI Content Planner will analyze your site and recommend topics.%1$s%2$sNote: Applying a content suggestion will replace your current blogpost content & metadata.%3$s%4$s","wordpress-seo"),"<p>","<i>","</i>","</p>"),{i:(0,f.jsx)("i",{}),p:(0,f.jsx)("p",{className:"yst-mt-4"})})})(e,s),g=(0,o.useSvgAria)();return(0,f.jsx)(o.Modal,{isOpen:l,onClose:c,children:(0,f.jsxs)(o.Modal.Panel,{className:"yst-text-center yst-w-96",closeButtonScreenReaderText:(0,i.__)("Close modal","wordpress-seo"),children:[(0,f.jsx)("div",{className:"yst-w-12 yst-h-12 yst-rounded-full yst-bg-ai-100 yst-flex yst-items-center yst-justify-center yst-mx-auto yst-mb-4",children:(0,f.jsx)(o.GradientSparklesIcon,{className:"yst-h-6 yst-w-6",...g})}),(0,f.jsx)(o.Modal.Title,{className:"yst-text-slate-900 yst-font-medium yst-text-lg yst-mb-2",children:u}),(0,f.jsx)(o.Modal.Description,{as:"div",className:"yst-text-slate-600 yst-text-sm yst-mb-6 yst-mx-10",children:h}),!t&&!s&&(0,f.jsx)(x,{className:"yst-mb-2"}),s?(0,f.jsxs)(o.Button,{variant:"upsell",as:"a",href:n,target:"_blank",className:"yst-w-full",rel:"noopener noreferrer",children:[(0,f.jsx)(p(),{className:"yst-w-4 yst-h-4 yst-me-2 yst-shrink-0",...g}),(0,i.sprintf)(/* translators: %s is the name of the premium product, Yoast SEO Premium. */ /* translators: %s is the name of the premium product, Yoast SEO Premium. */
274 274 (0,i.__)("Unlock with %s","wordpress-seo"),"Yoast SEO Premium"),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
275 -(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}):(0,f.jsxs)(o.Button,{onClick:r,variant:"ai-primary",className:"yst-w-full",children:[" ",(0,i.__)("Get content suggestions","wordpress-seo")," "]}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-sm",children:(0,f.jsxs)(o.Link,{as:y.rd,href:a,variant:"primary",className:"yst-inline yst-no-underline yst-font-medium",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(d(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180 yst-inline yst-ms-1.5"})]})})]})})});const b=["_formal","_informal","_ao90"],j=e=>{for(const t of b)if(e.endsWith(t))return e.slice(0,-t.length);return e},C=e=>({bottom:`calc( (${e+"px"} - 100vh) / 2 + 32px )`}),_=()=>{const{endpoint:e,postType:s,contentLocale:n,editorApiValue:o,recentContent:i,selectContentOutlineCache:a}=(0,t.useSelect)(e=>({endpoint:e(v.bw).selectContentOutlineEndpoint(),postType:e("yoast-seo/editor").getPostType(),contentLocale:e("yoast-seo/editor").getContentLocale(),editorApiValue:e("yoast-seo/editor").getEditorTypeApiValue(),recentContent:e(v.bw).selectRecentContent(),selectContentOutlineCache:e(v.bw).selectContentOutlineCache}),[]),{fetchContentOutline:l,restoreContentOutlineFromCache:c,setFeatureModalStatus:d}=(0,t.useDispatch)(v.bw);return(0,r.useCallback)(t=>{const r=a(t.id);if(r)return c({suggestion:t,outline:r}),void d(v.Qo.contentOutline);const u=j(n).replace("_","-");l({endpoint:e,postType:s,language:u,editor:o,recentContent:i,suggestion:{...t}})},[e,s,n,o,i,l,c,a,d])};var S=s(8334);const k=()=>{const{endpoint:e,postType:s,contentLocale:n,editorApiValue:o,isUsageCountLimitReached:i,usageCountEndpoint:a,hasValidPremiumSubscription:l,isPremium:c}=(0,t.useSelect)(e=>({endpoint:e(v.bw).selectContentSuggestionsEndpoint(),postType:e("yoast-seo/editor").getPostType(),contentLocale:e("yoast-seo/editor").getContentLocale(),editorApiValue:e("yoast-seo/editor").getEditorTypeApiValue(),usageCountEndpoint:e(w.XA).selectUsageCountEndpoint(),isUsageCountLimitReached:e(w.XA).isUsageCountLimitReached(),hasValidPremiumSubscription:e(w.XA).selectPremiumSubscription(),isPremium:e("yoast-seo/editor").getIsPremium()}),[]),{fetchContentPlannerSuggestions:d,setFeatureModalStatus:u,setContentSuggestionsStatus:p,setSuggestionsError:m}=(0,t.useDispatch)(v.bw),{fetchUsageCount:y,addUsageCount:h}=(0,t.useDispatch)(w.XA);return(0,r.useCallback)(async()=>{if(c&&!l)return u(v.Qo.contentSuggestions),void m({errorCode:402,errorIdentifier:"PAYMENT_REQUIRED",missingLicenses:["Yoast SEO Premium"]});if(i&&!l)return void u(v.Qo.idle);u(v.Qo.contentSuggestions),p(S.$H.loading);const{payload:t}=await y({endpoint:a,isWooProductEntity:!1});if((429===(null==t?void 0:t.errorCode)&&"USAGE_LIMIT_REACHED"===(null==t?void 0:t.errorIdentifier)||t.count>=t.limit)&&!l)return u(v.Qo.idle),void p(S.$H.idle);const r=j(n).replace("_","-");d({endpoint:e,postType:s,language:r,editor:o}),h()},[e,s,n,o,i,l,c,a,d,h,y,u,p,m])};var E=s(6692),N=s(1609);function R(...e){return e.filter(Boolean).join(" ")}function M(e,t,...s){if(e in t){let r=t[e];return"function"==typeof r?r(...s):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,M),r}var L,T,A=((T=A||{})[T.None=0]="None",T[T.RenderStrategy=1]="RenderStrategy",T[T.Static=2]="Static",T),O=((L=O||{})[L.Unmount=0]="Unmount",L[L.Hidden=1]="Hidden",L);function I({ourProps:e,theirProps:t,slot:s,defaultTag:r,features:n,visible:o=!0,name:i}){let a=$(t,e);if(o)return P(a,s,r,i);let l=null!=n?n:0;if(2&l){let{static:e=!1,...t}=a;if(e)return P(t,s,r,i)}if(1&l){let{unmount:e=!0,...t}=a;return M(e?0:1,{0:()=>null,1:()=>P({...t,hidden:!0,style:{display:"none"}},s,r,i)})}return P(a,s,r,i)}function P(e,t={},s,r){var n;let{as:o=s,children:i,refName:a="ref",...l}=U(e,["unmount","static"]),c=void 0!==e.ref?{[a]:e.ref}:{},d="function"==typeof i?i(t):i;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let u={};if(t){let e=!1,s=[];for(let[r,n]of Object.entries(t))"boolean"==typeof n&&(e=!0),!0===n&&s.push(r);e&&(u["data-headlessui-state"]=s.join(" "))}if(o===N.Fragment&&Object.keys(F(l)).length>0){if(!(0,N.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"));let e=R(null==(n=d.props)?void 0:n.className,l.className),t=e?{className:e}:{};return(0,N.cloneElement)(d,Object.assign({},$(d.props,F(U(l,["ref"]))),u,c,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let s of e)null!=s&&("function"==typeof s?s(t):s.current=t)}}}(d.ref,c.ref),t))}return(0,N.createElement)(o,Object.assign({},U(l,["ref"]),o!==N.Fragment&&c,o!==N.Fragment&&u),d)}function $(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},s={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=s[e]||(s[e]=[]),s[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(s).map(e=>[e,void 0])));for(let e in s)Object.assign(t,{[e](t,...r){let n=s[e];for(let e of n){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function H(e){var t;return Object.assign((0,N.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function F(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function U(e,t=[]){let s=Object.assign({},e);for(let e of t)e in s&&delete s[e];return s}let B=(0,N.createContext)(null);B.displayName="OpenClosedContext";var D=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(D||{});function z(){return(0,N.useContext)(B)}function q({value:e,children:t}){return N.createElement(B.Provider,{value:e},t)}var W=Object.defineProperty,G=(e,t,s)=>(((e,t,s)=>{t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!=typeof t?t+"":t,s),s);let V=new class{constructor(){G(this,"current",this.detect()),G(this,"handoffState","pending"),G(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},Y=(e,t)=>{V.isServer?(0,N.useEffect)(e,t):(0,N.useLayoutEffect)(e,t)};function K(){let e=(0,N.useRef)(!1);return Y(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Z(e){let t=(0,N.useRef)(e);return Y(()=>{t.current=e},[e]),t}function X(){let[e,t]=(0,N.useState)(V.isHandoffComplete);return e&&!1===V.isHandoffComplete&&t(!1),(0,N.useEffect)(()=>{!0!==e&&t(!0)},[e]),(0,N.useEffect)(()=>V.handoff(),[]),e}let J=function(e){let t=Z(e);return N.useCallback((...e)=>t.current(...e),[t])},Q=Symbol();function ee(...e){let t=(0,N.useRef)(e);(0,N.useEffect)(()=>{t.current=e},[e]);let s=J(e=>{for(let s of t.current)null!=s&&("function"==typeof s?s(e):s.current=e)});return e.every(e=>null==e||(null==e?void 0:e[Q]))?void 0:s}function te(){let e=[],t=[],s={enqueue(e){t.push(e)},addEventListener:(e,t,r,n)=>(e.addEventListener(t,r,n),s.add(()=>e.removeEventListener(t,r,n))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return s.add(()=>cancelAnimationFrame(t))},nextFrame:(...e)=>s.requestAnimationFrame(()=>s.requestAnimationFrame(...e)),setTimeout(...e){let t=setTimeout(...e);return s.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}(()=>{t.current&&e[0]()}),s.add(()=>{t.current=!1})},add:t=>(e.push(t),()=>{let s=e.indexOf(t);if(s>=0){let[t]=e.splice(s,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return s}function se(e,...t){e&&t.length>0&&e.classList.add(...t)}function re(e,...t){e&&t.length>0&&e.classList.remove(...t)}function ne(){let[e]=(0,N.useState)(te);return(0,N.useEffect)(()=>()=>e.dispose(),[e]),e}function oe({container:e,direction:t,classes:s,onStart:r,onStop:n}){let o=K(),i=ne(),a=Z(t);Y(()=>{let t=te();i.add(t.dispose);let l=e.current;if(l&&"idle"!==a.current&&o.current)return t.dispose(),r.current(a.current),t.add(function(e,t,s,r){let n=s?"enter":"leave",o=te(),i=void 0!==r?function(e){let t={called:!1};return(...s)=>{if(!t.called)return t.called=!0,e(...s)}}(r):()=>{};"enter"===n&&(e.removeAttribute("hidden"),e.style.display="");let a=M(n,{enter:()=>t.enter,leave:()=>t.leave}),l=M(n,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=M(n,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return re(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),se(e,...a,...c),o.nextFrame(()=>{re(e,...c),se(e,...l),function(e,t){let s=te();if(!e)return s.dispose;let{transitionDuration:r,transitionDelay:n}=getComputedStyle(e),[o,i]=[r,n].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t});if(o+i!==0){let r=s.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();s.add(()=>t()),s.dispose}(e,()=>(re(e,...a),se(e,...t.entered),i()))}),o.dispose}(l,s.current,"enter"===a.current,()=>{t.dispose(),n.current(a.current)})),t.dispose},[t])}function ie(e=""){return e.split(" ").filter(e=>e.trim().length>1)}let ae=(0,N.createContext)(null);ae.displayName="TransitionContext";var le,ce=((le=ce||{}).Visible="visible",le.Hidden="hidden",le);let de=(0,N.createContext)(null);function ue(e){return"children"in e?ue(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function pe(e,t){let s=Z(e),r=(0,N.useRef)([]),n=K(),o=ne(),i=J((e,t=O.Hidden)=>{let i=r.current.findIndex(({el:t})=>t===e);-1!==i&&(M(t,{[O.Unmount](){r.current.splice(i,1)},[O.Hidden](){r.current[i].state="hidden"}}),o.microTask(()=>{var e;!ue(r)&&n.current&&(null==(e=s.current)||e.call(s))}))}),a=J(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>i(e,O.Unmount)}),l=(0,N.useRef)([]),c=(0,N.useRef)(Promise.resolve()),d=(0,N.useRef)({enter:[],leave:[],idle:[]}),u=J((e,s,r)=>{l.current.splice(0),t&&(t.chains.current[s]=t.chains.current[s].filter(([t])=>t!==e)),null==t||t.chains.current[s].push([e,new Promise(e=>{l.current.push(e)})]),null==t||t.chains.current[s].push([e,new Promise(e=>{Promise.all(d.current[s].map(([e,t])=>t)).then(()=>e())})]),"enter"===s?c.current=c.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(s)):r(s)}),p=J((e,t,s)=>{Promise.all(d.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=l.current.shift())||e()}).then(()=>s(t))});return(0,N.useMemo)(()=>({children:r,register:a,unregister:i,onStart:u,onStop:p,wait:c,chains:d}),[a,i,r,u,p,d,c])}function me(){}de.displayName="NestingContext";let ye=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function he(e){var t;let s={};for(let r of ye)s[r]=null!=(t=e[r])?t:me;return s}let ge=A.RenderStrategy,fe=H(function(e,t){let{beforeEnter:s,afterEnter:r,beforeLeave:n,afterLeave:o,enter:i,enterFrom:a,enterTo:l,entered:c,leave:d,leaveFrom:u,leaveTo:p,...m}=e,y=(0,N.useRef)(null),h=ee(y,t),g=m.unmount?O.Unmount:O.Hidden,{show:f,appear:x,initial:v}=function(){let e=(0,N.useContext)(ae);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,b]=(0,N.useState)(f?"visible":"hidden"),j=function(){let e=(0,N.useContext)(de);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:C,unregister:_}=j,S=(0,N.useRef)(null);(0,N.useEffect)(()=>C(y),[C,y]),(0,N.useEffect)(()=>{if(g===O.Hidden&&y.current)return f&&"visible"!==w?void b("visible"):M(w,{hidden:()=>_(y),visible:()=>C(y)})},[w,y,C,_,f,g]);let k=Z({enter:ie(i),enterFrom:ie(a),enterTo:ie(l),entered:ie(c),leave:ie(d),leaveFrom:ie(u),leaveTo:ie(p)}),E=function(e){let t=(0,N.useRef)(he(e));return(0,N.useEffect)(()=>{t.current=he(e)},[e]),t}({beforeEnter:s,afterEnter:r,beforeLeave:n,afterLeave:o}),L=X();(0,N.useEffect)(()=>{if(L&&"visible"===w&&null===y.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,w,L]);let T=v&&!x,A=!L||T||S.current===f?"idle":f?"enter":"leave",P=J(e=>M(e,{enter:()=>E.current.beforeEnter(),leave:()=>E.current.beforeLeave(),idle:()=>{}})),$=J(e=>M(e,{enter:()=>E.current.afterEnter(),leave:()=>E.current.afterLeave(),idle:()=>{}})),H=pe(()=>{b("hidden"),_(y)},j);oe({container:y,classes:k,direction:A,onStart:Z(e=>{H.onStart(y,e,P)}),onStop:Z(e=>{H.onStop(y,e,$),"leave"===e&&!ue(H)&&(b("hidden"),_(y))})}),(0,N.useEffect)(()=>{!T||(g===O.Hidden?S.current=null:S.current=f)},[f,T,w]);let F=m,U={ref:h};return x&&f&&V.isServer&&(F={...F,className:R(m.className,...k.current.enter,...k.current.enterFrom)}),N.createElement(de.Provider,{value:H},N.createElement(q,{value:M(w,{visible:D.Open,hidden:D.Closed})},I({ourProps:U,theirProps:F,defaultTag:"div",features:ge,visible:"visible"===w,name:"Transition.Child"})))}),xe=H(function(e,t){let{show:s,appear:r=!1,unmount:n,...o}=e,i=(0,N.useRef)(null),a=ee(i,t);X();let l=z();if(void 0===s&&null!==l&&(s=M(l,{[D.Open]:!0,[D.Closed]:!1})),![!0,!1].includes(s))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=(0,N.useState)(s?"visible":"hidden"),u=pe(()=>{d("hidden")}),[p,m]=(0,N.useState)(!0),y=(0,N.useRef)([s]);Y(()=>{!1!==p&&y.current[y.current.length-1]!==s&&(y.current.push(s),m(!1))},[y,s]);let h=(0,N.useMemo)(()=>({show:s,appear:r,initial:p}),[s,r,p]);(0,N.useEffect)(()=>{if(s)d("visible");else if(ue(u)){let e=i.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")},[s,u]);let g={unmount:n};return N.createElement(de.Provider,{value:u},N.createElement(ae.Provider,{value:h},I({ourProps:{...g,as:N.Fragment,children:N.createElement(fe,{ref:a,...g,...o})},theirProps:{},defaultTag:N.Fragment,features:ge,visible:"visible"===c,name:"Transition"})))}),ve=H(function(e,t){let s=null!==(0,N.useContext)(ae),r=null!==z();return N.createElement(N.Fragment,null,!s&&r?N.createElement(xe,{ref:t,...e}):N.createElement(fe,{ref:t,...e}))}),we=Object.assign(xe,{Child:ve,Root:xe});var be=s(1802),je=s.n(be),Ce=s(9672),_e=s(7753);const Se=()=>(0,f.jsxs)(o.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:_e.D}),(0,f.jsx)(_e.n,{})]}),ke=({errorCode:e,errorIdentifier:s="",errorMessage:r="",missingLicenses:a=[],onRetry:l=n.noop})=>{const{onClose:c}=(0,o.useModalContext)();if((0,t.useSelect)(e=>e("yoast-seo/editor").getIsPremium(),[])&&(402===e||429===e&&"USAGE_LIMIT_REACHED"===s)){const e=a.length>0?a:["Yoast SEO Premium"];return(0,f.jsx)(Ce.AA,{invalidSubscriptions:e})}let d;switch(e){case 400:switch(s){case"SITE_UNREACHABLE":d=(0,f.jsx)(Se,{});break;case"WP_HTTP_REQUEST_ERROR":d=(0,f.jsx)(Ce.W7,{errorMessage:r});break;default:d=(0,f.jsx)(Ce.K2,{})}break;case 408:d=(0,f.jsx)(Ce.Am,{});break;case 429:d=(0,f.jsx)(Ce.IT,{});break;default:d=(0,f.jsx)(Ce.K2,{})}return(0,f.jsxs)(f.Fragment,{children:[d,(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(o.Button,{variant:"secondary",onClick:c,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(o.Button,{variant:"primary",onClick:l,children:(0,i.__)("Try again","wordpress-seo")})]})]})};ke.propTypes={errorCode:je().number.isRequired,errorIdentifier:je().string,errorMessage:je().string,missingLicenses:je().arrayOf(je().string),onRetry:je().func};var Ee=s(2580),Ne=s.n(Ee),Re=s(2509),Me=s.n(Re),Le=s(8393),Te=s.n(Le),Ae=s(5011),Oe=s.n(Ae);const Ie={informational:{classes:"yst-bg-blue-200 yst-text-blue-900",calloutClasses:"yst-bg-blue-50 yst-border-blue-200",calloutTextClasses:"yst-text-blue-900",Icon:Ne(),label:(0,i.__)("Informational","wordpress-seo"),tooltip:(0,i.__)("The user wants to find an answer to a specific question.","wordpress-seo")},navigational:{classes:"yst-bg-violet-200 yst-text-violet-900",calloutClasses:"yst-bg-violet-50 yst-border-violet-200",calloutTextClasses:"yst-text-violet-900",Icon:Te(),label:(0,i.__)("Navigational","wordpress-seo"),tooltip:(0,i.__)("The user wants to find a specific page or site.","wordpress-seo")},commercial:{classes:"yst-bg-amber-200 yst-text-amber-900",calloutClasses:"yst-bg-amber-50 yst-border-amber-200",calloutTextClasses:"yst-text-amber-900",Icon:Me(),label:(0,i.__)("Commercial","wordpress-seo"),tooltip:(0,i.__)("The user wants to investigate brands or services.","wordpress-seo")},transactional:{classes:"yst-bg-green-200 yst-text-green-900",calloutClasses:"yst-bg-green-50 yst-border-green-200",calloutTextClasses:"yst-text-green-900",Icon:Oe(),label:(0,i.__)("Transactional","wordpress-seo"),tooltip:(0,i.__)("The user wants to complete an action (conversion).","wordpress-seo")}},Pe=({intent:e,className:t,tooltipPosition:s="top-right",cursor:n="default"})=>{const i=Ie[e],a=(0,o.useSvgAria)(),l=`intent-tooltip-${e}-${(0,r.useId)()}`;if(!i)return(0,f.jsx)(o.Badge,{children:e});const{Icon:c}=i,d="pointer"===n?"yst-cursor-pointer":"yst-cursor-default";return(0,f.jsxs)(o.TooltipContainer,{children:[(0,f.jsx)(o.TooltipTrigger,{as:"span",ariaDescribedby:l,className:"yst-inline-flex yst-w-fit",children:(0,f.jsxs)(o.Badge,{className:g()("yst-relative yst-flex yst-items-center yst-gap-1 yst-w-fit",d,i.classes,t),children:[(0,f.jsx)(c,{className:g()("yst-w-3",i.classes),...a})," ",i.label]})}),(0,f.jsx)(o.TooltipWithContext,{id:l,className:"yst-max-w-48 yst-z-50 yst-text-center",position:s,children:i.tooltip})]})},$e=({suggestion:e,onClick:t})=>{const{intent:s,title:n,explanation:o}=e,i=(0,r.useCallback)(()=>t(e),[t,e]);return(0,f.jsxs)("button",{type:"button",onClick:i,className:"hover:yst-bg-slate-50 yst-group yst-text-start yst-w-full yst-rounded-md yst-border yst-border-slate-200 yst-mb-4 yst-p-4 yst-shadow-sm focus:yst-outline focus:yst-outline-2 focus:yst-outline-offset-2 focus:yst-outline-primary-500",children:[(0,f.jsx)(Pe,{intent:s,className:"yst-mb-2",cursor:"pointer"}),(0,f.jsx)("div",{className:"yst-font-medium yst-text-sm yst-mb-2 yst-text-slate-800 group-hover:yst-text-slate-900",children:(0,f.jsx)("span",{className:"group-hover:yst-border-b group-hover:yst-border-slate-900",children:n})}),(0,f.jsx)("p",{className:"yst-text-slate-600",children:o})]})},He=()=>(0,f.jsxs)("div",{className:"yst-w-full yst-rounded-md yst-border yst-border-slate-200 yst-mb-4 yst-p-4 yst-shadow-sm",children:[(0,f.jsxs)("div",{className:"yst-px-2 yst-py-1 yst-bg-white yst-inline-flex yst-gap-1 yst-items-center yst-justify-start yst-mb-2 yst-rounded-3xl yst-border yst-border-slate-300",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-2 yst-h-2 yst-rounded-full"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-20 yst-h-3 yst-rounded"})]}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-64 yst-h-[18px] yst-rounded yst-mb-3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-full yst-h-[13px] yst-rounded yst-mb-2"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-2/3 yst-h-[13px] yst-rounded"})]}),Fe=({suggestions:e,onSuggestionClick:t})=>(0,f.jsxs)("div",{children:[(0,f.jsx)(o.Modal.Description,{className:"yst-mb-4",children:(0,i.__)("Select a suggestion to generate a structured outline for your post.","wordpress-seo")}),e.map((e,s)=>(0,f.jsx)($e,{suggestion:e,onClick:t},`suggestion-${s}`))]}),Ue=()=>{const e=(0,o.useSvgAria)(),[t,s]=(0,r.useState)(0),[n,a]=(0,r.useState)(!0),[l,c]=(0,r.useState)(!0),d=[(0,i.__)("Analyzing your site content…","wordpress-seo"),(0,i.__)("Composing your content suggestions…","wordpress-seo"),(0,i.__)("Writing compelling headlines…","wordpress-seo")],u=(0,r.useRef)(null);return(0,r.useEffect)(()=>{const e=setInterval(()=>{a(!1),u.current=setTimeout(()=>{s(e=>(e+1)%d.length),a(!0)},300)},3e3);return()=>{clearInterval(e),clearTimeout(u.current)}},[]),(0,r.useEffect)(()=>{const e=setInterval(()=>{c(e=>!e)},1e3);return()=>clearInterval(e)},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-items-center yst-pb-8",children:[(0,f.jsx)(E.h,{className:"yst-w-24 yst-mb-2 yst-mt-6 yst-transition-colors yst-duration-1000 "+(l?"yst-text-primary-300":"yst-text-primary-500"),...e}),(0,f.jsxs)(o.Modal.Description,{className:"yst-italic yst-text-slate-500 yst-transition-opacity yst-duration-300 "+(n?"yst-opacity-100":"yst-opacity-0"),children:[(0,f.jsx)("span",{className:"yst-sr-only",children:" Yoast "}),d[t]]})]}),(0,f.jsxs)("div",{className:"yst-relative",children:[[...Array(5)].map((e,t)=>(0,f.jsx)(He,{},t)),(0,f.jsx)("div",{className:"yst-absolute yst-inset-0 yst-bg-gradient-to-t yst-from-white yst-to-transparent yst-transition-opacity","aria-hidden":"true"})]})]})},Be=(0,a.compose)([(0,t.withSelect)(e=>{const{selectSuggestions:t,selectSuggestionsStatus:s,selectSuggestionsError:r}=e(v.bw);return{suggestions:t(),status:s(),error:r()}})])(({status:e,onSuggestionClick:t=n.noop,suggestions:s,error:i,closeButtonRef:a})=>{const l=k(),c=e===S.$H.loading,d=e===S.$H.success;return(0,r.useEffect)(()=>{null!=a&&a.current&&a.current.focus()},[c]),(0,f.jsx)(o.Modal.Container.Content,{className:"yst-overflow-y-auto yst-p-6 yst-m-0",children:(0,f.jsxs)("div",{className:"yst-relative","aria-live":"polite",children:[(0,f.jsx)(we,{as:"div",show:c,enter:"yst-transition-opacity yst-duration-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300 yst-absolute yst-top-0 yst-left-0 yst-right-0",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(Ue,{})}),(0,f.jsx)(we,{as:"div",show:d,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(Fe,{suggestions:s,onSuggestionClick:t})}),e===S.$H.error&&(0,f.jsx)(ke,{errorCode:i.errorCode,errorIdentifier:i.errorIdentifier,errorMessage:i.errorMessage,missingLicenses:i.missingLicenses,onRetry:l})]})})});var De=s(4719),ze=s.n(De),qe=s(3838);const We=({intent:e,description:t})=>{const s=Ie[e],r=s?s.calloutClasses:"yst-bg-slate-50 yst-border-slate-200",n=s?s.calloutTextClasses:"yst-text-slate-900";return(0,f.jsxs)("div",{role:"note",className:g()("yst-border yst-rounded-md yst-p-4 yst-flex yst-flex-col yst-gap-2",r),children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-2",children:[(0,f.jsx)(Pe,{intent:e,tooltipPosition:"bottom-right"}),(0,f.jsx)("span",{className:g()("yst-font-medium yst-text-sm",n),children:(0,i.__)("Why this content?","wordpress-seo")})]}),(0,f.jsx)("p",{className:g()("yst-text-sm",n),children:t})]})},Ge=({children:e,className:t,dragProps:s,buttonProps:r})=>{const n=(0,o.useSvgAria)();return(0,f.jsx)("li",{...s,children:(0,f.jsxs)("button",{type:"button",className:g()("yst-h-10 yst-w-full yst-border yst-rounded-md yst-shadow yst-flex yst-items-center yst-gap-3 yst-px-3 yst-select-none",t),...r,children:[(0,f.jsxs)("svg",{className:"yst-w-2.5 yst-h-4 yst-shrink-0",viewBox:"0 0 10 16",fill:"currentColor",...n,children:[(0,f.jsx)("circle",{cx:"2",cy:"2",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"2",r:"1.5"}),(0,f.jsx)("circle",{cx:"2",cy:"8",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"8",r:"1.5"}),(0,f.jsx)("circle",{cx:"2",cy:"14",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"14",r:"1.5"})]}),(0,f.jsx)("div",{className:"yst-flex yst-items-center yst-gap-3 yst-flex-1 yst-min-w-0",children:e})]})})},Ve=({heading:e,index:t,dragOverIndex:s,onDragStart:n,onDragOver:o,onDrop:a,onDragEnd:l,onMoveUp:c,onMoveDown:d,totalItems:u,onAnnounce:p})=>{const m=(0,r.useCallback)(e=>n(e,t),[n,t]),y=(0,r.useCallback)(e=>o(e,t),[o,t]),h=(0,r.useCallback)(e=>a(e,t),[a,t]),x=(0,r.useCallback)(s=>{s.altKey&&("ArrowUp"===s.key&&t>0&&(s.preventDefault(),c(t),p(e,t)),"ArrowDown"===s.key&&t<u-1&&(s.preventDefault(),d(t),p(e,t+2)))},[t,u,c,d,p,e]),v={draggable:"true",onDragStart:m,onDragOver:y,onDrop:h,onDragEnd:l};return(0,f.jsxs)(Ge,{className:g()("yst-bg-slate-50 yst-text-slate-400 yst-border-slate-300 yst-text-sm yst-cursor-grab yst-transition-all focus:yst-outline focus:yst-outline-2 focus:yst-outline-offset-2 focus:yst-outline-primary-500",s===t&&"yst-border-primary-500 yst-border-2"),buttonProps:{onKeyDown:x},dragProps:v,children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-slate-500",children:"H2"}),(0,f.jsx)("span",{className:"yst-text-slate-600",children:e}),(0,f.jsx)("span",{className:"yst-sr-only",children:(0,i.sprintf)(/* translators: 1: current position, 2: total items. */ /* translators: 1: current position, 2: total items. */
276 -(0,i.__)("Position %1$d out of %2$d. Use Alt+Arrow Up/Down to reorder.","wordpress-seo"),t+1,u)})]})},Ye=()=>(0,f.jsxs)(Ge,{className:"yst-bg-white yst-text-slate-300 yst-border-slate-200",buttonProps:{disabled:!0},dragProps:{"aria-hidden":!0},children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3.5 yst-w-5 yst-rounded yst-shrink-0"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3.5 yst-w-32 yst-rounded"})]}),Ke=({categoryName:e,isEnabled:t,isLoading:s})=>s?(0,f.jsx)("div",{className:"yst-inline-flex yst-items-center yst-w-20 yst-h-5 yst-px-2 yst-py-1 yst-rounded-full yst-border yst-border-slate-300",children:(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-16 yst-h-3 yst-rounded"})}):t&&e?(0,f.jsx)(o.Badge,{variant:"plain",className:"yst-w-fit",children:e}):null,Ze=({category:e,isEnabled:t=!1,onToggle:s=n.noop,isLoading:r=!1})=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-3 yst-max-w-sm yst-mb-6",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-1.5",children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-justify-between",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:(0,i.__)("Suggest category","wordpress-seo")}),(0,f.jsx)(o.Toggle,{id:"suggest-category-toggle",checked:t,onChange:s,disabled:r,screenReaderLabel:(0,i.__)("Suggest category","wordpress-seo")})]}),(0,f.jsx)("p",{className:"yst-text-sm yst-text-slate-600",children:(0,i.__)("Adds post to an existing category, when applicable.","wordpress-seo")})]}),(0,f.jsx)(Ke,{categoryName:null==e?void 0:e.name,isEnabled:t,isLoading:r})]}),Xe=()=>(0,f.jsxs)("div",{className:"yst-flex yst-items-end yst-justify-between yst-mb-2",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:(0,i.__)("Blog post structure","wordpress-seo")}),(0,f.jsx)("span",{className:"yst-text-xs yst-text-slate-500",children:(0,i.__)("Drag to reorder","wordpress-seo")})]}),Je=({value:e,date:t="",locale:s,isCornerstone:r})=>{const{actual:n,score:o,max:i}=(0,qe.getDescriptionProgress)(e,t,r,!1,s),a=Math.min(n/i*100,100);return(0,f.jsx)("div",{className:"yst-w-full yst-h-1.5 yst-bg-slate-200 yst-rounded-full yst-overflow-hidden","aria-hidden":"true",children:(0,f.jsx)("div",{className:"yst-h-full yst-rounded-full yst-transition-all yst-duration-300",style:{width:`${a}%`,backgroundColor:(0,qe.getProgressColor)(o)}})})},Qe=({label:e,multiline:t=!1})=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-2",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:e}),(0,f.jsx)("div",{className:g()("yst-bg-white yst-border yst-border-slate-300 yst-rounded-md yst-shadow-sm yst-px-3 yst-py-2",t?"yst-min-h-20 yst-flex yst-flex-col yst-gap-1":"yst-h-10 yst-flex yst-items-center"),children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-full yst-h-4 yst-rounded"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-full yst-h-4 yst-rounded"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-1/2 yst-h-4 yst-rounded"})]}):(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-1/3 yst-h-4 yst-rounded"})})]}),et=()=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ze,{isLoading:!0}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-4",children:[(0,f.jsx)(Qe,{label:(0,i.__)("Focus Keyphrase","wordpress-seo")}),(0,f.jsx)(Qe,{label:(0,i.__)("Title","wordpress-seo")}),(0,f.jsx)(Qe,{label:(0,i.__)("Meta description","wordpress-seo"),multiline:!0})]}),(0,f.jsx)("hr",{className:"yst-border-slate-200 yst-my-6"}),(0,f.jsx)(Xe,{}),(0,f.jsx)("ul",{"aria-label":(0,i.__)("Blog post structure","wordpress-seo"),"aria-busy":!0,className:"yst-list-none yst-p-0 yst-m-0 yst-flex yst-flex-col yst-gap-2",children:Array.from({length:v.Tf}).map((e,t)=>(0,f.jsx)(Ye,{},`structure-row-skeleton-${t}`))})]})]}),tt=(0,a.compose)([(0,t.withSelect)(e=>{const{selectSuggestion:t,selectContentOutline:s,selectContentOutlineStatus:r,selectFeatureModalStatus:n,selectContentOutlineError:o}=e(v.bw),{getIsPremium:i}=e("yoast-seo/editor"),{isCornerstoneContent:a,getDateFromSettings:l,getContentLocale:c}=e("yoast-seo/editor");return{suggestion:t(),outline:s(),status:r(),error:o(),isPremium:i(),isActive:n()===v.Qo.contentOutline,locale:c(),date:l(),isCornerstone:a()}}),(0,t.withDispatch)(e=>{const{setFeatureModalStatus:t,saveOutlineEditsToCache:s,setSuggestion:r}=e(v.bw);return{onBackToSuggestions:(e,n)=>{s({id:e.id,structure:n}),r(e),t(v.Qo.contentSuggestions)}}})])(({status:e,onBackToSuggestions:s,onApplyOutline:n,suggestion:a,error:l,isCornerstone:c,date:d,locale:u,closeButtonRef:p})=>{const m=e===S.$H.loading,y=_(),h=(0,r.useCallback)(()=>y(a),[y,a]),[x,w]=(0,r.useState)(!0),[b,j]=(0,r.useState)(a.keyphrase),[C,k]=(0,r.useState)(a.title),[E,N]=(0,r.useState)(a.meta_description),{structure:R,dragOverIndex:M,reorderMessage:L,handleAnnounce:T,handleDragStart:A,handleDragOver:O,handleDrop:I,handleDragEnd:P,handleMoveUp:$,handleMoveDown:H}=(()=>{const e=(0,t.useSelect)(e=>e(v.bw).selectContentOutline(),[]),[s,n]=(0,r.useState)(e),[o,a]=(0,r.useState)(null),[l,c]=(0,r.useState)(""),d=(0,r.useRef)(null),u=(0,r.useCallback)((e,t)=>{c((0,i.sprintf)(/* translators: 1: heading text, 2: new 1-based position, 3: total items. */ /* translators: 1: heading text, 2: new 1-based position, 3: total items. */
277 -(0,i.__)("H2 %1$s moved to position %2$d of %3$d.","wordpress-seo"),e,t,s.length))},[s.length]);(0,r.useEffect)(()=>{n(e),c(""),a(null),d.current=null},[e]);const p=(0,r.useCallback)((e,t)=>{d.current=t,e.dataTransfer.effectAllowed="move"},[]),m=(0,r.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",a(t)},[]),y=(0,r.useCallback)((e,t)=>{e.preventDefault();const s=d.current;null!==s&&s!==t?(n(e=>{const r=[...e],[n]=r.splice(s,1),o=s<t?t-1:t;return r.splice(o,0,n),r}),a(null),d.current=null):a(null)},[]),h=(0,r.useCallback)(()=>{a(null),d.current=null},[]),g=(0,r.useCallback)(e=>{n(t=>{const s=[...t],[r]=s.splice(e,1);return s.splice(e-1,0,r),s})},[]),f=(0,r.useCallback)(e=>{n(t=>{const s=[...t],[r]=s.splice(e,1);return s.splice(e+1,0,r),s})},[]);return{structure:s,dragOverIndex:o,reorderMessage:l,handleAnnounce:u,handleDragStart:p,handleDragOver:m,handleDrop:y,handleDragEnd:h,handleMoveUp:g,handleMoveDown:f}})(),F=(0,r.useCallback)(e=>O(e,R.length),[O,R.length]),U=(0,r.useCallback)(e=>I(e,R.length),[I,R.length]);(0,r.useEffect)(()=>{j(a.keyphrase),k(a.title),N(a.meta_description)},[a]),(0,r.useEffect)(()=>{null!=p&&p.current&&p.current.focus()},[m]);const B=(0,r.useCallback)(e=>j(e.target.value),[]),D=(0,r.useCallback)(e=>k(e.target.value),[]),z=(0,r.useCallback)(e=>N(e.target.value),[]),q=(0,r.useCallback)(()=>{w(e=>!e)},[]),W=(0,r.useCallback)(()=>{s({...a,title:C,keyphrase:b,meta_description:E},R)},[s,a,C,b,E,R]),G=(0,r.useCallback)(()=>{n({title:C,metaDescription:E,focusKeyphrase:b,category:x?a.category:{name:"",id:-1},structure:R})},[n,C,E,b,x,a.category,R]),V=Boolean(a.category&&-1!==a.category.id);return e===S.$H.error?(0,f.jsx)(o.Modal.Container.Content,{className:"yst-overflow-y-auto yst-p-6 yst-m-0",children:(0,f.jsx)(ke,{errorCode:l.errorCode,errorIdentifier:l.errorIdentifier,errorMessage:l.errorMessage,missingLicenses:l.missingLicenses,onRetry:h})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(o.Modal.Container.Content,{className:"yst-overflow-y-auto yst-pt-6 yst-px-6 yst-pb-0 yst-m-0 yst-relative","aria-busy":m,children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-6",children:[(0,f.jsx)(We,{intent:a.intent,description:a.explanation}),(0,f.jsx)(o.Modal.Description,{className:"yst-text-sm yst-text-slate-600",children:(0,i.__)("Review and customize your content outline before adding it to your post","wordpress-seo")}),(0,f.jsx)("hr",{className:"yst-border-slate-200"}),(0,f.jsx)(we,{as:"div",show:m,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(et,{})}),(0,f.jsxs)(we,{as:"div",show:!m,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:[V&&(0,f.jsx)(Ze,{category:a.category,isEnabled:x,onToggle:q}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-4",children:[(0,f.jsx)(o.TextField,{id:"content-outline-focus-keyphrase",label:(0,i.__)("Focus Keyphrase","wordpress-seo"),value:b,onChange:B}),(0,f.jsx)(o.TextField,{id:"content-outline-title",label:(0,i.__)("Title","wordpress-seo"),value:C,onChange:D}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.TextareaField,{id:"content-outline-meta-description",label:(0,i.__)("Meta description","wordpress-seo"),value:E,onChange:z,className:"yst-mb-2"}),(0,f.jsx)(Je,{value:E,date:d,locale:u,isCornerstone:c})]})]}),(0,f.jsx)("hr",{className:"yst-border-slate-200 yst-my-6"}),(0,f.jsx)(Xe,{}),(0,f.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:"yst-sr-only",children:L}),(0,f.jsx)("ul",{"aria-label":(0,i.__)("Blog post structure","wordpress-seo"),className:"yst-flex yst-flex-col yst-gap-2 yst-list-none yst-p-0 yst-m-0",children:R.map((e,t)=>(0,f.jsx)(Ve,{index:t,heading:e.heading,dragOverIndex:M,onDragStart:A,onDragOver:O,onDrop:I,onDragEnd:P,onMoveUp:$,onMoveDown:H,totalItems:R.length,onAnnounce:T},e.id))}),(0,f.jsx)("div",{className:"yst-h-8",onDragOver:F,onDrop:U})]})]})]}),(0,f.jsx)("div",{className:g()(m?"yst-sticky":"yst-hidden","-yst-left-6 -yst-right-6 yst-bottom-0 yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-white yst-to-transparent yst-transition-opacity"),"aria-hidden":"true"})]}),(0,f.jsxs)(o.Modal.Container.Footer,{className:"yst-flex yst-items-center yst-justify-between yst-p-6 yst-border-t yst-border-slate-200",children:[(0,f.jsxs)(o.Button,{variant:"secondary",onClick:W,className:"yst-flex yst-items-center yst-gap-1.5",disabled:m,children:[(0,f.jsx)(ze(),{className:"yst-w-4 yst-h-4"}),(0,i.__)("Content suggestions","wordpress-seo")]}),(0,f.jsx)(o.Button,{variant:"ai-primary",onClick:G,className:"[&>.yst-button--sparkles-icon]:yst-hidden yst-ps-3",disabled:m,children:(0,i.__)("Add outline to post","wordpress-seo")})]})]})}),st="yst-mt-1 yst-mb-3",rt="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",nt=({onClose:e})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:st,children:(0,i.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,f.jsx)("div",{className:rt,children:(0,f.jsx)(o.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,i.__)("Got it!","wordpress-seo")})})]}),ot=({onClose:e,upsellLink:t,isWooProductEntity:s=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const n=(0,o.useSvgAria)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:st,children:(0,i.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
275 +(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}):(0,f.jsxs)(o.Button,{onClick:r,variant:"ai-primary",className:"yst-w-full",children:[" ",(0,i.__)("Get content suggestions","wordpress-seo")," "]}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-sm",children:(0,f.jsxs)(o.Link,{as:y.rd,href:a,variant:"primary",className:"yst-inline yst-no-underline yst-font-medium",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(d(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180 yst-inline yst-ms-1.5"})]})})]})})});const b=["_formal","_informal","_ao90"],j=e=>{for(const t of b)if(e.endsWith(t))return e.slice(0,-t.length);return e},C=e=>({bottom:`calc( (${e+"px"} - 100vh) / 2 + 32px )`}),_=()=>{const{endpoint:e,postType:s,contentLocale:n,editorApiValue:o,recentContent:i,selectContentOutlineCache:a}=(0,t.useSelect)(e=>({endpoint:e(v.bw).selectContentOutlineEndpoint(),postType:e("yoast-seo/editor").getPostType(),contentLocale:e("yoast-seo/editor").getContentLocale(),editorApiValue:e("yoast-seo/editor").getEditorTypeApiValue(),recentContent:e(v.bw).selectRecentContent(),selectContentOutlineCache:e(v.bw).selectContentOutlineCache}),[]),{fetchContentOutline:l,restoreContentOutlineFromCache:c,setFeatureModalStatus:d}=(0,t.useDispatch)(v.bw);return(0,r.useCallback)(t=>{const r=a(t.id);if(r)return c({suggestion:t,outline:r}),void d(v.Qo.contentOutline);const u=j(n).replace("_","-");l({endpoint:e,postType:s,language:u,editor:o,recentContent:i,suggestion:{...t}})},[e,s,n,o,i,l,c,a,d])};var S=s(8334);const k=()=>{const{endpoint:e,postType:s,contentLocale:n,editorApiValue:o,isUsageCountLimitReached:i,usageCountEndpoint:a,hasValidPremiumSubscription:l,isPremium:c}=(0,t.useSelect)(e=>({endpoint:e(v.bw).selectContentSuggestionsEndpoint(),postType:e("yoast-seo/editor").getPostType(),contentLocale:e("yoast-seo/editor").getContentLocale(),editorApiValue:e("yoast-seo/editor").getEditorTypeApiValue(),usageCountEndpoint:e(w.XA).selectUsageCountEndpoint(),isUsageCountLimitReached:e(w.XA).isUsageCountLimitReached(),hasValidPremiumSubscription:e(w.XA).selectPremiumSubscription(),isPremium:e("yoast-seo/editor").getIsPremium()}),[]),{fetchContentPlannerSuggestions:d,setFeatureModalStatus:u,setContentSuggestionsStatus:p,setSuggestionsError:m}=(0,t.useDispatch)(v.bw),{fetchUsageCount:y,addUsageCount:h}=(0,t.useDispatch)(w.XA);return(0,r.useCallback)(async()=>{if(c&&!l)return u(v.Qo.contentSuggestions),void m({errorCode:402,errorIdentifier:"PAYMENT_REQUIRED",missingLicenses:["Yoast SEO Premium"]});if(i&&!l)return void u(v.Qo.idle);u(v.Qo.contentSuggestions),p(S.$H.loading);const{payload:t}=await y({endpoint:a,isWooProductEntity:!1});if((429===(null==t?void 0:t.errorCode)&&"USAGE_LIMIT_REACHED"===(null==t?void 0:t.errorIdentifier)||t.count>=t.limit)&&!l)return u(v.Qo.idle),void p(S.$H.idle);const r=j(n).replace("_","-");d({endpoint:e,postType:s,language:r,editor:o}),h()},[e,s,n,o,i,l,c,a,d,h,y,u,p,m])};var E=s(6692),N=s(1609);function R(...e){return e.filter(Boolean).join(" ")}function M(e,t,...s){if(e in t){let r=t[e];return"function"==typeof r?r(...s):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,M),r}var L,T,A=((T=A||{})[T.None=0]="None",T[T.RenderStrategy=1]="RenderStrategy",T[T.Static=2]="Static",T),O=((L=O||{})[L.Unmount=0]="Unmount",L[L.Hidden=1]="Hidden",L);function I({ourProps:e,theirProps:t,slot:s,defaultTag:r,features:n,visible:o=!0,name:i}){let a=$(t,e);if(o)return P(a,s,r,i);let l=null!=n?n:0;if(2&l){let{static:e=!1,...t}=a;if(e)return P(t,s,r,i)}if(1&l){let{unmount:e=!0,...t}=a;return M(e?0:1,{0:()=>null,1:()=>P({...t,hidden:!0,style:{display:"none"}},s,r,i)})}return P(a,s,r,i)}function P(e,t={},s,r){var n;let{as:o=s,children:i,refName:a="ref",...l}=U(e,["unmount","static"]),c=void 0!==e.ref?{[a]:e.ref}:{},d="function"==typeof i?i(t):i;l.className&&"function"==typeof l.className&&(l.className=l.className(t));let u={};if(t){let e=!1,s=[];for(let[r,n]of Object.entries(t))"boolean"==typeof n&&(e=!0),!0===n&&s.push(r);e&&(u["data-headlessui-state"]=s.join(" "))}if(o===N.Fragment&&Object.keys(F(l)).length>0){if(!(0,N.isValidElement)(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"));let e=R(null==(n=d.props)?void 0:n.className,l.className),t=e?{className:e}:{};return(0,N.cloneElement)(d,Object.assign({},$(d.props,F(U(l,["ref"]))),u,c,function(...e){return{ref:e.every(e=>null==e)?void 0:t=>{for(let s of e)null!=s&&("function"==typeof s?s(t):s.current=t)}}}(d.ref,c.ref),t))}return(0,N.createElement)(o,Object.assign({},U(l,["ref"]),o!==N.Fragment&&c,o!==N.Fragment&&u),d)}function $(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},s={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=s[e]||(s[e]=[]),s[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(s).map(e=>[e,void 0])));for(let e in s)Object.assign(t,{[e](t,...r){let n=s[e];for(let e of n){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function H(e){var t;return Object.assign((0,N.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function F(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function U(e,t=[]){let s=Object.assign({},e);for(let e of t)e in s&&delete s[e];return s}let D=(0,N.createContext)(null);D.displayName="OpenClosedContext";var B=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(B||{});function z(){return(0,N.useContext)(D)}function q({value:e,children:t}){return N.createElement(D.Provider,{value:e},t)}var W=Object.defineProperty,G=(e,t,s)=>(((e,t,s)=>{t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s})(e,"symbol"!=typeof t?t+"":t,s),s);let V=new class{constructor(){G(this,"current",this.detect()),G(this,"handoffState","pending"),G(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},Y=(e,t)=>{V.isServer?(0,N.useEffect)(e,t):(0,N.useLayoutEffect)(e,t)};function Z(){let e=(0,N.useRef)(!1);return Y(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function K(e){let t=(0,N.useRef)(e);return Y(()=>{t.current=e},[e]),t}function J(){let[e,t]=(0,N.useState)(V.isHandoffComplete);return e&&!1===V.isHandoffComplete&&t(!1),(0,N.useEffect)(()=>{!0!==e&&t(!0)},[e]),(0,N.useEffect)(()=>V.handoff(),[]),e}let X=function(e){let t=K(e);return N.useCallback((...e)=>t.current(...e),[t])},Q=Symbol();function ee(...e){let t=(0,N.useRef)(e);(0,N.useEffect)(()=>{t.current=e},[e]);let s=X(e=>{for(let s of t.current)null!=s&&("function"==typeof s?s(e):s.current=e)});return e.every(e=>null==e||(null==e?void 0:e[Q]))?void 0:s}function te(){let e=[],t=[],s={enqueue(e){t.push(e)},addEventListener:(e,t,r,n)=>(e.addEventListener(t,r,n),s.add(()=>e.removeEventListener(t,r,n))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return s.add(()=>cancelAnimationFrame(t))},nextFrame:(...e)=>s.requestAnimationFrame(()=>s.requestAnimationFrame(...e)),setTimeout(...e){let t=setTimeout(...e);return s.add(()=>clearTimeout(t))},microTask(...e){let t={current:!0};return function(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}(()=>{t.current&&e[0]()}),s.add(()=>{t.current=!1})},add:t=>(e.push(t),()=>{let s=e.indexOf(t);if(s>=0){let[t]=e.splice(s,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return s}function se(e,...t){e&&t.length>0&&e.classList.add(...t)}function re(e,...t){e&&t.length>0&&e.classList.remove(...t)}function ne(){let[e]=(0,N.useState)(te);return(0,N.useEffect)(()=>()=>e.dispose(),[e]),e}function oe({container:e,direction:t,classes:s,onStart:r,onStop:n}){let o=Z(),i=ne(),a=K(t);Y(()=>{let t=te();i.add(t.dispose);let l=e.current;if(l&&"idle"!==a.current&&o.current)return t.dispose(),r.current(a.current),t.add(function(e,t,s,r){let n=s?"enter":"leave",o=te(),i=void 0!==r?function(e){let t={called:!1};return(...s)=>{if(!t.called)return t.called=!0,e(...s)}}(r):()=>{};"enter"===n&&(e.removeAttribute("hidden"),e.style.display="");let a=M(n,{enter:()=>t.enter,leave:()=>t.leave}),l=M(n,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=M(n,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return re(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),se(e,...a,...c),o.nextFrame(()=>{re(e,...c),se(e,...l),function(e,t){let s=te();if(!e)return s.dispose;let{transitionDuration:r,transitionDelay:n}=getComputedStyle(e),[o,i]=[r,n].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t});if(o+i!==0){let r=s.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),r())})}else t();s.add(()=>t()),s.dispose}(e,()=>(re(e,...a),se(e,...t.entered),i()))}),o.dispose}(l,s.current,"enter"===a.current,()=>{t.dispose(),n.current(a.current)})),t.dispose},[t])}function ie(e=""){return e.split(" ").filter(e=>e.trim().length>1)}let ae=(0,N.createContext)(null);ae.displayName="TransitionContext";var le,ce=((le=ce||{}).Visible="visible",le.Hidden="hidden",le);let de=(0,N.createContext)(null);function ue(e){return"children"in e?ue(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function pe(e,t){let s=K(e),r=(0,N.useRef)([]),n=Z(),o=ne(),i=X((e,t=O.Hidden)=>{let i=r.current.findIndex(({el:t})=>t===e);-1!==i&&(M(t,{[O.Unmount](){r.current.splice(i,1)},[O.Hidden](){r.current[i].state="hidden"}}),o.microTask(()=>{var e;!ue(r)&&n.current&&(null==(e=s.current)||e.call(s))}))}),a=X(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>i(e,O.Unmount)}),l=(0,N.useRef)([]),c=(0,N.useRef)(Promise.resolve()),d=(0,N.useRef)({enter:[],leave:[],idle:[]}),u=X((e,s,r)=>{l.current.splice(0),t&&(t.chains.current[s]=t.chains.current[s].filter(([t])=>t!==e)),null==t||t.chains.current[s].push([e,new Promise(e=>{l.current.push(e)})]),null==t||t.chains.current[s].push([e,new Promise(e=>{Promise.all(d.current[s].map(([e,t])=>t)).then(()=>e())})]),"enter"===s?c.current=c.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(s)):r(s)}),p=X((e,t,s)=>{Promise.all(d.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=l.current.shift())||e()}).then(()=>s(t))});return(0,N.useMemo)(()=>({children:r,register:a,unregister:i,onStart:u,onStop:p,wait:c,chains:d}),[a,i,r,u,p,d,c])}function me(){}de.displayName="NestingContext";let ye=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function he(e){var t;let s={};for(let r of ye)s[r]=null!=(t=e[r])?t:me;return s}let ge=A.RenderStrategy,fe=H(function(e,t){let{beforeEnter:s,afterEnter:r,beforeLeave:n,afterLeave:o,enter:i,enterFrom:a,enterTo:l,entered:c,leave:d,leaveFrom:u,leaveTo:p,...m}=e,y=(0,N.useRef)(null),h=ee(y,t),g=m.unmount?O.Unmount:O.Hidden,{show:f,appear:x,initial:v}=function(){let e=(0,N.useContext)(ae);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[w,b]=(0,N.useState)(f?"visible":"hidden"),j=function(){let e=(0,N.useContext)(de);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:C,unregister:_}=j,S=(0,N.useRef)(null);(0,N.useEffect)(()=>C(y),[C,y]),(0,N.useEffect)(()=>{if(g===O.Hidden&&y.current)return f&&"visible"!==w?void b("visible"):M(w,{hidden:()=>_(y),visible:()=>C(y)})},[w,y,C,_,f,g]);let k=K({enter:ie(i),enterFrom:ie(a),enterTo:ie(l),entered:ie(c),leave:ie(d),leaveFrom:ie(u),leaveTo:ie(p)}),E=function(e){let t=(0,N.useRef)(he(e));return(0,N.useEffect)(()=>{t.current=he(e)},[e]),t}({beforeEnter:s,afterEnter:r,beforeLeave:n,afterLeave:o}),L=J();(0,N.useEffect)(()=>{if(L&&"visible"===w&&null===y.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,w,L]);let T=v&&!x,A=!L||T||S.current===f?"idle":f?"enter":"leave",P=X(e=>M(e,{enter:()=>E.current.beforeEnter(),leave:()=>E.current.beforeLeave(),idle:()=>{}})),$=X(e=>M(e,{enter:()=>E.current.afterEnter(),leave:()=>E.current.afterLeave(),idle:()=>{}})),H=pe(()=>{b("hidden"),_(y)},j);oe({container:y,classes:k,direction:A,onStart:K(e=>{H.onStart(y,e,P)}),onStop:K(e=>{H.onStop(y,e,$),"leave"===e&&!ue(H)&&(b("hidden"),_(y))})}),(0,N.useEffect)(()=>{!T||(g===O.Hidden?S.current=null:S.current=f)},[f,T,w]);let F=m,U={ref:h};return x&&f&&V.isServer&&(F={...F,className:R(m.className,...k.current.enter,...k.current.enterFrom)}),N.createElement(de.Provider,{value:H},N.createElement(q,{value:M(w,{visible:B.Open,hidden:B.Closed})},I({ourProps:U,theirProps:F,defaultTag:"div",features:ge,visible:"visible"===w,name:"Transition.Child"})))}),xe=H(function(e,t){let{show:s,appear:r=!1,unmount:n,...o}=e,i=(0,N.useRef)(null),a=ee(i,t);J();let l=z();if(void 0===s&&null!==l&&(s=M(l,{[B.Open]:!0,[B.Closed]:!1})),![!0,!1].includes(s))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,d]=(0,N.useState)(s?"visible":"hidden"),u=pe(()=>{d("hidden")}),[p,m]=(0,N.useState)(!0),y=(0,N.useRef)([s]);Y(()=>{!1!==p&&y.current[y.current.length-1]!==s&&(y.current.push(s),m(!1))},[y,s]);let h=(0,N.useMemo)(()=>({show:s,appear:r,initial:p}),[s,r,p]);(0,N.useEffect)(()=>{if(s)d("visible");else if(ue(u)){let e=i.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&d("hidden")}else d("hidden")},[s,u]);let g={unmount:n};return N.createElement(de.Provider,{value:u},N.createElement(ae.Provider,{value:h},I({ourProps:{...g,as:N.Fragment,children:N.createElement(fe,{ref:a,...g,...o})},theirProps:{},defaultTag:N.Fragment,features:ge,visible:"visible"===c,name:"Transition"})))}),ve=H(function(e,t){let s=null!==(0,N.useContext)(ae),r=null!==z();return N.createElement(N.Fragment,null,!s&&r?N.createElement(xe,{ref:t,...e}):N.createElement(fe,{ref:t,...e}))}),we=Object.assign(xe,{Child:ve,Root:xe});var be=s(1802),je=s.n(be),Ce=s(9672),_e=s(7753);const Se=()=>(0,f.jsxs)(o.Alert,{variant:"error",children:[(0,f.jsx)("span",{className:"yst-block yst-font-medium",children:_e.D}),(0,f.jsx)(_e.n,{})]}),ke=({errorCode:e,errorIdentifier:s="",errorMessage:r="",missingLicenses:a=[],onRetry:l=n.noop})=>{const{onClose:c}=(0,o.useModalContext)();if((0,t.useSelect)(e=>e("yoast-seo/editor").getIsPremium(),[])&&(402===e||429===e&&"USAGE_LIMIT_REACHED"===s)){const e=a.length>0?a:["Yoast SEO Premium"];return(0,f.jsx)(Ce.AA,{invalidSubscriptions:e})}let d;switch(e){case 400:switch(s){case"SITE_UNREACHABLE":d=(0,f.jsx)(Se,{});break;case"WP_HTTP_REQUEST_ERROR":d=(0,f.jsx)(Ce.W7,{errorMessage:r});break;default:d=(0,f.jsx)(Ce.K2,{})}break;case 408:d=(0,f.jsx)(Ce.Am,{});break;case 429:d=(0,f.jsx)(Ce.IT,{});break;default:d=(0,f.jsx)(Ce.K2,{})}return(0,f.jsxs)(f.Fragment,{children:[d,(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(o.Button,{variant:"secondary",onClick:c,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(o.Button,{variant:"primary",onClick:l,children:(0,i.__)("Try again","wordpress-seo")})]})]})};ke.propTypes={errorCode:je().number.isRequired,errorIdentifier:je().string,errorMessage:je().string,missingLicenses:je().arrayOf(je().string),onRetry:je().func};var Ee=s(2580),Ne=s.n(Ee),Re=s(2509),Me=s.n(Re),Le=s(8393),Te=s.n(Le),Ae=s(5011),Oe=s.n(Ae);const Ie={informational:{classes:"yst-bg-blue-200 yst-text-blue-900",calloutClasses:"yst-bg-blue-50 yst-border-blue-200",calloutTextClasses:"yst-text-blue-900",Icon:Ne(),label:(0,i.__)("Informational","wordpress-seo"),tooltip:(0,i.__)("The user wants to find an answer to a specific question.","wordpress-seo")},navigational:{classes:"yst-bg-violet-200 yst-text-violet-900",calloutClasses:"yst-bg-violet-50 yst-border-violet-200",calloutTextClasses:"yst-text-violet-900",Icon:Te(),label:(0,i.__)("Navigational","wordpress-seo"),tooltip:(0,i.__)("The user wants to find a specific page or site.","wordpress-seo")},commercial:{classes:"yst-bg-amber-200 yst-text-amber-900",calloutClasses:"yst-bg-amber-50 yst-border-amber-200",calloutTextClasses:"yst-text-amber-900",Icon:Me(),label:(0,i.__)("Commercial","wordpress-seo"),tooltip:(0,i.__)("The user wants to investigate brands or services.","wordpress-seo")},transactional:{classes:"yst-bg-green-200 yst-text-green-900",calloutClasses:"yst-bg-green-50 yst-border-green-200",calloutTextClasses:"yst-text-green-900",Icon:Oe(),label:(0,i.__)("Transactional","wordpress-seo"),tooltip:(0,i.__)("The user wants to complete an action (conversion).","wordpress-seo")}},Pe=({intent:e,className:t,tooltipPosition:s="top-right",cursor:n="default"})=>{const i=Ie[e],a=(0,o.useSvgAria)(),l=`intent-tooltip-${e}-${(0,r.useId)()}`;if(!i)return(0,f.jsx)(o.Badge,{children:e});const{Icon:c}=i,d="pointer"===n?"yst-cursor-pointer":"yst-cursor-default";return(0,f.jsxs)(o.TooltipContainer,{children:[(0,f.jsx)(o.TooltipTrigger,{as:"span",ariaDescribedby:l,className:"yst-inline-flex yst-w-fit",children:(0,f.jsxs)(o.Badge,{className:g()("yst-relative yst-flex yst-items-center yst-gap-1 yst-w-fit",d,i.classes,t),children:[(0,f.jsx)(c,{className:g()("yst-w-3",i.classes),...a})," ",i.label]})}),(0,f.jsx)(o.TooltipWithContext,{id:l,className:"yst-max-w-48 yst-z-50 yst-text-center",position:s,children:i.tooltip})]})},$e=({suggestion:e,onClick:t})=>{const{intent:s,title:n,explanation:o}=e,i=(0,r.useCallback)(()=>t(e),[t,e]);return(0,f.jsxs)("button",{type:"button",onClick:i,className:"hover:yst-bg-slate-50 yst-group yst-text-start yst-w-full yst-rounded-md yst-border yst-border-slate-200 yst-mb-4 yst-p-4 yst-shadow-sm focus:yst-outline focus:yst-outline-2 focus:yst-outline-offset-2 focus:yst-outline-primary-500",children:[(0,f.jsx)(Pe,{intent:s,className:"yst-mb-2",cursor:"pointer"}),(0,f.jsx)("div",{className:"yst-font-medium yst-text-sm yst-mb-2 yst-text-slate-800 group-hover:yst-text-slate-900",children:(0,f.jsx)("span",{className:"group-hover:yst-border-b group-hover:yst-border-slate-900",children:n})}),(0,f.jsx)("p",{className:"yst-text-slate-600",children:o})]})},He=()=>(0,f.jsxs)("div",{className:"yst-w-full yst-rounded-md yst-border yst-border-slate-200 yst-mb-4 yst-p-4 yst-shadow-sm",children:[(0,f.jsxs)("div",{className:"yst-px-2 yst-py-1 yst-bg-white yst-inline-flex yst-gap-1 yst-items-center yst-justify-start yst-mb-2 yst-rounded-3xl yst-border yst-border-slate-300",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-2 yst-h-2 yst-rounded-full"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-20 yst-h-3 yst-rounded"})]}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-64 yst-h-[18px] yst-rounded yst-mb-3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-full yst-h-[13px] yst-rounded yst-mb-2"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-2/3 yst-h-[13px] yst-rounded"})]}),Fe=({suggestions:e,onSuggestionClick:t})=>(0,f.jsxs)("div",{children:[(0,f.jsx)(o.Modal.Description,{className:"yst-mb-4",children:(0,i.__)("Select a suggestion to generate a structured outline for your post.","wordpress-seo")}),e.map((e,s)=>(0,f.jsx)($e,{suggestion:e,onClick:t},`suggestion-${s}`))]}),Ue=()=>{const e=(0,o.useSvgAria)(),[t,s]=(0,r.useState)(0),[n,a]=(0,r.useState)(!0),[l,c]=(0,r.useState)(!0),d=[(0,i.__)("Analyzing your site content…","wordpress-seo"),(0,i.__)("Composing your content suggestions…","wordpress-seo"),(0,i.__)("Writing compelling headlines…","wordpress-seo")],u=(0,r.useRef)(null);return(0,r.useEffect)(()=>{const e=setInterval(()=>{a(!1),u.current=setTimeout(()=>{s(e=>(e+1)%d.length),a(!0)},300)},3e3);return()=>{clearInterval(e),clearTimeout(u.current)}},[]),(0,r.useEffect)(()=>{const e=setInterval(()=>{c(e=>!e)},1e3);return()=>clearInterval(e)},[]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-items-center yst-pb-8",children:[(0,f.jsx)(E.h,{className:"yst-w-24 yst-mb-2 yst-mt-6 yst-transition-colors yst-duration-1000 "+(l?"yst-text-primary-300":"yst-text-primary-500"),...e}),(0,f.jsxs)(o.Modal.Description,{className:"yst-italic yst-text-slate-500 yst-transition-opacity yst-duration-300 "+(n?"yst-opacity-100":"yst-opacity-0"),children:[(0,f.jsx)("span",{className:"yst-sr-only",children:" Yoast "}),d[t]]})]}),(0,f.jsxs)("div",{className:"yst-relative",children:[[...Array(5)].map((e,t)=>(0,f.jsx)(He,{},t)),(0,f.jsx)("div",{className:"yst-absolute yst-inset-0 yst-bg-gradient-to-t yst-from-white yst-to-transparent yst-transition-opacity","aria-hidden":"true"})]})]})},De=(0,a.compose)([(0,t.withSelect)(e=>{const{selectSuggestions:t,selectSuggestionsStatus:s,selectSuggestionsError:r}=e(v.bw);return{suggestions:t(),status:s(),error:r()}})])(({status:e,onSuggestionClick:t=n.noop,suggestions:s,error:i,closeButtonRef:a})=>{const l=k(),c=e===S.$H.loading,d=e===S.$H.success;return(0,r.useEffect)(()=>{null!=a&&a.current&&a.current.focus()},[c]),(0,f.jsx)(o.Modal.Container.Content,{className:"yst-overflow-y-auto yst-p-6 yst-m-0",children:(0,f.jsxs)("div",{className:"yst-relative","aria-live":"polite",children:[(0,f.jsx)(we,{as:"div",show:c,enter:"yst-transition-opacity yst-duration-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300 yst-absolute yst-top-0 yst-left-0 yst-right-0",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(Ue,{})}),(0,f.jsx)(we,{as:"div",show:d,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(Fe,{suggestions:s,onSuggestionClick:t})}),e===S.$H.error&&(0,f.jsx)(ke,{errorCode:i.errorCode,errorIdentifier:i.errorIdentifier,errorMessage:i.errorMessage,missingLicenses:i.missingLicenses,onRetry:l})]})})});var Be=s(4719),ze=s.n(Be),qe=s(3838);const We=({intent:e,description:t})=>{const s=Ie[e],r=s?s.calloutClasses:"yst-bg-slate-50 yst-border-slate-200",n=s?s.calloutTextClasses:"yst-text-slate-900";return(0,f.jsxs)("div",{role:"note",className:g()("yst-border yst-rounded-md yst-p-4 yst-flex yst-flex-col yst-gap-2",r),children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-2",children:[(0,f.jsx)(Pe,{intent:e,tooltipPosition:"bottom-right"}),(0,f.jsx)("span",{className:g()("yst-font-medium yst-text-sm",n),children:(0,i.__)("Why this content?","wordpress-seo")})]}),(0,f.jsx)("p",{className:g()("yst-text-sm",n),children:t})]})},Ge=({children:e,className:t,dragProps:s,buttonProps:r})=>{const n=(0,o.useSvgAria)();return(0,f.jsx)("li",{...s,children:(0,f.jsxs)("button",{type:"button",className:g()("yst-h-10 yst-w-full yst-border yst-rounded-md yst-shadow yst-flex yst-items-center yst-gap-3 yst-px-3 yst-select-none",t),...r,children:[(0,f.jsxs)("svg",{className:"yst-w-2.5 yst-h-4 yst-shrink-0",viewBox:"0 0 10 16",fill:"currentColor",...n,children:[(0,f.jsx)("circle",{cx:"2",cy:"2",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"2",r:"1.5"}),(0,f.jsx)("circle",{cx:"2",cy:"8",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"8",r:"1.5"}),(0,f.jsx)("circle",{cx:"2",cy:"14",r:"1.5"}),(0,f.jsx)("circle",{cx:"8",cy:"14",r:"1.5"})]}),(0,f.jsx)("div",{className:"yst-flex yst-items-center yst-gap-3 yst-flex-1 yst-min-w-0",children:e})]})})},Ve=({heading:e,index:t,dragOverIndex:s,onDragStart:n,onDragOver:o,onDrop:a,onDragEnd:l,onMoveUp:c,onMoveDown:d,totalItems:u,onAnnounce:p})=>{const m=(0,r.useCallback)(e=>n(e,t),[n,t]),y=(0,r.useCallback)(e=>o(e,t),[o,t]),h=(0,r.useCallback)(e=>a(e,t),[a,t]),x=(0,r.useCallback)(s=>{s.altKey&&("ArrowUp"===s.key&&t>0&&(s.preventDefault(),c(t),p(e,t)),"ArrowDown"===s.key&&t<u-1&&(s.preventDefault(),d(t),p(e,t+2)))},[t,u,c,d,p,e]),v={draggable:"true",onDragStart:m,onDragOver:y,onDrop:h,onDragEnd:l};return(0,f.jsxs)(Ge,{className:g()("yst-bg-slate-50 yst-text-slate-400 yst-border-slate-300 yst-text-sm yst-cursor-grab yst-transition-all focus:yst-outline focus:yst-outline-2 focus:yst-outline-offset-2 focus:yst-outline-primary-500",s===t&&"yst-border-primary-500 yst-border-2"),buttonProps:{onKeyDown:x},dragProps:v,children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-slate-500",children:"H2"}),(0,f.jsx)("span",{className:"yst-text-slate-600",children:e}),(0,f.jsx)("span",{className:"yst-sr-only",children:(0,i.sprintf)(/* translators: 1: current position, 2: total items. */ /* translators: 1: current position, 2: total items. */
276 +(0,i.__)("Position %1$d out of %2$d. Use Alt+Arrow Up/Down to reorder.","wordpress-seo"),t+1,u)})]})},Ye=()=>(0,f.jsxs)(Ge,{className:"yst-bg-white yst-text-slate-300 yst-border-slate-200",buttonProps:{disabled:!0},dragProps:{"aria-hidden":!0},children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3.5 yst-w-5 yst-rounded yst-shrink-0"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3.5 yst-w-32 yst-rounded"})]}),Ze=({categoryName:e,isEnabled:t,isLoading:s})=>s?(0,f.jsx)("div",{className:"yst-inline-flex yst-items-center yst-w-20 yst-h-5 yst-px-2 yst-py-1 yst-rounded-full yst-border yst-border-slate-300",children:(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-16 yst-h-3 yst-rounded"})}):t&&e?(0,f.jsx)(o.Badge,{variant:"plain",className:"yst-w-fit",children:e}):null,Ke=({category:e,isEnabled:t=!1,onToggle:s=n.noop,isLoading:r=!1})=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-3 yst-max-w-sm yst-mb-6",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-1.5",children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-justify-between",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:(0,i.__)("Suggest category","wordpress-seo")}),(0,f.jsx)(o.Toggle,{id:"suggest-category-toggle",checked:t,onChange:s,disabled:r,screenReaderLabel:(0,i.__)("Suggest category","wordpress-seo")})]}),(0,f.jsx)("p",{className:"yst-text-sm yst-text-slate-600",children:(0,i.__)("Adds post to an existing category, when applicable.","wordpress-seo")})]}),(0,f.jsx)(Ze,{categoryName:null==e?void 0:e.name,isEnabled:t,isLoading:r})]}),Je=()=>(0,f.jsxs)("div",{className:"yst-flex yst-items-end yst-justify-between yst-mb-2",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:(0,i.__)("Blog post structure","wordpress-seo")}),(0,f.jsx)("span",{className:"yst-text-xs yst-text-slate-500",children:(0,i.__)("Drag to reorder","wordpress-seo")})]}),Xe=({value:e,date:t="",locale:s,isCornerstone:r})=>{const{actual:n,score:o,max:i}=(0,qe.getDescriptionProgress)(e,t,r,!1,s),a=Math.min(n/i*100,100);return(0,f.jsx)("div",{className:"yst-w-full yst-h-1.5 yst-bg-slate-200 yst-rounded-full yst-overflow-hidden","aria-hidden":"true",children:(0,f.jsx)("div",{className:"yst-h-full yst-rounded-full yst-transition-all yst-duration-300",style:{width:`${a}%`,backgroundColor:(0,qe.getProgressColor)(o)}})})},Qe=({label:e,multiline:t=!1})=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-2",children:[(0,f.jsx)("span",{className:"yst-font-medium yst-text-sm yst-text-slate-800",children:e}),(0,f.jsx)("div",{className:g()("yst-bg-white yst-border yst-border-slate-300 yst-rounded-md yst-shadow-sm yst-px-3 yst-py-2",t?"yst-min-h-20 yst-flex yst-flex-col yst-gap-1":"yst-h-10 yst-flex yst-items-center"),children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-full yst-h-4 yst-rounded"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-full yst-h-4 yst-rounded"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-1/2 yst-h-4 yst-rounded"})]}):(0,f.jsx)(o.SkeletonLoader,{className:"yst-w-1/3 yst-h-4 yst-rounded"})})]}),et=()=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ke,{isLoading:!0}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-4",children:[(0,f.jsx)(Qe,{label:(0,i.__)("Focus Keyphrase","wordpress-seo")}),(0,f.jsx)(Qe,{label:(0,i.__)("Title","wordpress-seo")}),(0,f.jsx)(Qe,{label:(0,i.__)("Meta description","wordpress-seo"),multiline:!0})]}),(0,f.jsx)("hr",{className:"yst-border-slate-200 yst-my-6"}),(0,f.jsx)(Je,{}),(0,f.jsx)("ul",{"aria-label":(0,i.__)("Blog post structure","wordpress-seo"),"aria-busy":!0,className:"yst-list-none yst-p-0 yst-m-0 yst-flex yst-flex-col yst-gap-2",children:Array.from({length:v.Tf}).map((e,t)=>(0,f.jsx)(Ye,{},`structure-row-skeleton-${t}`))})]})]}),tt=(0,a.compose)([(0,t.withSelect)(e=>{const{selectSuggestion:t,selectContentOutline:s,selectContentOutlineStatus:r,selectFeatureModalStatus:n,selectContentOutlineError:o}=e(v.bw),{getIsPremium:i}=e("yoast-seo/editor"),{isCornerstoneContent:a,getDateFromSettings:l,getContentLocale:c}=e("yoast-seo/editor");return{suggestion:t(),outline:s(),status:r(),error:o(),isPremium:i(),isActive:n()===v.Qo.contentOutline,locale:c(),date:l(),isCornerstone:a()}}),(0,t.withDispatch)(e=>{const{setFeatureModalStatus:t,saveOutlineEditsToCache:s,setSuggestion:r}=e(v.bw);return{onBackToSuggestions:(e,n)=>{s({id:e.id,structure:n}),r(e),t(v.Qo.contentSuggestions)}}})])(({status:e,onBackToSuggestions:s,onApplyOutline:n,suggestion:a,error:l,isCornerstone:c,date:d,locale:u,closeButtonRef:p})=>{const m=e===S.$H.loading,y=_(),h=(0,r.useCallback)(()=>y(a),[y,a]),[x,w]=(0,r.useState)(!0),[b,j]=(0,r.useState)(a.keyphrase),[C,k]=(0,r.useState)(a.title),[E,N]=(0,r.useState)(a.meta_description),{structure:R,dragOverIndex:M,reorderMessage:L,handleAnnounce:T,handleDragStart:A,handleDragOver:O,handleDrop:I,handleDragEnd:P,handleMoveUp:$,handleMoveDown:H}=(()=>{const e=(0,t.useSelect)(e=>e(v.bw).selectContentOutline(),[]),[s,n]=(0,r.useState)(e),[o,a]=(0,r.useState)(null),[l,c]=(0,r.useState)(""),d=(0,r.useRef)(null),u=(0,r.useCallback)((e,t)=>{c((0,i.sprintf)(/* translators: 1: heading text, 2: new 1-based position, 3: total items. */ /* translators: 1: heading text, 2: new 1-based position, 3: total items. */
277 +(0,i.__)("H2 %1$s moved to position %2$d of %3$d.","wordpress-seo"),e,t,s.length))},[s.length]);(0,r.useEffect)(()=>{n(e),c(""),a(null),d.current=null},[e]);const p=(0,r.useCallback)((e,t)=>{d.current=t,e.dataTransfer.effectAllowed="move"},[]),m=(0,r.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",a(t)},[]),y=(0,r.useCallback)((e,t)=>{e.preventDefault();const s=d.current;null!==s&&s!==t?(n(e=>{const r=[...e],[n]=r.splice(s,1),o=s<t?t-1:t;return r.splice(o,0,n),r}),a(null),d.current=null):a(null)},[]),h=(0,r.useCallback)(()=>{a(null),d.current=null},[]),g=(0,r.useCallback)(e=>{n(t=>{const s=[...t],[r]=s.splice(e,1);return s.splice(e-1,0,r),s})},[]),f=(0,r.useCallback)(e=>{n(t=>{const s=[...t],[r]=s.splice(e,1);return s.splice(e+1,0,r),s})},[]);return{structure:s,dragOverIndex:o,reorderMessage:l,handleAnnounce:u,handleDragStart:p,handleDragOver:m,handleDrop:y,handleDragEnd:h,handleMoveUp:g,handleMoveDown:f}})(),F=(0,r.useCallback)(e=>O(e,R.length),[O,R.length]),U=(0,r.useCallback)(e=>I(e,R.length),[I,R.length]);(0,r.useEffect)(()=>{j(a.keyphrase),k(a.title),N(a.meta_description)},[a]),(0,r.useEffect)(()=>{null!=p&&p.current&&p.current.focus()},[m]);const D=(0,r.useCallback)(e=>j(e.target.value),[]),B=(0,r.useCallback)(e=>k(e.target.value),[]),z=(0,r.useCallback)(e=>N(e.target.value),[]),q=(0,r.useCallback)(()=>{w(e=>!e)},[]),W=(0,r.useCallback)(()=>{s({...a,title:C,keyphrase:b,meta_description:E},R)},[s,a,C,b,E,R]),G=(0,r.useCallback)(()=>{n({title:C,metaDescription:E,focusKeyphrase:b,category:x?a.category:{name:"",id:-1},structure:R})},[n,C,E,b,x,a.category,R]),V=Boolean(a.category&&-1!==a.category.id);return e===S.$H.error?(0,f.jsx)(o.Modal.Container.Content,{className:"yst-overflow-y-auto yst-p-6 yst-m-0",children:(0,f.jsx)(ke,{errorCode:l.errorCode,errorIdentifier:l.errorIdentifier,errorMessage:l.errorMessage,missingLicenses:l.missingLicenses,onRetry:h})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(o.Modal.Container.Content,{className:"yst-overflow-y-auto yst-pt-6 yst-px-6 yst-pb-0 yst-m-0 yst-relative","aria-busy":m,children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-6",children:[(0,f.jsx)(We,{intent:a.intent,description:a.explanation}),(0,f.jsx)(o.Modal.Description,{className:"yst-text-sm yst-text-slate-600",children:(0,i.__)("Review and customize your content outline before adding it to your post","wordpress-seo")}),(0,f.jsx)("hr",{className:"yst-border-slate-200"}),(0,f.jsx)(we,{as:"div",show:m,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:(0,f.jsx)(et,{})}),(0,f.jsxs)(we,{as:"div",show:!m,enter:"yst-transition-opacity yst-duration-300 yst-delay-300",enterFrom:"yst-opacity-0",enterTo:"yst-opacity-100",leave:"yst-transition-opacity yst-duration-300",leaveFrom:"yst-opacity-100",leaveTo:"yst-opacity-0",children:[V&&(0,f.jsx)(Ke,{category:a.category,isEnabled:x,onToggle:q}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col",children:[(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-gap-4",children:[(0,f.jsx)(o.TextField,{id:"content-outline-focus-keyphrase",label:(0,i.__)("Focus Keyphrase","wordpress-seo"),value:b,onChange:D}),(0,f.jsx)(o.TextField,{id:"content-outline-title",label:(0,i.__)("Title","wordpress-seo"),value:C,onChange:B}),(0,f.jsxs)("div",{children:[(0,f.jsx)(o.TextareaField,{id:"content-outline-meta-description",label:(0,i.__)("Meta description","wordpress-seo"),value:E,onChange:z,className:"yst-mb-2"}),(0,f.jsx)(Xe,{value:E,date:d,locale:u,isCornerstone:c})]})]}),(0,f.jsx)("hr",{className:"yst-border-slate-200 yst-my-6"}),(0,f.jsx)(Je,{}),(0,f.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:"yst-sr-only",children:L}),(0,f.jsx)("ul",{"aria-label":(0,i.__)("Blog post structure","wordpress-seo"),className:"yst-flex yst-flex-col yst-gap-2 yst-list-none yst-p-0 yst-m-0",children:R.map((e,t)=>(0,f.jsx)(Ve,{index:t,heading:e.heading,dragOverIndex:M,onDragStart:A,onDragOver:O,onDrop:I,onDragEnd:P,onMoveUp:$,onMoveDown:H,totalItems:R.length,onAnnounce:T},e.id))}),(0,f.jsx)("div",{className:"yst-h-8",onDragOver:F,onDrop:U})]})]})]}),(0,f.jsx)("div",{className:g()(m?"yst-sticky":"yst-hidden","-yst-left-6 -yst-right-6 yst-bottom-0 yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-white yst-to-transparent yst-transition-opacity"),"aria-hidden":"true"})]}),(0,f.jsxs)(o.Modal.Container.Footer,{className:"yst-flex yst-items-center yst-justify-between yst-p-6 yst-border-t yst-border-slate-200",children:[(0,f.jsxs)(o.Button,{variant:"secondary",onClick:W,className:"yst-flex yst-items-center yst-gap-1.5",disabled:m,children:[(0,f.jsx)(ze(),{className:"yst-w-4 yst-h-4"}),(0,i.__)("Content suggestions","wordpress-seo")]}),(0,f.jsx)(o.Button,{variant:"ai-primary",onClick:G,className:"[&>.yst-button--sparkles-icon]:yst-hidden yst-ps-3",disabled:m,children:(0,i.__)("Add outline to post","wordpress-seo")})]})]})}),st="yst-mt-1 yst-mb-3",rt="yst-flex yst-justify-end yst--me-8 yst-gap-3 yst--ms-2",nt=({onClose:e})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:st,children:(0,i.__)("As long as this is a beta feature, you get unlimited sparks.","wordpress-seo")}),(0,f.jsx)("div",{className:rt,children:(0,f.jsx)(o.Button,{type:"button",variant:"primary",size:"small",onClick:e,children:(0,i.__)("Got it!","wordpress-seo")})})]}),ot=({onClose:e,upsellLink:t,isWooProductEntity:s=!1,ctbId:r="f6a84663-465f-4cb5-8ba5-f7a6d72224b2"})=>{const n=(0,o.useSvgAria)();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:st,children:(0,i.sprintf)(/* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
278 278 (0,i.__)("Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium")}),(0,f.jsxs)("div",{className:rt,children:[(0,f.jsx)(o.Button,{type:"button",variant:"tertiary",size:"small",onClick:e,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsxs)(o.Button,{as:"a",size:"small",variant:"upsell",href:t,target:"_blank",rel:"noopener noreferrer","data-action":"load-nfd-ctb","data-ctb-id":r,children:[(0,f.jsx)(p(),{className:"yst-w-4 yst-h-4 yst--ms-1 yst-me-2 yst-shrink-0",...n}),(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast SEO Premium or Yoast WooCommerce SEO. */
279 279 (0,i.__)("Unlock with %1$s","wordpress-seo"),s?"Yoast WooCommerce SEO":"Yoast SEO Premium"),(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
280 280 (0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]})]})]})},it=({className:e=""})=>{const{isUsageCountLimitReached:s,usageCount:n,usageCountLimit:a,premiumUpsellLink:l,wooUpsellLink:c,isWooProductEntity:d,hasValidPremiumSubscription:u,hasValidWooSubscription:p}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),premiumUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks"),wooUpsellLink:s.selectLink("https://yoa.st/ai-toast-out-of-free-sparks-woo"),isWooProductEntity:s.getIsWooProductEntity(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),m=(0,r.useMemo)(()=>u&&!d||d&&p&&u,[u,d,p]),[y,,h,,g]=(0,o.useToggleState)(n===a),x=Math.max(0,a-n);(0,r.useEffect)(()=>{h(m&&n===a||!m&&x<=5)},[n,a,m,s]);const v=(0,r.useMemo)(()=>d?c:l,[d,c,l]),b=(0,r.useMemo)(()=>d&&!p,[d,p]);return y&&(0,f.jsx)(o.Notifications.Notification,{id:"ai-sparks-limit",className:e,variant:"info",dismissScreenReaderLabel:(0,i.__)("Close","wordpress-seo"),title:m?(0,i.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
281 281 (0,i._n)("You've used %s spark this month.","You've used %s sparks this month.",n,"wordpress-seo"),n):x<=5&&!s?(0,i.sprintf)(/* translators: %s is the number of the sparks. */ /* translators: %s is the number of the sparks. */
@@ -284,13 +284,13 @@
284 284 /* translators: Hidden accessibility text. */,screenReaderTextNext:(0,i.__)("Next","wordpress-seo"),...n})]}),Ut=({height:e,onFatalError:s})=>{const[a,l]=(0,r.useState)(""),{onClose:c}=(0,o.useModalContext)(),{editType:d,previewType:u,contentType:p}=xt(),y=(()=>{const{editType:e,previewType:t}=xt();let s="SEO";switch(t){case w.i0.social:s="social";break;case w.i0.twitter:s="X"}switch(e){case w.gC.title:return(0,i.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
285 285 (0,i.__)("Generated %s titles","wordpress-seo"),s);case w.gC.description:return t===w.i0.google&&(s="meta"),(0,i.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
286 286 (0,i.__)("Generated %s descriptions","wordpress-seo"),s)}})(),h=(()=>{const{editType:e,previewType:t}=xt();let s="SEO";switch(t){case w.i0.social:s="social";break;case w.i0.twitter:s="X"}switch(e){case w.gC.title:return(0,i.sprintf)(/* translators: %s is the type of title. */ /* translators: %s is the type of title. */
287 287 (0,i.__)("Apply %s title","wordpress-seo"),s);case w.gC.description:return t===w.i0.google&&(s="meta"),(0,i.sprintf)(/* translators: %s is the type of description. */ /* translators: %s is the type of description. */
288 -(0,i.__)("Apply %s description","wordpress-seo"),s)}})(),g=wt(),{suggestions:x,fetchSuggestions:v,setSelectedSuggestion:b}=gs(),j=ps(),{addAppliedSuggestion:_,addUsageCount:S}=(0,t.useDispatch)(w.XA),{isUsageCountLimitReached:k,isWooProductEntity:E,hasValidPremiumSubscription:N,hasValidWooSubscription:R}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),isPremium:s.getIsPremium(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),M=(0,r.useMemo)(()=>x.status===w.$H.loading||!(R||!k||!E)||!(N||!k),[N,k,x.status,E,R]),L=(0,o.usePrevious)(e),T=x.status===w.$H.success?e:L,{bottom:A}=C(T),[O,I]=(0,r.useState)(!1),P=(0,r.useCallback)(e=>{I(e.target.offsetHeight!==e.target.scrollHeight)},[I]),$=bt(P),H=xs(),F=(()=>{const e=(()=>{const{previewType:e}=xt();return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return()=>(0,t.select)(w.sH).getSnippetEditorData().description;case w.i0.social:return(0,t.select)(w.sH).getFacebookDescriptionOrFallback;case w.i0.twitter:return(0,t.select)(w.sH).getTwitterDescriptionOrFallback;default:return(0,n.constant)("")}},[e])})();return(0,r.useMemo)(e,[e])})(),U=(()=>{const e=(0,t.useSelect)(e=>e(w.sH).getReplaceVars(),[]),s=(0,r.useMemo)(()=>e.map(ht),[e]);return(0,r.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:o=!0,editType:i=w.gC.title,contentType:a=w.Ty.post}={})=>{for(const o of s)e=e.replace(new RegExp("%%"+(0,n.escapeRegExp)(o.name)+"%%","g"),(0,n.get)(r,o.name,o[t]));return a===w.Ty.term&&(e=e.replace(" Archives","")),o?((e,t=w.gC.title)=>{const s=(0,lt.applyReplaceUsingPlugin)({title:"",description:"",[t]:at.languageProcessing.stripSpaces(e)});return(0,n.get)(s,t,e)})(e,i):e},[s])})(),B=(0,r.useMemo)(()=>d===w.gC.title?{[w.uv[p]]:x.selected}:{},[d,p,x.selected]),D=(0,r.useMemo)(()=>U(H,{overrides:B,contentType:p}),[U,H,d,p,x.selected]),z=(0,r.useMemo)(()=>U(H,{overrides:{...B,sep:"",sitename:""},contentType:p}),[U,H,d,p,x.selected]),q=(0,r.useMemo)(()=>d===w.gC.description?x.selected:U(F,{editType:w.gC.description}),[U,F,d,x.selected]),W=(0,r.useCallback)(e=>U(H,{overrides:{[w.uv[p]]:e},key:"badge",applyPluggable:!1,contentType:p}),[U,H,p]),{currentPage:G,setCurrentPage:V,isOnLastPage:Y,totalPages:K,getItemsOnCurrentPage:Z}=(({totalItems:e=0,perPage:t=5})=>{const[s,o]=(0,r.useState)(1),i=(0,r.useMemo)(()=>Math.ceil(e/t),[e,t]),a=(0,r.useMemo)(()=>s*t,[s,t]),l=(0,r.useMemo)(()=>a-t,[a,t]),c=(0,r.useMemo)(()=>1===s,[s]),d=(0,r.useMemo)(()=>s===i,[s,i]),u=(0,r.useCallback)(()=>{s>1&&o(s-1)},[s,o]),p=(0,r.useCallback)(()=>{s<i&&o(s+1)},[s,o,i]),m=(0,r.useCallback)(e=>(0,n.slice)(e,l,a),[l,a]);return{currentPage:s,setCurrentPage:o,totalPages:i,isOnFirstPage:c,isOnLastPage:d,previousPage:u,nextPage:p,firstOnPage:l,lastOnPage:a,getItemsOnCurrentPage:m}})({totalItems:x.status===w.$H.loading||x.status===w.$H.error?x.entities.length+w.Gu:x.entities.length,perPage:w.Gu}),X=(0,r.useMemo)(()=>(0,n.map)(Z(x.entities),e=>{let t=e;return d===w.gC.title&&(t=W(e),t=t.replace(Ht,(e,t,s,r,n,o,{start:i,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${i}${a}${l}`:`${i}<span>${c}</span>${l}`}),t=(0,m.x)(t,{badge:(0,f.jsx)(o.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,f.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:t}}),[x.entities,Z,d,W]),J=(0,r.useMemo)(()=>x.status!==w.$H.error||x.status===w.$H.error&&!Y,[x.status,Y]),Q=(0,r.useMemo)(()=>x.status===w.$H.loading&&Y,[x.status,Y]),ee=(0,r.useMemo)(()=>x.status===w.$H.error&&Y,[x.status,Y]),te=(0,r.useCallback)(()=>{M||(V(x.status===w.$H.error?K:K+1),v().then(e=>{e===w.Sf.success&&S()}))},[v,x.status,K,V,b,k]),se=ms(),re=(0,$t.Z)(!0),ne=(0,r.useCallback)(()=>{const e=d===w.gC.title?H.replace(new RegExp(w.Zc[p]+"( Archives)?"),x.selected):x.selected;se(e),_({editType:d,previewType:u,suggestion:x.selected}),c(),"pre-publish"===g&&re()},[se,d,u,x.selected,H,c,_,re,g]);((e,t=[])=>{const s=(0,r.useRef)(!1);(0,r.useEffect)(()=>{s.current||(s.current=!0,e().finally(()=>{s.current=!1}))},[e,t])})(()=>""===a?v().then(e=>{l(e),e===w.Sf.success&&S()}):Promise.resolve(),[a,S,v]);const oe=a===w.Sf.error||x.status===w.$H.error&&402===x.error.code;return(0,r.useEffect)(()=>{var e,t,r,n,o,i,a,l;oe&&s({errorCode:null!==(e=null===(t=x.error)||void 0===t?void 0:t.code)&&void 0!==e?e:0,errorIdentifier:null!==(r=null===(n=x.error)||void 0===n?void 0:n.errorIdentifier)&&void 0!==r?r:"",invalidSubscriptions:null!==(o=null===(i=x.error)||void 0===i?void 0:i.missingLicenses)&&void 0!==o?o:[],errorMessage:null!==(a=null===(l=x.error)||void 0===l?void 0:l.message)&&void 0!==a?a:""})},[oe,x.error,s]),oe?null:(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)(o.Modal.Container.Content,{ref:$,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,f.jsx)(j,{title:D,description:q,status:x.status,titleForLength:z,showPreviewSkeleton:""===a,showLengthProgress:!Q}),J&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:y}),(0,f.jsx)(o.Button,{variant:"ai-secondary",size:"small",onClick:x.status===w.$H.loading?n.noop:te,isLoading:x.status===w.$H.loading,disabled:M,children:(0,i.__)("Generate 5 more","wordpress-seo")})]}),Q?(0,f.jsx)(is,{idSuffix:g,suggestionClassNames:d===w.gC.title?[["yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-8/12"]]:void 0}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ns,{idSuffix:g,suggestions:X,selected:x.selected,onChange:b}),(0,f.jsx)(Ft,{current:G,total:K,onNavigate:V,disabled:x.status===w.$H.loading||ee})]})]}),ee&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"yst-mt-8"}),(0,f.jsx)(ts,{errorCode:x.error.code,errorIdentifier:x.error.errorIdentifier,invalidSubscriptions:x.error.missingLicenses,errorMessage:x.error.message}),(0,f.jsx)(Ft,{current:G,total:K,onNavigate:V,disabled:x.status===w.$H.loading})]})]}),(0,f.jsxs)(o.Modal.Container.Footer,{children:[O&&(0,f.jsx)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-me-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,f.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,f.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,f.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,f.jsx)(o.Button,{variant:"secondary",onClick:c,children:(0,i.__)("Close","wordpress-seo")})}),(0,f.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,f.jsxs)(o.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:ne,disabled:""===x.selected||x.status===w.$H.loading||ee,children:[(0,f.jsx)(Pt(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),h]})}),(0,f.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,f.jsx)(o.Button,{variant:"secondary",onClick:c,className:"yst-w-full sm:yst-w-auto",children:(0,i.__)("Close","wordpress-seo")})})]})]}),(0,f.jsxs)(o.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:A},position:"bottom-left",children:[x.status!==w.$H.loading&&(0,f.jsx)(it,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(x.status===w.$H.success||x.status===w.$H.loading)&&(0,f.jsx)(ls,{})]})]})};Ut.propTypes={height:je().number.isRequired,onFatalError:je().func.isRequired};const Bt=({onActivateFreeSparks:e})=>{const{premiumUpsellLink:s,wooUpsellLink:n,isWooCommerceActive:a,isProductPost:l,learnMoreLink:c,imageLink:u,wistiaEmbedPermissionValue:h,wistiaEmbedPermissionStatus:x,isUsageCountLimitReached:v,activateFreeSparksEndpoint:b}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:s.getIsWooCommerceActive(),isProductPost:s.getIsProduct(),learnMoreLink:s.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:s.selectImageLink("ai-generator-preview.jpg"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:t.isUsageCountLimitReached(),activateFreeSparksEndpoint:t.selectFreeSparksActiveEndpoint()}},[]),{onClose:j,initialFocus:C}=(0,o.useModalContext)(),{title:_,upsellLabel:S,upsellLink:k,ctbId:E,newToText:N}=vs({premium:s,woo:n}),R=(0,r.useMemo)(()=>a&&l,[a,l]),M=(0,r.useMemo)(()=>({src:u,width:"432",height:"244"}),[u]),{setWistiaEmbedPermission:L}=(0,t.useDispatch)(w.sH),{activateFreeSparks:T}=(0,t.useDispatch)(w.XA),A=(0,r.useMemo)(()=>({value:h,status:x,set:L}),[h,x,L]),O=(0,r.useCallback)(()=>{T({endpoint:b}),e()},[T,b,j,e]),I={a:(0,f.jsx)(y.rd,{href:c,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,f.jsx)(d(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,f.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,f.jsx)(y.qc,{videoId:"vmrahpfjxp",thumbnail:M,wistiaEmbedPermission:A}),(0,f.jsx)(o.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info",children:"Beta"})]}),(0,f.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,f.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,f.jsx)("span",{className:"yst-logo-icon"}),N]})})]}),(0,f.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,f.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,f.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:_}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:R?(0,m.x)((0,i.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
288 +(0,i.__)("Apply %s description","wordpress-seo"),s)}})(),g=wt(),{suggestions:x,fetchSuggestions:v,setSelectedSuggestion:b}=gs(),j=ps(),{addAppliedSuggestion:_,addUsageCount:S}=(0,t.useDispatch)(w.XA),{isUsageCountLimitReached:k,isWooProductEntity:E,hasValidPremiumSubscription:N,hasValidWooSubscription:R}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{isUsageCountLimitReached:t.isUsageCountLimitReached(),isPremium:s.getIsPremium(),isWooProductEntity:s.getIsWooProductEntity(),isWooSeoActive:s.getIsWooSeoActive(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription()}},[]),M=(0,r.useMemo)(()=>x.status===w.$H.loading||!(R||!k||!E)||!(N||!k),[N,k,x.status,E,R]),L=(0,o.usePrevious)(e),T=x.status===w.$H.success?e:L,{bottom:A}=C(T),[O,I]=(0,r.useState)(!1),P=(0,r.useCallback)(e=>{I(e.target.offsetHeight!==e.target.scrollHeight)},[I]),$=bt(P),H=xs(),F=(()=>{const e=(()=>{const{previewType:e}=xt();return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return()=>(0,t.select)(w.sH).getSnippetEditorData().description;case w.i0.social:return(0,t.select)(w.sH).getFacebookDescriptionOrFallback;case w.i0.twitter:return(0,t.select)(w.sH).getTwitterDescriptionOrFallback;default:return(0,n.constant)("")}},[e])})();return(0,r.useMemo)(e,[e])})(),U=(()=>{const e=(0,t.useSelect)(e=>e(w.sH).getReplaceVars(),[]),s=(0,r.useMemo)(()=>e.map(ht),[e]);return(0,r.useCallback)((e,{key:t="value",overrides:r={},applyPluggable:o=!0,editType:i=w.gC.title,contentType:a=w.Ty.post}={})=>{for(const o of s)e=e.replace(new RegExp("%%"+(0,n.escapeRegExp)(o.name)+"%%","g"),(0,n.get)(r,o.name,o[t]));return a===w.Ty.term&&(e=e.replace(" Archives","")),o?((e,t=w.gC.title)=>{const s=(0,lt.applyReplaceUsingPlugin)({title:"",description:"",[t]:at.languageProcessing.stripSpaces(e)});return(0,n.get)(s,t,e)})(e,i):e},[s])})(),D=(0,r.useMemo)(()=>d===w.gC.title?{[w.uv[p]]:x.selected}:{},[d,p,x.selected]),B=(0,r.useMemo)(()=>U(H,{overrides:D,contentType:p}),[U,H,d,p,x.selected]),z=(0,r.useMemo)(()=>U(H,{overrides:{...D,sep:"",sitename:""},contentType:p}),[U,H,d,p,x.selected]),q=(0,r.useMemo)(()=>d===w.gC.description?x.selected:U(F,{editType:w.gC.description}),[U,F,d,x.selected]),W=(0,r.useCallback)(e=>U(H,{overrides:{[w.uv[p]]:e},key:"badge",applyPluggable:!1,contentType:p}),[U,H,p]),{currentPage:G,setCurrentPage:V,isOnLastPage:Y,totalPages:Z,getItemsOnCurrentPage:K}=(({totalItems:e=0,perPage:t=5})=>{const[s,o]=(0,r.useState)(1),i=(0,r.useMemo)(()=>Math.ceil(e/t),[e,t]),a=(0,r.useMemo)(()=>s*t,[s,t]),l=(0,r.useMemo)(()=>a-t,[a,t]),c=(0,r.useMemo)(()=>1===s,[s]),d=(0,r.useMemo)(()=>s===i,[s,i]),u=(0,r.useCallback)(()=>{s>1&&o(s-1)},[s,o]),p=(0,r.useCallback)(()=>{s<i&&o(s+1)},[s,o,i]),m=(0,r.useCallback)(e=>(0,n.slice)(e,l,a),[l,a]);return{currentPage:s,setCurrentPage:o,totalPages:i,isOnFirstPage:c,isOnLastPage:d,previousPage:u,nextPage:p,firstOnPage:l,lastOnPage:a,getItemsOnCurrentPage:m}})({totalItems:x.status===w.$H.loading||x.status===w.$H.error?x.entities.length+w.Gu:x.entities.length,perPage:w.Gu}),J=(0,r.useMemo)(()=>(0,n.map)(K(x.entities),e=>{let t=e;return d===w.gC.title&&(t=W(e),t=t.replace(Ht,(e,t,s,r,n,o,{start:i,wrap:a,end:l})=>{const c=a.trim();return 0===c.length?`${i}${a}${l}`:`${i}<span>${c}</span>${l}`}),t=(0,m.x)(t,{badge:(0,f.jsx)(o.Badge,{className:"yst-me-2 last:yst-me-0",variant:"plain",children:" "}),span:(0,f.jsx)("span",{className:"yst-flex yst-items-center yst-me-2 last:yst-me-0"})})),{value:e,label:t}}),[x.entities,K,d,W]),X=(0,r.useMemo)(()=>x.status!==w.$H.error||x.status===w.$H.error&&!Y,[x.status,Y]),Q=(0,r.useMemo)(()=>x.status===w.$H.loading&&Y,[x.status,Y]),ee=(0,r.useMemo)(()=>x.status===w.$H.error&&Y,[x.status,Y]),te=(0,r.useCallback)(()=>{M||(V(x.status===w.$H.error?Z:Z+1),v().then(e=>{e===w.Sf.success&&S()}))},[v,x.status,Z,V,b,k]),se=ms(),re=(0,$t.Z)(!0),ne=(0,r.useCallback)(()=>{const e=d===w.gC.title?H.replace(new RegExp(w.Zc[p]+"( Archives)?"),x.selected):x.selected;se(e),_({editType:d,previewType:u,suggestion:x.selected}),c(),"pre-publish"===g&&re()},[se,d,u,x.selected,H,c,_,re,g]);((e,t=[])=>{const s=(0,r.useRef)(!1);(0,r.useEffect)(()=>{s.current||(s.current=!0,e().finally(()=>{s.current=!1}))},[e,t])})(()=>""===a?v().then(e=>{l(e),e===w.Sf.success&&S()}):Promise.resolve(),[a,S,v]);const oe=a===w.Sf.error||x.status===w.$H.error&&402===x.error.code;return(0,r.useEffect)(()=>{var e,t,r,n,o,i,a,l;oe&&s({errorCode:null!==(e=null===(t=x.error)||void 0===t?void 0:t.code)&&void 0!==e?e:0,errorIdentifier:null!==(r=null===(n=x.error)||void 0===n?void 0:n.errorIdentifier)&&void 0!==r?r:"",invalidSubscriptions:null!==(o=null===(i=x.error)||void 0===i?void 0:i.missingLicenses)&&void 0!==o?o:[],errorMessage:null!==(a=null===(l=x.error)||void 0===l?void 0:l.message)&&void 0!==a?a:""})},[oe,x.error,s]),oe?null:(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)(o.Modal.Container.Content,{ref:$,className:"yst-flex yst-flex-col yst-py-6 yst-space-y-2",children:[(0,f.jsx)(j,{title:B,description:q,status:x.status,titleForLength:z,showPreviewSkeleton:""===a,showLengthProgress:!Q}),X&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-space-y-4",children:[(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default yst-mt-auto",children:y}),(0,f.jsx)(o.Button,{variant:"ai-secondary",size:"small",onClick:x.status===w.$H.loading?n.noop:te,isLoading:x.status===w.$H.loading,disabled:M,children:(0,i.__)("Generate 5 more","wordpress-seo")})]}),Q?(0,f.jsx)(is,{idSuffix:g,suggestionClassNames:d===w.gC.title?[["yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-8/12"]]:void 0}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ns,{idSuffix:g,suggestions:J,selected:x.selected,onChange:b}),(0,f.jsx)(Ft,{current:G,total:Z,onNavigate:V,disabled:x.status===w.$H.loading||ee})]})]}),ee&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"yst-mt-8"}),(0,f.jsx)(ts,{errorCode:x.error.code,errorIdentifier:x.error.errorIdentifier,invalidSubscriptions:x.error.missingLicenses,errorMessage:x.error.message}),(0,f.jsx)(Ft,{current:G,total:Z,onNavigate:V,disabled:x.status===w.$H.loading})]})]}),(0,f.jsxs)(o.Modal.Container.Footer,{children:[O&&(0,f.jsx)("div",{className:"yst-absolute yst-inset-x-0 yst--mt-10 yst-me-[calc(2.5rem-1px)] yst-h-10 yst-pointer-events-none yst-bg-gradient-to-t yst-from-slate-50"}),(0,f.jsx)("hr",{className:"yst-mb-6 yst--mx-6"}),(0,f.jsxs)("div",{className:"sm:yst-flex sm:yst-justify-end sm:yst-space-x-2 sm:rtl:yst-space-x-reverse",children:[(0,f.jsx)("div",{className:"yst-hidden sm:yst-inline",children:(0,f.jsx)(o.Button,{variant:"secondary",onClick:c,children:(0,i.__)("Close","wordpress-seo")})}),(0,f.jsx)("div",{className:"yst-block sm:yst-inline",children:(0,f.jsxs)(o.Button,{className:"yst-w-full sm:yst-w-auto",variant:"primary",onClick:ne,disabled:""===x.selected||x.status===w.$H.loading||ee,children:[(0,f.jsx)(Pt(),{className:"yst--ms-1 yst-me-1 yst-h-4 yst-w-4 yst-text-white"}),h]})}),(0,f.jsx)("div",{className:"yst-mt-3 sm:yst-hidden",children:(0,f.jsx)(o.Button,{variant:"secondary",onClick:c,className:"yst-w-full sm:yst-w-auto",children:(0,i.__)("Close","wordpress-seo")})})]})]}),(0,f.jsxs)(o.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:A},position:"bottom-left",children:[x.status!==w.$H.loading&&(0,f.jsx)(it,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all"}),(x.status===w.$H.success||x.status===w.$H.loading)&&(0,f.jsx)(ls,{})]})]})};Ut.propTypes={height:je().number.isRequired,onFatalError:je().func.isRequired};const Dt=({onActivateFreeSparks:e})=>{const{premiumUpsellLink:s,wooUpsellLink:n,isWooCommerceActive:a,isProductPost:l,learnMoreLink:c,imageLink:u,wistiaEmbedPermissionValue:h,wistiaEmbedPermissionStatus:x,isUsageCountLimitReached:v,activateFreeSparksEndpoint:b}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{premiumUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell"),wooUpsellLink:s.selectLink("https://yoa.st/ai-generator-upsell-woo-seo"),isWooCommerceActive:s.getIsWooCommerceActive(),isProductPost:s.getIsProduct(),learnMoreLink:s.selectLink("https://yoa.st/ai-generator-learn-more"),imageLink:s.selectImageLink("ai-generator-preview.jpg"),wistiaEmbedPermissionValue:s.selectWistiaEmbedPermissionValue(),wistiaEmbedPermissionStatus:s.selectWistiaEmbedPermissionStatus(),isUsageCountLimitReached:t.isUsageCountLimitReached(),activateFreeSparksEndpoint:t.selectFreeSparksActiveEndpoint()}},[]),{onClose:j,initialFocus:C}=(0,o.useModalContext)(),{title:_,upsellLabel:S,upsellLink:k,ctbId:E,newToText:N}=vs({premium:s,woo:n}),R=(0,r.useMemo)(()=>a&&l,[a,l]),M=(0,r.useMemo)(()=>({src:u,width:"432",height:"244"}),[u]),{setWistiaEmbedPermission:L}=(0,t.useDispatch)(w.sH),{activateFreeSparks:T}=(0,t.useDispatch)(w.XA),A=(0,r.useMemo)(()=>({value:h,status:x,set:L}),[h,x,L]),O=(0,r.useCallback)(()=>{T({endpoint:b}),e()},[T,b,j,e]),I={a:(0,f.jsx)(y.rd,{href:c,className:"yst-inline-flex yst-items-center yst-gap-1 yst-no-underline yst-font-medium",variant:"primary"}),ArrowNarrowRightIcon:(0,f.jsx)(d(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180"})};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"yst-px-10 yst-pt-10 yst-introduction-gradient yst-text-center",children:[(0,f.jsxs)("div",{className:"yst-relative yst-w-full",children:[(0,f.jsx)(y.qc,{videoId:"vmrahpfjxp",thumbnail:M,wistiaEmbedPermission:A}),(0,f.jsx)(o.Badge,{className:"yst-absolute yst--top-2 yst-end-4",variant:"info",children:"Beta"})]}),(0,f.jsx)("div",{className:"yst-mt-6 yst-text-xs yst-font-medium yst-flex yst-flex-col yst-items-center",children:(0,f.jsxs)("span",{className:"yst-introduction-modal-uppercase yst-flex yst-gap-2 yst-items-center",children:[(0,f.jsx)("span",{className:"yst-logo-icon"}),N]})})]}),(0,f.jsxs)("div",{className:"yst-px-10 yst-pb-4 yst-flex yst-flex-col yst-items-center",children:[(0,f.jsxs)("div",{className:"yst-mt-4 yst-mx-1.5 yst-text-center",children:[(0,f.jsx)("h3",{className:"yst-text-slate-900 yst-text-lg yst-font-medium",children:_}),(0,f.jsx)("div",{className:"yst-mt-2 yst-text-slate-600 yst-text-sm",children:R?(0,m.x)((0,i.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
289 289 (0,i.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for product titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),I):(0,m.x)((0,i.sprintf)(/* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */ /* translators: %1$s and %2$s are anchor tags; %3$s is the arrow icon. */
290 290 (0,i.__)("Let AI do some of the thinking for you and help you save time. Get high-quality suggestions for titles and meta descriptions to make your content rank high and look good on social media. %1$sLearn more%2$s%3$s","wordpress-seo"),"<a>","<ArrowNarrowRightIcon />","</a>"),I)})]}),v&&(0,f.jsx)(o.Alert,{className:"yst-my-4",children:(0,i.sprintf)(/* translators: %s is for Yoast SEO Premium. */ /* translators: %s is for Yoast SEO Premium. */
291 291 (0,i.__)("Oh no! Its seems like you're out of free Sparks. Keep the momentum going, unlock unlimited sparks with %s!","wordpress-seo"),"Yoast SEO Premium")}),(0,f.jsxs)("div",{className:g()("yst-w-full yst-flex yst-flex-col",v?"yst-mt-0":"yst-mt-6"),children:[(0,f.jsxs)(o.Button,{as:"a",className:"yst-grow",size:"extra-large",variant:"upsell",href:k,target:"_blank",ref:C,"data-action":"load-nfd-ctb","data-ctb-id":E,children:[(0,f.jsx)(p(),{className:"yst--ms-1 yst-me-2 yst-h-5 yst-w-5"}),S,(0,f.jsx)("span",{className:"yst-sr-only",children:/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
292 -(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}),!v&&(0,f.jsx)(o.Button,{variant:"ai-secondary",onClick:O,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11",children:(0,i.__)("Try for free","wordpress-seo")})]}),(0,f.jsx)(o.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:j,children:(0,i.__)("Close","wordpress-seo")})]})]})},Dt=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,panelRef:r,title:n,aiModalHelperLink:a,children:l})=>{const c=(0,o.useSvgAria)();return(0,f.jsx)(o.Modal,{className:"yst-ai-modal",isOpen:e,onClose:t,children:(0,f.jsx)(o.Modal.Panel,{ref:r,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:s,children:(0,f.jsxs)(o.Modal.Container,{children:[(0,f.jsxs)(o.Modal.Container.Header,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,f.jsx)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,f.jsx)(o.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2",children:n}),(0,f.jsx)(o.Link,{id:"ai-modal-learn-more",href:a,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener"
293 -/* translators: Hidden accessibility text. */,"aria-label":(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,f.jsx)(_t(),{...c,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,f.jsx)(o.Badge,{variant:"info",children:(0,i.__)("Beta","wordpress-seo")})]}),(0,f.jsx)("hr",{className:"yst-mt-6 yst--mx-6"})]}),l]})})})},zt=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,children:r})=>(0,f.jsx)(o.Modal,{className:"yst-introduction-modal",isOpen:e,onClose:t,children:(0,f.jsx)(o.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:s,children:r})}),qt={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",generate:"generate"};(({onUseAi:e})=>{const[s,n]=(0,r.useState)(qt.inactive),{editType:a,previewType:l}=xt(),c=wt(),d=(()=>{const{editType:e,previewType:t}=xt();switch(t){case w.i0.social:return e===w.gC.description?(0,i.__)("AI social description generator","wordpress-seo"):(0,i.__)("AI social title generator","wordpress-seo");case w.i0.twitter:return e===w.gC.description?(0,i.__)("AI X description generator","wordpress-seo"):(0,i.__)("AI X title generator","wordpress-seo");default:return e===w.gC.description?(0,i.__)("AI description generator","wordpress-seo"):(0,i.__)("AI title generator","wordpress-seo")}})(),{hasConsent:u,promptContentInitialized:p,currentSubscriptions:m,usageCountStatus:y,usageCount:h,usageCountLimit:g,usageCountEndpoint:x,hasValidPremiumSubscription:v,hasValidWooSubscription:b,focusKeyphrase:j,isPremium:C,isSeoAnalysisActive:_,aiModalHelperLink:k,isWooProductEntity:E,isFreeSparksActive:N,isWooSeoActive:R}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{hasConsent:t.selectHasAiGeneratorConsent(),promptContentInitialized:t.selectPromptContentInitialized(),currentSubscriptions:t.selectProductSubscriptions(),usageCountStatus:t.selectUsageCountStatus(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),usageCountEndpoint:t.selectUsageCountEndpoint(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription(),focusKeyphrase:s.getFocusKeyphrase(),isPremium:s.getIsPremium(),isWooSeoActive:s.getIsWooSeoActive(),isSeoAnalysisActive:s.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:s.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:s.getIsWooProductEntity(),isFreeSparksActive:e(w.XA).selectIsFreeSparksActive()}},[]),{fetchUsageCount:M}=(0,t.useDispatch)(w.XA),{closeEditorModal:L}=(0,t.useDispatch)(w.sH),T=(0,i.__)("Close modal","wordpress-seo"),[A,O]=(0,r.useState)(!1),[I,P]=(0,r.useState)(0),$=(0,r.useCallback)(e=>P(e.borderBoxSize[0].blockSize),[P]),H=bt($),[F,U]=(0,r.useState)(null),B=(0,r.useCallback)(({currentSubscriptions:e,isSeoAnalysisActive:s})=>{const r=(e=>{const s=(0,t.select)(w.sH),r=[];return((e,t)=>(e.getIsPremium()||e.getIsWooProductEntity())&&!t.premiumSubscription)(s,e)&&r.push("Yoast SEO Premium"),((e,t)=>e.getIsWooProductEntity()&&e.getIsWooSeoActive()&&!t.wooCommerceSubscription)(s,e)&&r.push("Yoast WooCommerce SEO"),r})(e);return r.length>0?{errorCode:402,errorIdentifier:"",invalidSubscriptions:r,errorMessage:""}:s?(()=>{var e,s;const r=(0,t.select)(w.XA);if(r.selectUsageCountStatus()!==S.$H.error)return null;const n=r.selectUsageCountError();return{errorCode:n.errorCode,errorIdentifier:null!==(e=n.errorIdentifier)&&void 0!==e?e:"",invalidSubscriptions:[],errorMessage:null!==(s=n.errorMessage)&&void 0!==s?s:""}})():{errorCode:0,errorIdentifier:"SEO_ANALYSIS_INACTIVE",invalidSubscriptions:[],errorMessage:""}},[]),D=(0,r.useCallback)(()=>{n(qt.inactive)},[]),z=(0,r.useCallback)(()=>U(null),[]),q=(0,r.useCallback)(()=>{U(null),n(qt.generate)},[]),W=(0,r.useCallback)(()=>{U(B({currentSubscriptions:m,isSeoAnalysisActive:_})),n(qt.inactive)},[B,m,_]),G=(0,r.useCallback)(e=>{U(e),n(qt.inactive)},[]),V={onClose:D,closeButtonScreenReaderText:T},Y=(0,r.useCallback)(()=>!(0===j.replace(yt,"").trim().length),[j]),K=(0,$t.Z)(!1),Z=(0,r.useCallback)(()=>{L(),"pre-publish"===c&&K(),setTimeout(()=>(e=>{const t=`focus-keyword-input-${["modal","pre-publish"].includes(e)?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const s=document.getElementById(t);s&&s.focus()})(c),0)},[L,c,K]),X=(0,r.useCallback)(()=>E?b&&v:v,[v,b,E]),J=(0,r.useCallback)(async()=>{if(e(),!_)return void W();if(!Y())return n(qt.inactive),void Z();const t=X();if(!t&&C&&R&&E)return void W();if(!t&&C&&!E)return void W();if(!u&&(N||t))return void n(qt.askConsent);O(!0);const{type:s,payload:r}=await M({endpoint:x,isWooProductEntity:E}),o=429===(null==r?void 0:r.errorCode)&&!(null!=r&&r.errorIdentifier)&&0===(null==r?void 0:r.missingLicenses.length),i=429===(null==r?void 0:r.errorCode)&&"USAGE_LIMIT_REACHED"===(null==r?void 0:r.errorIdentifier)||r.count>=r.limit;O(!1),o?W():403!==(null==r?void 0:r.errorCode)||!N&&!t?s!==Mt||429===(null==r?void 0:r.errorCode)||403===(null==r?void 0:r.errorCode)?s===Mt&&429===(null==r?void 0:r.errorCode)&&t?W():!t&&!N||!t&&i?n(qt.upsell):(t&&u&&n(qt.generate),!t&&N&&!i&&u&&n(qt.generate)):W():n(qt.askConsent)},[e,C,N,u,_,Y,Z,W,x,M,R,E,A]),Q=(0,r.useCallback)(async()=>{const{type:e,payload:t}=await M({endpoint:x,isWooProductEntity:E}),s=429===(null==t?void 0:t.errorCode)||t.count>=t.limit,r=X();!s||r?e!==Mt?n(qt.generate):W():n(qt.upsell)},[n,W,x,M,X,E]),ee=(0,r.useCallback)(()=>{n(u?qt.generate:qt.askConsent)},[n,u]),te=(0,r.useMemo)(()=>"google"===l?"title"===a?(0,i.__)("Generate SEO title","wordpress-seo"):(0,i.__)("Generate meta description","wordpress-seo"):"social"===l||"twitter"===l?"title"===a?(0,i.__)("Generate social title","wordpress-seo"):(0,i.__)("Generate social description","wordpress-seo"):void 0,[l,a]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.Button,{type:"button",variant:"ai-secondary",size:"small",id:`yst-replacevar__use-ai-button__${a}__${c}`,onClick:J,disabled:y===S.$H.loading||!p,isLoading:A&&y===S.$H.loading,children:te}),(0,f.jsxs)(zt,{...V,isOpen:[qt.askConsent,qt.upsell].includes(s),children:[s===qt.askConsent&&(0,f.jsx)(Ot,{onStartGenerating:Q}),s===qt.upsell&&(0,f.jsx)(Bt,{onActivateFreeSparks:ee})]}),(0,f.jsx)(Dt,{...V,isOpen:s===qt.generate,aiModalHelperLink:k,panelRef:H,title:d,children:s===qt.generate&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(St.UsageCounter,{limit:g,requests:h,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:C,mentionResetInTooltip:C}),(0,f.jsx)(Ut,{height:I,onFatalError:G})]})}),F&&(0,f.jsx)(jt,{isOpen:!0,errorCode:F.errorCode,errorIdentifier:F.errorIdentifier,invalidSubscriptions:F.invalidSubscriptions,errorMessage:F.errorMessage,showActions:!0,onRetry:q,onClose:z})]})}).propTypes={onUseAi:je().func.isRequired};const Wt=({title:e,description:s,status:n,titleForLength:a,showPreviewSkeleton:l,showLengthProgress:c})=>{const d=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorMode(),[]),[u,p]=(0,r.useState)(d),{editType:m}=xt(),y=wt(),h=fs({editType:m,title:a,description:s});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(qe.ModeSwitcher,{onChange:p,active:u,id:`yst-ai-google-preview-mode-switcher-${y}`,disabled:n===w.$H.loading}),l?(0,f.jsx)(Yt,{}):(0,f.jsx)(Vt,{mode:u,title:e,description:s}),(0,f.jsxs)("div",{className:"yst-pt-4",children:[(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:m===w.gC.title?(0,i.__)("SEO title width","wordpress-seo"):(0,i.__)("Meta description length","wordpress-seo")}),(0,f.jsx)(Kt,{className:"yst-mt-2",progress:c?h.actual:0,min:0,max:h.max,score:h.score})]})]})};Wt.propTypes={title:je().string.isRequired,description:je().string.isRequired,status:je().oneOf(Object.keys(w.$H)).isRequired,titleForLength:je().string.isRequired,showPreviewSkeleton:je().bool.isRequired,showLengthProgress:je().bool.isRequired};const Gt=/mobi/i,Vt=({mode:e,title:s,description:o})=>{var i,a;const l=(0,t.useSelect)(e=>e(w.sH).getBaseUrlFromSettings(),[]),c=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorData().slug||"",[]),d=(0,t.useSelect)(e=>e(w.sH).getDateFromSettings(),[]),u=(0,t.useSelect)(e=>e(w.sH).getFocusKeyphrase(),[]),p=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorPreviewImageUrl(),[]),m=(0,t.useSelect)(e=>e(w.sH).getSiteIconUrlFromSettings(),[]),y=(0,t.useSelect)(e=>e(w.sH).getShoppingData(),[]),h=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorWordsToHighlight(),[]),g=(0,t.useSelect)(e=>e(w.sH).getSiteName(),[]),x=(0,t.useSelect)(e=>e(w.sH).getContentLocale(),[]),v=(0,r.useMemo)(()=>l+c,[l,c]),b=(0,r.useMemo)(()=>{var e,t;return Gt.test(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)},[null===(i=window)||void 0===i||null===(a=i.navigator)||void 0===a?void 0:a.userAgent]);return(0,f.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${b?" yst-user-agent__mobile":""}`,children:(0,f.jsx)(qe.SnippetPreview,{title:s,description:o,mode:e,url:v,keyword:u,date:d,faviconSrc:m,mobileImageSrc:p,wordsToHighlight:h,siteName:g,locale:x,shoppingData:y,onMouseUp:n.noop})})};Vt.propTypes={mode:je().oneOf(Object.keys(w.Zv)).isRequired,title:je().string.isRequired,description:je().string.isRequired};const Yt=()=>(0,f.jsxs)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto",children:[(0,f.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),Kt=({className:e="",progress:t,max:s,score:n})=>{const i=(0,r.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(n),[n]);return(0,f.jsx)(o.ProgressBar,{className:g()("yst-length-progress-bar",i,e),progress:t,min:0,max:s})};Kt.propTypes={className:je().string,progress:je().number.isRequired,max:je().number.isRequired,score:je().number.isRequired};const Zt=({title:e,description:t,showPreviewSkeleton:s})=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,i.__)("Social preview","wordpress-seo")})}),s?(0,f.jsx)(Qt,{}):(0,f.jsx)(Jt,{title:e,description:t})]});Zt.propTypes={title:je().string.isRequired,description:je().string.isRequired,showPreviewSkeleton:je().bool.isRequired};var Xt=s(1426);const Jt=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(w.sH).getSiteUrl(),[]),o=(0,t.useSelect)(e=>e(w.sH).getFacebookImageUrl(),[]),i=(0,t.useSelect)(e=>e(w.sH).getEditorDataImageFallback(),[]),a=(0,t.useSelect)(e=>e(w.sH).getFacebookAltText(),[]);return(0,f.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,f.jsx)(Xt.Xi,{title:e,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:i,alt:a,onSelect:n.noop,onImageClick:n.noop,onMouseHover:n.noop})})};Jt.propTypes={title:je().string.isRequired,description:je().string.isRequired};const Qt=()=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,f.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),es=({children:e,onRetry:t})=>{const{onClose:s}=(0,o.useModalContext)();return(0,f.jsxs)(r.Fragment,{children:[e,(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(o.Button,{variant:"secondary",onClick:s,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(o.Button,{variant:"primary",onClick:t,children:(0,i.__)("Try again","wordpress-seo")})]})]})};es.propTypes={children:je().node.isRequired,onRetry:je().func.isRequired};const ts=({errorCode:e,errorIdentifier:t,invalidSubscriptions:s=[],showActions:r=!1,onRetry:o=n.noop,errorMessage:i=""})=>{switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,f.jsx)(Ce.Ri,{});case"NOT_ENOUGH_CONTENT":return(0,f.jsx)(Ce.Zd,{});case"SITE_UNREACHABLE":return(0,f.jsx)(Se,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.W7,{errorMessage:i})}):(0,f.jsx)(Ce.W7,{errorMessage:i});default:return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.K2,{})}):(0,f.jsx)(Ce.K2,{})}case 402:return(0,f.jsx)(Ce.AA,{invalidSubscriptions:s});case 408:return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.Am,{})}):(0,f.jsx)(Ce.Am,{});case 429:return"USAGE_LIMIT_REACHED"===t?(0,f.jsx)(Ce.AA,{invalidSubscriptions:s}):(0,f.jsx)(Ce.IT,{});case 410:return(0,f.jsx)(Ce.fQ,{});default:return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.K2,{})}):(0,f.jsx)(Ce.K2,{})}};ts.propTypes={errorCode:je().number.isRequired,errorIdentifier:je().string.isRequired,invalidSubscriptions:je().array,showActions:je().bool,onRetry:je().func,errorMessage:je().string};const ss=je().shape({value:je().string.isRequired,label:je().node.isRequired}),rs=({id:e,name:t,suggestion:s,isChecked:n,onChange:o})=>{const i=(0,r.useCallback)(()=>o(s.value),[s,o]);return(0,f.jsxs)("label",{htmlFor:e,className:g()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",n&&"yst-z-10 yst-border-primary-500"),children:[(0,f.jsx)("input",{type:"radio",id:e,name:t,className:"yst-radio__input",value:s.value,checked:n,onChange:i}),(0,f.jsx)("div",{className:g()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!n&&"yst-text-slate-600"),children:s.label})]})};rs.propTypes={id:je().string.isRequired,name:je().string.isRequired,suggestion:ss.isRequired,isChecked:je().bool.isRequired,onChange:je().func.isRequired};const ns=({idSuffix:e,suggestions:t,selected:s,onChange:r})=>(0,f.jsx)("div",{children:(0,f.jsx)(o.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:t.map((t,n)=>(0,f.jsx)(rs,{id:`yst-ai-suggestions-radio-${e}__${n}`,name:`ai-suggestion__${e}`,isChecked:t.value===s,onChange:r,suggestion:t},`yst-ai-suggestions-radio-${e}__${n}`))})});ns.propTypes={idSuffix:je().string.isRequired,suggestions:je().arrayOf(ss).isRequired,selected:je().string.isRequired,onChange:je().func.isRequired};const os=[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]],is=({suggestionClassNames:e=os})=>(0,f.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,t)=>(0,f.jsxs)("div",{className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",children:[(0,f.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,f.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,s)=>(0,f.jsx)(o.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${t}__${s}`))})]},`yst-ai-suggestion-radio-skeleton__${t}`))});is.propTypes={suggestionClassNames:je().arrayOf(je().arrayOf(je().string))};const as="ai_generator_tip_notification",ls=()=>{const e=(0,t.useSelect)(e=>e(w.sH).isAlertDismissed(as),[]),s=(0,t.useSelect)(e=>e(w.sH).getEditorDataContent(),[]),n=(0,t.useSelect)(e=>e(w.sH).getIsWooProductEntity(),[]),[a,,,l]=(0,o.useToggleState)(!1),{editType:c,contentType:d}=xt(),{dismissAlert:u}=(0,t.useDispatch)(w.sH),p=(0,r.useCallback)(()=>{u(as)},[u]),y=(0,r.useMemo)(()=>c===w.gC.description?(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo")
294 -/* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[c]),h=(0,r.useMemo)(()=>((e,t)=>e||t===w.Ty.term?w.C$:w.W1)(n,d),[d,n]);return e||a||s.length>h?null:(0,f.jsxs)(o.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,i.__)("Dismiss","wordpress-seo"),children:[(0,m.x)((0,i.sprintf)(y,"<span>","</span>"),{span:(0,f.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,f.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,f.jsx)(o.Button,{type:"button",variant:"tertiary",onClick:p,children:(0,i.__)("Don’t show again","wordpress-seo")}),(0,f.jsx)(o.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:l,children:(0,i.__)("Dismiss","wordpress-seo")})]})]})},cs=({title:e,description:t,showPreviewSkeleton:s})=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,i.__)("X preview","wordpress-seo")})}),s?(0,f.jsx)(us,{}):(0,f.jsx)(ds,{title:e,description:t})]});cs.propTypes={title:je().string.isRequired,description:je().string.isRequired,showPreviewSkeleton:je().bool.isRequired};const ds=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(w.sH).getSiteUrl(),[]),o=(0,t.useSelect)(e=>e(w.sH).getTwitterImageUrl(),[]),i=(0,t.useSelect)(e=>e(w.sH).getFacebookImageUrl(),[]),a=(0,t.useSelect)(e=>e(w.sH).getEditorDataImageFallback(),[]),l=(0,t.useSelect)(e=>e(w.sH).getTwitterImageType(),[]),c=(0,t.useSelect)(e=>e(w.sH).getTwitterAltText(),[]);return(0,f.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,f.jsx)(Xt.WG,{title:e,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:i||a,isLarge:"summary"!==l,alt:c,onSelect:n.noop,onImageClick:n.noop,onMouseHover:n.noop})})};ds.propTypes={title:je().string.isRequired,description:je().string.isRequired};const us=()=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,f.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]});je().number.isRequired,je().string,je().string,je().object.isRequired,je().bool;const ps=()=>{const{previewType:e}=xt();switch(e){case w.i0.social:return Zt;case w.i0.twitter:return cs;default:return Wt}},ms=()=>{const{editType:e}=xt();switch(e){case w.gC.title:return(()=>{const{previewType:e}=xt(),{updateData:s,setFacebookPreviewTitle:o,setTwitterPreviewTitle:i}=(0,t.useDispatch)(w.sH);return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return e=>s({title:e});case w.i0.social:return o;case w.i0.twitter:return i;default:return n.noop}},[e,s,o,i])})();case w.gC.description:return(()=>{const{previewType:e}=xt(),{updateData:s,setFacebookPreviewDescription:o,setTwitterPreviewDescription:i}=(0,t.useDispatch)(w.sH);return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return e=>s({description:e});case w.i0.social:return o;case w.i0.twitter:return i;default:return n.noop}},[e,s,o,i])})();default:return n.noop}},ys=(0,kt.createSlice)({name:"suggestions",initialState:{status:w.$H.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=w.$H.loading},setSuccess:(e,{payload:t})=>{e.status=w.$H.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=w.$H.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),hs=e=>{switch(e){case w.i0.social:return"Facebook";case w.i0.twitter:return"Twitter";default:return"Google"}},gs=()=>{const[e,s]=(0,r.useReducer)(ys.reducer,ys.getInitialState()),{editType:o,previewType:i,postType:a,contentType:l}=xt(),c=(0,t.useSelect)(e=>e(w.XA).selectPromptContent(),[]),d=(0,t.useSelect)(e=>e(w.XA).selectGetSuggestionsEndpoint(),[]),{contentLocale:u,focusKeyphrase:p,isWooCommerceActive:m,isGutenberg:y,isElementor:h}=(0,t.useSelect)(e=>({contentLocale:e(w.sH).getContentLocale(),focusKeyphrase:e(w.sH).getFocusKeyphrase(),isWooCommerceActive:e(w.sH).getIsWooCommerceActive(),isGutenberg:e(w.sH).getIsBlockEditor(),isElementor:e(w.sH).getIsElementorEditor()}),[]);let g,f=at.languageProcessing.helpers.processExactMatchRequest(p).keyphrase;f.length>191&&(f=f.slice(0,191)),g=h?"elementor":y?"gutenberg":"classic";const x=((e,t,s,r)=>{const n=e===w.gC.description?"meta-description":"seo-title";let o=((e,t)=>{if(e)switch(t){case w.M$.product:return"product-";case w.M$.productCategory:case w.M$.productTag:return"product-taxonomy-"}return""})(t,s);return o&&t||r!==w.Ty.term||(o="taxonomy-"),`${o}${n}`})(o,m,a,l);return{suggestions:e,fetchSuggestions:(0,r.useCallback)(async(e=!0)=>{s(ys.actions.setLoading());const{status:t,payload:r}=await(async({endpoint:e,data:t})=>{let s;const r=1e3*(0,n.get)(window,"wpseoAiGenerator.requestTimeout",30);try{ut&&ut.abort(),ut=new AbortController,pt=!1,s=setTimeout(()=>{pt=!0,ut.abort()},r);const n=await dt()({path:e,method:"POST",data:t,parse:!1,signal:ut.signal}),o=await n.json();return{status:w.Sf.success,payload:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return pt?{status:w.Sf.error,payload:{message:"timeout",code:408}}:{status:w.Sf.abort};const{message:t,missingLicenses:s,errorIdentifier:r}=await(async e=>{try{const t=e.body.getReader(),{value:s}=await t.read(),r=new TextDecoder("utf-8").decode(s);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:w.Sf.error,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(s)}})({endpoint:d,canAbort:e,data:{type:x,prompt_content:c,focus_keyphrase:f,platform:hs(i),language:j(u).replace("_","-"),editor:g}});switch(t){case w.Sf.abort:break;case w.Sf.error:s(ys.actions.setError(r));break;case w.Sf.success:s(ys.actions.setSuccess(r))}return t},[s]),setSelectedSuggestion:(0,r.useCallback)(e=>s(ys.actions.setSelected(e)),[s])}},fs=({editType:e,title:s,description:n})=>{const o=(0,t.useSelect)(e=>e(w.sH).getDateFromSettings(),[]),i=(0,t.useSelect)(e=>e(w.sH).getContentLocale(),[]),a=(0,t.useSelect)(e=>e(w.sH).isCornerstoneContent(),[]),l=(0,t.useSelect)(e=>e(w.sH).getIsTerm(),[]);return(0,r.useMemo)(()=>e===w.gC.description?(0,qe.getDescriptionProgress)(n,o,a,l,i):(0,qe.getTitleProgress)(s),[e,s,n,o,a,l,i])},xs=()=>{const{editType:e,previewType:s,contentType:o}=xt(),i=(()=>{const{previewType:e}=xt();return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return()=>(0,t.select)(w.sH).getSnippetEditorData().title;case w.i0.social:return(0,t.select)(w.sH).getFacebookTitleOrFallback;case w.i0.twitter:return(0,t.select)(w.sH).getTwitterTitleOrFallback;default:return(0,n.constant)("")}},[e])})(),a=(0,t.useSelect)(t=>t(w.XA).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,r.useMemo)(()=>{let t=i();return e===w.gC.description?t:(a&&(t=t.replace(a,w.Zc[o])),((e,t)=>e.includes(w.Zc[t])?e:w.Zc[t])(t,o))},[e,i])},vs=e=>{const{isWooProductEntity:s,isProductPost:n,hasValidWooSubscription:o}=(0,t.useSelect)(e=>{const t=e(w.sH),s=e(w.XA);return{isWooProductEntity:t.getIsWooProductEntity(),isProductPost:t.getIsProduct(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]);return(0,r.useMemo)(()=>{const t={upsellLink:e.premium,upsellLabel:(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
292 +(0,i.__)("(Opens in a new browser tab)","wordpress-seo")})]}),!v&&(0,f.jsx)(o.Button,{variant:"ai-secondary",onClick:O,className:"yst-mt-2 yst-w-full yst-text-base yst-text-slate-800 yst-font-medium yst-h-11",children:(0,i.__)("Try for free","wordpress-seo")})]}),(0,f.jsx)(o.Button,{as:"a",className:"yst-mt-4",variant:"tertiary",onClick:j,children:(0,i.__)("Close","wordpress-seo")})]})]})},Bt=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,panelRef:r,title:n,aiModalHelperLink:a,children:l})=>{const c=(0,o.useSvgAria)();return(0,f.jsx)(o.Modal,{className:"yst-ai-modal",isOpen:e,onClose:t,children:(0,f.jsx)(o.Modal.Panel,{ref:r,className:"yst-max-w-3xl yst-relative",closeButtonScreenReaderText:s,children:(0,f.jsxs)(o.Modal.Container,{children:[(0,f.jsxs)(o.Modal.Container.Header,{children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-center",children:[(0,f.jsx)("span",{className:"yst-logo-icon yst-h-5 yst-w-5"}),(0,f.jsx)(o.Modal.Title,{className:"yst-ms-3 yst-me-1.5",as:"h1",size:"2",children:n}),(0,f.jsx)(o.Link,{id:"ai-modal-learn-more",href:a,variant:"primary",className:"yst-no-underline yst-me-2",target:"_blank",rel:"noopener"
293 +/* translators: Hidden accessibility text. */,"aria-label":(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,f.jsx)(_t(),{...c,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,f.jsx)(o.Badge,{variant:"info",children:(0,i.__)("Beta","wordpress-seo")})]}),(0,f.jsx)("hr",{className:"yst-mt-6 yst--mx-6"})]}),l]})})})},zt=({isOpen:e,onClose:t,closeButtonScreenReaderText:s,children:r})=>(0,f.jsx)(o.Modal,{className:"yst-introduction-modal",isOpen:e,onClose:t,children:(0,f.jsx)(o.Modal.Panel,{className:"yst-max-w-lg yst-p-0 yst-rounded-3xl",closeButtonScreenReaderText:s,children:r})}),qt={inactive:"inactive",askConsent:"askConsent",upsell:"upsell",generate:"generate"};(({onUseAi:e})=>{const[s,n]=(0,r.useState)(qt.inactive),{editType:a,previewType:l}=xt(),c=wt(),d=(()=>{const{editType:e,previewType:t}=xt();switch(t){case w.i0.social:return e===w.gC.description?(0,i.__)("AI social description generator","wordpress-seo"):(0,i.__)("AI social title generator","wordpress-seo");case w.i0.twitter:return e===w.gC.description?(0,i.__)("AI X description generator","wordpress-seo"):(0,i.__)("AI X title generator","wordpress-seo");default:return e===w.gC.description?(0,i.__)("AI description generator","wordpress-seo"):(0,i.__)("AI title generator","wordpress-seo")}})(),{hasConsent:u,promptContentInitialized:p,currentSubscriptions:m,usageCountStatus:y,usageCount:h,usageCountLimit:g,usageCountEndpoint:x,hasValidPremiumSubscription:v,hasValidWooSubscription:b,focusKeyphrase:j,isPremium:C,isSeoAnalysisActive:_,aiModalHelperLink:k,isWooProductEntity:E,isFreeSparksActive:N,isWooSeoActive:R}=(0,t.useSelect)(e=>{const t=e(w.XA),s=e(w.sH);return{hasConsent:t.selectHasAiGeneratorConsent(),promptContentInitialized:t.selectPromptContentInitialized(),currentSubscriptions:t.selectProductSubscriptions(),usageCountStatus:t.selectUsageCountStatus(),usageCount:t.selectUsageCount(),usageCountLimit:t.selectUsageCountLimit(),usageCountEndpoint:t.selectUsageCountEndpoint(),hasValidPremiumSubscription:t.selectPremiumSubscription(),hasValidWooSubscription:t.selectWooCommerceSubscription(),focusKeyphrase:s.getFocusKeyphrase(),isPremium:s.getIsPremium(),isWooSeoActive:s.getIsWooSeoActive(),isSeoAnalysisActive:s.getPreference("isKeywordAnalysisActive",!0),aiModalHelperLink:s.selectLink("https://yoa.st/ai-generator-help-button-modal"),isWooProductEntity:s.getIsWooProductEntity(),isFreeSparksActive:e(w.XA).selectIsFreeSparksActive()}},[]),{fetchUsageCount:M}=(0,t.useDispatch)(w.XA),{closeEditorModal:L}=(0,t.useDispatch)(w.sH),T=(0,i.__)("Close modal","wordpress-seo"),[A,O]=(0,r.useState)(!1),[I,P]=(0,r.useState)(0),$=(0,r.useCallback)(e=>P(e.borderBoxSize[0].blockSize),[P]),H=bt($),[F,U]=(0,r.useState)(null),D=(0,r.useCallback)(({currentSubscriptions:e,isSeoAnalysisActive:s})=>{const r=(e=>{const s=(0,t.select)(w.sH),r=[];return((e,t)=>(e.getIsPremium()||e.getIsWooProductEntity())&&!t.premiumSubscription)(s,e)&&r.push("Yoast SEO Premium"),((e,t)=>e.getIsWooProductEntity()&&e.getIsWooSeoActive()&&!t.wooCommerceSubscription)(s,e)&&r.push("Yoast WooCommerce SEO"),r})(e);return r.length>0?{errorCode:402,errorIdentifier:"",invalidSubscriptions:r,errorMessage:""}:s?(()=>{var e,s;const r=(0,t.select)(w.XA);if(r.selectUsageCountStatus()!==S.$H.error)return null;const n=r.selectUsageCountError();return{errorCode:n.errorCode,errorIdentifier:null!==(e=n.errorIdentifier)&&void 0!==e?e:"",invalidSubscriptions:[],errorMessage:null!==(s=n.errorMessage)&&void 0!==s?s:""}})():{errorCode:0,errorIdentifier:"SEO_ANALYSIS_INACTIVE",invalidSubscriptions:[],errorMessage:""}},[]),B=(0,r.useCallback)(()=>{n(qt.inactive)},[]),z=(0,r.useCallback)(()=>U(null),[]),q=(0,r.useCallback)(()=>{U(null),n(qt.generate)},[]),W=(0,r.useCallback)(()=>{U(D({currentSubscriptions:m,isSeoAnalysisActive:_})),n(qt.inactive)},[D,m,_]),G=(0,r.useCallback)(e=>{U(e),n(qt.inactive)},[]),V={onClose:B,closeButtonScreenReaderText:T},Y=(0,r.useCallback)(()=>!(0===j.replace(yt,"").trim().length),[j]),Z=(0,$t.Z)(!1),K=(0,r.useCallback)(()=>{L(),"pre-publish"===c&&Z(),setTimeout(()=>(e=>{const t=`focus-keyword-input-${["modal","pre-publish"].includes(e)?"sidebar":e}`;if("metabox"===e){const e=document.getElementById("wpseo-meta-tab-content");e&&e.click()}const s=document.getElementById(t);s&&s.focus()})(c),0)},[L,c,Z]),J=(0,r.useCallback)(()=>E?b&&v:v,[v,b,E]),X=(0,r.useCallback)(async()=>{if(e(),!_)return void W();if(!Y())return n(qt.inactive),void K();const t=J();if(!t&&C&&R&&E)return void W();if(!t&&C&&!E)return void W();if(!u&&(N||t))return void n(qt.askConsent);O(!0);const{type:s,payload:r}=await M({endpoint:x,isWooProductEntity:E}),o=429===(null==r?void 0:r.errorCode)&&!(null!=r&&r.errorIdentifier)&&0===(null==r?void 0:r.missingLicenses.length),i=429===(null==r?void 0:r.errorCode)&&"USAGE_LIMIT_REACHED"===(null==r?void 0:r.errorIdentifier)||r.count>=r.limit;O(!1),o?W():403!==(null==r?void 0:r.errorCode)||!N&&!t?s!==Mt||429===(null==r?void 0:r.errorCode)||403===(null==r?void 0:r.errorCode)?s===Mt&&429===(null==r?void 0:r.errorCode)&&t?W():!t&&!N||!t&&i?n(qt.upsell):(t&&u&&n(qt.generate),!t&&N&&!i&&u&&n(qt.generate)):W():n(qt.askConsent)},[e,C,N,u,_,Y,K,W,x,M,R,E,A]),Q=(0,r.useCallback)(async()=>{const{type:e,payload:t}=await M({endpoint:x,isWooProductEntity:E}),s=429===(null==t?void 0:t.errorCode)||t.count>=t.limit,r=J();!s||r?e!==Mt?n(qt.generate):W():n(qt.upsell)},[n,W,x,M,J,E]),ee=(0,r.useCallback)(()=>{n(u?qt.generate:qt.askConsent)},[n,u]),te=(0,r.useMemo)(()=>"google"===l?"title"===a?(0,i.__)("Generate SEO title","wordpress-seo"):(0,i.__)("Generate meta description","wordpress-seo"):"social"===l||"twitter"===l?"title"===a?(0,i.__)("Generate social title","wordpress-seo"):(0,i.__)("Generate social description","wordpress-seo"):void 0,[l,a]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o.Button,{type:"button",variant:"ai-secondary",size:"small",id:`yst-replacevar__use-ai-button__${a}__${c}`,onClick:X,disabled:y===S.$H.loading||!p,isLoading:A&&y===S.$H.loading,children:te}),(0,f.jsxs)(zt,{...V,isOpen:[qt.askConsent,qt.upsell].includes(s),children:[s===qt.askConsent&&(0,f.jsx)(Ot,{onStartGenerating:Q}),s===qt.upsell&&(0,f.jsx)(Dt,{onActivateFreeSparks:ee})]}),(0,f.jsx)(Bt,{...V,isOpen:s===qt.generate,aiModalHelperLink:k,panelRef:H,title:d,children:s===qt.generate&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(St.UsageCounter,{limit:g,requests:h,isSkeleton:!1,className:"yst-absolute yst-top-[-11px] yst-end-12 sm:yst-end-16",mentionBetaInTooltip:C,mentionResetInTooltip:C}),(0,f.jsx)(Ut,{height:I,onFatalError:G})]})}),F&&(0,f.jsx)(jt,{isOpen:!0,errorCode:F.errorCode,errorIdentifier:F.errorIdentifier,invalidSubscriptions:F.invalidSubscriptions,errorMessage:F.errorMessage,showActions:!0,onRetry:q,onClose:z})]})}).propTypes={onUseAi:je().func.isRequired};const Wt=({title:e,description:s,status:n,titleForLength:a,showPreviewSkeleton:l,showLengthProgress:c})=>{const d=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorMode(),[]),[u,p]=(0,r.useState)(d),{editType:m}=xt(),y=wt(),h=fs({editType:m,title:a,description:s});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(qe.ModeSwitcher,{onChange:p,active:u,id:`yst-ai-google-preview-mode-switcher-${y}`,disabled:n===w.$H.loading}),l?(0,f.jsx)(Yt,{}):(0,f.jsx)(Vt,{mode:u,title:e,description:s}),(0,f.jsxs)("div",{className:"yst-pt-4",children:[(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:m===w.gC.title?(0,i.__)("SEO title width","wordpress-seo"):(0,i.__)("Meta description length","wordpress-seo")}),(0,f.jsx)(Zt,{className:"yst-mt-2",progress:c?h.actual:0,min:0,max:h.max,score:h.score})]})]})};Wt.propTypes={title:je().string.isRequired,description:je().string.isRequired,status:je().oneOf(Object.keys(w.$H)).isRequired,titleForLength:je().string.isRequired,showPreviewSkeleton:je().bool.isRequired,showLengthProgress:je().bool.isRequired};const Gt=/mobi/i,Vt=({mode:e,title:s,description:o})=>{var i,a;const l=(0,t.useSelect)(e=>e(w.sH).getBaseUrlFromSettings(),[]),c=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorData().slug||"",[]),d=(0,t.useSelect)(e=>e(w.sH).getDateFromSettings(),[]),u=(0,t.useSelect)(e=>e(w.sH).getFocusKeyphrase(),[]),p=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorPreviewImageUrl(),[]),m=(0,t.useSelect)(e=>e(w.sH).getSiteIconUrlFromSettings(),[]),y=(0,t.useSelect)(e=>e(w.sH).getShoppingData(),[]),h=(0,t.useSelect)(e=>e(w.sH).getSnippetEditorWordsToHighlight(),[]),g=(0,t.useSelect)(e=>e(w.sH).getSiteName(),[]),x=(0,t.useSelect)(e=>e(w.sH).getContentLocale(),[]),v=(0,r.useMemo)(()=>l+c,[l,c]),b=(0,r.useMemo)(()=>{var e,t;return Gt.test(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.userAgent)},[null===(i=window)||void 0===i||null===(a=i.navigator)||void 0===a?void 0:a.userAgent]);return(0,f.jsx)("div",{className:`yst-ai-generator-preview-section ${e}${b?" yst-user-agent__mobile":""}`,children:(0,f.jsx)(qe.SnippetPreview,{title:s,description:o,mode:e,url:v,keyword:u,date:d,faviconSrc:m,mobileImageSrc:p,wordsToHighlight:h,siteName:g,locale:x,shoppingData:y,onMouseUp:n.noop})})};Vt.propTypes={mode:je().oneOf(Object.keys(w.Zv)).isRequired,title:je().string.isRequired,description:je().string.isRequired};const Yt=()=>(0,f.jsxs)("div",{className:"yst-max-w-[400px] yst-py-4 yst-px-3 yst-border yst-rounded-lg yst-w-full yst-mx-auto",children:[(0,f.jsxs)("div",{className:"yst-flex yst-gap-x-3",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-flex-shrink-0 yst-h-7 yst-w-7 yst-rounded-full"}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-full yst-gap-y-1",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-2.5 yst-w-10/12"})]})]}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-4 yst-w-full yst-mt-6 yst-mb-4"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-full"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-10/12 yst-mt-2.5"})]}),Zt=({className:e="",progress:t,max:s,score:n})=>{const i=(0,r.useMemo)(()=>(e=>e>=7?"yst-score-good":e>=5?"yst-score-ok":"yst-score-bad")(n),[n]);return(0,f.jsx)(o.ProgressBar,{className:g()("yst-length-progress-bar",i,e),progress:t,min:0,max:s})};Zt.propTypes={className:je().string,progress:je().number.isRequired,max:je().number.isRequired,score:je().number.isRequired};const Kt=({title:e,description:t,showPreviewSkeleton:s})=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,i.__)("Social preview","wordpress-seo")})}),s?(0,f.jsx)(Qt,{}):(0,f.jsx)(Xt,{title:e,description:t})]});Kt.propTypes={title:je().string.isRequired,description:je().string.isRequired,showPreviewSkeleton:je().bool.isRequired};var Jt=s(1426);const Xt=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(w.sH).getSiteUrl(),[]),o=(0,t.useSelect)(e=>e(w.sH).getFacebookImageUrl(),[]),i=(0,t.useSelect)(e=>e(w.sH).getEditorDataImageFallback(),[]),a=(0,t.useSelect)(e=>e(w.sH).getFacebookAltText(),[]);return(0,f.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,f.jsx)(Jt.Xi,{title:e,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:i,alt:a,onSelect:n.noop,onImageClick:n.noop,onMouseHover:n.noop})})};Xt.propTypes={title:je().string.isRequired,description:je().string.isRequired};const Qt=()=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-w-[527px] yst-border yst-mx-auto",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-[273px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,f.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]}),es=({children:e,onRetry:t})=>{const{onClose:s}=(0,o.useModalContext)();return(0,f.jsxs)(r.Fragment,{children:[e,(0,f.jsxs)("div",{className:"yst-mt-6 yst-mb-1 yst-flex yst-space-x-3 rtl:yst-space-x-reverse yst-place-content-end",children:[(0,f.jsx)(o.Button,{variant:"secondary",onClick:s,children:(0,i.__)("Close","wordpress-seo")}),(0,f.jsx)(o.Button,{variant:"primary",onClick:t,children:(0,i.__)("Try again","wordpress-seo")})]})]})};es.propTypes={children:je().node.isRequired,onRetry:je().func.isRequired};const ts=({errorCode:e,errorIdentifier:t,invalidSubscriptions:s=[],showActions:r=!1,onRetry:o=n.noop,errorMessage:i=""})=>{switch(e){case 400:switch(t){case"AI_CONTENT_FILTER":return(0,f.jsx)(Ce.Ri,{});case"NOT_ENOUGH_CONTENT":return(0,f.jsx)(Ce.Zd,{});case"SITE_UNREACHABLE":return(0,f.jsx)(Se,{});case"WP_HTTP_REQUEST_ERROR":return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.W7,{errorMessage:i})}):(0,f.jsx)(Ce.W7,{errorMessage:i});default:return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.K2,{})}):(0,f.jsx)(Ce.K2,{})}case 402:return(0,f.jsx)(Ce.AA,{invalidSubscriptions:s});case 408:return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.Am,{})}):(0,f.jsx)(Ce.Am,{});case 429:return"USAGE_LIMIT_REACHED"===t?(0,f.jsx)(Ce.AA,{invalidSubscriptions:s}):(0,f.jsx)(Ce.IT,{});case 410:return(0,f.jsx)(Ce.fQ,{});default:return r?(0,f.jsx)(es,{onRetry:o,children:(0,f.jsx)(Ce.K2,{})}):(0,f.jsx)(Ce.K2,{})}};ts.propTypes={errorCode:je().number.isRequired,errorIdentifier:je().string.isRequired,invalidSubscriptions:je().array,showActions:je().bool,onRetry:je().func,errorMessage:je().string};const ss=je().shape({value:je().string.isRequired,label:je().node.isRequired}),rs=({id:e,name:t,suggestion:s,isChecked:n,onChange:o})=>{const i=(0,r.useCallback)(()=>o(s.value),[s,o]);return(0,f.jsxs)("label",{htmlFor:e,className:g()("yst-flex yst-p-4 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",n&&"yst-z-10 yst-border-primary-500"),children:[(0,f.jsx)("input",{type:"radio",id:e,name:t,className:"yst-radio__input",value:s.value,checked:n,onChange:i}),(0,f.jsx)("div",{className:g()("yst-label yst-radio__label yst-flex yst-flex-wrap yst-items-center",!n&&"yst-text-slate-600"),children:s.label})]})};rs.propTypes={id:je().string.isRequired,name:je().string.isRequired,suggestion:ss.isRequired,isChecked:je().bool.isRequired,onChange:je().func.isRequired};const ns=({idSuffix:e,suggestions:t,selected:s,onChange:r})=>(0,f.jsx)("div",{children:(0,f.jsx)(o.RadioGroup,{className:"yst-suggestions-radio-group yst-flex yst-flex-col",id:`yst-ai-suggestions-radio-group__${e}`,children:t.map((t,n)=>(0,f.jsx)(rs,{id:`yst-ai-suggestions-radio-${e}__${n}`,name:`ai-suggestion__${e}`,isChecked:t.value===s,onChange:r,suggestion:t},`yst-ai-suggestions-radio-${e}__${n}`))})});ns.propTypes={idSuffix:je().string.isRequired,suggestions:je().arrayOf(ss).isRequired,selected:je().string.isRequired,onChange:je().func.isRequired};const os=[["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-9/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-7/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-10/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-11/12"],["yst-h-3 yst-w-full","yst-mt-2.5 yst-h-3 yst-w-8/12"]],is=({suggestionClassNames:e=os})=>(0,f.jsx)("div",{className:"yst-flex yst-flex-col yst--space-y-[1px]",children:e.map((e,t)=>(0,f.jsxs)("div",{className:"yst-flex yst-p-4 yst-gap-x-3 yst-items-center yst-border first:yst-rounded-t-md last:yst-rounded-b-md",children:[(0,f.jsx)("input",{type:"radio",disabled:!0,className:"yst-my-0.5"}),(0,f.jsx)("div",{className:"yst-flex yst-flex-col yst-w-full",children:e.map((e,s)=>(0,f.jsx)(o.SkeletonLoader,{className:e},`yst-ai-suggestion-radio-skeleton-${t}__${s}`))})]},`yst-ai-suggestion-radio-skeleton__${t}`))});is.propTypes={suggestionClassNames:je().arrayOf(je().arrayOf(je().string))};const as="ai_generator_tip_notification",ls=()=>{const e=(0,t.useSelect)(e=>e(w.sH).isAlertDismissed(as),[]),s=(0,t.useSelect)(e=>e(w.sH).getEditorDataContent(),[]),n=(0,t.useSelect)(e=>e(w.sH).getIsWooProductEntity(),[]),[a,,,l]=(0,o.useToggleState)(!1),{editType:c,contentType:d}=xt(),{dismissAlert:u}=(0,t.useDispatch)(w.sH),p=(0,r.useCallback)(()=>{u(as)},[u]),y=(0,r.useMemo)(()=>c===w.gC.description?(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI descriptions by writing more content in your page.","wordpress-seo"):(0,i.__)("%1$sTip%2$s: Improve the accuracy of your generated AI titles by writing more content in your page.","wordpress-seo")
294 +/* translators: %1$s and %2$s expand to opening and closing of a span in order to emphasise the word. */,[c]),h=(0,r.useMemo)(()=>((e,t)=>e||t===w.Ty.term?w.C$:w.W1)(n,d),[d,n]),g=(0,r.useMemo)(()=>(e=>at.languageProcessing.sanitizeString(e||"").length)(s),[s]);return e||a||g>h?null:(0,f.jsxs)(o.Notifications.Notification,{id:"ai-generator-content-tip",variant:"info",dismissScreenReaderLabel:(0,i.__)("Dismiss","wordpress-seo"),children:[(0,m.x)((0,i.sprintf)(y,"<span>","</span>"),{span:(0,f.jsx)("span",{className:"yst-font-medium yst-text-slate-800"})}),(0,f.jsxs)("div",{className:"yst-flex yst-mt-3 yst--ms-3 yst-gap-1",children:[(0,f.jsx)(o.Button,{type:"button",variant:"tertiary",onClick:p,children:(0,i.__)("Don’t show again","wordpress-seo")}),(0,f.jsx)(o.Button,{type:"button",variant:"tertiary",className:"yst-text-slate-800",onClick:l,children:(0,i.__)("Dismiss","wordpress-seo")})]})]})},cs=({title:e,description:t,showPreviewSkeleton:s})=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"yst-flex yst-mb-6",children:(0,f.jsx)(o.Label,{as:"span",className:"yst-flex-grow yst-cursor-default",children:(0,i.__)("X preview","wordpress-seo")})}),s?(0,f.jsx)(us,{}):(0,f.jsx)(ds,{title:e,description:t})]});cs.propTypes={title:je().string.isRequired,description:je().string.isRequired,showPreviewSkeleton:je().bool.isRequired};const ds=({title:e,description:s})=>{const r=(0,t.useSelect)(e=>e(w.sH).getSiteUrl(),[]),o=(0,t.useSelect)(e=>e(w.sH).getTwitterImageUrl(),[]),i=(0,t.useSelect)(e=>e(w.sH).getFacebookImageUrl(),[]),a=(0,t.useSelect)(e=>e(w.sH).getEditorDataImageFallback(),[]),l=(0,t.useSelect)(e=>e(w.sH).getTwitterImageType(),[]),c=(0,t.useSelect)(e=>e(w.sH).getTwitterAltText(),[]);return(0,f.jsx)("div",{className:"yst-ai-generator-preview-section",children:(0,f.jsx)(Jt.WG,{title:e,description:s,siteUrl:r,imageUrl:o,imageFallbackUrl:i||a,isLarge:"summary"!==l,alt:c,onSelect:n.noop,onImageClick:n.noop,onMouseHover:n.noop})})};ds.propTypes={title:je().string.isRequired,description:je().string.isRequired};const us=()=>(0,f.jsxs)("div",{className:"yst-flex yst-flex-col yst-max-h-[370px] yst-w-[507px] yst-border yst-rounded-t-[14px] yst-overflow-hidden yst-mx-auto",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-[265px] yst-w-full yst-rounded-none yst-border yst-border-dashed"}),(0,f.jsxs)("div",{className:"yst-w-full yst-p-4 yst-space-y-1",children:[(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-1/3"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-5 yst-w-10/12"}),(0,f.jsx)(o.SkeletonLoader,{className:"yst-h-3 yst-w-full"})]})]});je().number.isRequired,je().string,je().string,je().object.isRequired,je().bool;const ps=()=>{const{previewType:e}=xt();switch(e){case w.i0.social:return Kt;case w.i0.twitter:return cs;default:return Wt}},ms=()=>{const{editType:e}=xt();switch(e){case w.gC.title:return(()=>{const{previewType:e}=xt(),{updateData:s,setFacebookPreviewTitle:o,setTwitterPreviewTitle:i}=(0,t.useDispatch)(w.sH);return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return e=>s({title:e});case w.i0.social:return o;case w.i0.twitter:return i;default:return n.noop}},[e,s,o,i])})();case w.gC.description:return(()=>{const{previewType:e}=xt(),{updateData:s,setFacebookPreviewDescription:o,setTwitterPreviewDescription:i}=(0,t.useDispatch)(w.sH);return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return e=>s({description:e});case w.i0.social:return o;case w.i0.twitter:return i;default:return n.noop}},[e,s,o,i])})();default:return n.noop}},ys=(0,kt.createSlice)({name:"suggestions",initialState:{status:w.$H.loading,error:{code:200,message:""},entities:[],selected:""},reducers:{setLoading:e=>{e.status=w.$H.loading},setSuccess:(e,{payload:t})=>{e.status=w.$H.success,e.selected=t[0],e.entities.push(...t)},setError:(e,{payload:t})=>{e.status=w.$H.error,e.error=t},setSelected:(e,{payload:t})=>{e.selected=t}}}),hs=e=>{switch(e){case w.i0.social:return"Facebook";case w.i0.twitter:return"Twitter";default:return"Google"}},gs=()=>{const[e,s]=(0,r.useReducer)(ys.reducer,ys.getInitialState()),{editType:o,previewType:i,postType:a,contentType:l}=xt(),c=(0,t.useSelect)(e=>e(w.XA).selectPromptContent(),[]),d=(0,t.useSelect)(e=>e(w.XA).selectGetSuggestionsEndpoint(),[]),{contentLocale:u,focusKeyphrase:p,isWooCommerceActive:m,isGutenberg:y,isElementor:h}=(0,t.useSelect)(e=>({contentLocale:e(w.sH).getContentLocale(),focusKeyphrase:e(w.sH).getFocusKeyphrase(),isWooCommerceActive:e(w.sH).getIsWooCommerceActive(),isGutenberg:e(w.sH).getIsBlockEditor(),isElementor:e(w.sH).getIsElementorEditor()}),[]);let g,f=at.languageProcessing.helpers.processExactMatchRequest(p).keyphrase;f.length>191&&(f=f.slice(0,191)),g=h?"elementor":y?"gutenberg":"classic";const x=((e,t,s,r)=>{const n=e===w.gC.description?"meta-description":"seo-title";let o=((e,t)=>{if(e)switch(t){case w.M$.product:return"product-";case w.M$.productCategory:case w.M$.productTag:return"product-taxonomy-"}return""})(t,s);return o&&t||r!==w.Ty.term||(o="taxonomy-"),`${o}${n}`})(o,m,a,l);return{suggestions:e,fetchSuggestions:(0,r.useCallback)(async(e=!0)=>{s(ys.actions.setLoading());const{status:t,payload:r}=await(async({endpoint:e,data:t})=>{let s;const r=1e3*(0,n.get)(window,"wpseoAiGenerator.requestTimeout",30);try{ut&&ut.abort(),ut=new AbortController,pt=!1,s=setTimeout(()=>{pt=!0,ut.abort()},r);const n=await dt()({path:e,method:"POST",data:t,parse:!1,signal:ut.signal}),o=await n.json();return{status:w.Sf.success,payload:o}}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return pt?{status:w.Sf.error,payload:{message:"timeout",code:408}}:{status:w.Sf.abort};const{message:t,missingLicenses:s,errorIdentifier:r}=await(async e=>{try{const t=e.body.getReader(),{value:s}=await t.read(),r=new TextDecoder("utf-8").decode(s);return console.error(r),JSON.parse(r)}catch(e){return{message:"Unknown"}}})(e);return{status:w.Sf.error,payload:{message:t,code:e.status||500,missingLicenses:s,errorIdentifier:r}}}finally{clearTimeout(s)}})({endpoint:d,canAbort:e,data:{type:x,prompt_content:c,focus_keyphrase:f,platform:hs(i),language:j(u).replace("_","-"),editor:g}});switch(t){case w.Sf.abort:break;case w.Sf.error:s(ys.actions.setError(r));break;case w.Sf.success:s(ys.actions.setSuccess(r))}return t},[s]),setSelectedSuggestion:(0,r.useCallback)(e=>s(ys.actions.setSelected(e)),[s])}},fs=({editType:e,title:s,description:n})=>{const o=(0,t.useSelect)(e=>e(w.sH).getDateFromSettings(),[]),i=(0,t.useSelect)(e=>e(w.sH).getContentLocale(),[]),a=(0,t.useSelect)(e=>e(w.sH).isCornerstoneContent(),[]),l=(0,t.useSelect)(e=>e(w.sH).getIsTerm(),[]);return(0,r.useMemo)(()=>e===w.gC.description?(0,qe.getDescriptionProgress)(n,o,a,l,i):(0,qe.getTitleProgress)(s),[e,s,n,o,a,l,i])},xs=()=>{const{editType:e,previewType:s,contentType:o}=xt(),i=(()=>{const{previewType:e}=xt();return(0,r.useMemo)(()=>{switch(e){case w.i0.google:return()=>(0,t.select)(w.sH).getSnippetEditorData().title;case w.i0.social:return(0,t.select)(w.sH).getFacebookTitleOrFallback;case w.i0.twitter:return(0,t.select)(w.sH).getTwitterTitleOrFallback;default:return(0,n.constant)("")}},[e])})(),a=(0,t.useSelect)(t=>t(w.XA).selectAppliedSuggestionFor({editType:e,previewType:s}),[e,s]);return(0,r.useMemo)(()=>{let t=i();return e===w.gC.description?t:(a&&(t=t.replace(a,w.Zc[o])),((e,t)=>e.includes(w.Zc[t])?e:w.Zc[t])(t,o))},[e,i])},vs=e=>{const{isWooProductEntity:s,isProductPost:n,hasValidWooSubscription:o}=(0,t.useSelect)(e=>{const t=e(w.sH),s=e(w.XA);return{isWooProductEntity:t.getIsWooProductEntity(),isProductPost:t.getIsProduct(),hasValidWooSubscription:s.selectWooCommerceSubscription()}},[]);return(0,r.useMemo)(()=>{const t={upsellLink:e.premium,upsellLabel:(0,i.sprintf)(/* translators: %1$s expands to Yoast SEO Premium. */ /* translators: %1$s expands to Yoast SEO Premium. */
295 295 (0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast SEO Premium"),newToText:"Yoast SEO Premium",ctbId:"f6a84663-465f-4cb5-8ba5-f7a6d72224b2",title:(0,i.__)("Use AI to generate your titles & descriptions!","wordpress-seo")};return s&&(n&&(t.title=(0,i.__)("Generate product titles & descriptions with AI!","wordpress-seo")),o||(t.newToText="Yoast WooCommerce SEO",t.upsellLabel=(0,i.sprintf)(/* translators: %1$s expands to Yoast WooCommerce SEO. */ /* translators: %1$s expands to Yoast WooCommerce SEO. */
296 -(0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),t.upsellLink=e.woo,t.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),t},[s,n,e.premium,e.woo])};var ws=s(4080),bs=s(5074),js=s.n(bs);const Cs=({onConfirm:e,isOpen:t,onClose:s})=>{const r=(0,o.useSvgAria)();return(0,f.jsx)(o.Modal,{isOpen:t,onClose:s,className:"yst-flex yst-items-center yst-justify-center",children:(0,f.jsxs)(o.Modal.Panel,{closeButtonScreenReaderText:(0,i.__)("Close replace content confirmation","wordpress-seo"),children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-start",children:[(0,f.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,f.jsx)(js(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...r})}),(0,f.jsxs)("div",{className:"yst-ms-4 yst-text-start",children:[(0,f.jsx)(o.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900 yst-mb-3",children:(0,i.__)("Replace existing content with this outline?","wordpress-seo")}),(0,f.jsx)(o.Modal.Description,{className:"yst-text-sm yst-text-slate-500",children:(0,i.__)("This will replace everything in your post with the generated outline and content notes. You can revert this action by clicking the 'undo' button in the Gutenberg editor.","wordpress-seo")})]})]}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-row yst-justify-end yst-gap-3 yst-mt-6",children:[(0,f.jsx)(o.Button,{type:"button",variant:"secondary",onClick:s,children:(0,i.__)("Cancel","wordpress-seo")}),(0,f.jsx)(o.Button,{type:"button",variant:"error",onClick:e,children:(0,i.__)("Replace content","wordpress-seo")})]})]})})},_s=((0,a.compose)([(0,t.withSelect)(e=>{const{selectFeatureModalStatus:t,selectSuggestionsStatus:s,selectContentOutlineStatus:r}=e(v.bw),n=e("core/editor").getEditedPostContent(),{getIsPremium:o,selectLink:i}=e("yoast-seo/editor"),{selectUsageCount:a,selectUsageCountLimit:c,selectUsageCountStatus:d}=e(w.XA);return{isEmptyPost:0===(0,l.count)(n,"words",{}),isPremium:o(),status:t(),modalHelpLink:i("https://yoa.st/ai-content-planner-help-button-modal"),usageCount:a(),usageCountLimit:c(),contentSuggestionsStatus:s(),contentOutlineStatus:r(),usageCountStatus:d()}}),(0,t.withDispatch)(e=>{const{closeModal:t}=e(v.bw);return{onClose:t}})])(({onClose:e,isEmptyPost:t,isPremium:s,status:n,modalHelpLink:a,usageCount:l,usageCountLimit:c,contentSuggestionsStatus:d,contentOutlineStatus:u,usageCountStatus:p,openReplaceContentModal:m,setHasVisitedReplace:y,editedOutlineRef:h,handleApplyOutline:g,isReplaceModalOpen:x=!1,onCloseReplace:w})=>{const b=_(),j=n===v.Qo.consent,k=(0,o.useSvgAria)(),E=(0,r.useRef)(null),N=n===v.Qo.contentSuggestions,R=d===S.$H.error,M=n===v.Qo.contentOutline,L=u===S.$H.error,[T,A]=(0,r.useState)(0),O=(0,r.useCallback)(e=>A(e.borderBoxSize[0].blockSize),[A]),I=bt(O),{bottom:P}=C(T),$=(0,r.useCallback)(e=>{b(e)},[b]),H=(0,r.useCallback)(e=>{h.current=e,t?g():(y(!0),m())},[t,g,m,y]);return(0,f.jsx)(o.Modal,{isOpen:!j&&(N||M),onClose:e,children:(0,f.jsxs)(o.Modal.Panel,{ref:I,className:"yst-p-0 yst-max-w-2xl yst-overflow-visible",hasCloseButton:!1,children:[(0,f.jsx)(o.Modal.CloseButton,{ref:E,screenReaderText:N?(0,i.__)("Close content suggestions modal","wordpress-seo"):(0,i.__)("Close content outline modal","wordpress-seo")}),(0,f.jsxs)(o.Modal.Container,{children:[(0,f.jsxs)(o.Modal.Container.Header,{className:"yst-flex yst-items-center yst-gap-2 yst-pe-14 yst-py-6 yst-ps-6 yst-border-b yst-border-slate-200",children:[(0,f.jsx)(ws.h,{className:"yst-fill-primary-500 yst-w-4 yst-mb-[1px]",...k}),(0,f.jsx)(o.Modal.Title,{size:"2",children:N?(0,i.__)("Content suggestions","wordpress-seo"):(0,i.__)("Content outline","wordpress-seo")}),(0,f.jsx)(o.Link,{href:a,variant:"primary",className:"yst-no-underline",target:"_blank",rel:"noopener noreferrer","aria-label":(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,f.jsx)(_t(),{...k,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,f.jsx)("span",{className:"yst-flex-grow"}),(0,f.jsx)(o.Badge,{size:"small",children:(0,i.__)("Beta","wordpress-seo")}),(N&&!R||M&&!L)&&(0,f.jsx)(St.UsageCounter,{className:"yst-relative yst-flex yst-items-center",limit:c,requests:l,mentionBetaInTooltip:s,mentionResetInTooltip:s,isSkeleton:d===S.$H.loading||p===S.$H.loading})]}),N&&(0,f.jsx)(Be,{onSuggestionClick:$,closeButtonRef:E}),M&&(0,f.jsx)(tt,{onApplyOutline:H,closeButtonRef:E})]}),(0,f.jsx)(o.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:P},position:"bottom-left",children:d===S.$H.success&&!L&&(0,f.jsx)(it,{})}),(0,f.jsx)(Cs,{isOpen:x,onConfirm:g,onClose:w})]})})}),window.wp.blockEditor);var Ss=s(6883),ks=s.n(Ss),Es=s(2127),Ns=s.n(Es);const Rs=({contentNotes:e})=>{const t=(0,o.useSvgAria)();return(0,f.jsxs)("div",{className:"yst-bg-slate-50 yst-font-sans yst-rounded-sm yst-shadow-sm yst-border yst-border-solid yst-border-slate-200 yst-p-4",children:[(0,f.jsxs)("div",{className:"yst-text-slate-500 yst-text-xs yst-flex yst-items-center yst-mb-4",children:[(0,f.jsx)(ks(),{className:"yst-inline-block yst-w-3 yst-h-3 yst-me-1 yst-shrink-0",...t}),(0,f.jsx)("span",{className:"yst-text-xs yst-leading-3",children:(0,i.__)("Only visible to you","wordpress-seo")})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"yst-flex yst-justify-start yst-items-center yst-gap-2 yst-mb-1 yst-ps-4",children:[(0,f.jsx)("div",{className:"yst-flex yst-items-center yst-justify-center yst-w-4 yst-h-4 yst-bg-ai-500 yst-rounded-[1.5px]",children:(0,f.jsx)(Ns(),{className:"yst-w-3 yst-h-3 yst-shrink-0 yst-text-white yst-flex yst-items-center yst-justify-center",...t})}),(0,f.jsx)("h3",{className:"yst-text-slate-800 yst-text-sm yst-leading-5 yst-font-medium yst-m-0",children:(0,i.__)("Content notes","wordpress-seo")})]}),e.length>0&&(0,f.jsx)("ul",{className:"yst-text-sm yst-text-slate-600 yst-font-normal yst-my-0 yst-ps-5 yst-leading-5 yst-list-none",children:e.map((e,t)=>(0,f.jsxs)("li",{className:"yst-flex yst-justify-start yst-gap-2",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"•"}),e]},`${t}-${e}`))})]})]})};(0,e.getBlockType)("yoast-seo/content-suggestion")||(0,e.registerBlockType)("yoast-seo/content-suggestion",{apiVersion:3,title:(0,i.__)("Content Suggestion","wordpress-seo"),category:"text",supports:{inserter:!1},transforms:{to:[{type:"block",blocks:["core/list"],transform:({suggestions:t})=>(0,e.createBlock)("core/list",{},t.map(t=>(0,e.createBlock)("core/list-item",{content:t})))}]},attributes:{title:{type:"string",default:""},suggestions:{type:"array",items:{type:"string"},default:[]}},edit:({attributes:e})=>{const t=(0,r.useRef)(null),s=(0,_s.useBlockProps)({ref:t});return(0,r.useEffect)(()=>{var e,s;const r=null!==(e=null===(s=t.current)||void 0===s?void 0:s.ownerDocument)&&void 0!==e?e:document;if(r===window.document||r.getElementById("yoast-seo-tailwind-css"))return;const n=window.document.getElementById("yoast-seo-tailwind-css");if(!n)return;const o=r.createElement("link");o.id="yoast-seo-tailwind-css",o.rel="stylesheet",o.href=n.href,r.head.appendChild(o)},[]),(0,f.jsx)("div",{...s,children:(0,f.jsx)(Rs,{contentNotes:e.suggestions})})},save:()=>null}),s(3832);const Ms=e=>{var t,s;let r=(0,n.isObject)(e)?e:{};(0,n.isString)(e)&&(r={message:e});const o={...r,errorMessage:(null===(t=r)||void 0===t?void 0:t.errorMessage)||(null===(s=r)||void 0===s?void 0:s.message)};return(0,n.mapValues)({errorCode:502,errorIdentifier:"",errorMessage:"",missingLicenses:[]},(e,t)=>o[t]||e)},Ls="fetchContentPlannerSuggestions",Ts=(0,kt.createSlice)({name:"contentSuggestions",initialState:{endpoint:"",status:S.$H.idle,suggestions:[],recentContent:[],error:v.pb},reducers:{setContentSuggestionsStatus:(e,{payload:t})=>{e.status=t},setSuggestion:(e,{payload:t})=>{const s=e.suggestions.findIndex(e=>e.id===t.id);-1!==s&&(e.suggestions[s]=t)},setSuggestionsError:(e,{payload:t})=>{e.status=S.$H.error,e.suggestions=[],e.error=Ms(t)}},extraReducers:e=>{e.addCase(`${Ls}/${S.fJ.request}`,e=>{e.status=S.$H.loading,e.suggestions=[],e.recentContent=[],e.error=v.pb}),e.addCase(`${Ls}/${S.fJ.success}`,(e,{payload:t})=>{e.status=S.$H.success,e.suggestions=t.suggestions,e.recentContent=t.recentContent,e.error=v.pb}),e.addCase(`${Ls}/${S.fJ.error}`,(e,{payload:t})=>{e.status=S.$H.error,e.error=Ms(t)})}});Ts.getInitialState,Ts.actions,Ts.reducer;const As="fetchContentOutline",Os={suggestion:null,outline:[],cache:{},endpoint:"",status:S.$H.idle,error:v.pb},Is=(0,kt.createSlice)({name:"contentOutline",initialState:Os,reducers:{setSuggestionForOutline:(e,{payload:t})=>{e.suggestion=t},restoreContentOutlineFromCache:(e,{payload:t})=>{const{suggestion:s,outline:r}=t;e.suggestion=s,e.outline=r,e.status=S.$H.success,e.error=v.pb},saveOutlineEditsToCache:(e,{payload:t})=>{const{id:s,structure:r}=t;s&&(e.cache[s]=r),e.suggestion=null,e.outline=[],e.status=S.$H.idle,e.error=v.pb}},extraReducers:e=>{e.addCase(`${As}/${S.fJ.request}`,(e,{payload:t})=>{e.status=S.$H.loading,e.suggestion=t.suggestion,e.error=v.pb}),e.addCase(`${As}/${S.fJ.success}`,(e,{payload:t})=>{e.status=S.$H.success;const s=t.outline.map((e,t)=>{var s,r;const n=null!==(s=e.subheading_text)&&void 0!==s?s:"";return{id:`${t}-${n}`,heading:n,contentNotes:null!==(r=e.content_notes)&&void 0!==r?r:[]}});e.outline=s}),e.addCase(`${As}/${S.fJ.error}`,(e,{payload:t})=>{e.status=S.$H.error,e.error=Ms(t)}),e.addCase(`${Ls}/${S.fJ.request}`,e=>({...Os,endpoint:e.endpoint}))}});Is.getInitialState,Is.actions,Is.reducer;const Ps=(0,kt.createSlice)({name:"modal",initialState:{isOpen:!1,featureModalStatus:null},reducers:{closeModal:()=>Ps.getInitialState(),setFeatureModalStatus:(e,{payload:t})=>{e.featureModalStatus=t}},extraReducers:e=>{e.addCase(`${As}/${S.fJ.request}`,e=>{e.featureModalStatus=v.Qo.contentOutline}),e.addCase(`${Ls}/${S.fJ.request}`,e=>{e.featureModalStatus=v.Qo.contentSuggestions})}}),$s=(Ps.getInitialState,Ps.reducer,Ps.actions,"availability"),Hs=(0,kt.createSlice)({name:$s,initialState:{minPostsMet:!1},reducers:{}});Hs.getInitialState,Hs.reducer,Hs.actions,s(3313);const Fs=(0,kt.createSlice)({name:"banner",initialState:{isBannerDismissed:!1,isBannerRendered:!1,isBannerPermanentlyDismissed:!1,bannerPermanentDismissalEndpoint:""},reducers:{setBannerRendered:e=>{e.isBannerRendered=!0},setBannerDismissed:e=>{e.isBannerDismissed=!0},setBannerPermanentlyDismissed:e=>{e.isBannerPermanentlyDismissed=!0}}});Fs.getInitialState,Fs.reducer;var Us=s(3560),Bs=s.n(Us),Ds=s(998),zs=s.n(Ds);const qs=({isPremium:e,onDismiss:t,onDismissPermanently:s,onClick:r,learnMoreLink:n})=>{const a=(0,o.useSvgAria)();return(0,f.jsx)(o.Root,{children:(0,f.jsxs)("div",{role:"group","aria-label":(0,i.__)("Content suggestions banner","wordpress-seo"),className:"yst-z-50 yst-relative yst-p-4 yst-ai-gradient-border yst-rounded-lg",children:[(0,f.jsxs)(o.DropdownMenu,{as:"span",className:"yst-absolute yst-top-4 yst-end-4",children:[(0,f.jsx)(o.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:(0,i.__)("Open banner options","wordpress-seo"),className:"yst-float-end"}),(0,f.jsxs)(o.DropdownMenu.List,{className:"yst-mt-8 yst-w-56",children:[(0,f.jsxs)(o.DropdownMenu.ButtonItem,{className:"yst-text-slate-600 yst-border-b yst-border-slate-200 yst-flex yst-py-2 yst-justify-start yst-gap-2 yst-px-4 yst-font-normal",onClick:t,children:[(0,f.jsx)(zs(),{className:"yst-w-4 yst-text-slate-400 yst-shrink-0",...a}),(0,i.__)("Remove for this post","wordpress-seo")]}),(0,f.jsxs)(o.DropdownMenu.ButtonItem,{className:"yst-text-red-500 yst-flex yst-py-2 yst-justify-start yst-gap-2 yst-px-4 yst-font-normal",onClick:s,children:[(0,f.jsx)(Bs(),{className:"yst-w-4 yst-shrink-0",...a}),(0,i.__)("Remove for all posts","wordpress-seo")]})]})]}),(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-2 yst-mb-1 yst-pe-8",children:[(0,f.jsx)(o.GradientSparklesIcon,{className:"yst-h-4 yst-w-4",...a}),(0,f.jsxs)("p",{className:"yst-grow yst-text-slate-800 yst-font-medium",children:[" ",(0,i.__)("Stuck on what to write next?","wordpress-seo")]})]}),(0,f.jsx)("p",{className:"yst-text-sm yst-text-slate-600 yst-mb-1 yst-max-w-xl",children:(0,i.__)("Let Yoast AI Content Planner analyze your content and suggest high-impact topics that fill content gaps and strengthen your SEO strategy.","wordpress-seo")}),(0,f.jsxs)(o.Link,{as:y.rd,href:n,variant:"primary",className:"yst-font-medium yst-no-underline",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(d(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180 yst-inline yst-ms-1.5"})]}),(0,f.jsxs)("div",{className:"yst-mt-1 yst-flex yst-justify-end yst-gap-2 yst-items-center",children:[!e&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(x,{}),(0,f.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,f.jsx)(o.Button,{variant:"ai-primary",onClick:r,children:(0,i.__)("Get content suggestions","wordpress-seo")})]})]})})},Ws=window.wp.dom;const Gs=({BlockListBlock:e,props:s,hasConsent:n})=>{const{isNewPost:o,isBannerDismissed:i,isBannerRendered:a,isBannerPermanentlyDismissed:l,bannerPermanentDismissalEndpoint:c,isPremium:d,minPostsMet:u,learnMoreLink:p}=(0,t.useSelect)(e=>{const t=e(v.bw);return{isNewPost:e("core/editor").isEditedPostNew(),isBannerDismissed:t.selectIsBannerDismissed(),isBannerRendered:t.selectIsBannerRendered(),isBannerPermanentlyDismissed:t.selectIsBannerPermanentlyDismissed(),bannerPermanentDismissalEndpoint:t.selectBannerPermanentDismissalEndpoint(),isPremium:e(w.sH).getIsPremium(),minPostsMet:e(v.bw).selectIsMinPostsMet(),learnMoreLink:e(w.sH).selectLink("https://yoa.st/content-planner-learn-more")}},[]),{setFeatureModalStatus:m,setBannerDismissed:y,setBannerRendered:h,dismissBannerPermanently:g}=(0,t.useDispatch)(v.bw),x=k(),b=(0,r.useRef)(null),j=!l&&!i&&(o||a)&&u,C=(0,r.useCallback)(()=>{y()},[y]),_=(0,r.useCallback)(()=>{g(c)},[g,c]),S=(0,r.useCallback)(()=>{n?x():m(v.Qo.consent)},[n,x,m]);return(0,r.useEffect)(()=>{j&&!a&&h()},[j,a,h]),(0,r.useEffect)(()=>{var e;const t=null===(e=b.current)||void 0===e?void 0:e.ownerDocument;if(!t||t===window.document||t.getElementById(v.x_))return;const s=window.document.getElementById(v.x_);if(!s)return;const r=t.createElement("link");r.id=v.x_,r.rel="stylesheet",r.href=s.href,t.head.appendChild(r)},[j]),(0,r.useEffect)(()=>{var e;if(!j)return;const t=null===(e=b.current)||void 0===e?void 0:e.ownerDocument;if(!t)return;function s(e){!function(e,t){!t.defaultPrevented&&e&&(["ArrowDown","ArrowUp"].includes(t.key)?function(e,t){const s=e.querySelector("[role='menu']");s&&(s===t.target||s.contains(t.target))&&t.preventDefault()}(e,t):"Tab"===t.key&&function(e,t){const s=(e=>e.shiftKey?Ws.focus.tabbable.findPrevious:Ws.focus.tabbable.findNext)(t),r=s(t.target);r&&((e,t,s)=>e.contains(t)||e.contains(s))(e,t.target,r)&&(t.preventDefault(),r.focus())}(e,t))}(b.current,e)}const r=e=>{(function(e,t){const s=null==e?void 0:e.querySelector(".yst-dropdown-menu__icon-trigger[aria-expanded='true']"),r=s&&e.querySelector("[role='menu']");return Boolean(r)&&!s.contains(t.target)&&!r.contains(t.target)})(b.current,e)&&b.current.querySelector(".yst-dropdown-menu__icon-trigger").click()};return t.addEventListener("keydown",s,{capture:!0}),t.addEventListener("mousedown",r,{capture:!0}),()=>{t.removeEventListener("keydown",s,{capture:!0}),t.removeEventListener("mousedown",r,{capture:!0})}},[j]),(0,f.jsxs)(f.Fragment,{children:[j&&(0,f.jsx)("div",{ref:b,className:"wp-block","data-block":"yoast-content-planner-banner",children:(0,f.jsx)(qs,{isPremium:d,onDismiss:C,onDismissPermanently:_,onClick:S,learnMoreLink:p})}),(0,f.jsx)(e,{...s})]})};(0,a.createHigherOrderComponent)(e=>function(s){const{isFirstBlock:i,isEditingTemplate:a}=(0,t.useSelect)(e=>{const t=e("core/editor"),r=t.getCurrentPostType();return{isFirstBlock:e("core/block-editor").getBlockOrder()[0]===s.clientId,isEditingTemplate:"wp_template"===r||"wp_template_part"===r||"template-locked"===t.getRenderingMode()}},[s.clientId]),l=(0,t.useSelect)(e=>(0,n.isObject)(e(w.XA)),[]),c=(0,t.useSelect)(e=>{var t,s;return null!==(t=null===(s=e(w.XA))||void 0===s?void 0:s.selectHasAiGeneratorConsent())&&void 0!==t&&t}),d=(0,r.useCallback)(()=>(0,f.jsx)(e,{...s}),[e,s]);return i&&l&&!a?(0,f.jsx)(o.ErrorBoundary,{FallbackComponent:d,children:(0,f.jsx)(Gs,{BlockListBlock:e,props:s,hasConsent:c})}):(0,f.jsx)(e,{...s})},"withYoastContentPlannerBanner")})()})();
296 +(0,i.__)("Unlock with %1$s","wordpress-seo"),"Yoast WooCommerce SEO"),t.upsellLink=e.woo,t.ctbId="5b32250e-e6f0-44ae-ad74-3cefc8e427f9")),t},[s,n,e.premium,e.woo])};var ws=s(4080),bs=s(5074),js=s.n(bs);const Cs=({onConfirm:e,isOpen:t,onClose:s})=>{const r=(0,o.useSvgAria)();return(0,f.jsx)(o.Modal,{isOpen:t,onClose:s,className:"yst-flex yst-items-center yst-justify-center",children:(0,f.jsxs)(o.Modal.Panel,{closeButtonScreenReaderText:(0,i.__)("Close replace content confirmation","wordpress-seo"),children:[(0,f.jsxs)("div",{className:"yst-flex yst-items-start",children:[(0,f.jsx)("div",{className:"yst-flex-shrink-0 yst-flex yst-items-center yst-justify-center yst-h-10 yst-w-10 yst-rounded-full yst-bg-red-100",children:(0,f.jsx)(js(),{className:"yst-h-6 yst-w-6 yst-text-red-600",...r})}),(0,f.jsxs)("div",{className:"yst-ms-4 yst-text-start",children:[(0,f.jsx)(o.Modal.Title,{className:"yst-text-lg yst-leading-6 yst-font-medium yst-text-slate-900 yst-mb-3",children:(0,i.__)("Replace existing content with this outline?","wordpress-seo")}),(0,f.jsx)(o.Modal.Description,{className:"yst-text-sm yst-text-slate-500",children:(0,i.__)("This will replace everything in your post with the generated outline and content notes. You can revert this action by clicking the 'undo' button in the Gutenberg editor.","wordpress-seo")})]})]}),(0,f.jsxs)("div",{className:"yst-flex yst-flex-row yst-justify-end yst-gap-3 yst-mt-6",children:[(0,f.jsx)(o.Button,{type:"button",variant:"secondary",onClick:s,children:(0,i.__)("Cancel","wordpress-seo")}),(0,f.jsx)(o.Button,{type:"button",variant:"error",onClick:e,children:(0,i.__)("Replace content","wordpress-seo")})]})]})})},_s=((0,a.compose)([(0,t.withSelect)(e=>{const{selectFeatureModalStatus:t,selectSuggestionsStatus:s,selectContentOutlineStatus:r}=e(v.bw),n=e("core/editor").getEditedPostContent(),{getIsPremium:o,selectLink:i}=e("yoast-seo/editor"),{selectUsageCount:a,selectUsageCountLimit:c,selectUsageCountStatus:d}=e(w.XA);return{isEmptyPost:0===(0,l.count)(n,"words",{}),isPremium:o(),status:t(),modalHelpLink:i("https://yoa.st/ai-content-planner-help-button-modal"),usageCount:a(),usageCountLimit:c(),contentSuggestionsStatus:s(),contentOutlineStatus:r(),usageCountStatus:d()}}),(0,t.withDispatch)(e=>{const{closeModal:t}=e(v.bw);return{onClose:t}})])(({onClose:e,isEmptyPost:t,isPremium:s,status:n,modalHelpLink:a,usageCount:l,usageCountLimit:c,contentSuggestionsStatus:d,contentOutlineStatus:u,usageCountStatus:p,openReplaceContentModal:m,setHasVisitedReplace:y,editedOutlineRef:h,handleApplyOutline:g,isReplaceModalOpen:x=!1,onCloseReplace:w})=>{const b=_(),j=n===v.Qo.consent,k=(0,o.useSvgAria)(),E=(0,r.useRef)(null),N=n===v.Qo.contentSuggestions,R=d===S.$H.error,M=n===v.Qo.contentOutline,L=u===S.$H.error,[T,A]=(0,r.useState)(0),O=(0,r.useCallback)(e=>A(e.borderBoxSize[0].blockSize),[A]),I=bt(O),{bottom:P}=C(T),$=(0,r.useCallback)(e=>{b(e)},[b]),H=(0,r.useCallback)(e=>{h.current=e,t?g():(y(!0),m())},[t,g,m,y]);return(0,f.jsx)(o.Modal,{isOpen:!j&&(N||M),onClose:e,children:(0,f.jsxs)(o.Modal.Panel,{ref:I,className:"yst-p-0 yst-max-w-2xl yst-overflow-visible",hasCloseButton:!1,children:[(0,f.jsx)(o.Modal.CloseButton,{ref:E,screenReaderText:N?(0,i.__)("Close content suggestions modal","wordpress-seo"):(0,i.__)("Close content outline modal","wordpress-seo")}),(0,f.jsxs)(o.Modal.Container,{children:[(0,f.jsxs)(o.Modal.Container.Header,{className:"yst-flex yst-items-center yst-gap-2 yst-pe-14 yst-py-6 yst-ps-6 yst-border-b yst-border-slate-200",children:[(0,f.jsx)(ws.h,{className:"yst-fill-primary-500 yst-w-4 yst-mb-[1px]",...k}),(0,f.jsx)(o.Modal.Title,{size:"2",children:N?(0,i.__)("Content suggestions","wordpress-seo"):(0,i.__)("Content outline","wordpress-seo")}),(0,f.jsx)(o.Link,{href:a,variant:"primary",className:"yst-no-underline",target:"_blank",rel:"noopener noreferrer","aria-label":(0,i.__)("Learn more about AI (Opens in a new browser tab)","wordpress-seo"),children:(0,f.jsx)(_t(),{...k,className:"yst-w-4 yst-h-4 yst-text-slate-500 yst-shrink-0"})}),(0,f.jsx)("span",{className:"yst-flex-grow"}),(0,f.jsx)(o.Badge,{size:"small",children:(0,i.__)("Beta","wordpress-seo")}),(N&&!R||M&&!L)&&(0,f.jsx)(St.UsageCounter,{className:"yst-relative yst-flex yst-items-center",limit:c,requests:l,mentionBetaInTooltip:s,mentionResetInTooltip:s,isSkeleton:d===S.$H.loading||p===S.$H.loading})]}),N&&(0,f.jsx)(De,{onSuggestionClick:$,closeButtonRef:E}),M&&(0,f.jsx)(tt,{onApplyOutline:H,closeButtonRef:E})]}),(0,f.jsx)(o.Notifications,{className:"yst-mx-[calc(50%-50vw)] yst-transition-all",style:{bottom:P},position:"bottom-left",children:d===S.$H.success&&!L&&(0,f.jsx)(it,{})}),(0,f.jsx)(Cs,{isOpen:x,onConfirm:g,onClose:w})]})})}),window.wp.blockEditor);var Ss=s(6883),ks=s.n(Ss),Es=s(2127),Ns=s.n(Es);const Rs=({contentNotes:e})=>{const t=(0,o.useSvgAria)();return(0,f.jsxs)("div",{className:"yst-bg-slate-50 yst-font-sans yst-rounded-sm yst-shadow-sm yst-border yst-border-solid yst-border-slate-200 yst-p-4",children:[(0,f.jsxs)("div",{className:"yst-text-slate-500 yst-text-xs yst-flex yst-items-center yst-mb-4",children:[(0,f.jsx)(ks(),{className:"yst-inline-block yst-w-3 yst-h-3 yst-me-1 yst-shrink-0",...t}),(0,f.jsx)("span",{className:"yst-text-xs yst-leading-3",children:(0,i.__)("Only visible to you","wordpress-seo")})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"yst-flex yst-justify-start yst-items-center yst-gap-2 yst-mb-1 yst-ps-4",children:[(0,f.jsx)("div",{className:"yst-flex yst-items-center yst-justify-center yst-w-4 yst-h-4 yst-bg-ai-500 yst-rounded-[1.5px]",children:(0,f.jsx)(Ns(),{className:"yst-w-3 yst-h-3 yst-shrink-0 yst-text-white yst-flex yst-items-center yst-justify-center",...t})}),(0,f.jsx)("h3",{className:"yst-text-slate-800 yst-text-sm yst-leading-5 yst-font-medium yst-m-0",children:(0,i.__)("Content notes","wordpress-seo")})]}),e.length>0&&(0,f.jsx)("ul",{className:"yst-text-sm yst-text-slate-600 yst-font-normal yst-my-0 yst-ps-5 yst-leading-5 yst-list-none",children:e.map((e,t)=>(0,f.jsxs)("li",{className:"yst-flex yst-justify-start yst-gap-2",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"•"}),e]},`${t}-${e}`))})]})]})};(0,e.getBlockType)("yoast-seo/content-suggestion")||(0,e.registerBlockType)("yoast-seo/content-suggestion",{apiVersion:3,title:(0,i.__)("Content Suggestion","wordpress-seo"),category:"text",supports:{inserter:!1},transforms:{to:[{type:"block",blocks:["core/list"],transform:({suggestions:t})=>(0,e.createBlock)("core/list",{},t.map(t=>(0,e.createBlock)("core/list-item",{content:t})))}]},attributes:{title:{type:"string",default:""},suggestions:{type:"array",items:{type:"string"},default:[]}},edit:({attributes:e})=>{const t=(0,r.useRef)(null),s=(0,_s.useBlockProps)({ref:t});return(0,r.useEffect)(()=>{var e,s;const r=null!==(e=null===(s=t.current)||void 0===s?void 0:s.ownerDocument)&&void 0!==e?e:document;if(r===window.document||r.getElementById("yoast-seo-tailwind-css"))return;const n=window.document.getElementById("yoast-seo-tailwind-css");if(!n)return;const o=r.createElement("link");o.id="yoast-seo-tailwind-css",o.rel="stylesheet",o.href=n.href,r.head.appendChild(o)},[]),(0,f.jsx)("div",{...s,children:(0,f.jsx)(Rs,{contentNotes:e.suggestions})})},save:()=>null}),s(3832);const Ms=e=>{var t,s;let r=(0,n.isObject)(e)?e:{};(0,n.isString)(e)&&(r={message:e});const o={...r,errorMessage:(null===(t=r)||void 0===t?void 0:t.errorMessage)||(null===(s=r)||void 0===s?void 0:s.message)};return(0,n.mapValues)({errorCode:502,errorIdentifier:"",errorMessage:"",missingLicenses:[]},(e,t)=>o[t]||e)},Ls="fetchContentPlannerSuggestions",Ts=(0,kt.createSlice)({name:"contentSuggestions",initialState:{endpoint:"",status:S.$H.idle,suggestions:[],recentContent:[],error:v.pb},reducers:{setContentSuggestionsStatus:(e,{payload:t})=>{e.status=t},setSuggestion:(e,{payload:t})=>{const s=e.suggestions.findIndex(e=>e.id===t.id);-1!==s&&(e.suggestions[s]=t)},setSuggestionsError:(e,{payload:t})=>{e.status=S.$H.error,e.suggestions=[],e.error=Ms(t)}},extraReducers:e=>{e.addCase(`${Ls}/${S.fJ.request}`,e=>{e.status=S.$H.loading,e.suggestions=[],e.recentContent=[],e.error=v.pb}),e.addCase(`${Ls}/${S.fJ.success}`,(e,{payload:t})=>{e.status=S.$H.success,e.suggestions=t.suggestions,e.recentContent=t.recentContent,e.error=v.pb}),e.addCase(`${Ls}/${S.fJ.error}`,(e,{payload:t})=>{e.status=S.$H.error,e.error=Ms(t)})}});Ts.getInitialState,Ts.actions,Ts.reducer;const As="fetchContentOutline",Os={suggestion:null,outline:[],cache:{},endpoint:"",status:S.$H.idle,error:v.pb},Is=(0,kt.createSlice)({name:"contentOutline",initialState:Os,reducers:{setSuggestionForOutline:(e,{payload:t})=>{e.suggestion=t},restoreContentOutlineFromCache:(e,{payload:t})=>{const{suggestion:s,outline:r}=t;e.suggestion=s,e.outline=r,e.status=S.$H.success,e.error=v.pb},saveOutlineEditsToCache:(e,{payload:t})=>{const{id:s,structure:r}=t;s&&(e.cache[s]=r),e.suggestion=null,e.outline=[],e.status=S.$H.idle,e.error=v.pb}},extraReducers:e=>{e.addCase(`${As}/${S.fJ.request}`,(e,{payload:t})=>{e.status=S.$H.loading,e.suggestion=t.suggestion,e.error=v.pb}),e.addCase(`${As}/${S.fJ.success}`,(e,{payload:t})=>{e.status=S.$H.success;const s=t.outline.map((e,t)=>{var s,r;const n=null!==(s=e.subheading_text)&&void 0!==s?s:"";return{id:`${t}-${n}`,heading:n,contentNotes:null!==(r=e.content_notes)&&void 0!==r?r:[]}});e.outline=s}),e.addCase(`${As}/${S.fJ.error}`,(e,{payload:t})=>{e.status=S.$H.error,e.error=Ms(t)}),e.addCase(`${Ls}/${S.fJ.request}`,e=>({...Os,endpoint:e.endpoint}))}});Is.getInitialState,Is.actions,Is.reducer;const Ps=(0,kt.createSlice)({name:"modal",initialState:{isOpen:!1,featureModalStatus:null},reducers:{closeModal:()=>Ps.getInitialState(),setFeatureModalStatus:(e,{payload:t})=>{e.featureModalStatus=t}},extraReducers:e=>{e.addCase(`${As}/${S.fJ.request}`,e=>{e.featureModalStatus=v.Qo.contentOutline}),e.addCase(`${Ls}/${S.fJ.request}`,e=>{e.featureModalStatus=v.Qo.contentSuggestions})}}),$s=(Ps.getInitialState,Ps.reducer,Ps.actions,"availability"),Hs=(0,kt.createSlice)({name:$s,initialState:{minPostsMet:!1},reducers:{}});Hs.getInitialState,Hs.reducer,Hs.actions,s(3313);const Fs=(0,kt.createSlice)({name:"banner",initialState:{isBannerDismissed:!1,isBannerRendered:!1,isBannerPermanentlyDismissed:!1,bannerPermanentDismissalEndpoint:""},reducers:{setBannerRendered:e=>{e.isBannerRendered=!0},setBannerDismissed:e=>{e.isBannerDismissed=!0},setBannerPermanentlyDismissed:e=>{e.isBannerPermanentlyDismissed=!0}}});Fs.getInitialState,Fs.reducer;var Us=s(3560),Ds=s.n(Us),Bs=s(998),zs=s.n(Bs);const qs=({isPremium:e,onDismiss:t,onDismissPermanently:s,onClick:r,learnMoreLink:n})=>{const a=(0,o.useSvgAria)();return(0,f.jsx)(o.Root,{children:(0,f.jsxs)("div",{role:"group","aria-label":(0,i.__)("Content suggestions banner","wordpress-seo"),className:"yst-z-50 yst-relative yst-p-4 yst-ai-gradient-border yst-rounded-lg",children:[(0,f.jsxs)(o.DropdownMenu,{as:"span",className:"yst-absolute yst-top-4 yst-end-4",children:[(0,f.jsx)(o.DropdownMenu.IconTrigger,{screenReaderTriggerLabel:(0,i.__)("Open banner options","wordpress-seo"),className:"yst-float-end"}),(0,f.jsxs)(o.DropdownMenu.List,{className:"yst-mt-8 yst-w-56",children:[(0,f.jsxs)(o.DropdownMenu.ButtonItem,{className:"yst-text-slate-600 yst-border-b yst-border-slate-200 yst-flex yst-py-2 yst-justify-start yst-gap-2 yst-px-4 yst-font-normal",onClick:t,children:[(0,f.jsx)(zs(),{className:"yst-w-4 yst-text-slate-400 yst-shrink-0",...a}),(0,i.__)("Remove for this post","wordpress-seo")]}),(0,f.jsxs)(o.DropdownMenu.ButtonItem,{className:"yst-text-red-500 yst-flex yst-py-2 yst-justify-start yst-gap-2 yst-px-4 yst-font-normal",onClick:s,children:[(0,f.jsx)(Ds(),{className:"yst-w-4 yst-shrink-0",...a}),(0,i.__)("Remove for all posts","wordpress-seo")]})]})]}),(0,f.jsxs)("div",{className:"yst-flex yst-items-center yst-gap-2 yst-mb-1 yst-pe-8",children:[(0,f.jsx)(o.GradientSparklesIcon,{className:"yst-h-4 yst-w-4",...a}),(0,f.jsxs)("p",{className:"yst-grow yst-text-slate-800 yst-font-medium",children:[" ",(0,i.__)("Stuck on what to write next?","wordpress-seo")]})]}),(0,f.jsx)("p",{className:"yst-text-sm yst-text-slate-600 yst-mb-1 yst-max-w-xl",children:(0,i.__)("Let Yoast AI Content Planner analyze your content and suggest high-impact topics that fill content gaps and strengthen your SEO strategy.","wordpress-seo")}),(0,f.jsxs)(o.Link,{as:y.rd,href:n,variant:"primary",className:"yst-font-medium yst-no-underline",children:[(0,i.__)("Learn more","wordpress-seo"),(0,f.jsx)(d(),{className:"yst-w-4 yst-h-4 rtl:yst-rotate-180 yst-inline yst-ms-1.5"})]}),(0,f.jsxs)("div",{className:"yst-mt-1 yst-flex yst-justify-end yst-gap-2 yst-items-center",children:[!e&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(x,{}),(0,f.jsx)("span",{"aria-hidden":"true",children:"·"})]}),(0,f.jsx)(o.Button,{variant:"ai-primary",onClick:r,children:(0,i.__)("Get content suggestions","wordpress-seo")})]})]})})},Ws=window.wp.dom;const Gs=({BlockListBlock:e,props:s,hasConsent:n})=>{const{isNewPost:o,isBannerDismissed:i,isBannerRendered:a,isBannerPermanentlyDismissed:l,bannerPermanentDismissalEndpoint:c,isPremium:d,minPostsMet:u,learnMoreLink:p}=(0,t.useSelect)(e=>{const t=e(v.bw);return{isNewPost:e("core/editor").isEditedPostNew(),isBannerDismissed:t.selectIsBannerDismissed(),isBannerRendered:t.selectIsBannerRendered(),isBannerPermanentlyDismissed:t.selectIsBannerPermanentlyDismissed(),bannerPermanentDismissalEndpoint:t.selectBannerPermanentDismissalEndpoint(),isPremium:e(w.sH).getIsPremium(),minPostsMet:e(v.bw).selectIsMinPostsMet(),learnMoreLink:e(w.sH).selectLink("https://yoa.st/content-planner-learn-more")}},[]),{setFeatureModalStatus:m,setBannerDismissed:y,setBannerRendered:h,dismissBannerPermanently:g}=(0,t.useDispatch)(v.bw),x=k(),b=(0,r.useRef)(null),j=!l&&!i&&(o||a)&&u,C=(0,r.useCallback)(()=>{y()},[y]),_=(0,r.useCallback)(()=>{g(c)},[g,c]),S=(0,r.useCallback)(()=>{n?x():m(v.Qo.consent)},[n,x,m]);return(0,r.useEffect)(()=>{j&&!a&&h()},[j,a,h]),(0,r.useEffect)(()=>{var e;const t=null===(e=b.current)||void 0===e?void 0:e.ownerDocument;if(!t||t===window.document||t.getElementById(v.x_))return;const s=window.document.getElementById(v.x_);if(!s)return;const r=t.createElement("link");r.id=v.x_,r.rel="stylesheet",r.href=s.href,t.head.appendChild(r)},[j]),(0,r.useEffect)(()=>{var e;if(!j)return;const t=null===(e=b.current)||void 0===e?void 0:e.ownerDocument;if(!t)return;function s(e){!function(e,t){!t.defaultPrevented&&e&&(["ArrowDown","ArrowUp"].includes(t.key)?function(e,t){const s=e.querySelector("[role='menu']");s&&(s===t.target||s.contains(t.target))&&t.preventDefault()}(e,t):"Tab"===t.key&&function(e,t){const s=(e=>e.shiftKey?Ws.focus.tabbable.findPrevious:Ws.focus.tabbable.findNext)(t),r=s(t.target);r&&((e,t,s)=>e.contains(t)||e.contains(s))(e,t.target,r)&&(t.preventDefault(),r.focus())}(e,t))}(b.current,e)}const r=e=>{(function(e,t){const s=null==e?void 0:e.querySelector(".yst-dropdown-menu__icon-trigger[aria-expanded='true']"),r=s&&e.querySelector("[role='menu']");return Boolean(r)&&!s.contains(t.target)&&!r.contains(t.target)})(b.current,e)&&b.current.querySelector(".yst-dropdown-menu__icon-trigger").click()};return t.addEventListener("keydown",s,{capture:!0}),t.addEventListener("mousedown",r,{capture:!0}),()=>{t.removeEventListener("keydown",s,{capture:!0}),t.removeEventListener("mousedown",r,{capture:!0})}},[j]),(0,f.jsxs)(f.Fragment,{children:[j&&(0,f.jsx)("div",{ref:b,className:"wp-block","data-block":"yoast-content-planner-banner",children:(0,f.jsx)(qs,{isPremium:d,onDismiss:C,onDismissPermanently:_,onClick:S,learnMoreLink:p})}),(0,f.jsx)(e,{...s})]})};(0,a.createHigherOrderComponent)(e=>function(s){const{isFirstBlock:i,isEditingTemplate:a}=(0,t.useSelect)(e=>{const t=e("core/editor"),r=t.getCurrentPostType();return{isFirstBlock:e("core/block-editor").getBlockOrder()[0]===s.clientId,isEditingTemplate:"wp_template"===r||"wp_template_part"===r||"template-locked"===t.getRenderingMode()}},[s.clientId]),l=(0,t.useSelect)(e=>(0,n.isObject)(e(w.XA)),[]),c=(0,t.useSelect)(e=>{var t,s;return null!==(t=null===(s=e(w.XA))||void 0===s?void 0:s.selectHasAiGeneratorConsent())&&void 0!==t&&t}),d=(0,r.useCallback)(()=>(0,f.jsx)(e,{...s}),[e,s]);return i&&l&&!a?(0,f.jsx)(o.ErrorBoundary,{FallbackComponent:d,children:(0,f.jsx)(Gs,{BlockListBlock:e,props:s,hasConsent:c})}):(0,f.jsx)(e,{...s})},"withYoastContentPlannerBanner")})()})();