(()=>{var e={4184:(e,t)=>{var r;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e=[],t=0;t{var o,n;void 0===(n="function"==typeof(o=function(){var e="undefined"!=typeof window?window:this,t=e.Glider=function(t,r){var o=this;if(t._glider)return t._glider;if(o.ele=t,o.ele.classList.add("glider"),o.ele._glider=o,o.opt=Object.assign({},{slidesToScroll:1,slidesToShow:1,resizeLock:!0,duration:.5,easing:function(e,t,r,o,n){return o*(t/=n)*t+r}},r),o.animate_id=o.page=o.slide=0,o.arrows={},o._opt=o.opt,o.opt.skipTrack)o.track=o.ele.children[0];else for(o.track=document.createElement("div"),o.ele.appendChild(o.track);1!==o.ele.children.length;)o.track.appendChild(o.ele.children[0]);o.track.classList.add("glider-track"),o.init(),o.resize=o.init.bind(o,!0),o.event(o.ele,"add",{scroll:o.updateControls.bind(o)}),o.event(e,"add",{resize:o.resize})},r=t.prototype;return r.init=function(e,t){var r=this,o=0,n=0;r.slides=r.track.children,[].forEach.call(r.slides,(function(e,t){e.classList.add("glider-slide"),e.setAttribute("data-gslide",t)})),r.containerWidth=r.ele.clientWidth;var i=r.settingsBreakpoint();if(t||(t=i),"auto"===r.opt.slidesToShow||void 0!==r.opt._autoSlide){var s=r.containerWidth/r.opt.itemWidth;r.opt._autoSlide=r.opt.slidesToShow=r.opt.exactWidth?s:Math.max(1,Math.floor(s))}"auto"===r.opt.slidesToScroll&&(r.opt.slidesToScroll=Math.floor(r.opt.slidesToShow)),r.itemWidth=r.opt.exactWidth?r.opt.itemWidth:r.containerWidth/r.opt.slidesToShow,[].forEach.call(r.slides,(function(e){e.style.height="auto",e.style.width=r.itemWidth+"px",o+=r.itemWidth,n=Math.max(e.offsetHeight,n)})),r.track.style.width=o+"px",r.trackWidth=o,r.isDrag=!1,r.preventClick=!1,r.move=!1,r.opt.resizeLock&&r.scrollTo(r.slide*r.itemWidth,0),(i||t)&&(r.bindArrows(),r.buildDots(),r.bindDrag()),r.updateControls(),r.emit(e?"refresh":"loaded")},r.bindDrag=function(){var e=this;e.mouse=e.mouse||e.handleMouse.bind(e);var t=function(){e.mouseDown=void 0,e.ele.classList.remove("drag"),e.isDrag&&(e.preventClick=!0),e.isDrag=!1};const r=function(){e.move=!0};var o={mouseup:t,mouseleave:t,mousedown:function(t){t.preventDefault(),t.stopPropagation(),e.mouseDown=t.clientX,e.ele.classList.add("drag"),e.move=!1,setTimeout(r,300)},touchstart:function(t){e.ele.classList.add("drag"),e.move=!1,setTimeout(r,300)},mousemove:e.mouse,click:function(t){e.preventClick&&e.move&&(t.preventDefault(),t.stopPropagation()),e.preventClick=!1,e.move=!1}};e.ele.classList.toggle("draggable",!0===e.opt.draggable),e.event(e.ele,"remove",o),e.opt.draggable&&e.event(e.ele,"add",o)},r.buildDots=function(){var e=this;if(e.opt.dots){if("string"==typeof e.opt.dots?e.dots=document.querySelector(e.opt.dots):e.dots=e.opt.dots,e.dots){e.dots.innerHTML="",e.dots.setAttribute("role","tablist"),e.dots.classList.add("glider-dots");for(var t=0;t=t.trackWidth;t.opt.rewind||(t.arrows.prev&&(t.arrows.prev.classList.toggle("disabled",t.ele.scrollLeft<=0||r),t.arrows.prev.setAttribute("aria-disabled",t.arrows.prev.classList.contains("disabled"))),t.arrows.next&&(t.arrows.next.classList.toggle("disabled",Math.ceil(t.ele.scrollLeft+t.containerWidth)>=Math.floor(t.trackWidth)||r),t.arrows.next.setAttribute("aria-disabled",t.arrows.next.classList.contains("disabled")))),t.slide=Math.round(t.ele.scrollLeft/t.itemWidth),t.page=Math.round(t.ele.scrollLeft/t.containerWidth);var o=t.slide+Math.floor(Math.floor(t.opt.slidesToShow)/2),n=Math.floor(t.opt.slidesToShow)%2?0:o+1;1===Math.floor(t.opt.slidesToShow)&&(n=0),t.ele.scrollLeft+t.containerWidth>=Math.floor(t.trackWidth)&&(t.page=t.dots?t.dots.children.length-1:0),[].forEach.call(t.slides,(function(e,r){var i=e.classList,s=i.contains("visible"),a=t.ele.scrollLeft,l=t.ele.scrollLeft+t.containerWidth,c=t.itemWidth*r,u=c+t.itemWidth;[].forEach.call(i,(function(e){/^left|right/.test(e)&&i.remove(e)})),i.toggle("active",t.slide===r),o===r||n&&n===r?i.add("center"):(i.remove("center"),i.add([r=Math.floor(a)&&Math.floor(u)<=Math.ceil(l);i.toggle("visible",d),d!==s&&t.emit("slide-"+(d?"visible":"hidden"),{slide:r})})),t.dots&&[].forEach.call(t.dots.children,(function(e,r){e.classList.toggle("active",t.page===r)})),e&&t.opt.scrollLock&&(clearTimeout(t.scrollLock),t.scrollLock=setTimeout((function(){clearTimeout(t.scrollLock),Math.abs(t.ele.scrollLeft/t.itemWidth-t.slide)>.02&&(t.mouseDown||t.trackWidth>t.containerWidth+t.ele.scrollLeft&&t.scrollItem(t.getCurrentSlide()))}),t.opt.scrollLockDelay||250))},r.getCurrentSlide=function(){var e=this;return e.round(e.ele.scrollLeft/e.itemWidth)},r.scrollItem=function(e,t,r){r&&r.preventDefault();var o=this,n=e;++o.animate_id;var i,s=o.slide;if(!0===t)i=(e=Math.round(e*o.containerWidth/o.itemWidth))*o.itemWidth;else{if("string"==typeof e){var a="prev"===e;if(e=o.opt.slidesToScroll%1||o.opt.slidesToShow%1?o.getCurrentSlide():o.slide,a?e-=o.opt.slidesToScroll:e+=o.opt.slidesToScroll,o.opt.rewind){var l=o.ele.scrollLeft;e=a&&!l?o.slides.length:!a&&l+o.containerWidth>=Math.floor(o.trackWidth)?0:e}}e=Math.max(Math.min(e,o.slides.length),0),o.slide=e,i=o.itemWidth*e}return o.emit("scroll-item",{prevSlide:s,slide:e}),o.scrollTo(i,o.opt.duration*Math.abs(o.ele.scrollLeft-i),(function(){o.updateControls(),o.emit("animated",{value:n,type:"string"==typeof n?"arrow":t?"dot":"slide"})})),!1},r.settingsBreakpoint=function(){var t=this,r=t._opt.responsive;if(r){r.sort((function(e,t){return t.breakpoint-e.breakpoint}));for(var o=0;o=n.breakpoint)return t.breakpoint!==n.breakpoint&&(t.opt=Object.assign({},t._opt,n.settings),t.breakpoint=n.breakpoint,!0)}}var i=0!==t.breakpoint;return t.opt=Object.assign({},t._opt),t.breakpoint=0,i},r.scrollTo=function(t,r,o){var n=this,i=(new Date).getTime(),s=n.animate_id,a=function(){var l=(new Date).getTime()-i;n.ele.scrollLeft=n.ele.scrollLeft+(t-n.ele.scrollLeft)*n.opt.easing(0,l,0,1,r),l{"use strict";var o=r(9985),n=r(3691),i=TypeError;e.exports=function(e){if(o(e))return e;throw new i(n(e)+" is not a function")}},29:(e,t,r)=>{"use strict";var o=r(1034).has;e.exports=function(e){return o(e),e}},767:(e,t,r)=>{"use strict";var o=r(3622),n=TypeError;e.exports=function(e,t){if(o(t,e))return e;throw new n("Incorrect invocation")}},5027:(e,t,r)=>{"use strict";var o=r(8999),n=String,i=TypeError;e.exports=function(e){if(o(e))return e;throw new i(n(e)+" is not an object")}},4328:(e,t,r)=>{"use strict";var o=r(5290),n=r(7578),i=r(6310),s=function(e){return function(t,r,s){var a,l=o(t),c=i(l),u=n(s,c);if(e&&r!=r){for(;c>u;)if((a=l[u++])!=a)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},5649:(e,t,r)=>{"use strict";var o=r(7697),n=r(2297),i=TypeError,s=Object.getOwnPropertyDescriptor,a=o&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(n(e)&&!s(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},1228:(e,t,r)=>{"use strict";var o=r(5027),n=r(2125);e.exports=function(e,t,r,i){try{return i?t(o(r)[0],r[1]):t(r)}catch(t){n(e,"throw",t)}}},6648:(e,t,r)=>{"use strict";var o=r(8844),n=o({}.toString),i=o("".slice);e.exports=function(e){return i(n(e),8,-1)}},926:(e,t,r)=>{"use strict";var o=r(3043),n=r(9985),i=r(6648),s=r(4201)("toStringTag"),a=Object,l="Arguments"===i(function(){return arguments}());e.exports=o?i:function(e){var t,r,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=a(e),s))?r:l?i(t):"Object"===(o=i(t))&&n(t.callee)?"Arguments":o}},8758:(e,t,r)=>{"use strict";var o=r(6812),n=r(9152),i=r(2474),s=r(2560);e.exports=function(e,t,r){for(var a=n(t),l=s.f,c=i.f,u=0;u{"use strict";var o=r(3689);e.exports=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},7807:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},5773:(e,t,r)=>{"use strict";var o=r(7697),n=r(2560),i=r(5684);e.exports=o?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},5684:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},2148:(e,t,r)=>{"use strict";var o=r(8702),n=r(2560);e.exports=function(e,t,r){return r.get&&o(r.get,t,{getter:!0}),r.set&&o(r.set,t,{setter:!0}),n.f(e,t,r)}},1880:(e,t,r)=>{"use strict";var o=r(9985),n=r(2560),i=r(8702),s=r(5014);e.exports=function(e,t,r,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(o(r)&&i(r,c,a),a.global)l?e[t]=r:s(t,r);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:n.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},6045:(e,t,r)=>{"use strict";var o=r(1880);e.exports=function(e,t,r){for(var n in t)o(e,n,t[n],r);return e}},5014:(e,t,r)=>{"use strict";var o=r(9037),n=Object.defineProperty;e.exports=function(e,t){try{n(o,e,{value:t,configurable:!0,writable:!0})}catch(r){o[e]=t}return t}},7697:(e,t,r)=>{"use strict";var o=r(3689);e.exports=!o((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2659:e=>{"use strict";var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},6420:(e,t,r)=>{"use strict";var o=r(9037),n=r(8999),i=o.document,s=n(i)&&n(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},5565:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},71:e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(e,t,r)=>{"use strict";var o,n,i=r(9037),s=r(71),a=i.process,l=i.Deno,c=a&&a.versions||l&&l.version,u=c&&c.v8;u&&(n=(o=u.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!n&&s&&(!(o=s.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=s.match(/Chrome\/(\d+)/))&&(n=+o[1]),e.exports=n},2739:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9989:(e,t,r)=>{"use strict";var o=r(9037),n=r(2474).f,i=r(5773),s=r(1880),a=r(5014),l=r(8758),c=r(5266);e.exports=function(e,t){var r,u,d,p,m,h=e.target,f=e.global,b=e.stat;if(r=f?o:b?o[h]||a(h,{}):(o[h]||{}).prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(m=n(r,u))&&m.value:r[u],!c(f?u:h+(b?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;l(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),s(r,u,p,e)}}},3689:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},4071:(e,t,r)=>{"use strict";var o=r(6576),n=r(509),i=r(7215),s=o(o.bind);e.exports=function(e,t){return n(e),void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}},7215:(e,t,r)=>{"use strict";var o=r(3689);e.exports=!o((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},2615:(e,t,r)=>{"use strict";var o=r(7215),n=Function.prototype.call;e.exports=o?n.bind(n):function(){return n.apply(n,arguments)}},1236:(e,t,r)=>{"use strict";var o=r(7697),n=r(6812),i=Function.prototype,s=o&&Object.getOwnPropertyDescriptor,a=n(i,"name"),l=a&&"something"===function(){}.name,c=a&&(!o||o&&s(i,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},2743:(e,t,r)=>{"use strict";var o=r(8844),n=r(509);e.exports=function(e,t,r){try{return o(n(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},6576:(e,t,r)=>{"use strict";var o=r(6648),n=r(8844);e.exports=function(e){if("Function"===o(e))return n(e)}},8844:(e,t,r)=>{"use strict";var o=r(7215),n=Function.prototype,i=n.call,s=o&&n.bind.bind(i,i);e.exports=o?s:function(e){return function(){return i.apply(e,arguments)}}},6058:(e,t,r)=>{"use strict";var o=r(9037),n=r(9985);e.exports=function(e,t){return arguments.length<2?(r=o[e],n(r)?r:void 0):o[e]&&o[e][t];var r}},2302:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1664:(e,t,r)=>{"use strict";var o=r(926),n=r(4849),i=r(981),s=r(9478),a=r(4201)("iterator");e.exports=function(e){if(!i(e))return n(e,a)||n(e,"@@iterator")||s[o(e)]}},5185:(e,t,r)=>{"use strict";var o=r(2615),n=r(509),i=r(5027),s=r(3691),a=r(1664),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(n(r))return i(o(r,e));throw new l(s(e)+" is not iterable")}},4849:(e,t,r)=>{"use strict";var o=r(509),n=r(981);e.exports=function(e,t){var r=e[t];return n(r)?void 0:o(r)}},1074:(e,t,r)=>{"use strict";var o=r(509),n=r(5027),i=r(2615),s=r(8700),a=r(2302),l="Invalid size",c=RangeError,u=TypeError,d=Math.max,SetRecord=function(e,t,r,o){this.set=e,this.size=t,this.has=r,this.keys=o};SetRecord.prototype={getIterator:function(){return a(n(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){n(e);var t=+e.size;if(t!=t)throw new u(l);var r=s(t);if(r<0)throw new c(l);return new SetRecord(e,d(r,0),o(e.has),o(e.keys))}},9037:function(e,t,r){"use strict";var o=function(e){return e&&e.Math===Math&&e};e.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof r.g&&r.g)||function(){return this}()||this||Function("return this")()},6812:(e,t,r)=>{"use strict";var o=r(8844),n=r(690),i=o({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(n(e),t)}},7248:e=>{"use strict";e.exports={}},2688:(e,t,r)=>{"use strict";var o=r(6058);e.exports=o("document","documentElement")},8506:(e,t,r)=>{"use strict";var o=r(7697),n=r(3689),i=r(6420);e.exports=!o&&!n((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},4413:(e,t,r)=>{"use strict";var o=r(8844),n=r(3689),i=r(6648),s=Object,a=o("".split);e.exports=n((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?a(e,""):s(e)}:s},6738:(e,t,r)=>{"use strict";var o=r(8844),n=r(9985),i=r(4091),s=o(Function.toString);n(i.inspectSource)||(i.inspectSource=function(e){return s(e)}),e.exports=i.inspectSource},618:(e,t,r)=>{"use strict";var o,n,i,s=r(9834),a=r(9037),l=r(8999),c=r(5773),u=r(6812),d=r(4091),p=r(2713),m=r(7248),h="Object already initialized",f=a.TypeError,b=a.WeakMap;if(s||d.state){var w=d.state||(d.state=new b);w.get=w.get,w.has=w.has,w.set=w.set,o=function(e,t){if(w.has(e))throw new f(h);return t.facade=e,w.set(e,t),t},n=function(e){return w.get(e)||{}},i=function(e){return w.has(e)}}else{var g=p("state");m[g]=!0,o=function(e,t){if(u(e,g))throw new f(h);return t.facade=e,c(e,g,t),t},n=function(e){return u(e,g)?e[g]:{}},i=function(e){return u(e,g)}}e.exports={set:o,get:n,has:i,enforce:function(e){return i(e)?n(e):o(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=n(t)).type!==e)throw new f("Incompatible receiver, "+e+" required");return r}}}},3292:(e,t,r)=>{"use strict";var o=r(4201),n=r(9478),i=o("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||s[i]===e)}},2297:(e,t,r)=>{"use strict";var o=r(6648);e.exports=Array.isArray||function(e){return"Array"===o(e)}},9985:(e,t,r)=>{"use strict";var o=r(2659),n=o.all;e.exports=o.IS_HTMLDDA?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}},5266:(e,t,r)=>{"use strict";var o=r(3689),n=r(9985),i=/#|\.prototype\./,s=function(e,t){var r=l[a(e)];return r===u||r!==c&&(n(t)?o(t):!!t)},a=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},981:e=>{"use strict";e.exports=function(e){return null==e}},8999:(e,t,r)=>{"use strict";var o=r(9985),n=r(2659),i=n.all;e.exports=n.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:o(e)||e===i}:function(e){return"object"==typeof e?null!==e:o(e)}},3931:e=>{"use strict";e.exports=!1},734:(e,t,r)=>{"use strict";var o=r(6058),n=r(9985),i=r(3622),s=r(9525),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=o("Symbol");return n(t)&&i(t.prototype,a(e))}},6704:(e,t,r)=>{"use strict";var o=r(2615);e.exports=function(e,t,r){for(var n,i,s=r?e:e.iterator,a=e.next;!(n=o(a,s)).done;)if(void 0!==(i=t(n.value)))return i}},8734:(e,t,r)=>{"use strict";var o=r(4071),n=r(2615),i=r(5027),s=r(3691),a=r(3292),l=r(6310),c=r(3622),u=r(5185),d=r(1664),p=r(2125),m=TypeError,Result=function(e,t){this.stopped=e,this.result=t},h=Result.prototype;e.exports=function(e,t,r){var f,b,w,g,v,y,_,E=r&&r.that,S=!(!r||!r.AS_ENTRIES),k=!(!r||!r.IS_RECORD),x=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),T=o(t,E),O=function(e){return f&&p(f,"normal",e),new Result(!0,e)},L=function(e){return S?(i(e),C?T(e[0],e[1],O):T(e[0],e[1])):C?T(e,O):T(e)};if(k)f=e.iterator;else if(x)f=e;else{if(!(b=d(e)))throw new m(s(e)+" is not iterable");if(a(b)){for(w=0,g=l(e);g>w;w++)if((v=L(e[w]))&&c(h,v))return v;return new Result(!1)}f=u(e,b)}for(y=k?e.next:f.next;!(_=n(y,f)).done;){try{v=L(_.value)}catch(e){p(f,"throw",e)}if("object"==typeof v&&v&&c(h,v))return v}return new Result(!1)}},2125:(e,t,r)=>{"use strict";var o=r(2615),n=r(5027),i=r(4849);e.exports=function(e,t,r){var s,a;n(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw r;return r}s=o(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw r;if(a)throw s;return n(s),r}},5419:(e,t,r)=>{"use strict";var o=r(2615),n=r(5391),i=r(5773),s=r(6045),a=r(4201),l=r(618),c=r(4849),u=r(2013).IteratorPrototype,d=r(7807),p=r(2125),m=a("toStringTag"),h="IteratorHelper",f="WrapForValidIterator",b=l.set,w=function(e){var t=l.getterFor(e?f:h);return s(n(u),{next:function(){var r=t(this);if(e)return r.nextHandler();try{var o=r.done?void 0:r.nextHandler();return d(o,r.done)}catch(e){throw r.done=!0,e}},return:function(){var r=t(this),n=r.iterator;if(r.done=!0,e){var i=c(n,"return");return i?o(i,n):d(void 0,!0)}if(r.inner)try{p(r.inner.iterator,"normal")}catch(e){return p(n,"throw",e)}return p(n,"normal"),d(void 0,!0)}})},g=w(!0),v=w(!1);i(v,m,"Iterator Helper"),e.exports=function(e,t){var r=function Iterator(r,o){o?(o.iterator=r.iterator,o.next=r.next):o=r,o.type=t?f:h,o.nextHandler=e,o.counter=0,o.done=!1,b(this,o)};return r.prototype=t?g:v,r}},8983:(e,t,r)=>{"use strict";var o=r(2615),n=r(509),i=r(5027),s=r(2302),a=r(5419),l=r(1228),c=a((function(){var e=this.iterator,t=i(o(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return i(this),n(e),new c(s(this),{mapper:e})}},2013:(e,t,r)=>{"use strict";var o,n,i,s=r(3689),a=r(9985),l=r(8999),c=r(5391),u=r(1868),d=r(1880),p=r(4201),m=r(3931),h=p("iterator"),f=!1;[].keys&&("next"in(i=[].keys())?(n=u(u(i)))!==Object.prototype&&(o=n):f=!0),!l(o)||s((function(){var e={};return o[h].call(e)!==e}))?o={}:m&&(o=c(o)),a(o[h])||d(o,h,(function(){return this})),e.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:f}},9478:e=>{"use strict";e.exports={}},6310:(e,t,r)=>{"use strict";var o=r(3126);e.exports=function(e){return o(e.length)}},8702:(e,t,r)=>{"use strict";var o=r(8844),n=r(3689),i=r(9985),s=r(6812),a=r(7697),l=r(1236).CONFIGURABLE,c=r(6738),u=r(618),d=u.enforce,p=u.get,m=String,h=Object.defineProperty,f=o("".slice),b=o("".replace),w=o([].join),g=a&&!n((function(){return 8!==h((function(){}),"length",{value:8}).length})),v=String(String).split("String"),y=e.exports=function(e,t,r){"Symbol("===f(m(t),0,7)&&(t="["+b(m(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||l&&e.name!==t)&&(a?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&r&&s(r,"arity")&&e.length!==r.arity&&h(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?a&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var o=d(e);return s(o,"source")||(o.source=w(v,"string"==typeof t?t:"")),e};Function.prototype.toString=y((function(){return i(this)&&p(this).source||c(this)}),"toString")},8828:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var o=+e;return(o>0?r:t)(o)}},5391:(e,t,r)=>{"use strict";var o,n=r(5027),i=r(8920),s=r(2739),a=r(7248),l=r(2688),c=r(6420),u=r(2713),d="prototype",p="script",m=u("IE_PROTO"),EmptyConstructor=function(){},h=function(e){return"<"+p+">"+e+""},NullProtoObjectViaActiveX=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObject=function(){try{o=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;NullProtoObject="undefined"!=typeof document?document.domain&&o?NullProtoObjectViaActiveX(o):(t=c("iframe"),r="java"+p+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):NullProtoObjectViaActiveX(o);for(var n=s.length;n--;)delete NullProtoObject[d][s[n]];return NullProtoObject()};a[m]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[d]=n(e),r=new EmptyConstructor,EmptyConstructor[d]=null,r[m]=e):r=NullProtoObject(),void 0===t?r:i.f(r,t)}},8920:(e,t,r)=>{"use strict";var o=r(7697),n=r(5648),i=r(2560),s=r(5027),a=r(5290),l=r(300);t.f=o&&!n?Object.defineProperties:function(e,t){s(e);for(var r,o=a(t),n=l(t),c=n.length,u=0;c>u;)i.f(e,r=n[u++],o[r]);return e}},2560:(e,t,r)=>{"use strict";var o=r(7697),n=r(8506),i=r(5648),s=r(5027),a=r(8360),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",m="writable";t.f=o?i?function(e,t,r){if(s(e),t=a(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&m in r&&!r[m]){var o=u(e,t);o&&o[m]&&(e[t]=r.value,r={configurable:p in r?r[p]:o[p],enumerable:d in r?r[d]:o[d],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(s(e),t=a(t),s(r),n)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},2474:(e,t,r)=>{"use strict";var o=r(7697),n=r(2615),i=r(9556),s=r(5684),a=r(5290),l=r(8360),c=r(6812),u=r(8506),d=Object.getOwnPropertyDescriptor;t.f=o?d:function(e,t){if(e=a(e),t=l(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return s(!n(i.f,e,t),e[t])}},2741:(e,t,r)=>{"use strict";var o=r(4948),n=r(2739).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return o(e,n)}},7518:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},1868:(e,t,r)=>{"use strict";var o=r(6812),n=r(9985),i=r(690),s=r(2713),a=r(1748),l=s("IE_PROTO"),c=Object,u=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=i(e);if(o(t,l))return t[l];var r=t.constructor;return n(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},3622:(e,t,r)=>{"use strict";var o=r(8844);e.exports=o({}.isPrototypeOf)},4948:(e,t,r)=>{"use strict";var o=r(8844),n=r(6812),i=r(5290),s=r(4328).indexOf,a=r(7248),l=o([].push);e.exports=function(e,t){var r,o=i(e),c=0,u=[];for(r in o)!n(a,r)&&n(o,r)&&l(u,r);for(;t.length>c;)n(o,r=t[c++])&&(~s(u,r)||l(u,r));return u}},300:(e,t,r)=>{"use strict";var o=r(4948),n=r(2739);e.exports=Object.keys||function(e){return o(e,n)}},9556:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,n=o&&!r.call({1:2},1);t.f=n?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},5899:(e,t,r)=>{"use strict";var o=r(2615),n=r(9985),i=r(8999),s=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&n(r=e.toString)&&!i(a=o(r,e)))return a;if(n(r=e.valueOf)&&!i(a=o(r,e)))return a;if("string"!==t&&n(r=e.toString)&&!i(a=o(r,e)))return a;throw new s("Can't convert object to primitive value")}},9152:(e,t,r)=>{"use strict";var o=r(6058),n=r(8844),i=r(2741),s=r(7518),a=r(5027),l=n([].concat);e.exports=o("Reflect","ownKeys")||function(e){var t=i.f(a(e)),r=s.f;return r?l(t,r(e)):t}},4684:(e,t,r)=>{"use strict";var o=r(981),n=TypeError;e.exports=function(e){if(o(e))throw new n("Can't call method on "+e);return e}},3097:(e,t,r)=>{"use strict";var o=r(1034),n=r(8774),i=o.Set,s=o.add;e.exports=function(e){var t=new i;return n(e,(function(e){s(t,e)})),t}},7748:(e,t,r)=>{"use strict";var o=r(29),n=r(1034),i=r(3097),s=r(7026),a=r(1074),l=r(8774),c=r(6704),u=n.has,d=n.remove;e.exports=function(e){var t=o(this),r=a(e),n=i(t);return s(t)<=r.size?l(t,(function(e){r.includes(e)&&d(n,e)})):c(r.getIterator(),(function(e){u(t,e)&&d(n,e)})),n}},1034:(e,t,r)=>{"use strict";var o=r(8844),n=Set.prototype;e.exports={Set,add:o(n.add),has:o(n.has),remove:o(n.delete),proto:n}},2948:(e,t,r)=>{"use strict";var o=r(29),n=r(1034),i=r(7026),s=r(1074),a=r(8774),l=r(6704),c=n.Set,u=n.add,d=n.has;e.exports=function(e){var t=o(this),r=s(e),n=new c;return i(t)>r.size?l(r.getIterator(),(function(e){d(t,e)&&u(n,e)})):a(t,(function(e){r.includes(e)&&u(n,e)})),n}},7795:(e,t,r)=>{"use strict";var o=r(29),n=r(1034).has,i=r(7026),s=r(1074),a=r(8774),l=r(6704),c=r(2125);e.exports=function(e){var t=o(this),r=s(e);if(i(t)<=r.size)return!1!==a(t,(function(e){if(r.includes(e))return!1}),!0);var u=r.getIterator();return!1!==l(u,(function(e){if(n(t,e))return c(u,"normal",!1)}))}},6951:(e,t,r)=>{"use strict";var o=r(29),n=r(7026),i=r(8774),s=r(1074);e.exports=function(e){var t=o(this),r=s(e);return!(n(t)>r.size)&&!1!==i(t,(function(e){if(!r.includes(e))return!1}),!0)}},3894:(e,t,r)=>{"use strict";var o=r(29),n=r(1034).has,i=r(7026),s=r(1074),a=r(6704),l=r(2125);e.exports=function(e){var t=o(this),r=s(e);if(i(t){"use strict";var o=r(8844),n=r(6704),i=r(1034),s=i.Set,a=i.proto,l=o(a.forEach),c=o(a.keys),u=c(new s).next;e.exports=function(e,t,r){return r?n({iterator:c(e),next:u},t):l(e,t)}},3234:(e,t,r)=>{"use strict";var o=r(6058),n=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=o("Set");try{(new t)[e](n(0));try{return(new t)[e](n(-1)),!1}catch(e){return!0}}catch(e){return!1}}},7026:(e,t,r)=>{"use strict";var o=r(2743),n=r(1034);e.exports=o(n.proto,"size","get")||function(e){return e.size}},2289:(e,t,r)=>{"use strict";var o=r(29),n=r(1034),i=r(3097),s=r(1074),a=r(6704),l=n.add,c=n.has,u=n.remove;e.exports=function(e){var t=o(this),r=s(e).getIterator(),n=i(t);return a(r,(function(e){c(t,e)?u(n,e):l(n,e)})),n}},5674:(e,t,r)=>{"use strict";var o=r(29),n=r(1034).add,i=r(3097),s=r(1074),a=r(6704);e.exports=function(e){var t=o(this),r=s(e).getIterator(),l=i(t);return a(r,(function(e){n(l,e)})),l}},2713:(e,t,r)=>{"use strict";var o=r(3430),n=r(4630),i=o("keys");e.exports=function(e){return i[e]||(i[e]=n(e))}},4091:(e,t,r)=>{"use strict";var o=r(9037),n=r(5014),i="__core-js_shared__",s=o[i]||n(i,{});e.exports=s},3430:(e,t,r)=>{"use strict";var o=r(3931),n=r(4091);(e.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.2",mode:o?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"})},146:(e,t,r)=>{"use strict";var o=r(3615),n=r(3689),i=r(9037).String;e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&o&&o<41}))},7578:(e,t,r)=>{"use strict";var o=r(8700),n=Math.max,i=Math.min;e.exports=function(e,t){var r=o(e);return r<0?n(r+t,0):i(r,t)}},5290:(e,t,r)=>{"use strict";var o=r(4413),n=r(4684);e.exports=function(e){return o(n(e))}},8700:(e,t,r)=>{"use strict";var o=r(8828);e.exports=function(e){var t=+e;return t!=t||0===t?0:o(t)}},3126:(e,t,r)=>{"use strict";var o=r(8700),n=Math.min;e.exports=function(e){return e>0?n(o(e),9007199254740991):0}},690:(e,t,r)=>{"use strict";var o=r(4684),n=Object;e.exports=function(e){return n(o(e))}},8732:(e,t,r)=>{"use strict";var o=r(2615),n=r(8999),i=r(734),s=r(4849),a=r(5899),l=r(4201),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!n(e)||i(e))return e;var r,l=s(e,u);if(l){if(void 0===t&&(t="default"),r=o(l,e,t),!n(r)||i(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},8360:(e,t,r)=>{"use strict";var o=r(8732),n=r(734);e.exports=function(e){var t=o(e,"string");return n(t)?t:t+""}},3043:(e,t,r)=>{"use strict";var o={};o[r(4201)("toStringTag")]="z",e.exports="[object z]"===String(o)},4327:(e,t,r)=>{"use strict";var o=r(926),n=String;e.exports=function(e){if("Symbol"===o(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}},3691:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},4630:(e,t,r)=>{"use strict";var o=r(8844),n=0,i=Math.random(),s=o(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++n+i,36)}},9525:(e,t,r)=>{"use strict";var o=r(146);e.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5648:(e,t,r)=>{"use strict";var o=r(7697),n=r(3689);e.exports=o&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1500:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e{"use strict";var o=r(9037),n=r(9985),i=o.WeakMap;e.exports=n(i)&&/native code/.test(String(i))},4201:(e,t,r)=>{"use strict";var o=r(9037),n=r(3430),i=r(6812),s=r(4630),a=r(146),l=r(9525),c=o.Symbol,u=n("wks"),d=l?c.for||c:c&&c.withoutSetter||s;e.exports=function(e){return i(u,e)||(u[e]=a&&i(c,e)?c[e]:d("Symbol."+e)),u[e]}},560:(e,t,r)=>{"use strict";var o=r(9989),n=r(690),i=r(6310),s=r(5649),a=r(5565);o({target:"Array",proto:!0,arity:1,forced:r(3689)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=n(this),r=i(t),o=arguments.length;a(r+o);for(var l=0;l{"use strict";var o=r(9989),n=r(9037),i=r(767),s=r(9985),a=r(1868),l=r(5773),c=r(3689),u=r(6812),d=r(4201),p=r(2013).IteratorPrototype,m=r(3931),h=d("toStringTag"),f=TypeError,b=n.Iterator,w=m||!s(b)||b.prototype!==p||!c((function(){b({})})),g=function Iterator(){if(i(this,p),a(this)===p)throw new f("Abstract class Iterator not directly constructable")};u(p,h)||l(p,h,"Iterator"),!w&&u(p,"constructor")&&p.constructor!==Object||l(p,"constructor",g),g.prototype=p,o({global:!0,constructor:!0,forced:w},{Iterator:g})},3476:(e,t,r)=>{"use strict";var o=r(9989),n=r(2615),i=r(509),s=r(5027),a=r(2302),l=r(5419),c=r(1228),u=r(3931),d=l((function(){for(var e,t,r=this.iterator,o=this.predicate,i=this.next;;){if(e=s(n(i,r)),this.done=!!e.done)return;if(t=e.value,c(r,o,[t,this.counter++],!0))return t}}));o({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(e){return s(this),i(e),new d(a(this),{predicate:e})}})},928:(e,t,r)=>{"use strict";var o=r(9989),n=r(8734),i=r(509),s=r(5027),a=r(2302);o({target:"Iterator",proto:!0,real:!0},{find:function(e){s(this),i(e);var t=a(this),r=0;return n(t,(function(t,o){if(e(t,r++))return o(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},5:(e,t,r)=>{"use strict";var o=r(9989),n=r(8734),i=r(509),s=r(5027),a=r(2302);o({target:"Iterator",proto:!0,real:!0},{forEach:function(e){s(this),i(e);var t=a(this),r=0;n(t,(function(t){e(t,r++)}),{IS_RECORD:!0})}})},1792:(e,t,r)=>{"use strict";var o=r(9989),n=r(8983);o({target:"Iterator",proto:!0,real:!0,forced:r(3931)},{map:n})},1107:(e,t,r)=>{"use strict";var o=r(9989),n=r(8734),i=r(509),s=r(5027),a=r(2302),l=TypeError;o({target:"Iterator",proto:!0,real:!0},{reduce:function(e){s(this),i(e);var t=a(this),r=arguments.length<2,o=r?void 0:arguments[1],c=0;if(n(t,(function(t){r?(r=!1,o=t):o=e(o,t,c),c++}),{IS_RECORD:!0}),r)throw new l("Reduce of empty iterator with no initial value");return o}})},5716:(e,t,r)=>{"use strict";var o=r(9989),n=r(7748);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("difference")},{difference:n})},3442:(e,t,r)=>{"use strict";var o=r(9989),n=r(3689),i=r(2948);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("intersection")||n((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:i})},1964:(e,t,r)=>{"use strict";var o=r(9989),n=r(7795);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("isDisjointFrom")},{isDisjointFrom:n})},9878:(e,t,r)=>{"use strict";var o=r(9989),n=r(6951);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("isSubsetOf")},{isSubsetOf:n})},2915:(e,t,r)=>{"use strict";var o=r(9989),n=r(3894);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("isSupersetOf")},{isSupersetOf:n})},7895:(e,t,r)=>{"use strict";var o=r(9989),n=r(2289);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("symmetricDifference")},{symmetricDifference:n})},2275:(e,t,r)=>{"use strict";var o=r(9989),n=r(5674);o({target:"Set",proto:!0,real:!0,forced:!r(3234)("union")},{union:n})},8858:(e,t,r)=>{"use strict";var o=r(1880),n=r(8844),i=r(4327),s=r(1500),a=URLSearchParams,l=a.prototype,c=n(l.append),u=n(l.delete),d=n(l.forEach),p=n([].push),m=new a("a=1&a=2&b=3");m.delete("a",1),m.delete("b",void 0),m+""!="a=2"&&o(l,"delete",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var o=[];d(this,(function(e,t){p(o,{key:t,value:e})})),s(t,1);for(var n,a=i(e),l=i(r),m=0,h=0,f=!1,b=o.length;m{"use strict";var o=r(1880),n=r(8844),i=r(4327),s=r(1500),a=URLSearchParams,l=a.prototype,c=n(l.getAll),u=n(l.has),d=new a("a=1");!d.has("a",2)&&d.has("a",void 0)||o(l,"has",(function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return u(this,e);var o=c(this,e);s(t,1);for(var n=i(r),a=0;a{"use strict";var o=r(7697),n=r(8844),i=r(2148),s=URLSearchParams.prototype,a=n(s.forEach);o&&!("size"in s)&&i(s,"size",{get:function(){var e=0;return a(this,(function(){e++})),e},configurable:!0,enumerable:!0})}},t={};function __webpack_require__(r){var o=t[r];if(void 0!==o)return o.exports;var n=t[r]={exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";__webpack_require__(560);const e="webStoriesTrackingDataLayer",t=function(){window[e]=window[e]||[],window[e].push(arguments)},{trackingAllowed:r,trackingIdGA4:o,appVersion:n,userProperties:i}=window.webStoriesTrackingSettings||{},s={trackingAllowed:!1,trackingEnabled:!1,trackingIdGA4:"",userProperties:{},appName:"",trackingAllowed:r,trackingIdGA4:o,appVersion:n,userProperties:i},a="data-web-stories-tracking";async function l(){let r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(document.querySelector(`script[${a}]`))return;try{await(o=`https://www.googletagmanager.com/gtag/js?id=${s.trackingIdGA4}&l=${e}`,new Promise(((e,t)=>{const r=document.createElement("script");r.setAttribute(a,""),r.async=!0,r.src=o,r.addEventListener("load",e),r.addEventListener("error",t),document.head.appendChild(r)})))}catch{return}var o;const n=s.appName,i="/"+s.appName.replace(/ /g,"-").toLowerCase();t("js",new Date),t("set","user_properties",{...s.userProperties,app_version:s.appVersion,page_title:n,page_path:i}),t("config",s.trackingIdGA4,{app_name:s.appName,app_version:s.appVersion,send_page_view:r,transport_type:"beacon"})}const c=async function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];s.trackingAllowed&&!s.trackingEnabled&&(await l(e),s.trackingEnabled=!0)};const u=async function(){return await c(),Boolean(s.trackingEnabled)};const d=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((o=>{const n=setTimeout((()=>{window.console.warn(`[Web Stories] Tracking event "${e}" took too long to fire.`),o()}),1e3);t("event",e,{...r,event_callback:()=>{clearTimeout(n),o()}})}))};const p=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return await u()?d("exception",{description:`${e}: ${t}`,fatal:r}):Promise.resolve()},m=["ResizeObserver loop limit exceeded"];function h(e){if(e.filename&&!e.filename.includes("web-stories"))return;if(m.includes(e.message))return;const t=`${e.message} (${e.lineno}:${e.colno})`;p("uncaught_error",t,!0)}function f(e){const t=e.reason||"Promise rejection";p("uncaught_promise",t)}const b=function(){window.addEventListener("error",h),window.addEventListener("unhandledrejection",f)};const w=async function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s.appName=e,await c(t),b()};const g=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await u()?d(e,t):Promise.resolve()};const v=window.wp.blocks,y=window.React,_=window.wp.i18n,E=window.wp.compose;var S,k,x;function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",C({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 23 18","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,S||(S=y.createElement("circle",{r:3,transform:"matrix(1 0 0 -1 20 9)"})),k||(k=y.createElement("circle",{r:3,transform:"matrix(1 0 0 -1 3 9)"})),x||(x=y.createElement("circle",{r:7.1,stroke:"#fff",strokeWidth:2.2,transform:"matrix(1 0 0 -1 12 9)"})))},T=(0,y.memo)(SvgCirclesCarouselView);var O,L,I,N,M;function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",R({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 42 24","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,O||(O=y.createElement("circle",{cx:21,cy:12,r:11,fill:"#fff",stroke:"#347BB5",strokeWidth:2})),L||(L=y.createElement("mask",{id:"a",fill:"#fff"},y.createElement("path",{fillRule:"evenodd",d:"M34.803 17.88A14.952 14.952 0 0 0 36 12c0-2.087-.426-4.075-1.197-5.88a6 6 0 1 1 0 11.761Z",clipRule:"evenodd"}))),I||(I=y.createElement("path",{fill:"#347BB5",d:"m34.803 17.88-1.84-.784-.962 2.258 2.406.487.396-1.96Zm0-11.76-.396-1.96L32 4.645l.963 2.258 1.84-.785ZM34 12c0 1.813-.37 3.534-1.036 5.096l3.679 1.57A16.952 16.952 0 0 0 38 12h-4Zm-1.036-5.096A12.952 12.952 0 0 1 34 12h4c0-2.362-.483-4.616-1.357-6.665l-3.68 1.57ZM35.2 8.08c.257-.052.524-.08.8-.08V4c-.544 0-1.077.055-1.593.16l.793 3.92ZM36 8a4 4 0 0 1 4 4h4a8 8 0 0 0-8-8v4Zm4 4a4 4 0 0 1-4 4v4a8 8 0 0 0 8-8h-4Zm-4 4c-.276 0-.543-.028-.8-.08l-.793 3.92c.516.105 1.05.16 1.593.16v-4Z",mask:"url(#a)"})),N||(N=y.createElement("mask",{id:"b",fill:"#fff"},y.createElement("path",{fillRule:"evenodd",d:"M7.197 6.12a6 6 0 1 0 0 11.761A14.952 14.952 0 0 1 6 12c0-2.087.426-4.075 1.197-5.88Z",clipRule:"evenodd"}))),M||(M=y.createElement("path",{fill:"#347BB5",d:"m7.197 6.12 1.84.784.962-2.258-2.406-.487-.396 1.96Zm0 11.76.396 1.96L10 19.355l-.963-2.258-1.84.785ZM6 8c.276 0 .543.028.8.08l.793-3.92A8.028 8.028 0 0 0 6 4v4Zm-4 4a4 4 0 0 1 4-4V4a8 8 0 0 0-8 8h4Zm4 4a4 4 0 0 1-4-4h-4a8 8 0 0 0 8 8v-4Zm.8-.08c-.257.052-.524.08-.8.08v4c.544 0 1.077-.055 1.593-.16L6.8 15.92Zm2.236 1.176A12.952 12.952 0 0 1 8 12H4c0 2.362.483 4.616 1.357 6.665l3.68-1.57ZM8 12c0-1.813.37-3.534 1.036-5.096l-3.679-1.57A16.952 16.952 0 0 0 4 12h4Z",mask:"url(#b)"})))},A=(0,y.memo)(SvgCirclesCarouselViewPanelIcon);var P,B;function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",j({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 31 42","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,P||(P=y.createElement("rect",{width:29,height:40,x:1,y:1,stroke:"currentColor",strokeWidth:2,rx:1})),B||(B=y.createElement("path",{fill:"currentColor",d:"M6 27h19v2H6zM6 31h4v2H6z"})))},z=(0,y.memo)(SvgLatestStoriesBlock);var W,D;function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",F({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,W||(W=y.createElement("circle",{cx:16,cy:16,r:15,stroke:"currentColor",strokeWidth:2})),D||(D=y.createElement("path",{stroke:"currentColor",strokeWidth:2,d:"M16 9.263V16m0 6.737V16m0 0H9.263M16 16h6.737"})))},H=(0,y.memo)(SvgSelectedStoriesBlock);var $;function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",V({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 16","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,$||($=y.createElement("path",{stroke:"currentColor",strokeWidth:2,d:"M14 1H8a7 7 0 1 0 0 14h6M18 1h6a7 7 0 1 1 0 14h-6M9 8h13.5"})))},q=(0,y.memo)(SvgEmbedStoryBlock);var U;function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",G({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 12 14","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,U||(U=y.createElement("path",{d:"M0 0h5v6H0zM0 8h5v6H0zM7 0h5v6H7zM7 8h5v6H7z"})))},Z=(0,y.memo)(SvgGridView);var X;function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",Q({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 13 13","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,X||(X=y.createElement("path",{d:"M0 0h12v3H0zM0 5h12v3H0zM0 10h12v3H0z"})))},K=(0,y.memo)(SvgListView);var Y;function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 14","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,Y||(Y=y.createElement("path",{d:"M4 14h10V0H4zM16 12h2V2h-2zM0 12h2V2H0z"})))},ee=(0,y.memo)(SvgBoxCarouselView);var te;function re(){return re=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",re({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 27","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,te||(te=y.createElement("path",{stroke:"currentColor",strokeWidth:2,d:"M1 1h6.462v9.538H1zM1 15.615h6.462v9.538H1zM12.539 1h6.462v9.538h-6.462zM12.539 15.615h6.462v9.538h-6.462z"})))},oe=(0,y.memo)(SvgGridViewPanelIcon);var ne;function ie(){return ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",ie({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 22 26","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,ne||(ne=y.createElement("path",{stroke:"currentColor",strokeWidth:2,d:"M1 1h20v4H1zM1 11h20v4H1zM1 21h20v4H1z"})))},se=(0,y.memo)(SvgListViewPanelIcon);var ae,le;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{title:t,titleId:r,...o}=e;return y.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 26 20","aria-labelledby":r},o),t?y.createElement("title",{id:r},t):null,ae||(ae=y.createElement("path",{stroke:"currentColor",strokeWidth:2,d:"M7 1h12v18H7z"})),le||(le=y.createElement("path",{fill:"currentColor",d:"M24 2h2v16h-2zM0 2h2v16H0z"})))},ue=(0,y.memo)(SvgBoxCarouselViewPanelIcon),de=y.createElement(z,{width:31,height:42}),pe=y.createElement(H,{width:32,height:32}),me=y.createElement(q,{width:32,height:16}),he=y.createElement(ee,{width:18,height:14}),fe=y.createElement(T,{className:"web-stories-block__toolbar-icon icon__circles-carousel",width:23,height:18}),be=y.createElement(Z,{width:12,height:14}),we=y.createElement(K,{width:12,height:13}),ge=y.createElement(ue,{width:26,height:20}),ve=y.createElement(se,{width:22,height:26}),ye=y.createElement(A,{width:42,height:24}),_e=y.createElement(oe,{width:20,height:27}),BlockIcon=()=>{const e=(0,E.useInstanceId)(BlockIcon);return y.createElement("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64"},y.createElement("circle",{cx:"32",cy:"32",r:"32",transform:"rotate(-180 32 32)",fill:`url(#gradient-${e})`}),y.createElement("g",{filter:`url(#filter-${e})`,fill:"#fff"},y.createElement("path",{d:"M41.6 19.2a3.2 3.2 0 013.2 3.2v19.2a3.2 3.2 0 01-3.2 3.2V19.2zm-24 0a3.2 3.2 0 013.2-3.2h14.4a3.2 3.2 0 013.2 3.2v25.6a3.2 3.2 0 01-3.2 3.2H20.8a3.2 3.2 0 01-3.2-3.2V19.2zM48 22.4a2.4 2.4 0 012.4 2.4v14.4a2.4 2.4 0 01-2.4 2.4V22.4z"})),y.createElement("defs",null,y.createElement("linearGradient",{id:`gradient-${e}`,x1:"13.255",y1:"6.599",x2:"35.289",y2:"62.791",gradientUnits:"userSpaceOnUse"},y.createElement("stop",{stopColor:"#79B3FF"}),y.createElement("stop",{offset:"1",stopColor:"#CBACFF"})),y.createElement("filter",{id:`filter-${e}`,x:"8.96",y:"10.24",width:"46.08",height:"46.08",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},y.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),y.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),y.createElement("feOffset",{dy:"1.28"}),y.createElement("feGaussianBlur",{stdDeviation:"1.92"}),y.createElement("feColorMatrix",{values:"0 0 0 0 0.423529 0 0 0 0 0.490196 0 0 0 0 0.733333 0 0 0 0.3 0"}),y.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow"}),y.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"}))))},Ee={url:{type:"string"},title:{type:"string"},poster:{type:"string"},width:{type:"number",default:360},height:{type:"number",default:600},align:{type:"string",default:"none"}};const Se={attributes:Ee,save:function(e){let{attributes:t}=e;const{url:r,title:o,poster:n,width:i,height:s,align:a="none"}=t;return r&&o?y.createElement("div",{className:`wp-block-web-stories-embed align${a}`},y.createElement("amp-story-player",{style:{width:i?`${i}px`:void 0,height:s?`${s}px`:void 0},"data-testid":"amp-story-player"},y.createElement("a",{href:r,style:{"--story-player-poster":n?`url('${n}')`:void 0}},o))):null}},ke={attributes:Ee,migrate:e=>({...e,blockType:"url",stories:[],viewType:"",numOfStories:5,numOfColumns:2,circleSize:96,orderby:"",order:"",archiveLinkLabel:"",authors:[],fieldState:{}}),save:function(e){let{attributes:t}=e;const{url:r,title:o,poster:n,width:i,height:s,align:a="none"}=t;return r&&o?y.createElement("div",{className:`wp-block-web-stories-embed align${a}`},y.createElement("a",{href:r},n?y.createElement("img",{alt:o,src:n,width:i,height:s}):o)):null},isEligible(e){let{url:t,blockType:r}=e;return Boolean(!r&&t&&t.trim().length)}},xe=[ke,Se];const Ce=function(e){let{attributes:t}=e;const{url:r,title:o,poster:n,width:i,height:s,align:a="none"}=t;return r&&o?y.createElement("div",{className:`wp-block-web-stories-embed align${a}`},y.createElement("a",{href:r},n?y.createElement("img",{alt:o,src:n,width:i,height:s,loading:"lazy",decoding:"async"}):o)):null};__webpack_require__(8858),__webpack_require__(1318),__webpack_require__(3228),__webpack_require__(1792);const Te=window.wp.element,Oe=window.wp.apiFetch,Le=window.wp.components,Ie=window.wp.viewport,Ne=window.wp.data,Me=window.wp.blockEditor,Re=window.wp.coreData;const Ae=function LoaderContainer(e){let{children:t}=e;return y.createElement("div",{className:"web-stories-block__loader-container"},t,y.createElement(Le.Spinner,null))};const Pe=function FetchSelectedStories(e){let{icon:t,label:r,selectedStoryIds:o=[],setSelectedStories:n,setIsFetching:i}=e;const s=(0,Ne.useSelect)((e=>e(Re.store).getEntityRecords("postType","web-story",{_embed:"wp:featuredmedia,author",context:"view",include:o,orderby:o.length>0?"include":void 0})));return(0,Te.useEffect)((()=>{null!=s&&(n(s),i(!1)),void 0===s&&(n([]),i(!1))}),[s,n,i]),y.createElement(Le.Placeholder,{icon:y.createElement(Me.BlockIcon,{icon:t,showColors:!0}),label:r,className:"wp-block-web-stories-embed",instructions:!1},y.createElement(Ae,null,(0,_.__)("Loading Stories…","web-stories")))},Be=["image"],EmbedControls=e=>{const{switchBackToURLInput:t,width:r,height:o,minWidth:n,maxWidth:i,minHeight:s,maxHeight:a,poster:l,title:c,previewOnly:u,setAttributes:d}=e,p=`web-stories-embed-block__poster-image-description-${(0,E.useInstanceId)(EmbedControls,"web-stories-embed")}`,m=(0,Te.createRef)(),h=(0,Te.useCallback)((e=>{d({poster:e.url})}),[d]),f=(0,Te.useCallback)((()=>{d({poster:""}),m.current.focus()}),[d,m]),b=(0,Te.useCallback)((()=>{d({previewOnly:!u})}),[d,u]),w=Boolean(l);return y.createElement(y.Fragment,null,y.createElement(Me.BlockControls,null,y.createElement(Le.ToolbarGroup,null,Le.ToolbarButton?y.createElement(Le.ToolbarButton,{onClick:t},(0,_.__)("Replace","web-stories")):y.createElement(Le.Button,{className:"components-toolbar__control",title:(0,_.__)("Replace","web-stories"),onClick:t}))),y.createElement(Me.InspectorControls,null,y.createElement(Le.PanelBody,{title:(0,_.__)("Embed Settings","web-stories")},y.createElement(Le.PanelRow,null,y.createElement(Le.BaseControl,null,y.createElement(Le.TextControl,{type:"text",className:"web-stories-embed-title-control",label:(0,_.__)("Title","web-stories"),value:c||"",onChange:e=>d({title:e})}))),y.createElement(Me.MediaUploadCheck,null,y.createElement(Le.PanelRow,null,y.createElement(Le.BaseControl,null,y.createElement(Le.BaseControl.VisualLabel,{className:"web-stories-embed-poster-label"},(0,_.__)("Poster image","web-stories")),w&&y.createElement("img",{src:l,alt:""}),y.createElement(Me.MediaUpload,{title:(0,_.__)("Select poster image","web-stories"),onSelect:h,allowedTypes:Be,render:e=>{let{open:t}=e;return y.createElement(Le.Button,{isPrimary:!0,onClick:t,ref:m,"aria-describedby":p},w?(0,_.__)("Replace","web-stories"):(0,_.__)("Select","web-stories"))}}),y.createElement("p",{id:p,hidden:!0},w?(0,_.sprintf)(/* translators: %s: poster image URL. */ (0,_.__)("The current poster image url is %s","web-stories"),l):(0,_.__)("There is no poster image currently selected","web-stories")),w&&y.createElement(Le.Button,{className:"web-stories-embed-poster-remove",onClick:f},(0,_.__)("Remove","web-stories"))))),y.createElement(Le.PanelRow,null,y.createElement(Le.BaseControl,{className:"web-stories-embed-size-control"},y.createElement(Le.BaseControl.VisualLabel,null,(0,_.__)("Story dimensions","web-stories")),y.createElement("div",{className:"web-stories-embed-size-control__row"},y.createElement(Le.TextControl,{type:"number",className:"web-stories-embed-size-control__width",label:(0,_.__)("Width","web-stories"),value:r||"",min:n,max:i,onChange:e=>d({width:parseInt(e)})}),y.createElement(Le.TextControl,{type:"number",className:"web-stories-embed-size-control__height",label:(0,_.__)("Height","web-stories"),value:o||"",min:s,max:a,onChange:e=>d({height:parseInt(e)})})))),y.createElement(Le.PanelRow,null,y.createElement(Le.BaseControl,null,y.createElement(Le.ToggleControl,{label:(0,_.__)("Display as preview","web-stories"),checked:u,onChange:b,help:(0,_.__)("Displays the story poster that opens the story in a lightbox on click","web-stories")}))))))},je=EmbedControls,ze=()=>y.createElement("div",{className:"wp-block-web-stories-embed is-loading"},y.createElement(Le.Spinner,null),y.createElement("p",null,(0,_.__)("Embedding…","web-stories"))),We=window.wp.url,De=window.wp.notices;__webpack_require__(7602),__webpack_require__(928),__webpack_require__(3476);const Fe=window.wp.date;const He=function ItemOverlay(e){let{isSelected:t,story:r,addSelectedStory:o,removeSelectedStory:n,isSelectable:i}=e;const s=(0,Te.useCallback)((e=>{e.preventDefault(),t||o(r)}),[o,r,t]),a=(0,Te.useCallback)((e=>{e.preventDefault(),t?n(r):o(r)}),[n,o,r,t]);return i?y.createElement("button",{type:"button",className:t?"web-stories-story-preview-card__overlay item-selected":"web-stories-story-preview-card__overlay",onClick:s},t&&y.createElement("div",{className:"item-selected-icon"},y.createElement(Le.Icon,{className:"item-selected-icon-check",icon:"saved"}),y.createElement(Le.Icon,{className:"item-selected-icon-minus",icon:"minus",onClick:a}),y.createElement(Le.VisuallyHidden,null,(0,_.__)("Deselect","web-stories")))):y.createElement("div",{className:"web-stories-story-preview-card__overlay"})},$e=()=>{};const Ve=function StoryPreview(e){let{story:t,isSelected:r,addSelectedStory:o=$e,removeSelectedStory:n=$e,isSelectable:i=!0}=e;const s=(0,Fe.getSettings)().formats.date,a=(0,Fe.dateI18n)(s,t.created),l=(0,Te.useMemo)((()=>{if(!a)return null;switch(t.status){case"publish":return(0,_.sprintf)(/* translators: %s: published date */ (0,_.__)("Published %s","web-stories"),a);case"future":return(0,_.sprintf)(/* translators: %s: future publish date */ (0,_.__)("Scheduled %s","web-stories"),a);default:return(0,_.sprintf)(/* translators: %s: last modified date */ (0,_.__)("Modified %s","web-stories"),a)}}),[t.status,a]),c=t.meta.web_stories_poster?.url,u=t._embedded?.["wp:featuredmedia"]?.[0]?.source_url,d=c||u,p=t.title.raw||t.title.rendered;return y.createElement("div",{className:"web-stories-story-preview-card"},y.createElement("div",{className:"web-stories-story-preview-card__poster"},y.createElement(He,{isSelected:r,story:t,addSelectedStory:o,removeSelectedStory:n,isSelectable:i}),d&&y.createElement("img",{src:d,alt:"",width:640,height:853})),y.createElement("div",{className:"web-stories-story-preview-card__label"},y.createElement("div",{className:"web-stories-story-preview-card__title"},y.createElement(Te.RawHTML,null,""===p?(0,_.__)("Untitled","web-stories"):p)),t._embedded?.author?.[0]?.name&&y.createElement("div",null,t._embedded?.author?.[0]?.name),y.createElement("div",null,l)))},qe=[{label:(0,_.__)("Name","web-stories"),value:"name"},{label:(0,_.__)("Date Created","web-stories"),value:"date"},{label:(0,_.__)("Last Modified","web-stories"),value:"modified"},{label:(0,_.__)("Created By","web-stories"),value:"author"}];function AuthorSearch(e){let{label:t,options:r,onFilterValueChange:o,onChange:n,value:i}=e;return y.createElement(Le.ComboboxControl,{label:t,options:r,onFilterValueChange:o,onChange:n,value:i,className:"web-stories-story-picker-filter__combobox"})}function KeywordSearch(e){let{label:t,options:r,onFilterValueChange:o,onChange:n,value:i}=e;return y.createElement(Le.ComboboxControl,{label:t,options:r,onFilterValueChange:o,onChange:n,value:i,className:"web-stories-story-picker-filter__combobox"})}const Ue=function SelectStories(e){let{stories:t=[],selectedStories:r=[],setSelectedStories:o,hasAllStories:n,isLoading:i,fetchStories:s,maxNumOfStories:a}=e;const[l,c]=(0,Te.useState)([]),[u,d]=(0,Te.useState)(""),[p,m]=(0,Te.useState)(""),[h,f]=(0,Te.useState)("desc"),[b,w]=(0,Te.useState)("modified"),g=(0,Te.useRef)(1),{authors:v}=(0,Ne.useSelect)((e=>{const{getUsers:t,getPostType:r}=e(Re.store),o=r("web-story")?.capabilities.edit_posts;return{authors:o?t({search:p,capabilities:o}):[]}}),[p]),S=(0,Te.useCallback)((()=>{s({author:l?.id||void 0,search:u||void 0,order:h,orderBy:b,page:g.current})}),[u,l,s,h,b]);(0,Te.useEffect)((()=>{g.current=1,S()}),[u,l,h,b,S]);const k=(0,Te.useCallback)((()=>{g.current++,S()}),[S]),x=(0,E.useDebounce)((e=>{d(e)}),300),C=(0,E.useDebounce)((e=>{m(e),c(""===e?null:v.find((t=>t.id===Number(e))))}),300),T=(0,Te.useCallback)((e=>{c(""===e?null:v.find((t=>t.id===Number(e))))}),[v,c]),O=(0,Te.useCallback)((e=>{w(e),f(["title","author"].includes(e)?"asc":"desc")}),[f,w]),L=(0,Te.useMemo)((()=>(v??[]).filter((e=>{let{name:t}=e;return Boolean(t?.trim().length)})).map((e=>{let{id:t,name:r}=e;return{label:r,value:t}}))),[v]),I=(0,Te.useMemo)((()=>t.filter((e=>{let{title:t}=e;return Boolean(t?.rendered?.trim()?.length)})).map((e=>{let{id:t,title:r}=e;return{label:r.rendered,value:t}}))),[t]),N=(0,Te.useMemo)((()=>r.map((e=>e.id))),[r]),M=(0,Te.useCallback)((e=>{N.includes(e.id)||(1!==a?r.length>=a||o([...r,e]):o([e]))}),[o,r,N,a]),R=(0,Te.useCallback)((e=>{o(r.filter((t=>t.id!==e.id)))}),[r,o]);return y.createElement(y.Fragment,null,y.createElement("div",{className:"web-stories-story-picker-filter"},y.createElement("div",{className:"web-stories-story-picker-filter__search-container"},y.createElement("div",{className:"web-stories-story-picker-filter__search-inner"},y.createElement(KeywordSearch,{label:(0,_.__)("Search Stories","web-stories"),options:I,onFilterValueChange:x,onChange:x,value:u})),y.createElement(AuthorSearch,{label:(0,_.__)("Search by Author","web-stories"),options:L,onFilterValueChange:C,onChange:T,value:l?.id}),y.createElement("div",null,y.createElement(Le.SelectControl,{label:(0,_.__)("Sort","web-stories"),options:qe,value:b,onChange:O})))),!t.length&&u&&y.createElement("p",null,(0,_.sprintf)(/* translators: %s: search term. */ (0,_.__)('Sorry, we couldn\'t find any results matching "%s"',"web-stories"),u)),!t.length&&!u&&y.createElement("p",null,(0,_.__)("Sorry, we couldn't find any results","web-stories")),t.length>=1&&y.createElement("div",{role:"list","aria-label":(0,_.__)("Viewing Stories","web-stories"),className:"web-stories-story-picker-filter__grid"},t.map((e=>{const t=N.includes(e.id);return y.createElement("div",{key:e.id,role:"listitem",className:"web-stories-story-picker-filter__grid_item"},y.createElement(Ve,{story:e,isSelected:t,addSelectedStory:M,removeSelectedStory:R}))}))),y.createElement("div",{className:"web-stories-story-picker-filter__load_more"},i&&y.createElement(Le.Spinner,null),!n&&t.length>0&&!i&&y.createElement(Le.Button,{variant:"primary",className:"is-primary",onClick:k},(0,_.__)("Load More","web-stories"))))};const Ge=function SortStories(e){let{selectedStories:t,setSelectedStories:r}=e;const[o,n]=(0,Te.useState)(),[i,s]=(0,Te.useState)(),a=(0,Te.useCallback)(((e,o)=>{const n=t.map((e=>e.id));n.splice(o,0,n.splice(e,1).pop()),r(n.map((e=>t.find((t=>t.id===e)))))}),[t,r]),l=(0,E.useThrottle)(((e,t)=>{e.preventDefault(),t.classList.add("web-stories-story-picker-show-drag-inserter");const r=t.getBoundingClientRect();Math.abs(e.clientX-r.x)>Math.abs(e.clientX-(r.x+r.width))?t.classList.add("web-stories-story-picker-show-drag-inserter-right"):t.classList.remove("web-stories-story-picker-show-drag-inserter-right");const o=Number(t.children[0].dataset.order);n(o)}));return y.createElement("div",{role:"list","aria-label":(0,_.__)("Sorting Stories","web-stories"),className:"web-stories-story-picker-filter__grid"},t.map(((e,r)=>y.createElement("div",{key:e.id,onDragOver:e=>{l(e,e.currentTarget)},onDragLeave:e=>{e.preventDefault(),l.cancel();e.target.closest(".droppable").classList.remove("web-stories-story-picker-show-drag-inserter","web-stories-story-picker-show-drag-inserter-right")},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),l.cancel(),i){const e=t.findIndex((e=>e.id===i));a(e,o)}e.target.closest(".droppable").classList.remove("web-stories-story-picker-show-drag-inserter","web-stories-story-picker-show-drag-inserter-right")},className:"droppable"},y.createElement("div",{"data-order":r,id:`draggable-story-${e.id}`},y.createElement(Le.Draggable,{elementId:`draggable-story-${e.id}`},(t=>{let{onDraggableStart:o,onDraggableEnd:n}=t;return y.createElement("div",{key:e.id,role:"listitem",className:"web-stories-story-picker-filter__grid_item",onDragStart:t=>{s(e.id),o(t)},onDragEnd:e=>{n(e)},"data-order":r,draggable:!0},y.createElement(Ve,{story:e,isSelectable:!1}))})))))))},{config:{api:{stories:Ze}}}=window.webStoriesBlockSettings;const Xe=function StoryPicker(e){let{selectedStories:t,setSelectedStories:r,closeStoryPicker:o,isSortingStories:n=!1,setIsSortingStories:i=(()=>{}),maxNumOfStories:s}=e;const{createErrorNotice:a}=(0,Ne.useDispatch)(De.store),[l,c]=(0,Te.useState)(t),[u,d]=(0,Te.useState)(!0),[p,m]=(0,Te.useState)("idle"),[h,f]=(0,Te.useState)([]),[b,w]=(0,Te.useState)([]),g=(0,Te.useCallback)((()=>{o(),r(l)}),[o,r,l]),v=(0,Te.useCallback)((async function(){let{orderby:e="modified",order:t="desc",search:r,author:o,page:n=1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={_embed:"author,wp:featuredmedia",context:"edit",_web_stories_envelope:!0,search:r,author:o,page:n,per_page:10,orderby:e,order:t,status:"publish"};try{m("loading");const e=await Oe({path:(0,We.addQueryArgs)(Ze,i)}),t=Number(e?.headers?.["X-WP-TotalPages"]);w(n===t),f((t=>1===n?e.body:[...t,...e.body]))}catch(e){m("error"),a((0,_.__)("Unable to load stories","web-stories"),{type:"snackbar"})}finally{m("idle"),d(!1)}}),[a]);(0,Te.useEffect)((()=>{u&&v()}),[u,v]);const E=1===s?(0,_.__)("Selected Story","web-stories"):(0,_.__)("Selected Stories","web-stories");return y.createElement(Le.Modal,{title:E,onRequestClose:o,shouldCloseOnClickOutside:!1,className:"web-stories-story-picker-modal"},y.createElement("div",{className:"web-stories-story-picker-modal__content"},u?y.createElement(Ae,null,(0,_.__)("Loading Stories…","web-stories")):n?y.createElement(Ge,{selectedStories:l,setSelectedStories:c}):y.createElement(Ue,{stories:h,selectedStories:l,setSelectedStories:c,hasAllStories:b,fetchStories:v,maxNumOfStories:s,isLoading:"loading"===p})),y.createElement("div",{className:"web-stories-story-picker-modal__footer"},y.createElement("div",{className:"web-stories-story-picker-modal__footer--left"},!n&&!u&&s>1&&y.createElement("p",null,(0,_.sprintf)(/* translators: %1$d: Number of selected stories, %2$d: Maximum allowed stories */ (0,_._n)("%1$d of %2$d story selected","%1$d of %2$d stories selected",s,"web-stories"),l.length,s))),y.createElement("div",{className:"web-stories-story-picker-modal__footer--right"},s>1&&(n?y.createElement(Le.Button,{onClick:()=>i(!1)},(0,_.__)("Select Stories","web-stories")):y.createElement(Le.Button,{onClick:()=>i(!0),disabled:l.length<2},(0,_.__)("Rearrange Stories","web-stories"))),y.createElement(Le.Button,{isPrimary:!0,disabled:!l.length,onClick:g},(0,_.__)("Update","web-stories")))))},Qe=window.wp.primitives,Ke=(0,y.createElement)(Qe.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,y.createElement)(Qe.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Ye=e=>{let{url:t,onChange:r,onSubmit:o,onClose:n}=e;return y.createElement(Me.URLPopover,{onClose:n},y.createElement("form",{className:"block-editor-media-placeholder__url-input-form","data-testid":"embed-placeholder-form",onSubmit:o},y.createElement("input",{className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":(0,_.__)("Story URL","web-stories"),placeholder:(0,_.__)("Paste or type URL","web-stories"),onChange:r,value:t}),y.createElement(Le.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Ke,label:(0,_.__)("Embed","web-stories"),type:"submit"})))},Je=e=>{let{icon:t,label:r,value:o,onSubmit:n,cannotEmbed:i=!1,errorMessage:s,selectedStories:a=[],setSelectedStories:l}=e;const[c,u]=(0,Te.useState)(o),[d,p]=(0,Te.useState)(!1),[m,h]=(0,Te.useState)(!1),f=(0,Te.useCallback)((()=>{h(!1)}),[]),b=()=>p(!1),w=a.length>0;return y.createElement(y.Fragment,null,y.createElement(Le.Placeholder,{icon:y.createElement(Me.BlockIcon,{icon:t,showColors:!0}),label:r,className:"wp-block-web-stories-embed",instructions:(0,_.__)("Select an existing story from your site, or add one with a URL.","web-stories")},y.createElement(y.Fragment,null,y.createElement(Le.Button,{isPrimary:!0,onClick:()=>h(!0)},w?(0,_.__)("Replace Story","web-stories"):(0,_.__)("Select Story","web-stories")),y.createElement("div",{className:"block-editor-media-placeholder__url-input-container"},y.createElement(Le.Button,{className:"block-editor-media-placeholder__button",onClick:()=>p(!0),isPressed:d,variant:"tertiary"},!w&&o?(0,_.__)("Replace URL","web-stories"):(0,_.__)("Insert from URL","web-stories")),d&&y.createElement(Ye,{url:c,onChange:e=>{u(e.target.value)},onSubmit:e=>{e.preventDefault(),b(),n(c)},onClose:b}))),i&&y.createElement("div",{className:"components-placeholder__error"},y.createElement("div",{className:"components-placeholder__instructions"},(0,_.__)("Sorry, this content could not be embedded.","web-stories"),s&&y.createElement(y.Fragment,null," ",(0,_.sprintf)(/* translators: %s: error message. */ (0,_.__)("Reason: %s.","web-stories"),s))))),m&&y.createElement(Xe,{closeStoryPicker:f,maxNumOfStories:1,selectedStories:a,setSelectedStories:l}))};const et=(0,Te.forwardRef)((function StoryPlayer(e,t){let{url:r,title:o,poster:n,width:i,height:s}=e;return y.createElement("amp-story-player",{ref:t,style:{width:i?`${i}px`:void 0,height:s?`${s}px`:void 0},"data-testid":"amp-story-player"},y.createElement("a",{href:r},n?y.createElement("img",{alt:o,src:n,width:i,height:s,"data-amp-story-player-poster-img":!0}):o))}));const tt=(0,Te.forwardRef)((function EmbedPreview(e,t){let{url:r,title:o,poster:n,isSelected:i,width:s,height:a}=e;const[l,c]=(0,Te.useState)(!1);(0,Te.useEffect)((()=>{!i&&l&&c(!1)}),[i,l,c]);const u=(0,Te.useCallback)((()=>c(!0)),[c]);return y.createElement("div",{className:"web-stories-embed-preview wp-block-embed__wrapper",style:{"--aspect-ratio":0!==s?a/s:1,"--width":`${s}px`,"--height":`${a}px`}},y.createElement(et,{url:r,title:o,poster:n,ref:t,onFocus:u}),!l&&y.createElement("div",{className:"web-stories-embed-preview-overlay","data-testid":"embed-preview-overlay",onMouseUp:u}))}));const rt=function Singleton(e){let{title:t,poster:r,width:o,height:n}=e;return y.createElement("div",{className:"web-stories-singleton"},y.createElement("div",{className:"wp-block-embed__wrapper",style:{"--aspect-ratio":0!==n?o/n:1,"--width":`${o}px`,"--height":`${n}px`}},y.createElement("div",{className:"web-stories-singleton-poster"},r?y.createElement("img",{src:r,alt:t}):y.createElement("div",{className:"web-stories-singleton-poster-placeholder"},y.createElement("span",null,t))),y.createElement("div",{className:"web-stories-singleton-overlay"},t&&y.createElement(Te.RawHTML,{className:"story-content-overlay__title"},t))))};const ot=(0,Ie.withViewportMatch)({_isResizable:"medium"})((function StoryEmbedEdit(e){let{attributes:t,setAttributes:r,className:o,isSelected:n,_isResizable:i,context:s={}}=e;const{url:a="",width:l=360,height:c=600,align:u="none",poster:d,title:p,stories:m=[],previewOnly:h=!1}=t,{postId:f,queryId:b}=s,w=Number.isFinite(b),[v,S]=(0,Te.useState)(!1),[k,x]=(0,Te.useState)(w?void 0:a),[C,T]=(0,Te.useState)(!1),[O,L]=(0,Te.useState)(!1),[I,N]=(0,Te.useState)({}),[M,R]=(0,Te.useState)(!1),[A,P]=(0,Te.useState)(w?[f]:m),[B,j]=(0,Te.useState)([]),z=C,W=!k||!a||v||M,D=E.useViewportMatch?E.useViewportMatch("medium"):i,F=(0,Te.useRef)();(0,Te.useEffect)((()=>{t.stories.toString()!==A.toString()&&r({stories:A})}),[t.stories,r,A]),(0,Te.useEffect)((()=>{A.length&&!B.length&&L(!0)}),[A,B,L]),(0,Te.useEffect)((()=>{x(a),g("story_embedded")}),[a]),(0,Te.useEffect)((()=>{g("story_poster_changed")}),[d]),(0,Te.useEffect)((()=>{if(F.current&&window.AmpStoryPlayer){new window.AmpStoryPlayer(window,F.current).load()}}),[z,W,D,h]);const H=(0,Te.useCallback)((async e=>{if(e)try{T(!0);const t=encodeURIComponent(new URL(e).toString()),o=await Oe({path:`web-stories/v1/embed?url=${t}`});R(!("string"==typeof o?.title)),N(o),r({url:e})}catch(e){e instanceof TypeError||N(e),R(!0)}finally{T(!1)}}),[r]);(0,Te.useEffect)((()=>{(I?.title||I?.poster)&&r({title:I?.title,poster:I?.poster})}),[a,r,I?.title,I?.poster]);const $=(0,Te.useCallback)((e=>{j(e),P(e.map((e=>e.id)));const t=e?.[0],o=t?.link;N({title:t?.title?.rendered,poster:t?._embedded?.["wp:featuredmedia"]?.[0]?.source_url}),x(o),S(!1),R(!1),r({url:o})}),[j,r]),V=(0,Te.useCallback)((e=>{j([]),P([]),S(!1),R(!1),x(e),e!==a&&H(e)}),[a,H]),q=(0,Te.useCallback)((()=>{S(!0)}),[]),{isRTL:U,maxWidth:G}=(0,Ne.useSelect)((e=>{const{getSettings:t}=e(Me.store),r=t();return{isRTL:r.isRTL,maxWidth:r.maxWidth}}),[]),{toggleSelection:Z}=(0,Ne.useDispatch)(Me.store);if(z)return y.createElement(ze,null);const X=(0,_.__)("Single Story","web-stories");if(W)return O?y.createElement(Pe,{icon:y.createElement(BlockIcon,null),label:X,selectedStoryIds:A,setSelectedStories:$,setIsFetching:L}):y.createElement(Je,{icon:y.createElement(BlockIcon,null),label:X,value:k,onSubmit:V,cannotEmbed:M,errorMessage:I?.message,selectedStories:B,setSelectedStories:$});const Q=l/c,K=lZ(!1),onResizeStop:(e,t,o,n)=>{Z(!0),r({width:parseInt(l+n.width),height:parseInt(c+n.height)})}},h?y.createElement(rt,{title:p,poster:d,width:l,height:c}):y.createElement(tt,{url:a,title:p,poster:d,ref:F,isSelected:n,width:l,height:c}))))}));var nt=__webpack_require__(4184);const it=e=>{const{width:t,height:r,minWidth:o,maxWidth:n,minHeight:i,maxHeight:s,previewOnly:a,setAttributes:l}=e,c=(0,Te.useCallback)((()=>{l({previewOnly:!a})}),[l,a]);return y.createElement(Me.InspectorControls,null,y.createElement(Le.PanelBody,{title:(0,_.__)("Embed Settings","web-stories")},y.createElement(Le.PanelRow,null,y.createElement(Le.BaseControl,{className:"web-stories-embed-size-control"},y.createElement(Le.BaseControl.VisualLabel,null,(0,_.__)("Story dimensions","web-stories")),y.createElement("div",{className:"web-stories-embed-size-control__row"},y.createElement(Le.TextControl,{type:"number",className:"web-stories-embed-size-control__width",label:(0,_.__)("Width","web-stories"),value:t||"",min:o,max:n,onChange:e=>l({width:parseInt(e)})}),y.createElement(Le.TextControl,{type:"number",className:"web-stories-embed-size-control__height",label:(0,_.__)("Height","web-stories"),value:r||"",min:i,max:s,onChange:e=>l({height:parseInt(e)})})))),y.createElement(Le.PanelRow,null,y.createElement(Le.BaseControl,null,y.createElement(Le.ToggleControl,{label:(0,_.__)("Display as preview","web-stories"),checked:a,onChange:c,help:(0,_.__)("Displays the story poster that opens the story in a lightbox on click","web-stories")})))))};const st=(0,Ie.withViewportMatch)({_isResizable:"medium"})((function StoryEmbedEditInLoop(e){let{attributes:t,setAttributes:r,className:o,isSelected:n,_isResizable:i,context:s={}}=e;const{width:a=360,height:l=600,align:c="none",previewOnly:u=!1}=t,{postId:d}=s,{story:p,isFetching:m}=(0,Ne.useSelect)((e=>{const{getEntityRecord:t,isResolving:r}=e(Re.store);let o=null;const n=t("postType","web-story",d);return n&&(o={url:n.link,title:n.title?.rendered,poster:n._embedded?.["wp:featuredmedia"]?.[0]?.source_url}),{story:o,isFetching:r("postType","web-story",d)||!1}}),[d]),{isRTL:h,maxWidth:f}=(0,Ne.useSelect)((e=>{const{getSettings:t}=e(Me.store),r=t();return{isRTL:r.isRTL,maxWidth:r.maxWidth}}),[]),b=E.useViewportMatch?E.useViewportMatch("medium"):i,w=(0,Te.useRef)();(0,Te.useEffect)((()=>{if(w.current&&window.AmpStoryPlayer&&!u){const e=new window.AmpStoryPlayer(window,w.current);try{e.load()}catch{}}}),[p,b,u]);const{toggleSelection:g}=(0,Ne.useDispatch)(Me.store);if(m)return y.createElement(ze,null);const v=(0,_.__)("Single Story","web-stories");if(m)return y.createElement(Le.Placeholder,{icon:y.createElement(Me.BlockIcon,{icon:y.createElement(BlockIcon,null),showColors:!0}),label:v,className:"wp-block-web-stories-embed",instructions:!1},y.createElement(Ae,null,(0,_.__)("Loading Story…","web-stories")));const S=a/l,k=ag(!1),onResizeStop:(e,t,o,n)=>{g(!0),r({width:parseInt(a+n.width),height:parseInt(l+n.height)})}},u?y.createElement(rt,{title:p.title,poster:p.poster,width:a,height:l}):y.createElement(tt,{url:p.url,title:p.title,poster:p.poster,ref:w,isSelected:n,width:a,height:l}))))})),at="latest-stories",lt="selected-stories",ct="url",ut=[{id:at,label:(0,_.__)("Latest Stories","web-stories"),description:(0,_.__)("Embed latest web stories.","web-stories"),icon:de},{id:lt,label:(0,_.__)("Selected Stories","web-stories"),description:(0,_.__)("Manually select web stories.","web-stories"),icon:pe},{id:ct,label:(0,_.__)("Single Story","web-stories"),description:(0,_.__)("Embed a single story.","web-stories"),icon:me}],dt="grid",pt="list",mt="circles",ht="carousel",ft=[{id:ht,label:(0,_.__)("Box Carousel","web-stories"),icon:he,panelIcon:ge},{id:mt,label:(0,_.__)("Circle Carousel","web-stories"),icon:fe,panelIcon:ye},{id:dt,label:(0,_.__)("Grid","web-stories"),icon:be,panelIcon:_e},{id:pt,label:(0,_.__)("List","web-stories"),icon:we,panelIcon:ve}];const bt=function BlockTypeSwitcher(e){let{selectedBlockType:t,setAttributes:r}=e;return y.createElement(Le.ToolbarGroup,null,Le.ToolbarItem?y.createElement(Le.ToolbarItem,null,(e=>y.createElement(Le.DropdownMenu,{icon:"update",toggleProps:e,label:(0,_.__)("Change Type","web-stories"),controls:ut.filter((e=>e.id!==t)).map((e=>({title:e.label,onClick:()=>r({blockType:e.id})})))}))):y.createElement(Le.DropdownMenu,{icon:"update",label:(0,_.__)("Change Type","web-stories"),controls:ut.filter((e=>e.id!==t)).map((e=>({title:e.label,onClick:()=>r({blockType:e.id})})))}))},wt=e=>{let{blockType:t,viewType:r,setAttributes:o}=e;return y.createElement(Me.BlockControls,null,y.createElement(Le.ToolbarGroup,null,t&&ct!==t&&y.createElement(Te.Fragment,null,ft.map((e=>Le.ToolbarButton?y.createElement(Le.ToolbarButton,{key:e.id,label:e.label,icon:e.icon,onClick:()=>{o({viewType:e.id})},isPressed:e.id===r}):y.createElement(Le.Button,{key:e.id,label:e.label,icon:e.icon,onClick:()=>{o({viewType:e.id})},isPressed:e.id===r}))))),y.createElement(bt,{selectedBlockType:t,setAttributes:o}))};const gt=function BlockConfigurationPanel(e){let{instructions:t,icon:r,setAttributes:o,selectionOptions:n,selectionType:i}=e;const s=(0,_.__)("Web Stories","web-stories");return y.createElement(Le.Placeholder,{icon:y.createElement(Me.BlockIcon,{icon:r,showColors:!0}),label:s,instructions:t,className:"web-stories-block-configuration-panel"},y.createElement("ul",{className:"web-stories-block-configuration-panel__options",role:"list","aria-label":(0,_.__)("Block Types","web-stories")},n.map((e=>y.createElement("li",{key:e.id},y.createElement(Le.Button,{variant:"secondary",isSecondary:!0,onClick:()=>{o({[i]:e.id})},icon:y.createElement(Le.Icon,{icon:e.panelIcon||e.icon,title:e.label}),label:e.description||e.label}),y.createElement("span",{className:"web-stories-block-configuration-panel__label components-placeholder__instructions",role:"presentation"},e.label))))))};__webpack_require__(5);const vt=e=>{let{label:t,value:r,onChange:o,onInputChange:n,placeholder:i,options:s=[]}=e;return Array.isArray(s)&&y.createElement("div",{className:"components-base-control"},y.createElement(Le.FormTokenField,{value:r,suggestions:s,onChange:o,onInputChange:n,maxSuggestions:100,label:t,placeholder:i}))},yt={per_page:100},_t=e=>{let{authors:t,setAttributes:r}=e;const[o,n]=(0,Te.useState)(""),{authorsList:i}=(0,Ne.useSelect)((e=>{const{getUsers:r}=e(Re.store);return{authorsList:r({...yt,include:t.join(",")})||[]}}),[t]),{authorSuggestions:s}=(0,Ne.useSelect)((e=>{const{getUsers:t}=e(Re.store);return{authorSuggestions:t({...yt,search:o})||[]}}),[o]),a=(0,Te.useCallback)((e=>{if(void 0===e||!Array.isArray(e))return;const t=e.map((e=>[...s,...i].find((t=>{let{name:r}=t;return r===e})))).filter(Boolean).map((e=>{let{id:t}=e;return t}));r({authors:t})}),[s,i,r]),l=(0,E.useDebounce)((e=>n(e)),500);return y.createElement(vt,{label:(0,_.__)("Authors","web-stories"),value:i.map((e=>{let{name:t}=e;return t})),options:s.map((e=>{let{name:t}=e;return t})),onChange:a,onInputChange:l})};__webpack_require__(1107),__webpack_require__(5716),__webpack_require__(3442),__webpack_require__(1964),__webpack_require__(9878),__webpack_require__(2915),__webpack_require__(7895),__webpack_require__(2275);const Et={order:"asc",_fields:"id,name",context:"view"},St=(e,t)=>{const r=t?.id||e?.find((e=>e.name===t))?.id;if(r)return r;const o=t.toLocaleLowerCase();return e?.find((e=>e.name.toLocaleLowerCase()===o))?.id};const kt=function TaxonomyItem(e){let{taxonomy:t,termIds:r,onChange:o}=e;const[n,i]=(0,Te.useState)(""),[s,a]=(0,Te.useState)([]),[l,c]=(0,Te.useState)([]),u=(0,E.useDebounce)(i,250),{searchResults:d,searchHasResolved:p}=(0,Ne.useSelect)((e=>{if(!n)return{searchResults:[],searchHasResolved:!0};const{getEntityRecords:o,hasFinishedResolution:i}=e(Re.store),s=["taxonomy",t.slug,{...Et,search:n,orderby:"name",exclude:r,per_page:20}];return{searchResults:o(...s),searchHasResolved:i("getEntityRecords",s)}}),[n,r,t.slug]),m=(0,Ne.useSelect)((e=>{if(!r?.length)return[];const{getEntityRecords:o}=e(Re.store);return o("taxonomy",t.slug,{...Et,include:r,per_page:r.length})}),[r,t.slug]);return(0,Te.useEffect)((()=>{if(r?.length||a([]),!m?.length)return;const e=r.reduce(((e,t)=>{const r=m.find((e=>e.id===t));return r&&e.push({id:t,value:r.name}),e}),[]);a(e)}),[r,m]),(0,Te.useEffect)((()=>{p&&c(d.map((e=>e.name)))}),[d,p]),y.createElement("div",{className:"block-library-query-inspector__taxonomy-control"},y.createElement(Le.FormTokenField,{label:t.name,value:s,onInputChange:u,suggestions:l,onChange:e=>{const t=new Set;for(const r of e){const e=St(d,r);e&&t.add(e)}c([]),o(Array.from(t))},__experimentalShowHowTo:!1}))},{config:{fieldStates:xt,archiveURL:Ct}}=window.webStoriesBlockSettings,Tt=e=>{const{attributes:{viewType:t,numOfStories:r,numOfColumns:o,order:n,orderby:i,archiveLinkLabel:s,authors:a,circleSize:l,imageAlignment:c,fieldState:u,taxQuery:d},setAttributes:p,showFilters:m=!0}=e,h=(0,Te.useRef)(!0),f=(0,Ne.useSelect)((e=>{const{getTaxonomies:t}=e(Re.store);return t({type:"web-story",per_page:-1,context:"view"})||[]}),[]);(0,Te.useEffect)((()=>{const e={};Object.entries(xt[t]).forEach((t=>{let[r,o]=t;const{show:n}=o;void 0===u[`show_${r}`]&&(e[`show_${r}`]=n)})),Object.keys(e).length&&p({fieldState:{...u,...e}})}),[]),(0,Te.useEffect)((()=>{if(h.current)return void(h.current=!1);const e={};Object.entries(xt[t]).forEach((t=>{let[r,o]=t;const{show:n}=o;e[`show_${r}`]=n})),p({fieldState:e})}),[t]);const ArchiveLink=()=>Ct?y.createElement("a",{target:"__blank",href:Ct},(0,_.__)("View archive page","web-stories")):null;return y.createElement(Me.InspectorControls,null,y.createElement(Le.PanelBody,{className:"web-stories-settings",title:(0,_.__)("Layout Options","web-stories")},xt[t]&&Object.entries(xt[t]).map((e=>{let[t,r]=e;const{label:o,hidden:n}=r;return!n&&"circle_size"!==t&&"image_alignment"!==t&&y.createElement(Le.ToggleControl,{key:`${t}__control`,label:o,checked:u[`show_${t}`]||!1,onChange:()=>(e=>{p({fieldState:{...u,[`show_${e}`]:!u[`show_${e}`]}})})(t),help:"archive_link"===t&&u[`show_${t}`]&&y.createElement(ArchiveLink,null)})})),u.show_archive_link&&Ct&&y.createElement(Le.TextControl,{label:(0,_.__)("Archive Link Label","web-stories"),value:s,placeholder:(0,_.__)("View All Stories","web-stories"),onChange:e=>p({archiveLinkLabel:e}),className:"web-stories-settings-archive-link"})),[mt,dt,pt].includes(t)&&y.createElement(Le.PanelBody,{className:"web-stories-settings",title:(0,_.__)("Layout and Style Options","web-stories")},pt===t&&y.createElement(Le.RadioControl,{label:(0,_.__)("Image Alignment","web-stories"),selected:c,options:[{value:"left",label:(0,_.__)("Left","web-stories")},{value:"right",label:(0,_.__)("Right","web-stories")}],onChange:e=>{p({imageAlignment:e})}}),dt===t&&y.createElement(Le.RangeControl,{label:(0,_.__)("Number of Columns","web-stories"),value:o,onChange:e=>p({numOfColumns:e}),min:1,max:4,step:1}),mt===t&&y.createElement(Le.RangeControl,{label:(0,_.__)("Circle Size","web-stories"),value:l,onChange:e=>p({circleSize:e}),min:80,max:200,step:5})),m&&y.createElement(Le.PanelBody,{title:(0,_.__)("Sorting and Filtering","web-stories")},y.createElement(Le.SelectControl,{label:(0,_.__)("Order By","web-stories"),options:[{value:"date",label:(0,_.__)("Date","web-stories")},{value:"title",label:(0,_.__)("Title","web-stories")}],value:i||"date",onChange:e=>p({orderby:e})}),y.createElement(Le.SelectControl,{label:(0,_.__)("Order","web-stories"),options:[{value:"asc",label:(0,_.__)("Ascending","web-stories")},{value:"desc",label:(0,_.__)("Descending","web-stories")}],value:n||"desc",onChange:e=>p({order:e})}),f.map((e=>{const t=d?.[e.slug]||[];return y.createElement(kt,{key:e.slug,taxonomy:e,termIds:t,onChange:t=>p({taxQuery:{...d,[e.slug]:t}})})})),y.createElement(_t,{authors:a,setAttributes:p}),y.createElement(Le.RangeControl,{label:(0,_.__)("Number of Stories","web-stories"),value:r,onChange:e=>p({numOfStories:e}),min:1,max:20,step:1})))},Ot=()=>y.createElement(Le.Placeholder,{className:"web-stories-placeholder",instructions:(0,_.__)("Loading Stories…","web-stories")},y.createElement(Le.Spinner,null));var Lt=__webpack_require__(1474);Lt.prototype.scrollItem=function(e,t,r){if(void 0===r&&t?.target&&(r=t,t=!1),void 0===r)return!1;if(r&&r.preventDefault(),this.opt.slidesToScroll=Math.max(1,this.opt.slidesToScroll),this.opt.slidesToShow=Math.max(1,this.opt.slidesToShow),this.itemWidth===1/0){const e=r.target.parentElement.querySelector(".web-stories-list__carousel"),t=window.getComputedStyle(e.querySelector(".web-stories-list__story"));this.itemWidth=parseFloat(t.width)+(parseFloat(t.marginLeft)+parseFloat(t.marginRight))}const o=e;if(++this.animate_id,!0===t)e*=this.containerWidth,e=Math.round(e/this.itemWidth)*this.itemWidth;else{if("string"==typeof e){const t="prev"===e;if(e=this.opt.slidesToScroll%1||this.opt.slidesToShow%1?this.getCurrentSlide():isNaN(this.slide)?0:this.slide,t?e-=this.opt.slidesToScroll:e+=this.opt.slidesToScroll,this.opt.rewind){const r=this.ele.scrollLeft;e=t&&!r?this.slides.length:!t&&r+this.containerWidth>=Math.floor(this.trackWidth)?0:e}}e=Math.min(e,this.slides.length),this.slide=e,e=this.itemWidth*e}return this.scrollTo(e,this.opt.duration*Math.abs(this.ele.scrollLeft-e),(function(){this.updateControls(),this.emit("animated",{value:o,type:"string"==typeof o?"arrow":t?"dot":"slide"})})),!1};const It=Lt;const Nt=function StoryCard(e){let{title:t,excerpt:r,poster:o,author:n,date:i,isShowingAuthor:s,isShowingDate:a,isShowingTitle:l,isShowingExcerpt:c,imageAlignment:u}=e;const d=nt("web-stories-list__story",{"image-align-right":"right"===u}),p=l||s||a,m=(0,Fe.getSettings)().formats.date;return y.createElement("div",{className:d},y.createElement("div",{className:"web-stories-list__story-poster"},o?y.createElement("img",{src:o,alt:t}):y.createElement("div",{className:"web-stories-list__story-poster-placeholder"},y.createElement("span",null,t))),p&&y.createElement("div",{className:"story-content-overlay web-stories-list__story-content-overlay"},l&&t&&y.createElement(Te.RawHTML,{className:"story-content-overlay__title"},t),c&&r&&y.createElement(Te.RawHTML,{className:"story-content-overlay__excerpt"},r),s&&y.createElement("div",{className:"story-content-overlay__author"},(0,_.sprintf)(/* translators: byline. %s: author name. */ (0,_.__)("By %s","web-stories"),n)),a&&y.createElement("time",{dateTime:(0,Fe.format)("c",i),className:"story-content-overlay__date"},(0,_.sprintf)(/* translators: %s: publish date. */ (0,_.__)("On %s","web-stories"),(0,Fe.dateI18n)(m,i)))))},{config:{archiveURL:Mt}}=window.webStoriesBlockSettings;const Rt=function StoriesPreview(e){const{attributes:{align:t,viewType:r,circleSize:o,imageAlignment:n,fieldState:i,numOfColumns:s},viewAllLabel:a,stories:l}=e,c=(0,Te.useRef)(null),u=(0,Te.useRef)(null),d=(0,Te.useRef)(null),p=nt({"is-style-default":!i.show_sharp_corners,"is-style-squared":i.show_sharp_corners,"is-carousel":mt===r||ht===r,[`is-view-type-${r}`]:r,[`columns-${s}`]:dt===r&&s,[`align${t}`]:t,"has-archive-link":i.show_archive_link},"web-stories-list"),StoriesLoop=()=>l.map((e=>{const t=e.meta.web_stories_poster?.url,r=e._embedded?.["wp:featuredmedia"]?.[0]?.source_url,s=t||r;return y.createElement(Nt,{key:e.id,url:e.link,title:e.title.rendered,excerpt:e.excerpt.rendered?e.excerpt.rendered:"",date:e.date_gmt,author:e._embedded.author[0].name,poster:s,imageAlignment:n,isShowingAuthor:i.show_author,isShowingDate:i.show_date,isShowingTitle:i.show_title,isShowingExcerpt:i.show_excerpt,circleSize:o})}));return(0,Te.useEffect)((()=>{if(!c.current)return;const e=c.current.querySelector(".web-stories-list__story");if(!e)return;const t=window.getComputedStyle(e),r=parseFloat(t.width)+(parseFloat(t.marginLeft)+parseFloat(t.marginRight)),o=new It(c.current,{slidesToShow:"auto",slidesToScroll:"auto",itemWidth:r,duration:.25,skipTrack:!0,scrollLock:!0,arrows:{prev:d.current,next:u.current}});o.resize();const n=r*l.length;o.trackWidth=n,o.track.style.width=`${n}px`}),[l.length,r,o]),y.createElement("div",{className:p,style:{"--ws-circle-size":"circles"===r&&o?`${o}px`:void 0}},y.createElement("div",{className:"web-stories-list__inner-wrapper"},mt===r||ht===r?y.createElement(y.Fragment,null,y.createElement("div",{className:"web-stories-list__carousel",ref:c},y.createElement("div",{className:"glider-track"},y.createElement(StoriesLoop,null))),y.createElement("div",{"aria-label":(0,_.__)("Previous","web-stories"),className:"glider-prev",ref:d}),y.createElement("div",{"aria-label":(0,_.__)("Next","web-stories"),className:"glider-next",ref:u})):y.createElement(StoriesLoop,null)),i.show_archive_link&&Mt&&y.createElement("div",{className:"web-stories-list__archive-link"},y.createElement("a",{target:"__blank",href:Mt},a)))};const At=function LatestStoriesEdit(e){let{attributes:t,setAttributes:r}=e;const{numOfStories:o,order:n,orderby:i,archiveLinkLabel:s,authors:a,taxQuery:l}=t,{isFetchingStories:c,fetchedStories:u}=(0,Ne.useSelect)((e=>{const{getEntityRecords:t,isResolving:r}=e(Re.store),o={per_page:20,_embed:"author,wp:featuredmedia",orderby:i||"modified",order:n||"desc",author:a||void 0,...l};return{fetchedStories:t("postType","web-story",o)||[],isFetchingStories:r("postType","web-story",o)||!1}}),[n,i,a,l]),d=s||(0,_.__)("View All Stories","web-stories"),p=u.length>o?u.slice(0,o):u;return y.createElement(y.Fragment,null,y.createElement(Tt,{attributes:t,setAttributes:r}),c&&y.createElement(Ot,null),!c&&Boolean(p?.length)&&y.createElement(Rt,{attributes:t,stories:p,viewAllLabel:d}),!c&&!p?.length&&y.createElement(Le.Placeholder,{icon:y.createElement(Me.BlockIcon,{icon:y.createElement(BlockIcon,null),showColors:!0}),label:(0,_.__)("Latest Stories","web-stories"),className:"wp-block-web-stories-embed",instructions:(0,_.__)("No stories found.","web-stories")},y.createElement(Le.Button,{href:(0,We.addQueryArgs)("post-new.php",{post_type:"web-story"}),isLink:!0},(0,_.__)("Create New Story","web-stories"))))},{config:{maxNumOfStories:Pt}}=window.webStoriesBlockSettings,Bt=e=>{let{icon:t,label:r,selectedStories:o,setSelectedStories:n}=e;const[i,s]=(0,Te.useState)(!1),[a,l]=(0,Te.useState)(!1),c=()=>s(!0),u=(0,Te.useCallback)((()=>{s(!1),l(!1)}),[]),d=(0,Te.useCallback)((()=>{l(!0),c()}),[]);return y.createElement(y.Fragment,null,y.createElement(Me.BlockControls,{group:"other"},Boolean(o?.length)&&(Le.ToolbarButton?y.createElement(y.Fragment,null,y.createElement(Le.ToolbarButton,{"aria-expanded":i,"aria-haspopup":"true",onClick:c},(0,_.__)("Select","web-stories")),y.createElement(Le.ToolbarButton,{"aria-expanded":i,"aria-haspopup":"true",onClick:d},(0,_.__)("Rearrange","web-stories"))):y.createElement(y.Fragment,null,y.createElement(Le.Button,{className:"components-toolbar__control",title:(0,_.__)("Select","web-stories"),"aria-expanded":i,"aria-haspopup":"true",onClick:c}),y.createElement(Le.Button,{className:"components-toolbar__control",title:(0,_.__)("Rearrange","web-stories"),"aria-expanded":d,"aria-haspopup":"true",onClick:d})))),0===o.length&&y.createElement(Le.Placeholder,{icon:y.createElement(Me.BlockIcon,{icon:t,showColors:!0}),label:r,className:"wp-block-web-stories-embed",instructions:(0,_.__)("Select the web stories you want to display on your site.","web-stories")},y.createElement(Le.Button,{isPrimary:!0,onClick:c},(0,_.__)("Select Stories","web-stories"))),i&&y.createElement(Xe,{closeStoryPicker:u,selectedStories:o,setSelectedStories:n,isSortingStories:a,setIsSortingStories:l,maxNumOfStories:Pt}))};const jt=function SelectedStoriesEdit(e){let{icon:t,attributes:r,setAttributes:o,isSelected:n}=e;const{stories:i=[],archiveLinkLabel:s}=r,[a,l]=(0,Te.useState)(i),[c,u]=(0,Te.useState)([]),[d,p]=(0,Te.useState)(!1),m=(0,_.__)("Selected Stories","web-stories"),h=s||(0,_.__)("View All Stories","web-stories");(0,Te.useEffect)((()=>{r.stories.toString()!==a.toString()&&o({stories:a})}),[r.stories,o,a]),(0,Te.useEffect)((()=>{a.length&&!c.length&&p(!0)}),[a,c,p]);const f=(0,Te.useCallback)((e=>{u(e),l(e.map((e=>e.id)))}),[u]);return d?y.createElement(Pe,{icon:t,label:m,selectedStoryIds:a,setSelectedStories:f,setIsFetching:p}):y.createElement(y.Fragment,null,y.createElement(Tt,{attributes:r,setAttributes:o,showFilters:!1}),Boolean(c?.length)&&y.createElement(Rt,{attributes:r,stories:c,viewAllLabel:h}),y.createElement(Bt,{icon:t,label:m,selectedStories:c,setSelectedStories:f,isEditing:n}))};const zt=function WebStoriesEdit(e){let{attributes:t,setAttributes:r,className:o,isSelected:n,context:i}=e;const{blockType:s,viewType:a}=t,{postType:l,postId:c,queryId:u}=i;return Number.isFinite(u)&&l&&c&&"web-story"===l?y.createElement(st,{icon:y.createElement(BlockIcon,null),attributes:t,setAttributes:r,context:i,className:o,isSelected:n}):s?s===ct||a?y.createElement(y.Fragment,null,y.createElement(wt,{blockType:s,viewType:a,setAttributes:r}),s===at&&y.createElement(At,{attributes:t,setAttributes:r}),s===lt&&y.createElement(jt,{icon:y.createElement(BlockIcon,null),attributes:t,setAttributes:r,isSelected:n}),s===ct&&y.createElement(ot,{icon:y.createElement(BlockIcon,null),attributes:t,setAttributes:r,className:o,isSelected:n})):y.createElement(gt,{icon:y.createElement(BlockIcon,null),setAttributes:r,instructions:(0,_.__)("Select a layout style","web-stories"),selectionOptions:ft,selectionType:"viewType"}):y.createElement(gt,{icon:y.createElement(BlockIcon,null),setAttributes:r,instructions:(0,_.__)("Embed a collection of your latest stories, select your own or enter an URL.","web-stories"),selectionOptions:ut,selectionType:"blockType"})},Wt=JSON.parse('{"name":"web-stories/embed","title":"Web Stories","description":"Embed Web Stories.","category":"embed","keywords":["embed","web stories","story","stories"],"textdomain":"web-stories","usesContext":["postId","postType","queryId"],"attributes":{"blockType":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"poster":{"type":"string"},"width":{"type":"number","default":360},"height":{"type":"number","default":600},"align":{"type":"string","default":"none"},"stories":{"type":"array","default":[]},"viewType":{"type":"string","default":""},"numOfStories":{"type":"number","default":5},"numOfColumns":{"type":"number","default":2},"circleSize":{"type":"number","default":96},"imageAlignment":{"type":"string","default":"left"},"order":{"type":"string","default":""},"orderby":{"type":"string","default":""},"archiveLinkLabel":{"type":"string","default":""},"authors":{"type":"array","default":[]},"fieldState":{"type":"object","default":{}},"taxQuery":{"type":"object","default":{}},"previewOnly":{"type":"boolean","default":false}},"supports":{"align":["wide","full","left","right","center"]}}'),{attributes:Dt}=Wt,Ft={from:[{type:"shortcode",tag:"web_stories_embed",attributes:{...Dt,align:{type:"string",shortcode:e=>{let{named:{align:t}}=e;return t}},height:{type:"number",shortcode:e=>{let{named:{height:t}}=e;return t}},poster:{type:"string",shortcode:e=>{let{named:{poster:t}}=e;return t}},title:{type:"string",shortcode:e=>{let{named:{title:t}}=e;return t}},url:{type:"string",shortcode:e=>{let{named:{url:t}}=e;return t}},width:{type:"number",shortcode:e=>{let{named:{width:t}}=e;return t}},blockType:{type:"string",default:ct}},priority:9},{type:"shortcode",tag:"web_stories",attributes:{...Dt,blockType:{type:"string",default:at},align:{type:"string",shortcode:e=>{let{named:{align:t}}=e;return t}},archiveLinkLabel:{type:"string",shortcode:e=>{let{named:{archive_link_label:t}}=e;return t}},viewType:{type:"string",shortcode:e=>{let{named:{view:t}}=e;return t}},numOfStories:{type:"number",shortcode:e=>{let{named:{number:t}}=e;return t}},numOfColumns:{type:"number",shortcode:e=>{let{named:{columns:t}}=e;return t}},circleSize:{type:"number",shortcode:e=>{let{named:{circle_size:t}}=e;return t}},fieldState:{type:"object",shortcode:e=>{let{named:{title:t,excerpt:r,author:o,date:n,archive_link:i,image_align:s}}=e;return{show_archive_link:"true"===i,show_author:"true"===o,show_date:"true"===n,show_excerpt:"true"===r,show_image_align:"true"===s,show_title:"true"===t}}}}},{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return!!r?.raw&&"web_stories_widget"===t},transform:e=>{let{instance:t}=e;const{raw:{archive_link_label:r,circle_size:o,image_alignment:n,number_of_columns:i,number_of_stories:s,view_type:a,show_title:l,show_author:c,show_date:u,show_excerpt:d,show_archive_link:p,sharp_corners:m,show_image_alignment:h,title:f,orderby:b="",order:w=""}}=t,g=(0,v.createBlock)("web-stories/embed",{blockType:"latest-stories",viewType:a,fieldState:{show_title:l,show_author:c,show_date:u,show_excerpt:d,show_archive_link:p,show_sharp_corners:m,show_image_alignment:h},archiveLinkLabel:r,circleSize:o,numOfColumns:i,imageAlignment:n,numOfStories:s,orderby:b.replace("post_",""),order:w.toLowerCase()});return f?[(0,v.createBlock)("core/heading",{content:f}),g]:g}}]},{name:Ht,category:$t,keywords:Vt,attributes:qt,supports:Ut}=Wt,Gt={title:(0,_.__)("Web Stories","web-stories"),description:(0,_.__)("Embed stories using various layout options.","web-stories"),category:$t,icon:y.createElement(BlockIcon,null),keywords:Vt,attributes:qt,example:{attributes:{blockType:at,viewType:dt,numberOfColumns:2}},supports:Ut,deprecated:xe,edit:zt,save:Ce,transforms:Ft};(0,v.registerBlockType)(Ht,Gt),w("Embed Block",!1)})()})();