var AdvonCommerceWidgetToolkit=function(){"use strict";function t(){}function e(t,e){for(const n in e)t[n]=e[n];return t}function n(t){return t()}function a(){return Object.create(null)}function l(t){t.forEach(n)}function i(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(e,n,a){e.$$.on_destroy.push(function(e,...n){if(null==e)return t;const a=e.subscribe(...n);return a.unsubscribe?()=>a.unsubscribe():a}(n,a))}function o(t,e,n,a){if(t){const l=c(t,e,n,a);return t[0](l)}}function c(t,n,a,l){return t[1]&&l?e(a.ctx.slice(),t[1](l(n))):a.ctx}function u(t,e,n,a,l,i,r){const s=function(t,e,n,a){if(t[2]&&a){const l=t[2](a(n));if(void 0===e.dirty)return l;if("object"==typeof l){const t=[],n=Math.max(e.dirty.length,l.length);for(let a=0;at.removeEventListener(e,n,a)}function _(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function y(t){return""===t?null:+t}function x(t){return Array.from(t.childNodes)}function C(t,e,n,a){for(let a=0;a{const a=t.$$.callbacks[e];if(a){const l=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(e,n);a.slice().forEach((e=>{e.call(t,l)}))}}}const I=[],N=[],O=[],j=[],H=Promise.resolve();let z=!1;function V(t){O.push(t)}function B(t){j.push(t)}let F=!1;const U=new Set;function W(){if(!F){F=!0;do{for(let t=0;t{q.delete(t),a&&(n&&t.d(1),a())})),t.o(e)}}const Q="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Z(t,e,n){const a=t.$$.props[e];void 0!==a&&(t.$$.bound[a]=n,n(t.$$.ctx[a]))}function tt(t){t&&t.c()}function et(t,e){t&&t.l(e)}function nt(t,e,a){const{fragment:r,on_mount:s,on_destroy:o,after_update:c}=t.$$;r&&r.m(e,a),V((()=>{const e=s.map(n).filter(i);o?o.push(...e):l(e),t.$$.on_mount=[]})),c.forEach(V)}function at(t,e){const n=t.$$;null!==n.fragment&&(l(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function lt(t,e){-1===t.$$.dirty[0]&&(I.push(t),z||(z=!0,H.then(W)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const l=a.length?a[0]:n;return h.ctx&&s(h.ctx[t],h.ctx[t]=l)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](l),f&<(e,t)),n})):[],h.update(),f=!0,l(h.before_update),h.fragment=!!r&&r(h.ctx),n.target){if(n.hydrate){const t=x(n.target);h.fragment&&h.fragment.l(t),t.forEach(g)}else h.fragment&&h.fragment.c();n.intro&&Y(e.$$.fragment),nt(e,n.target,n.anchor),W()}D(u)}class rt{$destroy(){at(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const st=[];function ot(e,n=t){let a;const l=[];function i(t){if(r(e,t)&&(e=t,a)){const t=!st.length;for(let t=0;t{const t=l.indexOf(o);-1!==t&&l.splice(t,1),0===l.length&&(a(),a=null)}}}}const ct={"Article Container":"logo",Title:"logo_title","Intro Text":"logo_intro","Article Image Container":"logo_fig","Article Image":"logo_fig_img","Publisher Name":"logo_publisher_name",CTA:"logo_cta"},ut={Title:"font-size: 14px;\nfont-weight: 600;\nline-height: 2em;\noverflow: hidden;\ntext-overflow: ellipsis;\nwhite-space: nowrap;","Intro Text":"font-size: 12px;\nline-height: 1.25em;\nmargin-bottom: 10px;\nmin-height:7.5em;\norder: 2;","Article Image Container":"position: relative;\nflex: 1 1 auto;\norder: 1;","Article Image":"display: block;\nmax-height: 100%;\nmax-width: 100%;\nposition: absolute;\ntop: 50%;\nleft: 0;\ntransform: translateY(-50%);\nmargin: 0;",CTA:"color: #6d6e71;\nfont-size: 12px;\nline-height: 1.2;\nmargin-top: 5px;\norder: 4;","Publisher Name":"order: 3;"},dt={Link:"link_product","Product Container":"product",Award:"product_award",Headline:"product_headline","Product Image Container":"product_fig","Product Image":"product_fig_img","Product Name":"product_title",Summary:"product_summary",Price:"product_price","Add To Cart":"add_to_cart"},ht={Award:"background-color: #e6f1fc;\nborder-radius: 2px;\ncolor: #00479e;\ndisplay: inline-block;\nflex: 0;\nfont-size: 12px;\nleft: 1em;\nline-height: 20px;\npadding: 0 8px;",Headline:"font-size: 12px;\nheight: 1em;\nmargin-bottom: 5px;\ncolor: #247139;","Product Image Container":"flex: 1 1 auto;\nmax-height: 200px;\nmin-height:100px;\norder: 3;\nposition: relative;\nwidth: 100%;","Product Image":"left: 50%;\nmax-height: 80%;\nmax-width: 100%;\nposition: absolute;\ntop: 50%;\ntransform: translate(-50%, -50%);","Product Name":"font-size: 14px;\nline-height: 1.2;\norder: 3;\nmargin-top: 10px;\nwidth:100%;\noverflow:hidden;\ntext-overflow:ellipsis;",Summary:"font-size: 12px;\nheight: 6em;\nline-height: normal;\norder: 4;\ncolor: #6d6e71;\nmargin-top: 5px;\nwhite-space: initial;",Price:"font-weight: 700;\nmargin-top: 8px;\nfont-size: 20px;\nfont-weight: 400;\norder: 5;","Add To Cart":"width: 100%;\npadding: 5px;\nmargin: 5px 0px;\norder: 6;"},ft={Carousel:"carousel","Carousel Button":"carousel_btn","Left Button":"carousel_btn_left","Right Button":"carousel_btn_right","Carousel Content":"carousel_content",Slider:"carousel_slider"},gt={"Carousel Button":"background-color: rgba(0,0,0,0.25);\nborder: none;\nborder-radius: 5px;\npadding: 0;\nbackground-color: rgba(0, 0, 0, 0.25);\n"},mt={"Publisher Tag":"product_publisher","Publisher Tag Figure":"product_publisher_fig","Publisher Tag Figure Image":"product_publisher_fig_img","Publisher Tag Label":"product_publisher_label"},pt={"Publisher Tag":"border-top: 1px solid #d2d4da;\norder: 7;\nwidth: 100%;\nmargin-top: 12px;\npadding-top: 12px;","Publisher Tag Figure":"display: inline-block;\nmargin-right: 8px;","Publisher Tag Figure Image":"height: auto;\nwidth:32px;","Publisher Tag Label":"display: inline-block;\nfont-size: 14px;\nfont-weight: 600;\nline-height: 32px;\noverflow: hidden;\ntext-overflow: ellipsis;\nwhite-space: nowrap;\nvertical-align: center;"},$t={Rating:"rating","Rating Stars":"rating_stars","Full Star":"rating_star-full","Half Star":"rating_star-half","Empty Star":"rating_star-empty",Value:"rating_value",Reviews:"rating_reviews","Review Count":"rating_reviews_count","Review Label":"rating_reviews_label"},vt={Rating:"order: 5;\nmargin-top: 8px;","Rating Stars":"display: inline-block;\nmargin-right: 4px;","Full Star":'background-image: url(\'data:image/svg+xml;utf8,\');\nbackground-repeat: no-repeat;\nbackground-size: 100%;\ndisplay: inline-block;\nheight: 1rem;\nline-height: 1rem;\nvertical-align: text-bottom;\nwidth: 1rem;',"Half Star":'background-image: url(\'data:image/svg+xml;utf8,\');\nbackground-repeat: no-repeat;\nbackground-size: 100%;\ndisplay: inline-block;\nheight: 1rem;\nline-height: 1rem;\nvertical-align: text-bottom;\nwidth: 1rem;',"Empty Star":'background-image: url(\'data:image/svg+xml;utf8,\');\nbackground-repeat: no-repeat;\nbackground-size: 100%;\ncolor: rgba(0,0,0,0.1);\ndisplay: inline-block;\nheight: 1rem;\nline-height: 1rem;\nvertical-align: text-bottom;\nwidth: 1rem;',Reviews:"color: #6d6e71;\nfont-size: 16px;","Review Count":"font-size: 0.8em;","Review Label":"text-transform: lowercase;"},bt={charStarRatingEmpty:"",charStarRatingFull:"",charStarRatingHalf:"",starRatingRoundDirection:"UP",showNumericRating:!1,starReviewTypeLabel:"reviews",showStarRatingHalves:!0,showTotalReviewCount:!0},wt=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ut),ht),gt),pt),vt),_t={api:{productSearchTerm:"crib toys",url:"https://widget-demo-daick67vca-uc.a.run.app/"},display:Object.assign({addToCart:!1,addToCartLabel:"Add To Cart",classPrefix:"demo-widget",displayCallToAction:!1,hasCarousel:!0,maxProductDisplayCount:3,starRatingRoundDirection:"UP",showStarRatings:!0},bt),redirect:{queryParam:"to",url:"http://localhost:8040/redirect"}},yt=ot({customCss:wt,width:100,height:500}),xt=ot(_t.api),Ct=ot(_t.display),Et=ot(_t.redirect);function St(e){let n,a,l,i,r,s,o,c;return{c(){n=p("div"),a=p("label"),l=$(e[1]),i=v(),r=p("input"),this.h()},l(t){n=C(t,"DIV",{class:!0});var s=x(n);a=C(s,"LABEL",{class:!0,for:!0});var o=x(a);l=E(o,e[1]),o.forEach(g),i=S(s),r=C(s,"INPUT",{type:!0,name:!0,id:!0}),s.forEach(g),this.h()},h(){_(a,"class","demo_checkbox_label svelte-yhbsfp"),_(a,"for",e[2]),_(r,"type","checkbox"),_(r,"name",e[2]),_(r,"id",e[2]),_(n,"class",s="demo_checkbox "+(e[3].class??"")+" svelte-yhbsfp")},m(t,s){f(t,n,s),h(n,a),h(a,l),h(n,i),h(n,r),r.checked=e[0],o||(c=w(r,"change",e[4]),o=!0)},p(t,[e]){2&e&&R(l,t[1]),4&e&&_(a,"for",t[2]),4&e&&_(r,"name",t[2]),4&e&&_(r,"id",t[2]),1&e&&(r.checked=t[0]),8&e&&s!==(s="demo_checkbox "+(t[3].class??"")+" svelte-yhbsfp")&&_(n,"class",s)},i:t,o:t,d(t){t&&g(n),o=!1,c()}}}function Rt(t,n,a){let{label:l}=n,{name:i}=n,{value:r=!1}=n;return t.$$set=t=>{a(3,n=e(e({},n),d(t))),"label"in t&&a(1,l=t.label),"name"in t&&a(2,i=t.name),"value"in t&&a(0,r=t.value)},n=d(n),[r,l,i,n,function(){r=this.checked,a(0,r)}]}class Tt extends rt{constructor(t){super(),it(this,t,Rt,St,r,{label:1,name:2,value:0})}}function kt(t){let e,n,a;const l=t[3].default,i=o(l,t,t[2],null);return{c(){e=p("article"),i&&i.c(),this.h()},l(t){e=C(t,"ARTICLE",{class:!0,style:!0});var n=x(e);i&&i.l(n),n.forEach(g),this.h()},h(){_(e,"class",n="demo_paper "+(t[1].class??"")+" svelte-1c8hwqm"),_(e,"style",t[0])},m(t,n){f(t,e,n),i&&i.m(e,null),a=!0},p(t,[r]){i&&i.p&&4&r&&u(i,l,t,t[2],r,null,null),(!a||2&r&&n!==(n="demo_paper "+(t[1].class??"")+" svelte-1c8hwqm"))&&_(e,"class",n),(!a||1&r)&&_(e,"style",t[0])},i(t){a||(Y(i,t),a=!0)},o(t){K(i,t),a=!1},d(t){t&&g(e),i&&i.d(t)}}}function Pt(t,n,a){let{$$slots:l={},$$scope:i}=n,{style:r}=n;return t.$$set=t=>{a(1,n=e(e({},n),d(t))),"style"in t&&a(0,r=t.style),"$$scope"in t&&a(2,i=t.$$scope)},n=d(n),[r,n,i,l]}class At extends rt{constructor(t){super(),it(this,t,Pt,kt,r,{style:0})}}function Dt(e){let n,a,i,r,s,o,c,u,d,m;return{c(){n=p("div"),a=p("label"),i=$(e[1]),r=$(":"),s=v(),o=p("input"),c=v(),u=p("input"),this.h()},l(t){n=C(t,"DIV",{class:!0});var l=x(n);a=C(l,"LABEL",{for:!0,class:!0});var d=x(a);i=E(d,e[1]),r=E(d,":"),d.forEach(g),s=S(l),o=C(l,"INPUT",{class:!0,type:!0,id:!0,name:!0,min:!0,max:!0,step:!0}),c=S(l),u=C(l,"INPUT",{class:!0,type:!0,name:!0,min:!0,max:!0,step:!0}),l.forEach(g),this.h()},h(){_(a,"for",e[4]),_(a,"class","svelte-crsi0k"),_(o,"class","demo_numeric svelte-crsi0k"),_(o,"type","number"),_(o,"id",e[4]),_(o,"name",e[4]),_(o,"min",e[3]),_(o,"max",e[2]),_(o,"step",e[5]),_(u,"class","demo_slider_input svelte-crsi0k"),_(u,"type","range"),_(u,"name",e[4]),_(u,"min",e[3]),_(u,"max",e[2]),_(u,"step",e[5]),_(n,"class","demo_slider svelte-crsi0k")},m(t,l){f(t,n,l),h(n,a),h(a,i),h(a,r),h(n,s),h(n,o),T(o,e[0]),h(n,c),h(n,u),T(u,e[0]),d||(m=[w(o,"input",e[6]),w(u,"change",e[7]),w(u,"input",e[7])],d=!0)},p(t,[e]){2&e&&R(i,t[1]),16&e&&_(a,"for",t[4]),16&e&&_(o,"id",t[4]),16&e&&_(o,"name",t[4]),8&e&&_(o,"min",t[3]),4&e&&_(o,"max",t[2]),32&e&&_(o,"step",t[5]),1&e&&y(o.value)!==t[0]&&T(o,t[0]),16&e&&_(u,"name",t[4]),8&e&&_(u,"min",t[3]),4&e&&_(u,"max",t[2]),32&e&&_(u,"step",t[5]),1&e&&T(u,t[0])},i:t,o:t,d(t){t&&g(n),d=!1,l(m)}}}function Lt(t,e,n){let{label:a}=e,{max:l}=e,{min:i}=e,{name:r}=e,{step:s=1}=e,{value:o}=e;return t.$$set=t=>{"label"in t&&n(1,a=t.label),"max"in t&&n(2,l=t.max),"min"in t&&n(3,i=t.min),"name"in t&&n(4,r=t.name),"step"in t&&n(5,s=t.step),"value"in t&&n(0,o=t.value)},[o,a,l,i,r,s,function(){o=y(this.value),n(0,o)},function(){o=y(this.value),n(0,o)}]}class It extends rt{constructor(t){super(),it(this,t,Lt,Dt,r,{label:1,max:2,min:3,name:4,step:5,value:0})}}function Nt(t,e,n){const a=t.slice();return a[6]=e[n],a}function Ot(t){let e,n,a,l=t[6][0]+"";return{c(){e=p("option"),n=$(l),this.h()},l(t){e=C(t,"OPTION",{value:!0});var a=x(e);n=E(a,l),a.forEach(g),this.h()},h(){e.__value=a=t[6][1],e.value=e.__value},m(t,a){f(t,e,a),h(e,n)},p(t,i){8&i&&l!==(l=t[6][0]+"")&&R(n,l),8&i&&a!==(a=t[6][1])&&(e.__value=a,e.value=e.__value)},d(t){t&&g(e)}}}function jt(e){let n,a,l,i,r,s=e[3],o=[];for(let t=0;te[5].call(n)))},m(t,a){f(t,n,a);for(let t=0;t{a(4,n=e(e({},n),d(t))),"id"in t&&a(1,l=t.id),"name"in t&&a(2,i=t.name),"options"in t&&a(3,r=t.options),"value"in t&&a(0,s=t.value)},n=d(n),[s,l,i,r,n,function(){s=function(t){const e=t.querySelector(":checked")||t.options[0];return e&&e.__value}(this),a(0,s),a(3,r)}]}class zt extends rt{constructor(t){super(),it(this,t,Ht,jt,r,{id:1,name:2,options:3,value:0})}}const Vt=t=>({}),Bt=t=>({});function Ft(t){let e,n,a,l,i,r,s,c,d,m;const b=t[5].foot,y=o(b,t,t[4],Bt);return{c(){e=p("div"),n=p("label"),a=$(t[2]),l=v(),i=p("input"),r=v(),y&&y.c(),this.h()},l(s){e=C(s,"DIV",{class:!0});var o=x(e);n=C(o,"LABEL",{class:!0,for:!0});var c=x(n);a=E(c,t[2]),c.forEach(g),l=S(o),i=C(o,"INPUT",{type:!0,name:!0,id:!0}),r=S(o),y&&y.l(o),o.forEach(g),this.h()},h(){_(n,"class","demo_textField_label svelte-9pjuap"),_(n,"for",t[1]),_(i,"type","text"),_(i,"name",t[1]),_(i,"id",t[1]),_(e,"class",s="demo_textField "+(t[3].class??"")+" svelte-9pjuap")},m(s,o){f(s,e,o),h(e,n),h(n,a),h(e,l),h(e,i),T(i,t[0]),h(e,r),y&&y.m(e,null),c=!0,d||(m=w(i,"input",t[6]),d=!0)},p(t,[l]){(!c||4&l)&&R(a,t[2]),(!c||2&l)&&_(n,"for",t[1]),(!c||2&l)&&_(i,"name",t[1]),(!c||2&l)&&_(i,"id",t[1]),1&l&&i.value!==t[0]&&T(i,t[0]),y&&y.p&&16&l&&u(y,b,t,t[4],l,Vt,Bt),(!c||8&l&&s!==(s="demo_textField "+(t[3].class??"")+" svelte-9pjuap"))&&_(e,"class",s)},i(t){c||(Y(y,t),c=!0)},o(t){K(y,t),c=!1},d(t){t&&g(e),y&&y.d(t),d=!1,m()}}}function Ut(t,n,a){let{$$slots:l={},$$scope:i}=n,{name:r}=n,{value:s}=n,{label:o}=n;return t.$$set=t=>{a(3,n=e(e({},n),d(t))),"name"in t&&a(1,r=t.name),"value"in t&&a(0,s=t.value),"label"in t&&a(2,o=t.label),"$$scope"in t&&a(4,i=t.$$scope)},n=d(n),[s,r,o,n,i,l,function(){s=this.value,a(0,s)}]}class Wt extends rt{constructor(t){super(),it(this,t,Ut,Ft,r,{name:1,value:0,label:2})}}function Mt(t){let e,n,a,l,i,r,s,o,c,u,d,m,b,w,y,R,T,k,P,A,D,L,I,O,j,H,z,V,F,U,W,M,q,J;function G(e){t[3].call(null,e)}let X={class:"demo_rating_entry",label:"Full Star Character:",name:"charStarRatingFull"};function Q(e){t[4].call(null,e)}void 0!==t[0].charStarRatingFull&&(X.value=t[0].charStarRatingFull),r=new Wt({props:X}),N.push((()=>Z(r,"value",G)));let lt={class:"demo_rating_entry",label:"Half Star Character:",name:"charStarRatingHalf"};function it(e){t[5].call(null,e)}void 0!==t[0].charStarRatingHalf&&(lt.value=t[0].charStarRatingHalf),c=new Wt({props:lt}),N.push((()=>Z(c,"value",Q)));let rt={class:"demo_rating_entry",label:"Empty Star Character:",name:"charStarRatingEmpty"};function st(e){t[6].call(null,e)}void 0!==t[0].charStarRatingEmpty&&(rt.value=t[0].charStarRatingEmpty),m=new Wt({props:rt}),N.push((()=>Z(m,"value",it)));let ot={class:"demo_rating_entry",label:"Star Review Type Label:",name:"starReviewTypeLabel"};function ct(e){t[7].call(null,e)}void 0!==t[0].starReviewTypeLabel&&(ot.value=t[0].starReviewTypeLabel),R=new Wt({props:ot}),N.push((()=>Z(R,"value",st)));let ut={class:"demo_rating_entry",label:"Show Star Rating Halves:",name:"showStarRatingHalves"};function dt(e){t[8].call(null,e)}void 0!==t[0].showStarRatingHalves&&(ut.value=t[0].showStarRatingHalves),P=new Tt({props:ut}),N.push((()=>Z(P,"value",ct)));let ht={class:"demo_rating_entry",label:"Show Numeric Rating Value:",name:"showNumericRating"};function ft(e){t[9].call(null,e)}void 0!==t[0].showNumericRating&&(ht.value=t[0].showNumericRating),L=new Tt({props:ht}),N.push((()=>Z(L,"value",dt)));let gt={class:"demo_rating_entry",label:"Show Total Review Count:",name:"showTotalReviewCount"};function mt(e){t[10].call(null,e)}void 0!==t[0].showTotalReviewCount&&(gt.value=t[0].showTotalReviewCount),j=new Tt({props:gt}),N.push((()=>Z(j,"value",ft)));let pt={id:"starRatingRoundDirection",name:"starRatingRoundDirection",options:t[1]};return void 0!==t[0].starRatingRoundDirection&&(pt.value=t[0].starRatingRoundDirection),W=new zt({props:pt}),N.push((()=>Z(W,"value",mt))),{c(){e=p("div"),n=p("div"),a=p("p"),l=$("Note: The ( Full, Half, Empty ) Star Character configurations need to\r\n coordinate with their corresponding (Star Rating) CSS styling."),i=v(),tt(r.$$.fragment),o=v(),tt(c.$$.fragment),d=v(),tt(m.$$.fragment),w=v(),y=p("div"),tt(R.$$.fragment),k=v(),tt(P.$$.fragment),D=v(),tt(L.$$.fragment),O=v(),tt(j.$$.fragment),z=v(),V=p("label"),F=$("Star Ratings Rounding Direction:"),U=v(),tt(W.$$.fragment),this.h()},l(t){e=C(t,"DIV",{class:!0});var s=x(e);n=C(s,"DIV",{class:!0});var u=x(n);a=C(u,"P",{class:!0});var h=x(a);l=E(h,"Note: The ( Full, Half, Empty ) Star Character configurations need to\r\n coordinate with their corresponding (Star Rating) CSS styling."),h.forEach(g),i=S(u),et(r.$$.fragment,u),o=S(u),et(c.$$.fragment,u),d=S(u),et(m.$$.fragment,u),u.forEach(g),w=S(s),y=C(s,"DIV",{class:!0});var f=x(y);et(R.$$.fragment,f),k=S(f),et(P.$$.fragment,f),D=S(f),et(L.$$.fragment,f),O=S(f),et(j.$$.fragment,f),z=S(f),V=C(f,"LABEL",{class:!0,for:!0});var p=x(V);F=E(p,"Star Ratings Rounding Direction:"),p.forEach(g),U=S(f),et(W.$$.fragment,f),f.forEach(g),s.forEach(g),this.h()},h(){_(a,"class","demo_rating_info svelte-1g9zfcx"),_(n,"class","demo_rating_group svelte-1g9zfcx"),_(V,"class","demo_rating_label svelte-1g9zfcx"),_(V,"for","starRatingRoundDirection"),_(y,"class","demo_rating_group svelte-1g9zfcx"),_(e,"class",q="demo_rating "+(t[2].class??"")+" svelte-1g9zfcx")},m(t,s){f(t,e,s),h(e,n),h(n,a),h(a,l),h(n,i),nt(r,n,null),h(n,o),nt(c,n,null),h(n,d),nt(m,n,null),h(e,w),h(e,y),nt(R,y,null),h(y,k),nt(P,y,null),h(y,D),nt(L,y,null),h(y,O),nt(j,y,null),h(y,z),h(y,V),h(V,F),h(y,U),nt(W,y,null),J=!0},p(t,[n]){const a={};!s&&1&n&&(s=!0,a.value=t[0].charStarRatingFull,B((()=>s=!1))),r.$set(a);const l={};!u&&1&n&&(u=!0,l.value=t[0].charStarRatingHalf,B((()=>u=!1))),c.$set(l);const i={};!b&&1&n&&(b=!0,i.value=t[0].charStarRatingEmpty,B((()=>b=!1))),m.$set(i);const o={};!T&&1&n&&(T=!0,o.value=t[0].starReviewTypeLabel,B((()=>T=!1))),R.$set(o);const d={};!A&&1&n&&(A=!0,d.value=t[0].showStarRatingHalves,B((()=>A=!1))),P.$set(d);const h={};!I&&1&n&&(I=!0,h.value=t[0].showNumericRating,B((()=>I=!1))),L.$set(h);const f={};!H&&1&n&&(H=!0,f.value=t[0].showTotalReviewCount,B((()=>H=!1))),j.$set(f);const g={};!M&&1&n&&(M=!0,g.value=t[0].starRatingRoundDirection,B((()=>M=!1))),W.$set(g),(!J||4&n&&q!==(q="demo_rating "+(t[2].class??"")+" svelte-1g9zfcx"))&&_(e,"class",q)},i(t){J||(Y(r.$$.fragment,t),Y(c.$$.fragment,t),Y(m.$$.fragment,t),Y(R.$$.fragment,t),Y(P.$$.fragment,t),Y(L.$$.fragment,t),Y(j.$$.fragment,t),Y(W.$$.fragment,t),J=!0)},o(t){K(r.$$.fragment,t),K(c.$$.fragment,t),K(m.$$.fragment,t),K(R.$$.fragment,t),K(P.$$.fragment,t),K(L.$$.fragment,t),K(j.$$.fragment,t),K(W.$$.fragment,t),J=!1},d(t){t&&g(e),at(r),at(c),at(m),at(R),at(P),at(L),at(j),at(W)}}}function qt(t,n,a){let l;s(t,Ct,(t=>a(0,l=t)));return t.$$set=t=>{a(2,n=e(e({},n),d(t)))},n=d(n),[l,[["Round Nearest Star","NEAREST"],["Round Up Star","UP"],["Round Down Star","DOWN"]],n,function(t){l.charStarRatingFull=t,Ct.set(l)},function(t){l.charStarRatingHalf=t,Ct.set(l)},function(t){l.charStarRatingEmpty=t,Ct.set(l)},function(t){l.starReviewTypeLabel=t,Ct.set(l)},function(t){l.showStarRatingHalves=t,Ct.set(l)},function(t){l.showNumericRating=t,Ct.set(l)},function(t){l.showTotalReviewCount=t,Ct.set(l)},function(t){l.starRatingRoundDirection=t,Ct.set(l)}]}class Jt extends rt{constructor(t){super(),it(this,t,qt,Mt,r,{})}}function Gt(t,e,n){const a=t.slice();return a[12]=e[n],a}function Xt(t){let e,n,a,i,r,s,o,c,u,d,m=t[12]+"";return{c(){e=p("div"),n=p("input"),r=v(),s=p("label"),o=$(m),this.h()},l(t){e=C(t,"DIV",{class:!0});var a=x(e);n=C(a,"INPUT",{type:!0,id:!0,value:!0,class:!0}),r=S(a),s=C(a,"LABEL",{for:!0,class:!0});var l=x(s);o=E(l,m),l.forEach(g),a.forEach(g),this.h()},h(){_(n,"type","radio"),_(n,"id",a=t[12]),n.__value=i=t[12],n.value=n.__value,_(n,"class","svelte-3yijgi"),t[8][0].push(n),_(s,"for",c=t[12]),_(s,"class","svelte-3yijgi"),_(e,"class","tab svelte-3yijgi")},m(a,l){f(a,e,l),h(e,n),n.checked=n.__value===t[2],h(e,r),h(e,s),h(s,o),u||(d=[w(n,"change",t[7]),w(n,"change",t[6])],u=!0)},p(t,e){8&e&&a!==(a=t[12])&&_(n,"id",a),8&e&&i!==(i=t[12])&&(n.__value=i,n.value=n.__value),4&e&&(n.checked=n.__value===t[2]),8&e&&m!==(m=t[12]+"")&&R(o,m),8&e&&c!==(c=t[12])&&_(s,"for",c)},d(a){a&&g(e),t[8][0].splice(t[8][0].indexOf(n),1),u=!1,l(d)}}}function Yt(t){let e,n,a,l,i;return{c(){e=p("div"),n=$("Class Diagram"),a=v(),l=p("img"),this.h()},l(t){e=C(t,"DIV",{});var i=x(e);n=E(i,"Class Diagram"),i.forEach(g),a=S(t),l=C(t,"IMG",{src:!0,alt:!0}),this.h()},h(){l.src!==(i="/assets/"+t[1])&&_(l,"src",i),_(l,"alt","class")},m(t,i){f(t,e,i),h(e,n),f(t,a,i),f(t,l,i)},p(t,e){2&e&&l.src!==(i="/assets/"+t[1])&&_(l,"src",i)},d(t){t&&g(e),t&&g(a),t&&g(l)}}}function Kt(t){let e,n,a,l,i,r,s,o,c,u,d,m,b,y,k,P=t[5].classPrefix+"",A=t[0][t[2]]+"";return{c(){e=p("div"),n=$("Custom CSS for "),a=$(t[2]),l=$(":"),i=v(),r=p("div"),s=p("textarea"),o=v(),c=p("div"),u=$("."),d=$(P),m=$("_"),b=$(A),this.h()},l(h){e=C(h,"DIV",{});var f=x(e);n=E(f,"Custom CSS for "),a=E(f,t[2]),l=E(f,":"),f.forEach(g),i=S(h),r=C(h,"DIV",{class:!0});var p=x(r);s=C(p,"TEXTAREA",{class:!0}),x(s).forEach(g),p.forEach(g),o=S(h),c=C(h,"DIV",{class:!0,title:!0});var $=x(c);u=E($,"."),d=E($,P),m=E($,"_"),b=E($,A),$.forEach(g),this.h()},h(){_(s,"class","svelte-3yijgi"),_(r,"class","flex svelte-3yijgi"),_(c,"class","selector"),_(c,"title","CSS selector")},m(g,p){f(g,e,p),h(e,n),h(e,a),h(e,l),f(g,i,p),f(g,r,p),h(r,s),T(s,t[4].customCss[t[2]]),f(g,o,p),f(g,c,p),h(c,u),h(c,d),h(c,m),h(c,b),y||(k=w(s,"input",t[10]),y=!0)},p(t,e){4&e&&R(a,t[2]),20&e&&T(s,t[4].customCss[t[2]]),32&e&&P!==(P=t[5].classPrefix+"")&&R(d,P),5&e&&A!==(A=t[0][t[2]]+"")&&R(b,A)},d(t){t&&g(e),t&&g(i),t&&g(r),t&&g(o),t&&g(c),y=!1,k()}}}function Qt(e){let n,a,l,i,r,s,o,c,u,d,b,y=e[3],R=[];for(let t=0;tn(4,a=t))),s(t,Ct,(t=>n(5,l=t)));const i=L();let r,{sections:o={Title:"Title"}}=e,{diagram:c=""}=e,u="";return t.$$set=t=>{"sections"in t&&n(0,o=t.sections),"diagram"in t&&n(1,c=t.diagram)},t.$$.update=()=>{1&t.$$.dirty&&n(3,r=Object.keys(o)),13&t.$$.dirty&&n(2,u=o[u]||"diagram"===u?u:r[0])},[o,c,u,r,a,l,function(t){i("tabChange",t.target.value)},function(){u=this.__value,n(2,u),n(0,o),n(3,r)},[[]],function(){u=this.__value,n(2,u),n(0,o),n(3,r)},function(){a.customCss[u]=this.value,yt.set(a),n(2,u),n(0,o),n(3,r)}]}class te extends rt{constructor(t){super(),it(this,t,Zt,Qt,r,{sections:0,diagram:1})}}const ee={"Main Content":"main_content"},ne=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ct),ft),dt),ee),$t),mt),ae={Carousel:ft,"Article Summary":ct,"Product Card":dt,"Static Product List":ee,"Publisher Tag":mt,"Star Rating":$t},le={Carousel:"widget_fe_diagram_carousel.png","Product Card":"widget_fe_diagram_product.png","Star Rating":"widget_fe_diagram_ratings.png","Article Summary":"widget_fe_diagram_publisher.png","Static Product List":"widget_fe_diagram_static.png"},{document:ie}=Q;function re(e){let n,a;return{c(){n=p("h1"),a=$("AdvonCommerceWidget required.")},l(t){n=C(t,"H1",{});var e=x(n);a=E(e,"AdvonCommerceWidget required."),e.forEach(g)},m(t,e){f(t,n,e),h(n,a)},p:t,i:t,o:t,d(t){t&&g(n)}}}function se(t){let e,n,a,i,r,s,o,c,u,d,m,b,y,T,k,P,A,D,L,I,N,O,j,H,z,V,B,F,U,W,M,q,J,Q,Z,lt=t[2]?"Hide":"Show",it=t[3]?"Hide":"Show",rt=t[2]&&oe(t),st=t[3]&&de(t);return M=new At({props:{class:"demo_content_widget",$$slots:{default:[he]},$$scope:{ctx:t}}}),{c(){e=p("header"),n=p("div"),a=p("h1"),i=$("Embedded Expert"),r=v(),s=p("div"),o=p("button"),c=$(lt),u=$("\r\n Config"),d=v(),m=p("button"),b=$(it),y=$("\r\n Styles"),T=v(),k=p("button"),P=$("Export CSS"),A=v(),D=p("button"),L=$("Export Config"),I=v(),N=p("button"),O=$("Import Config"),j=v(),H=p("div"),rt&&rt.c(),z=v(),st&&st.c(),V=v(),B=p("div"),F=p("h4"),U=$("Example Widget"),W=v(),tt(M.$$.fragment),this.h()},l(t){e=C(t,"HEADER",{class:!0});var l=x(e);n=C(l,"DIV",{class:!0});var h=x(n);a=C(h,"H1",{class:!0});var f=x(a);i=E(f,"Embedded Expert"),f.forEach(g),r=S(h),s=C(h,"DIV",{class:!0});var p=x(s);o=C(p,"BUTTON",{class:!0});var $=x(o);c=E($,lt),u=E($,"\r\n Config"),$.forEach(g),d=S(p),m=C(p,"BUTTON",{class:!0});var v=x(m);b=E(v,it),y=E(v,"\r\n Styles"),v.forEach(g),T=S(p),k=C(p,"BUTTON",{class:!0});var w=x(k);P=E(w,"Export CSS"),w.forEach(g),A=S(p),D=C(p,"BUTTON",{class:!0});var _=x(D);L=E(_,"Export Config"),_.forEach(g),I=S(p),N=C(p,"BUTTON",{class:!0});var R=x(N);O=E(R,"Import Config"),R.forEach(g),p.forEach(g),h.forEach(g),l.forEach(g),j=S(t),H=C(t,"DIV",{});var q=x(H);rt&&rt.l(q),z=S(q),st&&st.l(q),q.forEach(g),V=S(t),B=C(t,"DIV",{class:!0,style:!0});var J=x(B);F=C(J,"H4",{class:!0});var G=x(F);U=E(G,"Example Widget"),G.forEach(g),W=S(J),et(M.$$.fragment,J),J.forEach(g),this.h()},h(){_(a,"class","demo_header_title svelte-1el12es"),_(o,"class","svelte-1el12es"),_(m,"class","svelte-1el12es"),_(k,"class","svelte-1el12es"),_(D,"class","svelte-1el12es"),_(N,"class","svelte-1el12es"),_(s,"class","demo_save_buttons svelte-1el12es"),_(n,"class","demo_header_block svelte-1el12es"),_(e,"class","demo_header svelte-1el12es"),_(F,"class","demo_headline svelte-1el12es"),_(B,"class","demo_content svelte-1el12es"),_(B,"style",q=`width:${t[9].width}%;height:${t[9].height}px`)},m(l,g){f(l,e,g),h(e,n),h(n,a),h(a,i),h(n,r),h(n,s),h(s,o),h(o,c),h(o,u),h(s,d),h(s,m),h(m,b),h(m,y),h(s,T),h(s,k),h(k,P),h(s,A),h(s,D),h(D,L),h(s,I),h(s,N),h(N,O),f(l,j,g),f(l,H,g),rt&&rt.m(H,null),h(H,z),st&&st.m(H,null),f(l,V,g),f(l,B,g),h(B,F),h(F,U),h(B,W),nt(M,B,null),J=!0,Q||(Z=[w(o,"click",t[16]),w(m,"click",t[17]),w(k,"click",t[15]),w(D,"click",t[14]),w(N,"click",t[13])],Q=!0)},p(t,e){(!J||4&e[0])&<!==(lt=t[2]?"Hide":"Show")&&R(c,lt),(!J||8&e[0])&&it!==(it=t[3]?"Hide":"Show")&&R(b,it),t[2]?rt?(rt.p(t,e),4&e[0]&&Y(rt,1)):(rt=oe(t),rt.c(),Y(rt,1),rt.m(H,z)):rt&&(G(),K(rt,1,1,(()=>{rt=null})),X()),t[3]?st?(st.p(t,e),8&e[0]&&Y(st,1)):(st=de(t),st.c(),Y(st,1),st.m(H,null)):st&&(G(),K(st,1,1,(()=>{st=null})),X());const n={};1027&e[0]|512&e[1]&&(n.$$scope={dirty:e,ctx:t}),M.$set(n),(!J||512&e[0]&&q!==(q=`width:${t[9].width}%;height:${t[9].height}px`))&&_(B,"style",q)},i(t){J||(Y(rt),Y(st),Y(M.$$.fragment,t),J=!0)},o(t){K(rt),K(st),K(M.$$.fragment,t),J=!1},d(t){t&&g(e),t&&g(j),t&&g(H),rt&&rt.d(),st&&st.d(),t&&g(V),t&&g(B),at(M),Q=!1,l(Z)}}}function oe(t){let e,n,a,l,i;return l=new At({props:{class:"demo_config_block demo_config_base",$$slots:{default:[ue]},$$scope:{ctx:t}}}),{c(){e=p("h4"),n=$("Widget Settings"),a=v(),tt(l.$$.fragment),this.h()},l(t){e=C(t,"H4",{class:!0});var i=x(e);n=E(i,"Widget Settings"),i.forEach(g),a=S(t),et(l.$$.fragment,t),this.h()},h(){_(e,"class","demo_headline svelte-1el12es")},m(t,r){f(t,e,r),h(e,n),f(t,a,r),nt(l,t,r),i=!0},p(t,e){const n={};576&e[0]|512&e[1]&&(n.$$scope={dirty:e,ctx:t}),l.$set(n)},i(t){i||(Y(l.$$.fragment,t),i=!0)},o(t){K(l.$$.fragment,t),i=!1},d(t){t&&g(e),t&&g(a),at(l,t)}}}function ce(t){let e,n,a,l,i,r;return i=new Jt({}),{c(){e=p("div"),n=p("h5"),a=$("Star Rating"),l=v(),tt(i.$$.fragment),this.h()},l(t){e=C(t,"DIV",{class:!0});var r=x(e);n=C(r,"H5",{});var s=x(n);a=E(s,"Star Rating"),s.forEach(g),l=S(r),et(i.$$.fragment,r),r.forEach(g),this.h()},h(){_(e,"class","demo_config_group svelte-1el12es")},m(t,s){f(t,e,s),h(e,n),h(n,a),h(e,l),nt(i,e,null),r=!0},i(t){r||(Y(i.$$.fragment,t),r=!0)},o(t){K(i.$$.fragment,t),r=!1},d(t){t&&g(e),at(i)}}}function ue(t){let e,n,a,l,i,r,s,o,c,u,d,h,m,$,w,_,y,E,R,T,k,P,A,D,L,I,O,j,H,z,V,F,U,W;function M(e){t[19].call(null,e)}let q={name:"class-prefix",label:"Class Prefix:"};function J(e){t[20].call(null,e)}void 0!==t[6].classPrefix&&(q.value=t[6].classPrefix),a=new Wt({props:q}),N.push((()=>Z(a,"value",M)));let Q={name:"productOnly",label:"Product Only:"};function lt(e){t[21].call(null,e)}void 0!==t[6].productOnly&&(Q.value=t[6].productOnly),r=new Tt({props:Q}),N.push((()=>Z(r,"value",J)));let it={name:"displayCallToAction",label:"Display Call To Action:"};function rt(e){t[22].call(null,e)}void 0!==t[6].displayCallToAction&&(it.value=t[6].displayCallToAction),c=new Tt({props:it}),N.push((()=>Z(c,"value",lt)));let st={name:"number-of-items",label:"Number of Items",min:1,max:10};function ot(e){t[23].call(null,e)}void 0!==t[6].maxProductDisplayCount&&(st.value=t[6].maxProductDisplayCount),h=new It({props:st}),N.push((()=>Z(h,"value",rt)));let ct={name:"height",label:"Height (px)",min:200,max:800,step:10};function ut(e){t[24].call(null,e)}void 0!==t[9].height&&(ct.value=t[9].height),w=new It({props:ct}),N.push((()=>Z(w,"value",ot)));let dt={name:"width",label:"Width (%)",min:0,max:100};function ht(e){t[25].call(null,e)}void 0!==t[9].width&&(dt.value=t[9].width),E=new It({props:dt}),N.push((()=>Z(E,"value",ut)));let ft={label:"Carousel:",name:"hasCarousel"};function gt(e){t[26].call(null,e)}void 0!==t[6].hasCarousel&&(ft.value=t[6].hasCarousel),k=new Tt({props:ft}),N.push((()=>Z(k,"value",ht)));let mt={label:"Add To Cart Button:",name:"addToCart"};function pt(e){t[27].call(null,e)}void 0!==t[6].addToCart&&(mt.value=t[6].addToCart),D=new Tt({props:mt}),N.push((()=>Z(D,"value",gt)));let $t={name:"addToCartLabel",label:"Add To Cart Label:"};function vt(e){t[28].call(null,e)}void 0!==t[6].addToCartLabel&&($t.value=t[6].addToCartLabel),O=new Wt({props:$t}),N.push((()=>Z(O,"value",pt)));let bt={onToggle:t[11],label:"Show Star Rating:",name:"showStarRatings"};void 0!==t[6].showStarRatings&&(bt.value=t[6].showStarRatings),z=new Tt({props:bt}),N.push((()=>Z(z,"value",vt)));let wt=t[6].showStarRatings&&ce();return{c(){e=p("div"),n=v(),tt(a.$$.fragment),i=v(),tt(r.$$.fragment),o=v(),tt(c.$$.fragment),d=v(),tt(h.$$.fragment),$=v(),tt(w.$$.fragment),y=v(),tt(E.$$.fragment),T=v(),tt(k.$$.fragment),A=v(),tt(D.$$.fragment),I=v(),tt(O.$$.fragment),H=v(),tt(z.$$.fragment),F=v(),wt&&wt.c(),U=b()},l(t){e=C(t,"DIV",{}),x(e).forEach(g),n=S(t),et(a.$$.fragment,t),i=S(t),et(r.$$.fragment,t),o=S(t),et(c.$$.fragment,t),d=S(t),et(h.$$.fragment,t),$=S(t),et(w.$$.fragment,t),y=S(t),et(E.$$.fragment,t),T=S(t),et(k.$$.fragment,t),A=S(t),et(D.$$.fragment,t),I=S(t),et(O.$$.fragment,t),H=S(t),et(z.$$.fragment,t),F=S(t),wt&&wt.l(t),U=b()},m(t,l){f(t,e,l),f(t,n,l),nt(a,t,l),f(t,i,l),nt(r,t,l),f(t,o,l),nt(c,t,l),f(t,d,l),nt(h,t,l),f(t,$,l),nt(w,t,l),f(t,y,l),nt(E,t,l),f(t,T,l),nt(k,t,l),f(t,A,l),nt(D,t,l),f(t,I,l),nt(O,t,l),f(t,H,l),nt(z,t,l),f(t,F,l),wt&&wt.m(t,l),f(t,U,l),W=!0},p(t,e){const n={};!l&&64&e[0]&&(l=!0,n.value=t[6].classPrefix,B((()=>l=!1))),a.$set(n);const i={};!s&&64&e[0]&&(s=!0,i.value=t[6].productOnly,B((()=>s=!1))),r.$set(i);const o={};!u&&64&e[0]&&(u=!0,o.value=t[6].displayCallToAction,B((()=>u=!1))),c.$set(o);const d={};!m&&64&e[0]&&(m=!0,d.value=t[6].maxProductDisplayCount,B((()=>m=!1))),h.$set(d);const f={};!_&&512&e[0]&&(_=!0,f.value=t[9].height,B((()=>_=!1))),w.$set(f);const g={};!R&&512&e[0]&&(R=!0,g.value=t[9].width,B((()=>R=!1))),E.$set(g);const p={};!P&&64&e[0]&&(P=!0,p.value=t[6].hasCarousel,B((()=>P=!1))),k.$set(p);const $={};!L&&64&e[0]&&(L=!0,$.value=t[6].addToCart,B((()=>L=!1))),D.$set($);const v={};!j&&64&e[0]&&(j=!0,v.value=t[6].addToCartLabel,B((()=>j=!1))),O.$set(v);const b={};!V&&64&e[0]&&(V=!0,b.value=t[6].showStarRatings,B((()=>V=!1))),z.$set(b),t[6].showStarRatings?wt?64&e[0]&&Y(wt,1):(wt=ce(),wt.c(),Y(wt,1),wt.m(U.parentNode,U)):wt&&(G(),K(wt,1,1,(()=>{wt=null})),X())},i(t){W||(Y(a.$$.fragment,t),Y(r.$$.fragment,t),Y(c.$$.fragment,t),Y(h.$$.fragment,t),Y(w.$$.fragment,t),Y(E.$$.fragment,t),Y(k.$$.fragment,t),Y(D.$$.fragment,t),Y(O.$$.fragment,t),Y(z.$$.fragment,t),Y(wt),W=!0)},o(t){K(a.$$.fragment,t),K(r.$$.fragment,t),K(c.$$.fragment,t),K(h.$$.fragment,t),K(w.$$.fragment,t),K(E.$$.fragment,t),K(k.$$.fragment,t),K(D.$$.fragment,t),K(O.$$.fragment,t),K(z.$$.fragment,t),K(wt),W=!1},d(t){t&&g(e),t&&g(n),at(a,t),t&&g(i),at(r,t),t&&g(o),at(c,t),t&&g(d),at(h,t),t&&g($),at(w,t),t&&g(y),at(E,t),t&&g(T),at(k,t),t&&g(A),at(D,t),t&&g(I),at(O,t),t&&g(H),at(z,t),t&&g(F),wt&&wt.d(t),t&&g(U)}}}function de(t){let e,n,a,l,i,r,s,o,c,u;function d(e){t[29].call(null,e)}let m={class:"demo_headline_control",options:t[5],name:"widgetComponentStyle"};return void 0!==t[4]&&(m.value=t[4]),i=new zt({props:m}),N.push((()=>Z(i,"value",d))),c=new te({props:{sections:t[7],diagram:le[t[4]]}}),c.$on("tabChange",t[12]),{c(){e=p("header"),n=p("h4"),a=$("Widget Component Styles"),l=v(),tt(i.$$.fragment),s=v(),o=p("div"),tt(c.$$.fragment),this.h()},l(t){e=C(t,"HEADER",{class:!0});var r=x(e);n=C(r,"H4",{class:!0});var u=x(n);a=E(u,"Widget Component Styles"),u.forEach(g),l=S(r),et(i.$$.fragment,r),r.forEach(g),s=S(t),o=C(t,"DIV",{class:!0});var d=x(o);et(c.$$.fragment,d),d.forEach(g),this.h()},h(){_(n,"class","demo_headline_title svelte-1el12es"),_(e,"class","demo_headline svelte-1el12es"),_(o,"class","demo_config_block")},m(t,r){f(t,e,r),h(e,n),h(n,a),h(e,l),nt(i,e,null),f(t,s,r),f(t,o,r),nt(c,o,null),u=!0},p(t,e){const n={};32&e[0]&&(n.options=t[5]),!r&&16&e[0]&&(r=!0,n.value=t[4],B((()=>r=!1))),i.$set(n);const a={};128&e[0]&&(a.sections=t[7]),16&e[0]&&(a.diagram=le[t[4]]),c.$set(a)},i(t){u||(Y(i.$$.fragment,t),Y(c.$$.fragment,t),u=!0)},o(t){K(i.$$.fragment,t),K(c.$$.fragment,t),u=!1},d(t){t&&g(e),at(i),t&&g(s),t&&g(o),at(c)}}}function he(t){let e,n,a;var l=t[10];function i(t){return{props:{config:t[18],data:t[0]}}}return l&&(e=new l(i(t)),t[30](e)),{c(){e&&tt(e.$$.fragment),n=b()},l(t){e&&et(e.$$.fragment,t),n=b()},m(t,l){e&&nt(e,t,l),f(t,n,l),a=!0},p(t,a){const r={};if(1&a[0]&&(r.data=t[0]),l!==(l=t[10])){if(e){G();const t=e;K(t.$$.fragment,1,0,(()=>{at(t,1)})),X()}l?(e=new l(i(t)),t[30](e),tt(e.$$.fragment),Y(e.$$.fragment,1),nt(e,n.parentNode,n)):e=null}else l&&e.$set(r)},i(t){a||(e&&Y(e.$$.fragment,t),a=!0)},o(t){e&&K(e.$$.fragment,t),a=!1},d(a){t[30](null),a&&g(n),e&&at(e,a)}}}function fe(t){let e,n,a,l,i,r,s,o=``;const c=[se,re],u=[];function d(t,e){return null!=t[10]?0:1}return i=d(t),r=u[i]=c[i](t),{c(){n=b(),a=v(),l=p("section"),r.c(),this.h()},l(t){const e=function(t,e=document.body){return Array.from(e.querySelectorAll(t))}('[data-svelte="svelte-1gkxtdh"]',ie.head);n=b(),e.forEach(g),a=S(t),l=C(t,"SECTION",{class:!0});var i=x(l);r.l(i),i.forEach(g),this.h()},h(){e=new P(n),_(l,"class","demo svelte-1el12es")},m(t,r){e.m(o,ie.head),h(ie.head,n),f(t,a,r),f(t,l,r),u[i].m(l,null),s=!0},p(t,n){(!s||256&n[0])&&o!==(o=``)&&e.p(o);let a=i;i=d(t),i===a?u[i].p(t,n):(G(),K(u[a],1,1,(()=>{u[a]=null})),X(),r=u[i],r?r.p(t,n):(r=u[i]=c[i](t),r.c()),Y(r,1),r.m(l,null))},i(t){s||(Y(r),s=!0)},o(t){K(r),s=!1},d(t){g(n),t&&e.d(),t&&g(a),t&&g(l),u[i].d()}}}function ge(t,e=300){let n;return(...a)=>{clearTimeout(n),n=setTimeout((()=>{t.apply(this,a)}),e)}}function me(t,e,n){let a,l,i,r;s(t,Ct,(t=>n(6,a=t))),s(t,yt,(t=>n(9,l=t))),s(t,xt,(t=>n(32,i=t))),s(t,Et,(t=>n(33,r=t)));var o=this&&this.__awaiter||function(t,e,n,a){return new(n||(n=Promise))((function(l,i){function r(t){try{o(a.next(t))}catch(t){i(t)}}function s(t){try{o(a.throw(t))}catch(t){i(t)}}function o(t){var e;t.done?l(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(r,s)}o((a=a.apply(t,e||[])).next())}))};let c,{widgetData:u=null}=e,d=!0,h=!0,f="Product Card";const g=t=>{const e=new FileReader;e.readAsText(t.target.files[0]),e.onload=function(){const t=JSON.parse(e.result),n=t.config;xt.set(n.api),Ct.set(n.display),Et.set(n.redirect),yt.update((e=>(e.customCss=t.customCss,e)))}},m=(t,e)=>{const n=document.createElement("a");if(n.setAttribute("href","data:text/json;charset=utf-8,"+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))),n.setAttribute("download",t),document.createEvent){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0});n.dispatchEvent(t)}else n.click()},p=ge((t=>{c.setDisplayConfig(t)})),$=ge((t=>{c.setRedirectConfig(t)})),v={api:i,display:a,redirect:r};let b,w,_,y,x;return t.$$set=t=>{"widgetData"in t&&n(0,u=t.widgetData)},t.$$.update=()=>{64&t.$$.dirty[0]&&n(5,b=Object.entries(ae).reduce(((t,[e,n])=>("Article Summary"===e&&a.productOnly||"Carousel"===e&&!a.hasCarousel||"Static Product List"===e&&a.hasCarousel||"Publisher Tag"===e&&!a.productOnly||t.push([e,e]),t)),[])),64&t.$$.dirty[0]&&n(31,w=a.classPrefix),16&t.$$.dirty[0]&&n(7,_=ae[f]),512&t.$$.dirty[0]|1&t.$$.dirty[1]&&n(8,y=Object.entries(ne).filter((t=>l.customCss[t[0]])).map((t=>`.${w}_main .${w}_${t[1]} {\n${l.customCss[t[0]]}\n}`)).join("\n")),64&t.$$.dirty[0]&&p(a),4&t.$$.dirty[1]&&$(r)},n(10,x=window.AdvonCommerceWidget),[u,c,d,h,f,b,a,_,y,l,x,t=>{const e=t.detail;Ct.update((t=>e?Object.assign({},t,bt):Object.keys(bt).reduce(((t,e)=>(delete t[e],t)),Object.assign({},t))))},t=>{Array.from(document.getElementsByClassName("current_edit")).forEach((t=>{t.classList.remove("current_edit")}));const e=ne[t.detail];Array.from(document.getElementsByClassName(`${w}_${e}`)).forEach((t=>{t.classList.add("current_edit")}))},()=>o(void 0,void 0,void 0,(function*(){const t=document.createElement("input");if(t.setAttribute("type","file"),t.addEventListener("change",g,!1),document.createEvent){const e=new MouseEvent("click",{bubbles:!0,cancelable:!0});t.dispatchEvent(e)}else t.click()})),()=>o(void 0,void 0,void 0,(function*(){m("ee-widget-config.json",{config:{api:i,display:a,redirect:r},customCss:l.customCss})})),()=>o(void 0,void 0,void 0,(function*(){m("ee-widget-styles.css",y)})),()=>o(void 0,void 0,void 0,(function*(){n(2,d=!d)})),()=>o(void 0,void 0,void 0,(function*(){n(3,h=!h)})),v,function(t){a.classPrefix=t,Ct.set(a)},function(t){a.productOnly=t,Ct.set(a)},function(t){a.displayCallToAction=t,Ct.set(a)},function(t){a.maxProductDisplayCount=t,Ct.set(a)},function(t){l.height=t,yt.set(l)},function(t){l.width=t,yt.set(l)},function(t){a.hasCarousel=t,Ct.set(a)},function(t){a.addToCart=t,Ct.set(a)},function(t){a.addToCartLabel=t,Ct.set(a)},function(t){a.showStarRatings=t,Ct.set(a)},function(t){f=t,n(4,f)},function(t){N[t?"unshift":"push"]((()=>{c=t,n(1,c)}))}]}return class extends rt{constructor(t){super(),it(this,t,me,fe,r,{widgetData:0},[-1,-1])}get widgetData(){return this.$$.ctx[0]}set widgetData(t){this.$set({widgetData:t}),W()}}}();