Changeset 2770186
- Timestamp:
- 08/13/2022 07:02:12 PM (4 years ago)
- Location:
- user-post-collections
- Files:
-
- 14 edited
- 1 copied
-
tags/0.8.29 (copied) (copied from user-post-collections/trunk)
-
tags/0.8.29/classes/user-post-collections.php (modified) (1 diff)
-
tags/0.8.29/controllers/mg-list-page-alt.php (modified) (1 diff)
-
tags/0.8.29/javascript/mg-upc-client/dist/admin.js (modified) (1 diff)
-
tags/0.8.29/javascript/mg-upc-client/dist/css/styles.css (modified) (1 diff)
-
tags/0.8.29/javascript/mg-upc-client/dist/main.js (modified) (1 diff)
-
tags/0.8.29/readme.txt (modified) (2 diffs)
-
tags/0.8.29/user-post-collections.php (modified) (1 diff)
-
trunk/classes/user-post-collections.php (modified) (1 diff)
-
trunk/controllers/mg-list-page-alt.php (modified) (1 diff)
-
trunk/javascript/mg-upc-client/dist/admin.js (modified) (1 diff)
-
trunk/javascript/mg-upc-client/dist/css/styles.css (modified) (1 diff)
-
trunk/javascript/mg-upc-client/dist/main.js (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/user-post-collections.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
user-post-collections/tags/0.8.29/classes/user-post-collections.php
r2770005 r2770186 16 16 public $model; 17 17 18 const VERSION = '0.8.2 8';18 const VERSION = '0.8.29'; 19 19 20 20 /** -
user-post-collections/tags/0.8.29/controllers/mg-list-page-alt.php
r2770005 r2770186 481 481 return home_url( '/' . trim( $val, '/' ) . '/' . rawurlencode( $slug ) ); 482 482 } 483 return home_url( '/' . add_query_arg( array( 'list' => $slug), $val ) );483 return home_url( '/' . add_query_arg( array( 'list' => rawurlencode( $slug ) ), $val ) ); 484 484 } 485 485 } -
user-post-collections/tags/0.8.29/javascript/mg-upc-client/dist/admin.js
r2770005 r2770186 1 !function(){"use strict";var t,e,n,i,s,o,a,l={},r=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function u(t,e){for(var n in e)t[n]=e[n];return t}function d(t){var e=t.parentNode;e&&e.removeChild(t)}function p(e,n,i){var s,o,a,l={};for(a in n)"key"==a?s=n[a]:"ref"==a?o=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return _(e,l,s,o,null)}function _(t,i,s,o,a){var l={type:t,props:i,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function m(t){return t.children}function f(t,e){this.props=t,this.context=e}function g(t,e){if(null==e)return t.__?g(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?g(t):null}function h(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return h(t)}}function v(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!y.__r++||o!==e.debounceRendering)&&((o=e.debounceRendering)||s)(y)}function y(){for(var t;y.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,s,o,a;t.__d&&(o=(s=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=u({},s)).__v=s.__v+1,S(a,s,i,e.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,n,null==o?g(s):o,s.__h),T(n,s),s.__e!=o&&h(s)))}))}function b(t,e,n,i,s,o,a,c,u,d){var p,f,h,v,y,b,w,k=i&&i.__k||r,C=k.length;for(n.__k=[],p=0;p<e.length;p++)if(null!=(v=n.__k[p]=null==(v=e[p])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?_(null,v,null,null,v):Array.isArray(v)?_(m,{children:v},null,null,null):v.__b>0?_(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=k[p])||h&&v.key==h.key&&v.type===h.type)k[p]=void 0;else for(f=0;f<C;f++){if((h=k[f])&&v.key==h.key&&v.type===h.type){k[f]=void 0;break}h=null}S(t,v,h=h||l,s,o,a,c,u,d),y=v.__e,(f=v.ref)&&h.ref!=f&&(w||(w=[]),h.ref&&w.push(h.ref,null,v),w.push(f,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=P(v,u,t):u=N(t,v,h,k,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=g(h))}for(n.__e=b,p=C;p--;)null!=k[p]&&("function"==typeof n.type&&null!=k[p].__e&&k[p].__e==n.__d&&(n.__d=g(i,p+1)),L(k[p],k[p]));if(w)for(p=0;p<w.length;p++)E(w[p],w[++p],w[++p])}function P(t,e,n){for(var i,s=t.__k,o=0;s&&o<s.length;o++)(i=s[o])&&(i.__=t,e="function"==typeof i.type?P(i,e,n):N(n,i,i,s,i.__e,e));return e}function w(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){w(t,e)})):e.push(t)),e}function N(t,e,n,i,s,o){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||s!=o||null==s.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(s),a=null;else{for(l=o,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==s)break t;t.insertBefore(s,o),a=o}return void 0!==a?a:s.nextSibling}function k(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function C(t,e,n,i,s){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||k(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||k(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?I:x,o):t.removeEventListener(e,o?I:x,o);else if("dangerouslySetInnerHTML"!==e){if(s)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function x(t){this.l[t.type+!1](e.event?e.event(t):t)}function I(t){this.l[t.type+!0](e.event?e.event(t):t)}function S(t,n,i,s,o,a,l,r,c){var d,p,_,g,h,v,y,P,w,N,k,C=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(c=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof C){if(P=n.props,w=(d=C.contextType)&&s[d.__c],N=d?w?w.props.value:d.__:s,i.__c?y=(p=n.__c=i.__c).__=p.__E:("prototype"in C&&C.prototype.render?n.__c=p=new C(P,N):(n.__c=p=new f(P,N),p.constructor=C,p.render=D),w&&w.sub(p),p.props=P,p.state||(p.state={}),p.context=N,p.__n=s,_=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=C.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=u({},p.__s)),u(p.__s,C.getDerivedStateFromProps(P,p.__s))),g=p.props,h=p.state,_)null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==C.getDerivedStateFromProps&&P!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(P,N),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(P,p.__s,N)||n.__v===i.__v){p.props=P,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(P,p.__s,N),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}p.context=N,p.props=P,p.state=p.__s,(d=e.__r)&&d(n),p.__d=!1,p.__v=n,p.__P=t,d=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(s=u(u({},s),p.getChildContext())),_||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),k=null!=d&&d.type===m&&null==d.key?d.props.children:d,b(t,Array.isArray(k)?k:[k],n,i,s,o,a,l,r,c),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),y&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=A(i.__e,n,i,s,o,a,l,c);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(c||null!=a)&&(n.__e=r,n.__h=!!c,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function T(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function A(e,n,i,s,o,a,r,c){var u,p,_,m=i.props,f=n.props,h=n.type,v=0;if("svg"===h&&(o=!0),null!=a)for(;v<a.length;v++)if((u=a[v])&&"setAttribute"in u==!!h&&(h?u.localName===h:3===u.nodeType)){e=u,a[v]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=o?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),a=null,c=!1}if(null===h)m===f||c&&e.data===f||(e.data=f);else{if(a=a&&t.call(e.childNodes),p=(m=i.props||l).dangerouslySetInnerHTML,_=f.dangerouslySetInnerHTML,!c){if(null!=a)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,s){var o;for(o in n)"children"===o||"key"===o||o in e||C(t,o,null,n[o],i);for(o in e)s&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||C(t,o,e[o],n[o],i)}(e,f,m,o,c),_)n.__k=[];else if(v=n.props.children,b(e,Array.isArray(v)?v:[v],n,i,s,o&&"foreignObject"!==h,a,r,a?a[0]:i.__k&&g(i,0),c),null!=a)for(v=a.length;v--;)null!=a[v]&&d(a[v]);c||("value"in f&&void 0!==(v=f.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&C(e,"value",v,m.value,!1),"checked"in f&&void 0!==(v=f.checked)&&v!==e.checked&&C(e,"checked",v,m.checked,!1))}return e}function E(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function L(t,n,i){var s,o;if(e.unmount&&e.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||E(s,null,n)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(t){e.__e(t,n)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&L(s[o],n,"function"!=typeof t.type);i||null==t.__e||d(t.__e),t.__e=t.__d=void 0}function D(t,e,n){return this.constructor(t,n)}function O(n,i,s){var o,a,r;e.__&&e.__(n,i),a=(o="function"==typeof s)?null:s&&s.__k||i.__k,r=[],S(i,n=(!o&&s||i).__k=p(m,null,[n]),a||l,l,void 0!==i.ownerSVGElement,!o&&s?[s]:a?null:i.firstChild?t.call(i.childNodes):null,r,!o&&s?s:a?a.__e:i.firstChild,o),T(r,n)}t=r.slice,e={__e:function(t,e,n,i){for(var s,o,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(t)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(t,i||{}),a=s.__d),a)return s.__E=s}catch(e){t=e}throw t}},n=0,f.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},n),this.props)),t&&u(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),v(this))},f.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),v(this))},f.prototype.render=m,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y.__r=0,a=0;var R,U,W,$=0,H=[],M=e.__b,j=e.__r,B=e.diffed,F=e.__c,q=e.unmount;function X(t,n){e.__h&&e.__h(U,t,$||n),$=0;var i=U.__H||(U.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function K(t){return $=1,V(st,t)}function V(t,e,n){var i=X(R++,2);return i.t=t,i.__c||(i.__=[n?n(e):st(void 0,e),function(t){var e=i.t(i.__[0],t);i.__[0]!==e&&(i.__=[e,i.__[1]],i.__c.setState({}))}],i.__c=U),i.__}function Q(t,n){var i=X(R++,3);!e.__s&&it(i.__H,n)&&(i.__=t,i.__H=n,U.__H.__h.push(i))}function G(t){return $=5,z((function(){return{current:t}}),[])}function z(t,e){var n=X(R++,7);return it(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function J(t,e){return $=8,z((function(){return t}),e)}function Y(t){var e=U.context[t.__c],n=X(R++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(U)),e.props.value):t.__}function Z(){for(var t;t=H.shift();)if(t.__P)try{t.__H.__h.forEach(et),t.__H.__h.forEach(nt),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){U=null,M&&M(t)},e.__r=function(t){j&&j(t),R=0;var e=(U=t.__c).__H;e&&(e.__h.forEach(et),e.__h.forEach(nt),e.__h=[])},e.diffed=function(t){B&&B(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==H.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),tt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);tt&&(e=requestAnimationFrame(n))})(Z)),U=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(et),t.__h=t.__h.filter((function(t){return!t.__||nt(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),F&&F(t,n)},e.unmount=function(t){q&&q(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{et(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var tt="function"==typeof requestAnimationFrame;function et(t){var e=U,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),U=e}function nt(t){var e=U;t.__c=t.__(),U=e}function it(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function st(t,e){return"function"==typeof e?e(t):e}var ot=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t};const at="ui/reset",lt="ui/error",rt="ui/editing",ct="ui/mode",ut="listOfLists/set",dt="listOfLists/remove",pt="listOfLists/create",_t="listOfList/addingPost",mt="listOfList/setPage",ft="listOfList/setTotalPages",gt="list/set",ht="list/update",vt="list/setPage",yt="list/setTotalPages",bt="list/setItems",Pt="list/removeItem",wt="list/addItem",Nt="list/updateItem",kt="list/moveItem",Ct="list/cart";var xt=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Lt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Lt().ajaxUrl,e),i=await n.json();i.nonce&&(Lt().nonce=i.nonce),i.user_id&&(Lt().user_id=i.user_id)}const s={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Lt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(s.body=JSON.stringify(n));const o=await fetch(Lt().root+i+e,s);o.headers.get("x-wp-nonce")&&(Lt().nonce=o.headers.get("x-wp-nonce"));const a=await o.json();return{data:a,headers:o.headers,status:o.status}};function It(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Lt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class St extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function Tt(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var s;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new St(null==t||null===(s=t.data)||void 0===s?void 0:s.message,t)}let At={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt("GET","/My"+It(t),{}).then((function(t){return Tt(t),t}))},discover:function(t){return xt("GET","/"+It(t),{}).then((function(t){return Tt(t),t}))},get:function(t){return xt("GET","/"+t,{}).then((function(t){return Tt(t),t}))},cart:function(t){return xt("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return Tt(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt("GET","/"+t+"/items"+It(e),{}).then((function(t){return Tt(t),t}))},delete:function(t){return xt("DELETE","/"+t,{}).then((function(t){return Tt(t),t}))},create:function(t){return xt("POST","",t).then((function(t){return Tt(t),t}))},update:function(t){let e=t.id;return delete t.id,xt("PATCH","/"+e,t).then((function(t){return Tt(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),xt("POST","/"+t+"/items"+It(n),e).then((function(t){return Tt(t),t}))},quit:function(t,e){return xt("DELETE","/"+t+"/items/"+e,{}).then((function(t){return Tt(t),t}))},updateItem:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,n).then((function(t){return Tt(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return xt("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return Tt(t),t}))},move:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return Tt(t),t}))}};var Et=At;function Lt(){return MgUserPostCollections}function Dt(){var t;return null===(t=Lt())||void 0===t?void 0:t.sortable}function Ot(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Rt(){var t;return Object.values(null===(t=Lt())||void 0===t?void 0:t.statuses)}function Ut(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function Wt(t,e){return!!t.type&&Ht(t.type,e)}function $t(t){var e;const n=[],i=null===(e=Lt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(Ht(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function Ht(t,e){const n=Ot(t);return!(!n||!n.supports)&&n.supports.includes(e)}const Mt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function jt(t){return JSON.parse(JSON.stringify(t))}function Bt(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Ft(t,e){const{type:n,payload:i}=e;let s=!1;const o=t=>(s=a({status:"failed"}),t.error&&(s.error=t.error.message?t.error.message:"",s.errorCode=t.error.code?t.error.code:""),s),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=jt(t)),e)for(const t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);return s};let l=function(t,e){const{type:n,payload:i}=e;let s,o;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=!1===t?{}:jt(t)),e)for(const t in e)o[t]=e[t];return o};switch(n){case gt:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case ht:return i.items=jt(t.items),i;case pt:return i;case bt:return a({items:i});case"list/addItem/failed":case wt:return null!=i&&i.list?a(i.list):t;case Nt:const e=!!i.item&&i.item;return s=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:s});case Pt:if(1===t.items.length||!1===i)return t;if(o=a(),s=o.items.filter((t=>t.post_id!==i)),Ht(t.type,"sortable")){const e=parseInt(t.items[0].position,10);s.forEach(((t,n)=>{s[n].position=e+n}))}if(Ht(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(o.vote_counter=o.vote_counter-e.votes)}return{...o,items:s};case kt:const n=parseInt(t.items[0].position,10);s=a().items.slice();const l=a().items[i.oldIndex];return s.splice(i.oldIndex,1),s.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(s.forEach(((t,e)=>{s[e].position=n+e})),a({items:s}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case ut:return i;case wt:case gt:return!1;case dt:return!1===i?t:jt(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(s=a({listOfList:r,list:l}),t.addingPost||(s.title=s.list?s.list.title:Vt.title)),n){case ct:return a({mode:i});case at:return{...Vt,mode:t.mode};case lt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case"ui/message":return a(!1===i?{message:!1,errorCode:!1}:{message:i});case Ct:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case rt:return a({editing:i});case _t:return s=a(),s.addingPost=i,i&&(s.title="Add to..."),s;case pt:s=a(),s.title=i.title?i.title:Vt.title,s.listTotalPages=1,s.listPage=1,s.addingPost=!1;break;case wt:if(s=a(),null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Vt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(s.error=i.message,s.status="failed"),s.addingPost=!1;break;case mt:return a({page:i});case ft:return a({totalPages:i});case vt:return a({listPage:i});case yt:return a({listTotalPages:i});case"list/set/loading":return s=a(),s.status="loading",s.listOfList=!1,"object"==typeof i?(s.list=i,i.title&&(s.title=i.title)):s.list={ID:i},s;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case pt+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return s=a(),s.addingPost=!1,s.status="succeeded",s.error=!1,s.errorCode=!1,s.title=s.list?s.list.title:Vt.title,s;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case pt+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case pt+"/failed":return s=a({status:"failed"}),e.error&&e.error.message&&(s.error=e.error.message),s;case"list/addItem/failed":if(s=a(),s.addingPost=!1,s.title=s.list?s.list.title:Vt.title,null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Vt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(s.error=i.message,s.status="failed"),o(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return o(e)}return!1!==s?s:t}const qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:s}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Kt=(t,e)=>n=>{let i;if((s=n)&&"object"==typeof s&&!0===s.asyncThunk){let s={dispatch:Kt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,s)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var s;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Vt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:ot("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},Qt=function(t,e){var n={__c:e="__cC"+a++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(v)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function Gt(t){return new Date(t).toLocaleDateString()}var zt,Jt,Yt,Zt=function(t){const{state:e,dispatch:n}=Y(Qt);return p("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),p("div",{className:"mg-upc-dg-item-title"},p("span",null,t.list.title),"my"!==e.mode&&p(m,null,p("span",null,p("a",{href:"#",onClick:function(e){Bt(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),p("span",{className:"mg-upc-list-dates"},p("i",null," ",p("b",null,"Created:")," ",Gt(t.list.created)),p("i",null," ",p("b",null,"Modified:")," ",Gt(t.list.modified)))))),p("span",{className:"mg-upc-dg-item-count"},t.list.count),p("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&p("button",{"aria-label":ot("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},p("span",{className:"mg-upc-icon upc-font-trash"}))))};class te extends f{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(p("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return p("span",null,e?t.map(((t,n)=>p(e,{key:n},t,""))):t)}}Yt={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(Jt="defaultProps")in(zt=te)?Object.defineProperty(zt,Jt,{value:Yt,enumerable:!0,configurable:!0,writable:!0}):zt[Jt]=Yt;var ee=function(t){return p("div",{className:"mg-upc-dg-pagination-div"},p("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":ot("Previous page"),title:ot("Previous page"),onClick:t.onPreview},p("span",{className:"mg-upc-icon upc-font-arrow_left"})),p("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),p("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":ot("Next page"),title:ot("Next page"),onClick:t.onNext},p("span",{className:"mg-upc-icon upc-font-arrow_right"})))};const ne=()=>({type:at,payload:null}),ie=t=>({type:_t,payload:t}),se=t=>({type:rt,payload:t}),oe=qt(Ct,(async function(t,e){return await function(t){return Et.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}(t)})),ae=qt(ut,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Et.my(t).then((t=>re(t,e,i)))})),le=qt(ut,(async function(t,e){return null===t&&(t={}),await Et.discover(t).then((t=>re(t,e,!1)))}));function re(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(ue(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(de(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},s={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in s){const n=t.headers.get(e);n&&(i[s[e]]=decodeURIComponent(n))}e.dispatch(ie(i))}return t.data}const ce=qt(dt,(async function(t,e){return await Et.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(ae({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(ae({page:n-1}))}return!1}return t}))})),ue=t=>({type:mt,payload:t}),de=t=>({type:ft,payload:t}),pe=t=>({type:vt,payload:t}),_e=t=>({type:yt,payload:t}),me=qt(gt,(async function(t,e){return!1===t||!0===t?t:await Et.get("object"==typeof t?t.ID:t).then((t=>(ke(t,e.dispatch),t.data)))})),fe=qt(ht,(async function(t,e){return await Et.update(t).then((t=>(e.dispatch(se(!1)),ke(t,e.dispatch),t.data)))})),ge=qt(pt,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(ie({id:t.addingPost})),await Et.create(t).then((t=>(e.dispatch(se(!1)),ke(t,e.dispatch),t.data)))})),he=qt(bt,(async function(t,e){return await Et.items(e.getState().list.ID,t).then((t=>(ke(t,e.dispatch),t.data)))})),ve=qt(Pt,(async function(t,e){const n=e.getState();return await Et.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(he({page:t})):t===i&&e.dispatch(he({page:Math.max(1,t-1)})),!1}return t}))})),ye=qt(wt,(async function(t,e){let n=e.extra[0],i=!1;try{await Et.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var s;const n=null==t||null===(s=t.response)||void 0===s?void 0:s.data;i=e.rejectWithValue(n)}return i})),be=qt(Nt,(async function(t,e){const n=e.extra[0];return await Et.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),Pe=qt(kt,(async function(t,e){const n=e.extra[0],i=e.extra[1],s=n.items[t],o=s.position-t+i;return await Et.move(n.ID,s.post_id,o).then((e=>({oldIndex:t,newIndex:i})))})),we=qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Et.move(n.ID,s.post_id,i+1),await e.dispatch(he({page:e.getState().listPage})),t})),Ne=qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Et.move(n.ID,s.post_id,i-1),await e.dispatch(he({page:e.getState().listPage})),t}));function ke(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(pe(parseInt(t.headers.get("x-wp-page"),10))),e(_e(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(pe(parseInt(t.data.items_page["X-WP-Page"],10))),e(_e(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}var Ce=function(t){const{state:e,dispatch:n}=Y(Qt);return p(m,null,p("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>p("li",{className:"mg-upc-dg-item-list"},p("div",null,p(te,{width:"1.5em",height:"1.5em"})),p("div",{className:"mg-upc-dg-item-title"},p(te,null)),p("div",{className:"mg-upc-dg-item-count"},p(te,null)))))),p("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>p(Zt,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&p(ee,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},xe=function(t){var e,n,i;const[s,o]=K(!1),[a,l]=K(""),r=G({});return Q((()=>{l(t.item.description)}),[t.item]),Q((()=>{s&&r.current.focus()}),[s]),p(m,null,p("span",null,p("br",null),"Adding item:"),p("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null," "),p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:Mt}),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!s&&p("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!s&&p("button",{onClick:()=>{o(!0)}},""===a&&p("span",null,ot("Add Comment")),""!==a&&p("span",null,ot("Edit Comment"))),p("input",{ref:r,className:s?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),s&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{o(!1),l(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,ot("Cancel"))),s&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{o(!1),t.onSaveItemDescription(a)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,ot("Save"))))),p("span",null,ot("Select where the item will be added:")))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ie.apply(this,arguments)}function Se(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Te(t){this.props=t}(Te.prototype=new f).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(t,e){return Se(this.props,t)||Se(this.state,e)};var Ae=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ae&&Ae(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ee=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var s,o=e;o=o.__;)if((s=o.__c)&&s.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),s.__c(t,e);Ee(t,e,n,i)};var Le=e.unmount;function De(){this.__u=0,this.t=null,this.__b=null}function Oe(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Re(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),Le&&Le(t)},(De.prototype=new f).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var s=Oe(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,s?s(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__e){var t=i.state.__e;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__e:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(a,a)},De.prototype.componentWillUnmount=function(){this.t=[]},De.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var s=e.__e&&p(m,null,t.fallback);return s&&(s.__h=null),[p(m,null,e.__e?null:t.children),s]};var Ue=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function We(t){return this.getChildContext=function(){return t.context},t.children}function $e(t){var e=this,n=t.i;e.componentWillUnmount=function(){O(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),O(p(We,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Re.prototype=new f).__e=function(t){var e=this,n=Oe(e.__v),i=e.o.get(t);return i[0]++,function(s){var o=function(){e.props.revealOrder?(i.push(s),Ue(e,t,i)):s()};n?n(o):o()}},Re.prototype.render=function(t){this.u=null,this.o=new Map;var e=w(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Re.prototype.componentDidUpdate=Re.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ue(t,n,e)}))};var He="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,je="undefined"!=typeof document,Be=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};f.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(f.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Fe=e.event;function qe(){}function Xe(){return this.cancelBubble}function Ke(){return this.defaultPrevented}e.event=function(t){return Fe&&(t=Fe(t)),t.persist=qe,t.isPropagationStopped=Xe,t.isDefaultPrevented=Ke,t.nativeEvent=t};var Ve={configurable:!0,get:function(){return this.class}},Qe=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var s=-1===e.indexOf("-");for(var o in i={},n){var a=n[o];je&&"children"===o&&"noscript"===e||"value"===o&&"defaultValue"in n&&null==a||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===a?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!Be(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():s&&Me.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),i[o]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=w(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=w(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Ve.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Ve))}t.$$typeof=He,Qe&&Qe(t)};var Ge=e.__r;e.__r=function(t){Ge&&Ge(t),t.__c};var ze=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Je(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ye(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function Ze(t){(t.querySelector("[autofocus]")||t).focus()}function tn(){Ye("[data-a11y-dialog]").forEach((function(t){new Je(t)}))}Je.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ye('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ye("[data-a11y-dialog-hide]",this.$el).concat(Ye('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Je.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,Ze(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Je.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Je.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Je.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Je.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Je.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Je.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&27===t.which&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&9===t.which&&function(t,e){var n=function(t){return Ye(ze.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Je.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||Ze(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",tn):window.requestAnimationFrame?window.requestAnimationFrame(tn):window.setTimeout(tn,16));(t=>{const e=(()=>{const[t,e]=K(!1);return Q((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=K(null);return[t,J((t=>{null!==t&&e(new Je(t))}),[])]})(),i=J((()=>e.hide()),[e]),s=t.role||"dialog",o="alertdialog"===s,a=t.titleId||t.id+"-title";return Q((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:s,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:o?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:s}=t;if(Q((()=>(n&&s(n),()=>s(void 0))),[s,n]),!e)return null;const o=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=p("h2",Ie({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&p("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=p("button",Ie({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=p($e,{__v:t,i:e});return n.containerInfo=e,n}(p("div",Ie({},i.container,{className:t.classNames.container}),p("div",Ie({},i.overlay,{className:t.classNames.overlay})),p("div",Ie({},i.dialog,{className:t.classNames.dialog}),r)),o)}).defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}};var en=function(t){var e;const[n,i]=K(""),[s,o]=K(""),[a,l]=K(""),[r,c]=K(""),u=z((()=>$t(t.addingPost)),[t.addingPost]);function d(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&d(u[0]),Q((()=>{i(t.list.title),o(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),Q((()=>{var t;null!==(t=Ot(a))&&void 0!==t&&t.available_statuses&&-1===Ot(a).available_statuses.indexOf(r)&&c(Ot(a).available_statuses[0])}),[a]),p("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&p(m,null,p("label",null,ot("Select a list type:")),p("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>p("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>d(t),onKeyPress:e=>{13===e.keyCode&&d(t)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,t.label),p("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&Ht(a,"editable_title")&&p(m,null,p("label",{htmlFor:`title-${t.list.ID}`},ot("Title")),p("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&Ht(a,"editable_content")&&p(m,null,p("label",{htmlFor:`content-${t.list.ID}`},ot("Description")),p("textarea",{id:`content-${t.list.ID}`,value:s,onChange:function(t){o(t.target.value)},maxLength:500}),p("span",{className:"mg-upc-dg-list-desc-edit-count"},p("i",null,null==s?void 0:s.length),"/500")),""!==a&&!Ot(a)&&p("span",null,ot("Unknown List Type...")),""!==a&&(null===(e=Ot(a))||void 0===e?void 0:e.available_statuses)&&Ot(a).available_statuses.length>1&&p(m,null,p("label",{htmlFor:`status-${t.list.ID}`},ot("Status")),p("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ot(a).available_statuses.map(((t,e)=>{if(function(t){const e=Ut(t);return e&&e.show_in_status_list}(t))return p("option",{value:t},function(t){const e=Ut(t);return e?e.label:t}(t))})))),""!==a&&Ot(a)&&p("div",{className:"mg-upc-dg-edit-actions"},p("button",{onClick:()=>t.onSave({title:n,content:s,type:a,status:r})},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,ot("Save"))),p("button",{onClick:()=>t.onCancel()},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,ot("Cancel")))))},nn=function(t){var e;const[n,i]=K(!1),[s,o]=K(""),[a,l]=K(null===(e=t.item)||void 0===e?void 0:e.quantity),r=G({});Q((()=>{o(t.item.description)}),[t.item]),Q((()=>{n&&r.current.focus()}),[n]);const c=G(!1);return Q((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),p("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},Wt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),p("span",{className:"mg-upc-dg-item-number"},t.item.position)),Wt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return Wt(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),p("a",{href:t.item.link},p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:Mt})),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:t.item.link},t.item.title),t.item.price_html&&p("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&p("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&p("p",null,t.item.description),t.editable&&!n&&Wt(t.list,"editable_item_description")&&p("button",{onClick:()=>{i(!0)}},p("span",{className:"mg-upc-icon upc-font-edit"}),""===s&&p("span",null,ot("Add Comment")),""!==s&&p("span",null,ot("Edit Comment"))),p("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:s,onChange:function(t){o(t.target.value)},maxLength:400}),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),o(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,ot("Cancel"))),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(s)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,ot("Save")))),t.editable&&Wt(t.list,"quantity")&&p("div",{className:"mg-upc-dg-quantity"},p("small",null,ot("Quantity")),p("input",{"aria-label":ot("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&p("div",null,p("button",{"aria-label":"Remove item",onClick:t.onRemove},p("span",{className:"mg-upc-icon upc-font-trash"}))))},sn=function(t){return new Promise((function(e,n){const i=document.createElement("script");let s=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){s||this.readyState&&"complete"!=this.readyState||(s=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},on=function(t){var e,n,i;const s=G(null),o=G((e=>{t.onMove(e)}));return Q((()=>{o.current=t.onMove})),Q((()=>{let e=!1;if(Wt(t.list,"sortable")){const t=()=>{e=Sortable.create(s.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){o.current(t)}})};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),p(m,null,p("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>p("li",{className:"mg-upc-dg-item"},Wt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",p(te,{width:"1.5em"})," "),p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(te,{width:"1em"})," ")),Wt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(te,{width:"1em"})," ")),p("div",{className:"mg-upc-dg-item-skeleton-image"},p(te,{width:"5em",height:"5em"})),p("div",{className:"mg-upc-dg-item-data"},p(te,{count:2})))))),p("ul",{ref:s,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&p("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>p(nn,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),Wt(t.list,"vote")&&p("span",{className:"mg-upc-dg-total-votes"}," ",ot("Total votes:")," ",p("span",null," ",t.list.vote_counter)))},an=function(t){const e=G(null),n=G(null),i=ot("Copy"),[s,o]=K(i);Q((()=>{let t=null;s!==i&&(t=setTimeout((()=>{o(i),clearTimeout(t)}),2e3))}),[s]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:ot("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Lt().shareButtons&&(r=r.filter((t=>Lt().shareButtons.includes(t.slug||t.name.toLowerCase())))),p("div",{className:"mg-upc-dg-share-link"},p("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),p("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?o(ot("Copied!")):o("Error!")}},p("span",{className:"mg-upc-icon upc-font-copy"}),p("span",null,s)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),p("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},p("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},ln=function(t){var e;const{state:n,dispatch:i}=Y(Qt),[s,o]=K(!1),a=G(!1),l=G(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(he({page:t}))}return Q((()=>{const t=n.list;let e=!1,s=!1;if(t&&Wt(t,"sortable")){const t=()=>{n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(we(t.oldIndex))}})),n.listPage>1&&(s=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(Ne(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy(),s&&s.destroy()}}),[n.list,n.listPage,n.listTotalPages]),Q((()=>{o(!1)}),[n.editing,n.list,n.addingPost]),p(m,null,n.editing&&p(en,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const s={};s.title=t.title,s.content=t.content,s.type=t.type,s.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(s.adding=n.addingPost.post_id),i(ge(s))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(fe(e))}},onCancel:function(){i(se(!1)),-1===n.list.ID&&(i(me(!1)),i(ne()),i(ae()))}}),!n.editing&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return Ht(i,"editable_title")||Ht(i,"editable_content")||(null===(e=Ot(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&p("button",{className:"mg-upg-edit",onClick:()=>i(se(!0))},p("span",{className:"mg-upc-icon upc-font-edit"}),p("span",null,ot("Edit"))),n.list.link&&p("button",{className:"mg-upg-share",onClick:()=>o(!s)},p("span",{className:"mg-upc-icon upc-font-share"}),p("span",null,ot("Share"))),"cart"===n.list.type&&p("button",{className:"mg-upg-share",onClick:function(){i(oe(n.list.ID))}},p("span",{className:"mg-upc-icon upc-font-cart"}),p("span",null,ot("Add all to cart")))),s&&n.list.link&&p(an,{link:n.list.link,title:n.list.title}),n.list.content&&p("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:(c=n.list.content,"string"!=typeof c?"":c.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2"))}}),p(te,{count:3}),p(on,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(Pe(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ve(e.post_id))},onSaveItemDescription:function(t,e,n){i(be(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(be(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&p(ee,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}));var c};O(p((t=>{const[e,n]=V(Ft,Vt);return p(Qt.Provider,{value:{state:e,dispatch:Kt(n,(()=>e))}},t.children)}),null,p((function(){const{state:t,dispatch:e}=Y(Qt),[n,i]=K("any"),[s,o]=K("any"),[a,l]=K(""),[r,c]=K(null),u=G(!1),d=z((()=>$t(t.addingPost)),[t.addingPost]),_=z((()=>{return Object.values(null===(t=Lt())||void 0===t?void 0:t.types);var t}),[]);let f="listOfList";if(t.addingPost)f=t.editing?"addingToNew":"adding";else if(t.editing){var g;f=-1!==(null===(g=t.list)||void 0===g?void 0:g.ID)?"edit":"new"}else f=t.list?"list":"listOfList";Q((()=>{window.showMainLists=function(){e(ne()),h()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(ne()),n||P(t)}}),[e]);const h=()=>{const i={};n&&(i.types=n),s&&(i.status=s),r&&(i.search=r),a&&(i.author=a),t.page>1&&(i.page=t.page),e(le(i))};function v(){t.page>1&&e(ue(1))}function y(t){v(),i(t)}function b(t){v(),o(t)}Q((()=>{Vt.title="",e({type:ct,payload:"admin"});const t=function(t){const n=parseInt(("author",new URLSearchParams(document.location.hash.substring(1)).get("author")),10);n>0&&n!==a&&(t&&Bt(t),e(ue(1)),l(n),location.hash="")};return t(0),window.addEventListener("hashchange",t,!1),()=>{window.removeEventListener("hashchange",t)}}),[]),Q((()=>{t.list||h()}),[n,s,a,t.page]),Q((()=>{null!=r&&(clearTimeout(u.current),u.current=setTimeout((function(){h()}),300))}),[r]);const P=t=>{e(ie({post_id:t})),e(ae({addingPost:t}))};function w(n){n<1||n>t.totalPages||"loading"===t.status||e(ue(n))}const N=p("h2",{key:"title"},("list"===f||"new"===f||"edit"===f||"addingToNew"===f)&&p("a",{"aria-label":"Back",className:"mg-upc-dg-back",href:"#",onClick:n=>{n.preventDefault(),function(){switch(f){case"list":e(me(!1)),h();break;case"new":e(me(!1)),e(se(!1)),h();break;case"edit":e(se(!1));break;case"addingToNew":e(me(!1)),e(se(!1)),e(ae({addingPost:t.addingPost.post_id}));break;default:h()}}()}},"←")," ",t.title);return p(m,null,N,p("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+f},p("div",{className:"mg-upc-dg-wait"}),t.error&&p("div",{className:"mg-upc-dg-error"},t.error,p("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:lt,payload:null})}},p("span",{className:"mg-upc-icon upc-font-close"}))),p("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&p(xe,{item:t.addingPost,onSaveItemDescription:function(n){e(ie({...t.addingPost,description:n}))}}),("listOfList"===f||"adding"===f)&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},d.length>0&&p("button",{className:"mg-list-new",onClick:function(t){e(se(!0)),e(me(!0))}},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null,ot("Create List")))),p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Types"))),p("li",{className:"any"==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",onClick:()=>y("any"),onKeyPress:t=>{13===t.keyCode&&y("any")},tabIndex:"0"},p("i",{className:"mg-upc-icon upc-font-close mg-upc-dg-item-type mg-upc-dg-item-type-none"}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,"All"))),_.map(((t,e)=>p("li",{className:t.name==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",key:t.name,onClick:()=>y(t.name),onKeyPress:e=>{13===e.keyCode&&y(t.name)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,t.label)))))),Rt()&&p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Status"))),p("li",{className:"any"==s?"mg-upc-selected":"",onClick:()=>b("any"),onKeyPress:t=>{13===t.keyCode&&b("any")},tabIndex:"0"},p("div",{className:"mg-upc-dg-item-title"},p("strong",null,"All"))),Rt().map(((t,e)=>p("li",{className:t.name==s?"mg-upc-selected":"",key:t.name,onClick:()=>b(t.name),onKeyPress:e=>{13===e.keyCode&&b(t.name)},tabIndex:"0"},t.label)))),p("div",{className:"mg-upc-dg-df"},p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Search"))),p("input",{onChange:function(t){v(),c(t.target.value)},value:r})),p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Author (ID)"))),p("input",{type:"number",onChange:function(t){v(),l(t.target.value)},value:a}))),p(Ce,{lists:t.listOfList,onSelect:function(n){e(se(!1)),t.addingPost?e(ye(n.ID,t.addingPost)):e(me(n))},onRemove:!t.addingPost&&function(t){e(ce(t.ID))},loadPreview:function(){w(t.page-1)},loadNext:function(){w(t.page+1)}})),t.list&&p(ln,{editable:(t.list,!0)}))))}),null)," "),document.getElementById("mg-upc-admin-app")),setTimeout(window.showMainLists,1e3)}();1 (()=>{"use strict";var t,e,n,i,s,o,a={},l=[],r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c(t,e){for(var n in e)t[n]=e[n];return t}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function d(e,n,i){var s,o,a,l={};for(a in n)"key"==a?s=n[a]:"ref"==a?o=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return p(e,l,s,o,null)}function p(t,i,s,o,a){var l={type:t,props:i,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function _(t){return t.children}function m(t,e){this.props=t,this.context=e}function f(t,e){if(null==e)return t.__?f(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?f(t):null}function g(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return g(t)}}function h(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!v.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||setTimeout)(v)}function v(){for(var t;v.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,s,o,a;t.__d&&(o=(s=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=c({},s)).__v=s.__v+1,I(a,s,i,e.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,n,null==o?f(s):o,s.__h),S(n,s),s.__e!=o&&g(s)))}))}function y(t,e,n,i,s,o,r,c,u,d){var m,g,h,v,y,P,k,w=i&&i.__k||l,C=w.length;for(n.__k=[],m=0;m<e.length;m++)if(null!=(v=n.__k[m]=null==(v=e[m])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?p(null,v,null,null,v):Array.isArray(v)?p(_,{children:v},null,null,null):v.__b>0?p(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=w[m])||h&&v.key==h.key&&v.type===h.type)w[m]=void 0;else for(g=0;g<C;g++){if((h=w[g])&&v.key==h.key&&v.type===h.type){w[g]=void 0;break}h=null}I(t,v,h=h||a,s,o,r,c,u,d),y=v.__e,(g=v.ref)&&h.ref!=g&&(k||(k=[]),h.ref&&k.push(h.ref,null,v),k.push(g,v.__c||y,v)),null!=y?(null==P&&(P=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=b(v,u,t):u=N(t,v,h,w,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=f(h))}for(n.__e=P,m=C;m--;)null!=w[m]&&("function"==typeof n.type&&null!=w[m].__e&&w[m].__e==n.__d&&(n.__d=f(i,m+1)),E(w[m],w[m]));if(k)for(m=0;m<k.length;m++)A(k[m],k[++m],k[++m])}function b(t,e,n){for(var i,s=t.__k,o=0;s&&o<s.length;o++)(i=s[o])&&(i.__=t,e="function"==typeof i.type?b(i,e,n):N(n,i,i,s,i.__e,e));return e}function P(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){P(t,e)})):e.push(t)),e}function N(t,e,n,i,s,o){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||s!=o||null==s.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(s),a=null;else{for(l=o,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==s)break t;t.insertBefore(s,o),a=o}return void 0!==a?a:s.nextSibling}function k(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||r.test(e)?n:n+"px"}function w(t,e,n,i,s){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||k(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||k(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?x:C,o):t.removeEventListener(e,o?x:C,o);else if("dangerouslySetInnerHTML"!==e){if(s)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function C(t){this.l[t.type+!1](e.event?e.event(t):t)}function x(t){this.l[t.type+!0](e.event?e.event(t):t)}function I(t,n,i,s,o,a,l,r,u){var d,p,f,g,h,v,b,P,N,k,w,C,x,I=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(u=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof I){if(P=n.props,N=(d=I.contextType)&&s[d.__c],k=d?N?N.props.value:d.__:s,i.__c?b=(p=n.__c=i.__c).__=p.__E:("prototype"in I&&I.prototype.render?n.__c=p=new I(P,k):(n.__c=p=new m(P,k),p.constructor=I,p.render=L),N&&N.sub(p),p.props=P,p.state||(p.state={}),p.context=k,p.__n=s,f=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=c({},p.__s)),c(p.__s,I.getDerivedStateFromProps(P,p.__s))),g=p.props,h=p.state,f)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&P!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(P,k),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(P,p.__s,k)||n.__v===i.__v){p.props=P,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(P,p.__s,k),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}if(p.context=k,p.props=P,p.__v=n,p.__P=t,w=e.__r,C=0,"prototype"in I&&I.prototype.render)p.state=p.__s,p.__d=!1,w&&w(n),d=p.render(p.props,p.state,p.context);else do{p.__d=!1,w&&w(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++C<25);p.state=p.__s,null!=p.getChildContext&&(s=c(c({},s),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),x=null!=d&&d.type===_&&null==d.key?d.props.children:d,y(t,Array.isArray(x)?x:[x],n,i,s,o,a,l,r,u),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=T(i.__e,n,i,s,o,a,l,u);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(u||null!=a)&&(n.__e=r,n.__h=!!u,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function S(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function T(e,n,i,s,o,l,r,c){var d,p,_,m=i.props,g=n.props,h=n.type,v=0;if("svg"===h&&(o=!0),null!=l)for(;v<l.length;v++)if((d=l[v])&&"setAttribute"in d==!!h&&(h?d.localName===h:3===d.nodeType)){e=d,l[v]=null;break}if(null==e){if(null===h)return document.createTextNode(g);e=o?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,g.is&&g),l=null,c=!1}if(null===h)m===g||c&&e.data===g||(e.data=g);else{if(l=l&&t.call(e.childNodes),p=(m=i.props||a).dangerouslySetInnerHTML,_=g.dangerouslySetInnerHTML,!c){if(null!=l)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,s){var o;for(o in n)"children"===o||"key"===o||o in e||w(t,o,null,n[o],i);for(o in e)s&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||w(t,o,e[o],n[o],i)}(e,g,m,o,c),_)n.__k=[];else if(v=n.props.children,y(e,Array.isArray(v)?v:[v],n,i,s,o&&"foreignObject"!==h,l,r,l?l[0]:i.__k&&f(i,0),c),null!=l)for(v=l.length;v--;)null!=l[v]&&u(l[v]);c||("value"in g&&void 0!==(v=g.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&w(e,"value",v,m.value,!1),"checked"in g&&void 0!==(v=g.checked)&&v!==e.checked&&w(e,"checked",v,m.checked,!1))}return e}function A(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function E(t,n,i){var s,o;if(e.unmount&&e.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||A(s,null,n)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(t){e.__e(t,n)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&E(s[o],n,"function"!=typeof t.type);i||null==t.__e||u(t.__e),t.__e=t.__d=void 0}function L(t,e,n){return this.constructor(t,n)}function D(n,i,s){var o,l,r;e.__&&e.__(n,i),l=(o="function"==typeof s)?null:s&&s.__k||i.__k,r=[],I(i,n=(!o&&s||i).__k=d(_,null,[n]),l||a,a,void 0!==i.ownerSVGElement,!o&&s?[s]:l?null:i.firstChild?t.call(i.childNodes):null,r,!o&&s?s:l?l.__e:i.firstChild,o),S(r,n)}t=l.slice,e={__e:function(t,e,n,i){for(var s,o,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(t)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(t,i||{}),a=s.__d),a)return s.__E=s}catch(e){t=e}throw t}},n=0,m.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c({},this.state),"function"==typeof t&&(t=t(c({},n),this.props)),t&&c(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),h(this))},m.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),h(this))},m.prototype.render=_,i=[],v.__r=0,o=0;var O,U,R,W,$=0,H=[],M=[],j=e.__b,B=e.__r,F=e.diffed,V=e.__c,q=e.unmount;function X(t,n){e.__h&&e.__h(U,t,$||n),$=0;var i=U.__H||(U.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:M}),i.__[t]}function K(t){return $=1,Q(ot,t)}function Q(t,e,n){var i=X(O++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):ot(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=U,!i.__c.u)){i.__c.__H.u=!0;var s=i.__c.shouldComponentUpdate;i.__c.shouldComponentUpdate=function(t,e,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(t){return t.__c}));return(o.every((function(t){return!t.__N}))||!o.every((function(t){if(!t.__N)return!0;var e=t.__[0];return t.__=t.__N,t.__N=void 0,e===t.__[0]})))&&(!s||s(t,e,n))}}return i.__N||i.__}function G(t,n){var i=X(O++,3);!e.__s&&st(i.__H,n)&&(i.__=t,i.i=n,U.__H.__h.push(i))}function z(t){return $=5,J((function(){return{current:t}}),[])}function J(t,e){var n=X(O++,7);return st(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Y(t,e){return $=8,J((function(){return t}),e)}function Z(t){var e=U.context[t.__c],n=X(O++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(U)),e.props.value):t.__}function tt(){for(var t;t=H.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(nt),t.__H.__h.forEach(it),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){U=null,j&&j(t)},e.__r=function(t){B&&B(t),O=0;var e=(U=t.__c).__H;e&&(R===U?(e.__h=[],U.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=M,t.__N=t.i=void 0}))):(e.__h.forEach(nt),e.__h.forEach(it),e.__h=[])),R=U},e.diffed=function(t){F&&F(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(1!==H.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),et&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);et&&(e=requestAnimationFrame(n))})(tt)),n.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==M&&(t.__=t.__V),t.i=void 0,t.__V=M}))),R=U=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(nt),t.__h=t.__h.filter((function(t){return!t.__||it(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),V&&V(t,n)},e.unmount=function(t){q&&q(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{nt(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var et="function"==typeof requestAnimationFrame;function nt(t){var e=U,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),U=e}function it(t){var e=U;t.__c=t.__(),U=e}function st(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function ot(t,e){return"function"==typeof e?e(t):e}const at=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t},lt="ui/reset",rt="ui/error",ct="ui/editing",ut="ui/mode",dt="listOfLists/set",pt="listOfLists/remove",_t="listOfLists/create",mt="listOfList/addingPost",ft="listOfList/setPage",gt="listOfList/setTotalPages",ht="list/set",vt="list/update",yt="list/setPage",bt="list/setTotalPages",Pt="list/setItems",Nt="list/removeItem",kt="list/addItem",wt="list/updateItem",Ct="list/moveItem",xt="list/cart",It=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Dt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Dt().ajaxUrl,e),i=await n.json();i.nonce&&(Dt().nonce=i.nonce),i.user_id&&(Dt().user_id=i.user_id)}const s={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Dt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(s.body=JSON.stringify(n));const o=await fetch(Dt().root+i+e,s);o.headers.get("x-wp-nonce")&&(Dt().nonce=o.headers.get("x-wp-nonce"));const a=await o.json();return{data:a,headers:o.headers,status:o.status}};function St(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Dt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class Tt extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function At(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var s;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new Tt(null==t||null===(s=t.data)||void 0===s?void 0:s.message,t)}let Et={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return It("GET","/My"+St(t),{}).then((function(t){return At(t),t}))},discover:function(t){return It("GET","/"+St(t),{}).then((function(t){return At(t),t}))},get:function(t){return It("GET","/"+t,{}).then((function(t){return At(t),t}))},cart:function(t){return It("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return At(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return It("GET","/"+t+"/items"+St(e),{}).then((function(t){return At(t),t}))},delete:function(t){return It("DELETE","/"+t,{}).then((function(t){return At(t),t}))},create:function(t){return It("POST","",t).then((function(t){return At(t),t}))},update:function(t){let e=t.id;return delete t.id,It("PATCH","/"+e,t).then((function(t){return At(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),It("POST","/"+t+"/items"+St(n),e).then((function(t){return At(t),t}))},quit:function(t,e){return It("DELETE","/"+t+"/items/"+e,{}).then((function(t){return At(t),t}))},updateItem:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,n).then((function(t){return At(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return It("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return At(t),t}))},move:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return At(t),t}))}};const Lt=Et;function Dt(){return MgUserPostCollections}function Ot(){var t;return null===(t=Dt())||void 0===t?void 0:t.sortable}function Ut(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Rt(){var t;return Object.values(null===(t=Dt())||void 0===t?void 0:t.statuses)}function Wt(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function $t(t,e){return!!t.type&&Mt(t.type,e)}function Ht(t){var e;const n=[],i=null===(e=Dt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(Mt(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function Mt(t,e){const n=Ut(t);return!(!n||!n.supports)&&n.supports.includes(e)}const jt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function Bt(t){return JSON.parse(JSON.stringify(t))}function Ft(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Vt(t,e){const{type:n,payload:i}=e;let s=!1;const o=t=>(s=a({status:"failed"}),t.error&&(s.error=t.error.message?t.error.message:"",s.errorCode=t.error.code?t.error.code:""),s),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=Bt(t)),e)for(const t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);return s};let l=function(t,e){const{type:n,payload:i}=e;let s,o;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=!1===t?{}:Bt(t)),e)for(const t in e)o[t]=e[t];return o};switch(n){case ht:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case vt:return i.items=Bt(t.items),i;case _t:return i;case Pt:return a({items:i});case"list/addItem/failed":case kt:return null!=i&&i.list?a(i.list):t;case wt:const e=!!i.item&&i.item;return s=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:s});case Nt:if(1===t.items.length||!1===i)return t;if(o=a(),s=o.items.filter((t=>t.post_id!==i)),Mt(t.type,"sortable")){const e=parseInt(t.items[0].position,10);s.forEach(((t,n)=>{s[n].position=e+n}))}if(Mt(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(o.vote_counter=o.vote_counter-e.votes)}return{...o,items:s};case Ct:const n=parseInt(t.items[0].position,10);s=a().items.slice();const l=a().items[i.oldIndex];return s.splice(i.oldIndex,1),s.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(s.forEach(((t,e)=>{s[e].position=n+e})),a({items:s}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case dt:return i;case kt:case ht:return!1;case pt:return!1===i?t:Bt(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(s=a({listOfList:r,list:l}),t.addingPost||(s.title=s.list?s.list.title:Qt.title)),n){case ut:return a({mode:i});case lt:return{...Qt,mode:t.mode};case rt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case"ui/message":return a(!1===i?{message:!1,errorCode:!1}:{message:i});case xt:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case ct:return a({editing:i});case mt:return s=a(),s.addingPost=i,i&&(s.title="Add to..."),s;case _t:s=a(),s.title=i.title?i.title:Qt.title,s.listTotalPages=1,s.listPage=1,s.addingPost=!1;break;case kt:if(s=a(),null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Qt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(s.error=i.message,s.status="failed"),s.addingPost=!1;break;case ft:return a({page:i});case gt:return a({totalPages:i});case yt:return a({listPage:i});case bt:return a({listTotalPages:i});case"list/set/loading":return s=a(),s.status="loading",s.listOfList=!1,"object"==typeof i?(s.list=i,i.title&&(s.title=i.title)):s.list={ID:i},s;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case _t+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return s=a(),s.addingPost=!1,s.status="succeeded",s.error=!1,s.errorCode=!1,s.title=s.list?s.list.title:Qt.title,s;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case _t+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case _t+"/failed":return s=a({status:"failed"}),e.error&&e.error.message&&(s.error=e.error.message),s;case"list/addItem/failed":if(s=a(),s.addingPost=!1,s.title=s.list?s.list.title:Qt.title,null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Qt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(s.error=i.message,s.status="failed"),o(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return o(e)}return!1!==s?s:t}const qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:s}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Kt=(t,e)=>n=>{let i;if((s=n)&&"object"==typeof s&&!0===s.asyncThunk){let s={dispatch:Kt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,s)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var s;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Qt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:at("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},Gt=function(t,e){var n={__c:e="__cC"+o++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(h)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function zt(t){return new Date(t).toLocaleDateString()}const Jt=function(t){const{state:e,dispatch:n}=Z(Gt);return d("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),d("div",{className:"mg-upc-dg-item-title"},d("span",null,t.list.title),"my"!==e.mode&&d(_,null,d("span",null,d("a",{href:"#",onClick:function(e){Ft(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),d("span",{className:"mg-upc-list-dates"},d("i",null," ",d("b",null,"Created:")," ",zt(t.list.created)),d("i",null," ",d("b",null,"Modified:")," ",zt(t.list.modified)))))),d("span",{className:"mg-upc-dg-item-count"},t.list.count),d("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&d("button",{"aria-label":at("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},d("span",{className:"mg-upc-icon upc-font-trash"}))))};class Yt extends m{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(d("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return d("span",null,e?t.map(((t,n)=>d(e,{key:n},t,""))):t)}}var Zt,te,ee;ee={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(te="defaultProps")in(Zt=Yt)?Object.defineProperty(Zt,te,{value:ee,enumerable:!0,configurable:!0,writable:!0}):Zt[te]=ee;const ne=function(t){return d("div",{className:"mg-upc-dg-pagination-div"},d("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":at("Previous page"),title:at("Previous page"),onClick:t.onPreview},d("span",{className:"mg-upc-icon upc-font-arrow_left"})),d("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),d("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":at("Next page"),title:at("Next page"),onClick:t.onNext},d("span",{className:"mg-upc-icon upc-font-arrow_right"})))},ie=()=>({type:lt,payload:null}),se=t=>({type:mt,payload:t}),oe=t=>({type:ct,payload:t}),ae=qt(xt,(async function(t,e){return await function(t){return Lt.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}(t)})),le=qt(dt,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Lt.my(t).then((t=>ce(t,e,i)))})),re=qt(dt,(async function(t,e){return null===t&&(t={}),await Lt.discover(t).then((t=>ce(t,e,!1)))}));function ce(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(de(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(pe(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},s={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in s){const n=t.headers.get(e);n&&(i[s[e]]=decodeURIComponent(n))}e.dispatch(se(i))}return t.data}const ue=qt(pt,(async function(t,e){return await Lt.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(le({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(le({page:n-1}))}return!1}return t}))})),de=t=>({type:ft,payload:t}),pe=t=>({type:gt,payload:t}),_e=t=>({type:yt,payload:t}),me=t=>({type:bt,payload:t}),fe=qt(ht,(async function(t,e){return!1===t||!0===t?t:await Lt.get("object"==typeof t?t.ID:t).then((t=>(Ce(t,e.dispatch),t.data)))})),ge=qt(vt,(async function(t,e){return await Lt.update(t).then((t=>(e.dispatch(oe(!1)),Ce(t,e.dispatch),t.data)))})),he=qt(_t,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(se({id:t.addingPost})),await Lt.create(t).then((t=>(e.dispatch(oe(!1)),Ce(t,e.dispatch),t.data)))})),ve=qt(Pt,(async function(t,e){return await Lt.items(e.getState().list.ID,t).then((t=>(Ce(t,e.dispatch),t.data)))})),ye=qt(Nt,(async function(t,e){const n=e.getState();return await Lt.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(ve({page:t})):t===i&&e.dispatch(ve({page:Math.max(1,t-1)})),!1}return t}))})),be=qt(kt,(async function(t,e){let n=e.extra[0],i=!1;try{await Lt.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var s;const n=null==t||null===(s=t.response)||void 0===s?void 0:s.data;i=e.rejectWithValue(n)}return i})),Pe=qt(wt,(async function(t,e){const n=e.extra[0];return await Lt.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),Ne=qt(Ct,(async function(t,e){const n=e.extra[0],i=e.extra[1],s=n.items[t],o=s.position-t+i;return await Lt.move(n.ID,s.post_id,o).then((e=>({oldIndex:t,newIndex:i})))})),ke=qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Lt.move(n.ID,s.post_id,i+1),await e.dispatch(ve({page:e.getState().listPage})),t})),we=qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Lt.move(n.ID,s.post_id,i-1),await e.dispatch(ve({page:e.getState().listPage})),t}));function Ce(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(_e(parseInt(t.headers.get("x-wp-page"),10))),e(me(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(_e(parseInt(t.data.items_page["X-WP-Page"],10))),e(me(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}const xe=function(t){const{state:e,dispatch:n}=Z(Gt);return d(_,null,d("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>d("li",{className:"mg-upc-dg-item-list"},d("div",null,d(Yt,{width:"1.5em",height:"1.5em"})),d("div",{className:"mg-upc-dg-item-title"},d(Yt,null)),d("div",{className:"mg-upc-dg-item-count"},d(Yt,null)))))),d("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>d(Jt,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&d(ne,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},Ie=function(t){var e,n,i;const[s,o]=K(!1),[a,l]=K(""),r=z({});return G((()=>{l(t.item.description)}),[t.item]),G((()=>{s&&r.current.focus()}),[s]),d(_,null,d("span",null,d("br",null),"Adding item:"),d("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null," "),d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:jt}),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!s&&d("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!s&&d("button",{onClick:()=>{o(!0)}},""===a&&d("span",null,at("Add Comment")),""!==a&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:s?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),s&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{o(!1),l(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),s&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{o(!1),t.onSaveItemDescription(a)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))))),d("span",null,at("Select where the item will be added:")))};function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Se.apply(this,arguments)}function Te(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Ae(t){this.props=t}(Ae.prototype=new m).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(t,e){return Te(this.props,t)||Te(this.state,e)};var Ee=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ee&&Ee(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Le=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var s,o=e;o=o.__;)if((s=o.__c)&&s.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),s.__c(t,e);Le(t,e,n,i)};var De=e.unmount;function Oe(){this.__u=0,this.t=null,this.__b=null}function Ue(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Re(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),De&&De(t)},(Oe.prototype=new m).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var s=Ue(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,s?s(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},Oe.prototype.componentWillUnmount=function(){this.t=[]},Oe.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var s=e.__a&&d(_,null,t.fallback);return s&&(s.__h=null),[d(_,null,e.__a?null:t.children),s]};var We=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function $e(t){return this.getChildContext=function(){return t.context},t.children}function He(t){var e=this,n=t.i;e.componentWillUnmount=function(){D(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),D(d($e,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Re.prototype=new m).__a=function(t){var e=this,n=Ue(e.__v),i=e.o.get(t);return i[0]++,function(s){var o=function(){e.props.revealOrder?(i.push(s),We(e,t,i)):s()};n?n(o):o()}},Re.prototype.render=function(t){this.u=null,this.o=new Map;var e=P(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Re.prototype.componentDidUpdate=Re.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){We(t,n,e)}))};var Me="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,Fe=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(m.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Ve=e.event;function qe(){}function Xe(){return this.cancelBubble}function Ke(){return this.defaultPrevented}e.event=function(t){return Ve&&(t=Ve(t)),t.persist=qe,t.isPropagationStopped=Xe,t.isDefaultPrevented=Ke,t.nativeEvent=t};var Qe={configurable:!0,get:function(){return this.class}},Ge=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var s=-1===e.indexOf("-");for(var o in i={},n){var a=n[o];Be&&"children"===o&&"noscript"===e||"value"===o&&"defaultValue"in n&&null==a||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===a?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!Fe(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():s&&je.test(o)?o=o.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(o)&&(o=o.toLowerCase(),i[o]&&(o="oninputCapture")),i[o]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=P(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Qe.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Qe))}t.$$typeof=Me,Ge&&Ge(t)};var ze=e.__r;e.__r=function(t){ze&&ze(t),t.__c};var Je=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Ye(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ze(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function tn(t){(t.querySelector("[autofocus]")||t).focus()}function en(){Ze("[data-a11y-dialog]").forEach((function(t){new Ye(t)}))}Ye.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ze('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ze("[data-a11y-dialog-hide]",this.$el).concat(Ze('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Ye.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,tn(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Ye.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Ye.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Ye.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Ye.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Ye.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Ye.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&"Escape"===t.key&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&"Tab"===t.key&&function(t,e){var n=function(t){return Ze(Je.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Ye.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||tn(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",en):window.requestAnimationFrame?window.requestAnimationFrame(en):window.setTimeout(en,16));(t=>{const e=(()=>{const[t,e]=K(!1);return G((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=K(null);return[t,Y((t=>{null!==t&&e(new Ye(t))}),[])]})(),i=Y((()=>e.hide()),[e]),s=t.role||"dialog",o="alertdialog"===s,a=t.titleId||t.id+"-title";return G((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:s,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:o?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:s}=t;if(G((()=>(n&&s(n),()=>s(void 0))),[s,n]),!e)return null;const o=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=d("h2",Se({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&d("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=d("button",Se({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=d(He,{__v:t,i:e});return n.containerInfo=e,n}(d("div",Se({},i.container,{className:t.classNames.container}),d("div",Se({},i.overlay,{className:t.classNames.overlay})),d("div",Se({},i.dialog,{className:t.classNames.dialog}),r)),o)}).defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}};const nn=function(t){var e;const[n,i]=K(""),[s,o]=K(""),[a,l]=K(""),[r,c]=K(""),u=J((()=>Ht(t.addingPost)),[t.addingPost]);function p(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&p(u[0]),G((()=>{i(t.list.title),o(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),G((()=>{var t;null!==(t=Ut(a))&&void 0!==t&&t.available_statuses&&-1===Ut(a).available_statuses.indexOf(r)&&c(Ut(a).available_statuses[0])}),[a]),d("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&d(_,null,d("label",null,at("Select a list type:")),d("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>d("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>p(t),onKeyPress:e=>{13===e.keyCode&&p(t)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,t.label),d("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&Mt(a,"editable_title")&&d(_,null,d("label",{htmlFor:`title-${t.list.ID}`},at("Title")),d("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&Mt(a,"editable_content")&&d(_,null,d("label",{htmlFor:`content-${t.list.ID}`},at("Description")),d("textarea",{id:`content-${t.list.ID}`,value:s,onChange:function(t){o(t.target.value)},maxLength:500}),d("span",{className:"mg-upc-dg-list-desc-edit-count"},d("i",null,null==s?void 0:s.length),"/500")),""!==a&&!Ut(a)&&d("span",null,at("Unknown List Type...")),""!==a&&(null===(e=Ut(a))||void 0===e?void 0:e.available_statuses)&&Ut(a).available_statuses.length>1&&d(_,null,d("label",{htmlFor:`status-${t.list.ID}`},at("Status")),d("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ut(a).available_statuses.map(((t,e)=>{if(function(t){const e=Wt(t);return e&&e.show_in_status_list}(t))return d("option",{value:t},function(t){const e=Wt(t);return e?e.label:t}(t))})))),""!==a&&Ut(a)&&d("div",{className:"mg-upc-dg-edit-actions"},d("button",{onClick:()=>t.onSave({title:n,content:s,type:a,status:r})},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))),d("button",{onClick:()=>t.onCancel()},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel")))))},sn=function(t){var e;const[n,i]=K(!1),[s,o]=K(""),[a,l]=K(null===(e=t.item)||void 0===e?void 0:e.quantity),r=z({});G((()=>{o(t.item.description)}),[t.item]),G((()=>{n&&r.current.focus()}),[n]);const c=z(!1);return G((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),d("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},$t(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),d("span",{className:"mg-upc-dg-item-number"},t.item.position)),$t(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return $t(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),d("a",{href:t.item.link},d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:jt})),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:t.item.link},t.item.title),t.item.price_html&&d("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&d("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&d("p",null,t.item.description),t.editable&&!n&&$t(t.list,"editable_item_description")&&d("button",{onClick:()=>{i(!0)}},d("span",{className:"mg-upc-icon upc-font-edit"}),""===s&&d("span",null,at("Add Comment")),""!==s&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:s,onChange:function(t){o(t.target.value)},maxLength:400}),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),o(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(s)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save")))),t.editable&&$t(t.list,"quantity")&&d("div",{className:"mg-upc-dg-quantity"},d("small",null,at("Quantity")),d("input",{"aria-label":at("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&d("div",null,d("button",{"aria-label":"Remove item",onClick:t.onRemove},d("span",{className:"mg-upc-icon upc-font-trash"}))))},on=function(t){return new Promise((function(e,n){const i=document.createElement("script");let s=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){s||this.readyState&&"complete"!=this.readyState||(s=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},an=function(t){var e,n,i;const s=z(null),o=z((e=>{t.onMove(e)}));return G((()=>{o.current=t.onMove})),G((()=>{let e=!1;if($t(t.list,"sortable")){const t=()=>{e=Sortable.create(s.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){o.current(t)}})};"undefined"!=typeof Sortable?t():on(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),d(_,null,d("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>d("li",{className:"mg-upc-dg-item"},$t(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",d(Yt,{width:"1.5em"})," "),d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Yt,{width:"1em"})," ")),$t(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Yt,{width:"1em"})," ")),d("div",{className:"mg-upc-dg-item-skeleton-image"},d(Yt,{width:"5em",height:"5em"})),d("div",{className:"mg-upc-dg-item-data"},d(Yt,{count:2})))))),d("ul",{ref:s,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&d("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>d(sn,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),$t(t.list,"vote")&&d("span",{className:"mg-upc-dg-total-votes"}," ",at("Total votes:")," ",d("span",null," ",t.list.vote_counter)))},ln=function(t){const e=z(null),n=z(null),i=at("Copy"),[s,o]=K(i);G((()=>{let t=null;s!==i&&(t=setTimeout((()=>{o(i),clearTimeout(t)}),2e3))}),[s]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:at("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Dt().shareButtons&&(r=r.filter((t=>Dt().shareButtons.includes(t.slug||t.name.toLowerCase())))),d("div",{className:"mg-upc-dg-share-link"},d("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),d("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?o(at("Copied!")):o("Error!")}},d("span",{className:"mg-upc-icon upc-font-copy"}),d("span",null,s)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),d("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},d("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},rn=function(t){var e;const{state:n,dispatch:i}=Z(Gt),[s,o]=K(!1),a=z(!1),l=z(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(ve({page:t}))}return G((()=>{const t=n.list;let e=!1,s=!1;if(t&&$t(t,"sortable")){const t=()=>{a.current&&n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(ke(t.oldIndex))}})),a.current&&n.listPage>1&&(s=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(we(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():on(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy(),s&&s.destroy()}}),[n.list,n.listPage,n.listTotalPages]),G((()=>{o(!1)}),[n.editing,n.list,n.addingPost]),d(_,null,n.editing&&d(nn,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const s={};s.title=t.title,s.content=t.content,s.type=t.type,s.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(s.adding=n.addingPost.post_id),i(he(s))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(ge(e))}},onCancel:function(){i(oe(!1)),-1===n.list.ID&&(i(fe(!1)),i(ie()),i(le()))}}),!n.editing&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return Mt(i,"editable_title")||Mt(i,"editable_content")||(null===(e=Ut(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&d("button",{className:"mg-upg-edit",onClick:()=>i(oe(!0))},d("span",{className:"mg-upc-icon upc-font-edit"}),d("span",null,at("Edit"))),n.list.link&&d("button",{className:"mg-upg-share",onClick:()=>o(!s)},d("span",{className:"mg-upc-icon upc-font-share"}),d("span",null,at("Share"))),"cart"===n.list.type&&d("button",{className:"mg-upg-share",onClick:function(){i(ae(n.list.ID))}},d("span",{className:"mg-upc-icon upc-font-cart"}),d("span",null,at("Add all to cart")))),s&&n.list.link&&d(ln,{link:n.list.link,title:n.list.title}),n.list.content&&d("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:(c=n.list.content,"string"!=typeof c?"":c.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2"))}}),d(Yt,{count:3}),d(an,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(Ne(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ye(e.post_id))},onSaveItemDescription:function(t,e,n){i(Pe(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(Pe(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&d(ne,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}));var c};D(d((t=>{const[e,n]=Q(Vt,Qt);return d(Gt.Provider,{value:{state:e,dispatch:Kt(n,(()=>e))}},t.children)}),null,d((function(){const{state:t,dispatch:e}=Z(Gt),[n,i]=K("any"),[s,o]=K("any"),[a,l]=K(""),[r,c]=K(null),u=z(!1),p=J((()=>Ht(t.addingPost)),[t.addingPost]),m=J((()=>{return Object.values(null===(t=Dt())||void 0===t?void 0:t.types);var t}),[]);let f="listOfList";if(t.addingPost)f=t.editing?"addingToNew":"adding";else if(t.editing){var g;f=-1!==(null===(g=t.list)||void 0===g?void 0:g.ID)?"edit":"new"}else f=t.list?"list":"listOfList";G((()=>{window.showMainLists=function(){e(ie()),h()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(ie()),n||P(t)}}),[e]);const h=()=>{const i={};n&&(i.types=n),s&&(i.status=s),r&&(i.search=r),a&&(i.author=a),t.page>1&&(i.page=t.page),e(re(i))};function v(){t.page>1&&e(de(1))}function y(t){v(),i(t)}function b(t){v(),o(t)}G((()=>{Qt.title="",e({type:ut,payload:"admin"});const t=function(t){const n=parseInt(("author",new URLSearchParams(document.location.hash.substring(1)).get("author")),10);n>0&&n!==a&&(t&&Ft(t),e(de(1)),l(n),location.hash="")};return t(0),window.addEventListener("hashchange",t,!1),()=>{window.removeEventListener("hashchange",t)}}),[]),G((()=>{t.list||h()}),[n,s,a,t.page]),G((()=>{null!=r&&(clearTimeout(u.current),u.current=setTimeout((function(){h()}),300))}),[r]);const P=t=>{e(se({post_id:t})),e(le({addingPost:t}))};function N(n){n<1||n>t.totalPages||"loading"===t.status||e(de(n))}const k=d("h2",{key:"title"},("list"===f||"new"===f||"edit"===f||"addingToNew"===f)&&d("a",{"aria-label":"Back",className:"mg-upc-dg-back",href:"#",onClick:n=>{n.preventDefault(),function(){switch(f){case"list":e(fe(!1)),h();break;case"new":e(fe(!1)),e(oe(!1)),h();break;case"edit":e(oe(!1));break;case"addingToNew":e(fe(!1)),e(oe(!1)),e(le({addingPost:t.addingPost.post_id}));break;default:h()}}()}},"←")," ",t.title);return d(_,null,k,d("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+f},d("div",{className:"mg-upc-dg-wait"}),t.error&&d("div",{className:"mg-upc-dg-error"},t.error,d("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:rt,payload:null})}},d("span",{className:"mg-upc-icon upc-font-close"}))),d("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&d(Ie,{item:t.addingPost,onSaveItemDescription:function(n){e(se({...t.addingPost,description:n}))}}),("listOfList"===f||"adding"===f)&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},p.length>0&&d("button",{className:"mg-list-new",onClick:function(t){e(oe(!0)),e(fe(!0))}},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null,at("Create List")))),d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Types"))),d("li",{className:"any"==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",onClick:()=>y("any"),onKeyPress:t=>{13===t.keyCode&&y("any")},tabIndex:"0"},d("i",{className:"mg-upc-icon upc-font-close mg-upc-dg-item-type mg-upc-dg-item-type-none"}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,"All"))),m.map(((t,e)=>d("li",{className:t.name==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",key:t.name,onClick:()=>y(t.name),onKeyPress:e=>{13===e.keyCode&&y(t.name)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,t.label)))))),Rt()&&d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Status"))),d("li",{className:"any"==s?"mg-upc-selected":"",onClick:()=>b("any"),onKeyPress:t=>{13===t.keyCode&&b("any")},tabIndex:"0"},d("div",{className:"mg-upc-dg-item-title"},d("strong",null,"All"))),Rt().map(((t,e)=>d("li",{className:t.name==s?"mg-upc-selected":"",key:t.name,onClick:()=>b(t.name),onKeyPress:e=>{13===e.keyCode&&b(t.name)},tabIndex:"0"},t.label)))),d("div",{className:"mg-upc-dg-df"},d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Search"))),d("input",{onChange:function(t){v(),c(t.target.value)},value:r})),d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Author (ID)"))),d("input",{type:"number",onChange:function(t){v(),l(t.target.value)},value:a}))),d(xe,{lists:t.listOfList,onSelect:function(n){e(oe(!1)),t.addingPost?e(be(n.ID,t.addingPost)):e(fe(n))},onRemove:!t.addingPost&&function(t){e(ue(t.ID))},loadPreview:function(){N(t.page-1)},loadNext:function(){N(t.page+1)}})),t.list&&d(rn,{editable:(t.list,!0)}))))}),null)," "),document.getElementById("mg-upc-admin-app")),setTimeout(window.showMainLists,1e3)})(); -
user-post-collections/tags/0.8.29/javascript/mg-upc-client/dist/css/styles.css
r2770005 r2770186 1 .mg-upc-single-template .mg-upc-description{margin-top:1em}.mg-upc-single-template .mg-upc-author-box{margin:1em 0}.mg-upc-page-inner{flex-grow:2}.mg-upc-page-inner .mg-upc-author-box{padding:12px 10px 32px 120px;position:relative;min-height:120px}.mg-upc-page-inner .mg-upc-author-box .mg-upc-author-avatar{width:96px;height:96px;object-fit:cover;position:absolute;top:12px;left:0}.mg-upc-page-inner .mg-upc-author-box h4{font-size:21px;margin:12px 0 8px}.mg-upc-items-container{margin-left:0;margin-bottom:0;clear:both}.mg-upc-item{display:flex;flex-direction:row;position:relative;align-items:center;margin:40px 0}.mg-upc-item::after{content:' ';position:absolute;bottom:-20px;left:50%;width:80%;background:rgba(0,0,0,0.15);height:1px;margin-left:-40%}.mg-upc-item:last-child::after{display:none}.mg-upc-item .mg-upc-list-item-price{display:inline-block;margin-right:1em}.mg-upc-item p.stock{margin:0;display:inline-block;float:right}.mg-upc-item-data{flex-grow:1;flex-shrink:2;padding-right:1em;padding-left:1em}.mg-upc-item-data header h2{margin:10px 0 5px;font-size:20px;font-weight:600}.mg-upc-item-data header a{text-decoration:none}@media (max-width: 500px){.mg-upc-item{flex-direction:column;text-align:center;align-items:stretch}.mg-upc-item-actions button,.mg-upc-item-actions>a{width:100%}}.mg-upc-item-img{width:15%;min-width:100px;margin:auto}.mg-upc-item-img figure{margin:0}.mg-upc-item-img img{min-height:130px;width:100%;background:#6f7277;object-fit:cover;object-position:center}.mg-upc-item-desc{margin:0;line-height:1.3;font-weight:300;clear:both}.mg-upc-item-number{font-size:2em;min-width:2em;text-align:center}.mg-upc-item-quantity{margin:0.3em 1em}.mg-upc-item-quantity>*{display:block;text-align:center;padding:0.1em 0.5em}.mg-upc-item-quantity small{opacity:0.5}.mg-upc-item-actions{display:flex;flex-direction:column;row-gap:0.5em;padding:1em 0}.mg-upc-item-actions button,.mg-upc-item-actions>a{min-width:9em;text-align:center;white-space:nowrap}.mg-upc-votes{width:100%;height:45px;position:relative;clear:both}.mg-upc-item-bar{width:100%;height:10px;position:absolute;top:24px}.mg-upc-item-bar-progress,.mg-upc-item-bar-fill{display:block;width:100%;height:100%;background:#ededed;border:solid 1px #ccc;position:absolute;top:0}.mg-upc-item-bar-fill{box-shadow:0 0 3px #aaa}.mg-upc-item-bar-progress{background:#380;border-color:#286103}.mg-upc-item-percent{right:0;position:absolute;line-height:24px;font-size:20px}.mg-upc-item-votes{display:block;font-size:12px;left:0;position:absolute;line-height:25px;top:3px}.mg-upc-items-pagination{padding:1em 0;border:1px solid rgba(0,0,0,0.05);border-width:1px 0;text-align:center;clear:both}.mg-upc-items-pagination ul.page-numbers::after,.mg-upc-items-pagination ul.page-numbers::before{content:'';display:table}.mg-upc-items-pagination ul.page-numbers::after{clear:both}.mg-upc-items-pagination .page-numbers{list-style:none;margin:0}.mg-upc-items-pagination .page-numbers li{display:inline-block}.mg-upc-items-pagination .page-numbers li .page-numbers{border-left-width:0;display:inline-block;padding:.3342343017em .875em;background-color:rgba(0,0,0,0.025);color:#43454b}.mg-upc-items-pagination .page-numbers li .page-numbers.current{background-color:#474747;border-color:#474747;color:#fff}.mg-upc-items-pagination .page-numbers li .page-numbers.dots{background-color:transparent}.mg-upc-items-pagination .page-numbers li .page-numbers.next,.mg-upc-items-pagination .page-numbers li .page-numbers.prev{padding-left:1em;padding-right:1em}.mg-upc-items-pagination .page-numbers li a.page-numbers:hover{background-color:rgba(0,0,0,0.05)}.rtl .mg-upc-items-pagination a.next,.rtl .mg-upc-items-pagination a.prev{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}@keyframes mg-upc-alert{0%{transform:scaleY(0);margin-bottom:-19px}100%{transform:scaleY(1);margin-bottom:0}}.mg-upc-alert{padding:10px 40px 10px 1em;border:solid 1px #017401;background:rgba(154,240,173,0.8);color:#000;margin:1em 0;animation:mg-upc-alert 0.3s 1 ease-in-out both}.mg-upc-alert p{margin:0}.mg-upc-item .mg-upc-alert{position:absolute;bottom:-19px;left:0;right:0;margin:0}.mg-upc-alert-error{border-color:#d50000;background:rgba(255,121,121,0.8)}.mg-upc-alert-close{position:absolute;top:10px;right:15px;text-decoration:none !important;color:black}.mg-upc-hide{display:none}.mg-upc-product-added{background-color:#a3e8a3;color:#445e18}.mg-upc-product-error{color:#740000;background-color:#f89a9a}@keyframes mg-upc-btn-loading{100%{transform:translateX(100%)}}.mg-upc-btn-loading{background-color:#c7c7c7;position:relative;overflow:hidden;z-index:1;vertical-align:middle}.mg-upc-btn-loading::before,.mg-upc-btn-loading::after{content:' ';display:block !important;position:absolute;top:0;left:0;right:0;height:100%;background-color:#c7c7c7;z-index:2}.mg-upc-btn-loading::after{background-repeat:no-repeat;background-image:linear-gradient(90deg, #c7c7c7, #f5f5f5, #c7c7c7);transform:translateX(-100%);animation-name:mg-upc-btn-loading;animation-duration:0.8s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-add-product-to-list{margin-bottom:0.236em;margin-top:0.236em}.post-adding{margin:1em;text-align:center}.mg-upc-add-list-to-cart{margin:1em 1em 1em 0}.mg-upc-dg-container,.mg-upc-dg-overlay{position:fixed;top:0;right:0;bottom:0;left:0}.mg-upc-dg-container{z-index:999999;display:flex}.mg-upc-dg-container[aria-hidden='true']{display:none}.mg-upc-dg-overlay{background-color:rgba(43,46,56,0.9);animation:fade-in 200ms both}.mg-upc-dg-content{margin:auto;z-index:2;position:relative;background-color:#fff;color:#333;overflow-y:auto;animation:fade-in 400ms 200ms both, slide-up 400ms 200ms both;padding:1em;max-width:90%;max-height:80%;width:800px;border-radius:2px}.mg-upc-dg-content p{color:#333}.mg-upc-dg-content::after,.mg-list-edit::after{content:'';display:block;clear:both}@media screen and (min-width: 700px){.mg-upc-dg-content{padding:2em 1.5em}}.mg-upc-dg-close{position:absolute;top:0.5em;right:0.5em;border:0;padding:0;background-color:transparent;color:#000;font-weight:bold;font-size:1.25em;line-height:1.25em;min-width:1.2em;min-height:1.2em;text-align:center;cursor:pointer;transition:0.15s}@media screen and (min-width: 700px){.mg-upc-dg-close{top:1em;right:1em}}.mg-upc-dialog-content-wrapper{position:relative}@keyframes fade-in{from{opacity:0}}@keyframes slide-up{from{transform:translateY(10%)}}@font-face{font-family:"mgupc";src:url(../fd323a61b0577418b63a.eot?3p2eq6);src:url(../fd323a61b0577418b63a.eot?3p2eq6#iefix) format("embedded-opentype"),url(../aeaf4155903c2239613b.ttf?3p2eq6) format("truetype"),url(../d90b677af57f791b2998.woff?3p2eq6) format("woff"),url(../2f74331407887267c9f0.svg?3p2eq6#mgupc) format("svg");font-weight:normal;font-style:normal;font-display:block}.mg-upc-icon{font-family:"mgupc" !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.upc-font-close:before{content:""}.upc-font-copy:before{content:""}.upc-font-first_page:before{content:""}.upc-font-last_page:before{content:""}.upc-font-arrow_left:before{content:""}.upc-font-arrow_right:before{content:""}.upc-font-poll:before{content:""}.upc-font-numbered:before{content:""}.upc-font-cart:before{content:""}.upc-font-bookmark:before{content:""}.upc-font-heart:before{content:""}.upc-font-save:before{content:""}.upc-font-edit:before{content:""}.upc-font-share:before{content:""}.upc-font-list:before{content:""}.upc-font-add:before{content:""}.upc-font-trash:before{content:""}.mg-upc-icon+span{margin-left:0.6em;vertical-align:middle}.mg-upc-icon{vertical-align:middle}.mg-upc-dg-content button{min-height:30px}.mg-upc-dg-msg{display:block;background:rgba(172,205,100,0.75);padding:0.7em;border:solid 1px #7dbf21;border-radius:2px;color:#314f00;margin:1em 0;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-msg{top:-2em}}.mg-upc-dg-error{display:block;background:rgba(255,48,48,0.75);padding:0.7em;border:solid 1px #bf2121;border-radius:2px;color:#4f0001;margin:1em 0;position:sticky;top:-1em;z-index:5;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-error{top:-2em}}.mg-upc-dg-alert-close{float:right;color:#fff;text-decoration:none;text-shadow:0 0 2px #ffff}.mg-upc-dg-wait{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.7);z-index:9;display:none}.mg-upc-dg-wait:before{content:'';position:absolute;top:50%;right:50%;margin:-1em 0 0 -1em;width:2em;height:2em;border-radius:50%;border-top:2px solid #5583f8;border-bottom:2px solid #345fc9;border-right:2px solid transparent;animation:loading-spinner .6s linear infinite}.mg-upc-dg-status-loading{max-height:90vh;min-height:50px;overflow:hidden}@keyframes loading-spinner{to{transform:rotate(360deg)}}.mg-upc-dg-dn{display:none !important}.mg-upc-dg-content ul{padding:0;margin:1em 0.3em}.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{display:flex;padding:0.6em;margin:0.2em;justify-content:flex-start;align-content:stretch;align-items:center;border:solid 1px #e5e5e5;cursor:pointer}.mg-upc-dg-item-list:hover,.mg-upc-dg-item-list:focus,.mg-upc-dg-item-list-type:hover,.mg-upc-dg-item-list-type:focus{border:solid 1px #a9a9a9;background:#fafafa}.mg-upc-dg-item-list .mg-upc-dg-item-type,.mg-upc-dg-item-list-type .mg-upc-dg-item-type{width:30px;height:30px;font-size:24px;line-height:30px;text-align:center}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{display:flex;flex-direction:column;color:#333;flex-grow:2;text-align:start;padding:0.1em 1em;word-break:break-word}.mg-upc-dg-item-list .mg-upc-dg-item-title>span:nth-child(2),.mg-upc-dg-item-list-type .mg-upc-dg-item-title>span:nth-child(2){opacity:0.6}.mg-upc-dg-item-list .mg-upc-dg-item-count,.mg-upc-dg-item-list-type .mg-upc-dg-item-count{width:3em;text-align:center;opacity:0.5}@media screen and (max-width: 400px){.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{flex-direction:column}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{text-align:center}}.mg-upc-dg-item-type:before{content:""}.mg-upc-dg-item-type-numbered:before{content:""}.mg-upc-dg-item-type-vote:before{content:""}.mg-upc-dg-item-type-favorites:before{content:""}.mg-upc-dg-item-type-bookmarks:before{content:""}.mg-upc-dg-item-type-cart:before{content:""}.mg-upc-dg-item-type-none:before{content:""}.mg-upg-edit{float:right}ul.mg-upc-dg-list::before{content:'';display:block;clear:both}.mg-upc-dg-title{margin-top:0;word-break:break-word}.mg-upc-dg-title>a{vertical-align:middle;font-size:1em;text-decoration:none}.mg-upc-dg-top-action{margin:1em 0;display:flex;align-items:center;align-content:stretch;flex-direction:row-reverse}.mg-upc-dg-top-action button{margin:0.5em;flex-grow:2}@media (max-width: 550px){.mg-upc-dg-top-action{align-items:stretch;flex-direction:column}}.mg-upc-dg-total-votes{text-align:right;display:block;margin-bottom:2em}.mg-list-edit label{color:#000000;display:block;margin-top:0.5em}.mg-list-edit input[type=text],.mg-list-edit textarea,.mg-list-edit select{width:100%;margin-bottom:0.5em;display:block;min-height:2em}.mg-list-edit textarea{height:8em}.mg-list-edit button{margin:0.7em 0;float:left}.mg-list-edit button:first-of-type{float:right}@media (max-width: 550px){.mg-list-edit button{width:100%}}.mg-upc-dg-list-desc-edit-count{display:block;text-align:right}.mg-upc-dg-item{display:flex;align-items:center;margin:2em 0}.mg-upc-dg-item>*{flex-shrink:0}.mg-upc-dg-item>.mg-upc-dg-item-data{flex-grow:1;flex-shrink:2}.mg-upc-dg-item button{margin:0.3em}@media (max-width: 550px){.mg-upc-dg-item{flex-direction:column;text-align:center}.mg-upc-dg-item .mg-upc-dg-item-number{position:relative;top:0.1em;height:0;font-size:3em;color:#fff;font-weight:700;text-shadow:0 0 4px black}.mg-upc-dg-item .mg-upc-dg-item-image{height:7em;width:7em}.mg-upc-dg-item .mg-upc-dg-stock>*,.mg-upc-dg-item .mg-upc-dg-price{float:none;margin:auto;display:block}}.mg-upc-dg-item-adding{margin:0.5em;opacity:0.7;padding:0.3em 1em;background:#eaeaea}.mg-upc-dg-item-handle{padding:0.5em;white-space:nowrap;cursor:move}.mg-upc-dg-item-number{width:3em;text-align:center;flex-shrink:0}.mg-upc-dg-item-image{height:5em;width:5em;max-width:none;object-fit:cover;background:#d5d5d5}.mg-upc-dg-item-data{padding-right:1em;padding-left:1em}.mg-upc-dg-item-data button{font-size:small}.mg-upc-dg-item-data>p{margin:0}.mg-upc-dg-btn-item-desc{width:100%}.mg-upc-dg-btn-item-desc-cancel,.mg-upc-dg-btn-item-desc-save{width:46%;margin:2%;float:left}.mg-upc-dg-price{float:right;margin-left:1em}.mg-upc-dg-price del{opacity:0.5}.mg-upc-dg-stock>*{margin:0;float:right}.mg-upc-dg-pagination-div{display:flex;align-content:stretch;justify-content:center;align-items:center}.mg-upc-dg-hidden{opacity:0.2}.mg-upc-dg-pagination-div.mg-upc-dg-hidden{display:none}.mg-upc-dg-pagination-div::after{content:'';clear:both;display:block}.mg-upc-dg-pagination,.mg-upc-dg-pagination-current{width:39%;text-align:center;position:relative}.mg-upc-dg-pagination-current{width:10%}.mg-upc-dg-pagination .sortable-chosen{position:absolute;top:0;left:0;bottom:0;right:0;margin:0;overflow:hidden;background:#ececd0}.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-handle,.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-number,.mg-upc-dg-pagination .sortable-chosen button{display:none}@keyframes mg-upc-dg-loading-skeleton{100%{transform:translateX(100%)}}.mg-upc-dg-loading-skeleton{--base-color: #ebebeb;--highlight-color: #f5f5f5;--animation-duration: 1.5s;--animation-direction: normal;--pseudo-element-display: block;background-color:var(--base-color);width:100%;border-radius:0.25rem;display:inline-flex;line-height:1;position:relative;overflow:hidden;z-index:1}.mg-upc-dg-loading-skeleton::after{content:' ';display:var(--pseudo-element-display);position:absolute;top:0;left:0;right:0;height:100%;background-repeat:no-repeat;background-image:linear-gradient(90deg, var(--base-color), var(--highlight-color), var(--base-color));transform:translateX(-100%);animation-name:mg-upc-dg-loading-skeleton;animation-direction:var(--animation-direction);animation-duration:var(--animation-duration);animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-dg-loading-skeleton,.mg-upc-dg-on-loading{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-desc,.mg-upc-dg-status-loading .mg-upc-dg-pagination-div,.mg-upc-dg-status-loading button{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-of-lists,.mg-upc-dg-status-loading .mg-upc-dg-list{visibility:hidden}.mg-upc-dg-status-loading .mg-upc-dg-on-loading{display:block}.mg-upc-dg-status-loading .mg-upc-dg-loading-skeleton{display:inline-flex}@keyframes share-animate{from{max-height:0;transform:scaleY(0);opacity:0}to{max-height:125px;transform:scaleY(1);opacity:1}}.mg-upc-dg-share-link{margin:1em 0;max-height:none;animation:share-animate .3s linear;text-align:center}.mg-upc-dg-share-link input{width:70%;font-size:16px;height:40px;border:none;background:#e2e2e2;color:#333;margin:0;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link button{width:30%;font-size:16px;padding:2px ;height:40px;line-height:36px;border:none;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link .mg-upc-dg-share{display:inline-block;margin:2% 0}.mg-upc-zero-quantity{opacity:0.3}.mg-upc-dg-quantity{width:4em;display:flex;flex-direction:column;text-align:center;margin:1em}.mg-upc-dg-quantity small{opacity:0.5}.mg-upc-dg-quantity input{text-align:center}.mg-upc-err-required_logged_in .mg-list-new,.mg-upc-err-required_logged_in .mg-upc-dg-alert-close{display:none}.mg-upc-share-btn-img{height:64px;width:64px;display:inline-block;vertical-align:middle;background-size:100%}.mg-upc-share-link{display:block;text-align:right;margin:1em 0}.mg-upc-share-link::after{content:'';display:block;clear:both}.mg-upc-share{text-decoration:none}.mg-upc-dg-share:hover .mg-upc-share-btn-img,.mg-upc-dg-share:focus .mg-upc-share-btn-img,.mg-upc-share:hover .mg-upc-share-btn-img,.mg-upc-share:focus .mg-upc-share-btn-img{transform:scale(1.3);transition:transform 0.3s}.mg-upc-share-facebook{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%233b5998%27%3E%3C/rect%3E%3Cpath d=%27M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-twitter{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300aced%27%3E%3C/rect%3E%3Cpath d=%27M48,22.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6 C41.7,19.8,40,19,38.2,19c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5c-5.5-0.3-10.3-2.9-13.5-6.9c-0.6,1-0.9,2.1-0.9,3.3 c0,2.3,1.2,4.3,2.9,5.5c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1 c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1c2.9,1.9,6.4,2.9,10.1,2.9c12.1,0,18.7-10,18.7-18.7 c0-0.3,0-0.6,0-0.8C46,24.5,47.1,23.4,48,22.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-whatsapp{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2325D366%27%3E%3C/rect%3E%3Cpath d=%27m42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-telegram{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2337aee2%27%3E%3C/rect%3E%3Cpath d=%27m45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-line{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300b800%27%3E%3C/rect%3E%3Cpath d=%27M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-email{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23b2b2b2%27%3E%3C/rect%3E%3Cpath d=%27M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-pinterest{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23dc0000%27/%3E%3Cpath d=%27M32.9 12.4c-10.4 0-15.6 7.6-15.6 13.7 0 3.7 1.5 7.1 4.5 8.3.6.3 1 0 1.1-.5l.4-1.8c.2-.5.2-.8-.2-1.2-1-1-1.6-2.3-1.6-4.3 0-5.6 4.1-10.5 10.8-10.5 6 0 9.2 3.6 9.2 8.4 0 6.2-2.9 11.6-7 11.6-2.2 0-4-2-3.4-4.3.7-2.7 2-5.7 2-7.7 0-1.8-1-3.3-3-3.3-2.4 0-4.3 2.3-4.3 5.6 0 2 .7 3.4.7 3.4l-2.9 11.9c-.4 1.6-1 8.3-1 9.8.9.4 2.2-1.6 3.5-3.8.7-1.2 1.6-2.8 2-4.4l1.5-6c.7 1.5 3 2.7 5.3 2.7 7 0 11.8-6.4 11.8-15 0-6.5-5.5-12.6-13.8-12.6z%27 fill=%27%23fff%27 paint-order=%27fill markers stroke%27/%3E%3C/svg%3E")}1 .mg-upc-single-template .mg-upc-description{margin-top:1em}.mg-upc-single-template .mg-upc-author-box{margin:1em 0}.mg-upc-page-inner{flex-grow:2}.mg-upc-page-inner .mg-upc-author-box{padding:12px 10px 32px 120px;position:relative;min-height:120px}.mg-upc-page-inner .mg-upc-author-box .mg-upc-author-avatar{width:96px;height:96px;object-fit:cover;position:absolute;top:12px;left:0}.mg-upc-page-inner .mg-upc-author-box h4{font-size:21px;margin:12px 0 8px}.mg-upc-items-container{margin-left:0;margin-bottom:0;clear:both}.mg-upc-item{display:flex;flex-direction:row;position:relative;align-items:center;margin:40px 0}.mg-upc-item::after{content:' ';position:absolute;bottom:-20px;left:50%;width:80%;background:rgba(0,0,0,0.15);height:1px;margin-left:-40%}.mg-upc-item:last-child::after{display:none}.mg-upc-item .mg-upc-list-item-price{display:inline-block;margin-right:1em}.mg-upc-item p.stock{margin:0;display:inline-block;float:right}.mg-upc-item-data{flex-grow:1;flex-shrink:2;padding-right:1em;padding-left:1em}.mg-upc-item-data header h2{margin:10px 0 5px;font-size:20px;font-weight:600}.mg-upc-item-data header a{text-decoration:none}@media (max-width: 500px){.mg-upc-item{flex-direction:column;text-align:center;align-items:stretch}.mg-upc-item-actions button,.mg-upc-item-actions>a{width:100%}}.mg-upc-item-img{width:15%;min-width:100px;margin:auto}.mg-upc-item-img figure{margin:0}.mg-upc-item-img img{min-height:130px;width:100%;background:#6f7277;object-fit:cover;object-position:center}.mg-upc-item-desc{margin:0;line-height:1.3;font-weight:300;clear:both}.mg-upc-item-number{font-size:2em;min-width:2em;text-align:center}.mg-upc-item-quantity{margin:0.3em 1em}.mg-upc-item-quantity>*{display:block;text-align:center;padding:0.1em 0.5em}.mg-upc-item-quantity small{opacity:0.5}.mg-upc-item-actions{display:flex;flex-direction:column;row-gap:0.5em;padding:1em 0}.mg-upc-item-actions button,.mg-upc-item-actions>a{min-width:9em;text-align:center;white-space:nowrap}.mg-upc-votes{width:100%;height:45px;position:relative;clear:both}.mg-upc-item-bar{width:100%;height:10px;position:absolute;top:24px}.mg-upc-item-bar-progress,.mg-upc-item-bar-fill{display:block;width:100%;height:100%;background:#ededed;border:solid 1px #ccc;position:absolute;top:0}.mg-upc-item-bar-fill{box-shadow:0 0 3px #aaa}.mg-upc-item-bar-progress{background:#380;border-color:#286103}.mg-upc-item-percent{right:0;position:absolute;line-height:24px;font-size:20px}.mg-upc-item-votes{display:block;font-size:12px;left:0;position:absolute;line-height:25px;top:3px}.mg-upc-items-pagination{padding:1em 0;border:1px solid rgba(0,0,0,0.05);border-width:1px 0;text-align:center;clear:both}.mg-upc-items-pagination ul.page-numbers::after,.mg-upc-items-pagination ul.page-numbers::before{content:'';display:table}.mg-upc-items-pagination ul.page-numbers::after{clear:both}.mg-upc-items-pagination .page-numbers{list-style:none;margin:0}.mg-upc-items-pagination .page-numbers li{display:inline-block}.mg-upc-items-pagination .page-numbers li .page-numbers{border-left-width:0;display:inline-block;padding:.3342343017em .875em;background-color:rgba(0,0,0,0.025);color:#43454b}.mg-upc-items-pagination .page-numbers li .page-numbers.current{background-color:#474747;border-color:#474747;color:#fff}.mg-upc-items-pagination .page-numbers li .page-numbers.dots{background-color:transparent}.mg-upc-items-pagination .page-numbers li .page-numbers.next,.mg-upc-items-pagination .page-numbers li .page-numbers.prev{padding-left:1em;padding-right:1em}.mg-upc-items-pagination .page-numbers li a.page-numbers:hover{background-color:rgba(0,0,0,0.05)}.rtl .mg-upc-items-pagination a.next,.rtl .mg-upc-items-pagination a.prev{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}@keyframes mg-upc-alert{0%{transform:scaleY(0);margin-bottom:-19px}100%{transform:scaleY(1);margin-bottom:0}}.mg-upc-alert{padding:10px 40px 10px 1em;border:solid 1px #017401;background:rgba(154,240,173,0.8);color:#000;margin:1em 0;animation:mg-upc-alert 0.3s 1 ease-in-out both}.mg-upc-alert p{margin:0}.mg-upc-item .mg-upc-alert{position:absolute;bottom:-19px;left:0;right:0;margin:0}.mg-upc-alert-error{border-color:#d50000;background:rgba(255,121,121,0.8)}.mg-upc-alert-close{position:absolute;top:10px;right:15px;text-decoration:none !important;color:black}.mg-upc-hide{display:none}.mg-upc-product-added{background-color:#a3e8a3;color:#445e18}.mg-upc-product-error{color:#740000;background-color:#f89a9a}@keyframes mg-upc-btn-loading{100%{transform:translateX(100%)}}.mg-upc-btn-loading{background-color:#c7c7c7;position:relative;overflow:hidden;z-index:1;vertical-align:middle}.mg-upc-btn-loading::before,.mg-upc-btn-loading::after{content:' ';display:block !important;position:absolute;top:0;left:0;right:0;height:100%;background-color:#c7c7c7;z-index:2}.mg-upc-btn-loading::after{background-repeat:no-repeat;background-image:linear-gradient(90deg, #c7c7c7, #f5f5f5, #c7c7c7);transform:translateX(-100%);animation-name:mg-upc-btn-loading;animation-duration:0.8s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-add-product-to-list{margin-bottom:0.236em;margin-top:0.236em}.post-adding{margin:1em;text-align:center}.mg-upc-add-list-to-cart{margin:1em 1em 1em 0}.mg-upc-dg-container,.mg-upc-dg-overlay{position:fixed;top:0;right:0;bottom:0;left:0}.mg-upc-dg-container{z-index:999999;display:flex}.mg-upc-dg-container[aria-hidden='true']{display:none}.mg-upc-dg-overlay{background-color:rgba(43,46,56,0.9);animation:fade-in 200ms both}.mg-upc-dg-content{margin:auto;z-index:2;position:relative;background-color:#fff;color:#333;overflow-y:auto;animation:fade-in 400ms 200ms both, slide-up 400ms 200ms both;padding:1em;max-width:90%;max-height:80%;width:800px;border-radius:2px}.mg-upc-dg-content p{color:#333}.mg-upc-dg-content::after,.mg-list-edit::after{content:'';display:block;clear:both}@media screen and (min-width: 700px){.mg-upc-dg-content{padding:2em 1.5em}}.mg-upc-dg-close{position:absolute;top:0.5em;right:0.5em;border:0;padding:0;background-color:transparent;color:#000;font-weight:bold;font-size:1.25em;line-height:1.25em;min-width:1.2em;min-height:1.2em;text-align:center;cursor:pointer;transition:0.15s}@media screen and (min-width: 700px){.mg-upc-dg-close{top:1em;right:1em}}.mg-upc-dialog-content-wrapper{position:relative}@keyframes fade-in{from{opacity:0}}@keyframes slide-up{from{transform:translateY(10%)}}@font-face{font-family:"mgupc";src:url(../fd323a61b0577418b63a.eot?3p2eq6);src:url(../fd323a61b0577418b63a.eot?3p2eq6#iefix) format("embedded-opentype"),url(../aeaf4155903c2239613b.ttf?3p2eq6) format("truetype"),url(../d90b677af57f791b2998.woff?3p2eq6) format("woff"),url(../2f74331407887267c9f0.svg?3p2eq6#mgupc) format("svg");font-weight:normal;font-style:normal;font-display:block}.mg-upc-icon{font-family:"mgupc" !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.upc-font-close:before{content:""}.upc-font-copy:before{content:""}.upc-font-first_page:before{content:""}.upc-font-last_page:before{content:""}.upc-font-arrow_left:before{content:""}.upc-font-arrow_right:before{content:""}.upc-font-poll:before{content:""}.upc-font-numbered:before{content:""}.upc-font-cart:before{content:""}.upc-font-bookmark:before{content:""}.upc-font-heart:before{content:""}.upc-font-save:before{content:""}.upc-font-edit:before{content:""}.upc-font-share:before{content:""}.upc-font-list:before{content:""}.upc-font-add:before{content:""}.upc-font-trash:before{content:""}.mg-upc-icon+span{margin-left:0.6em;vertical-align:middle}.mg-upc-icon{vertical-align:middle}.mg-upc-dg-content button{min-height:30px}.mg-upc-dg-msg{display:block;background:rgba(172,205,100,0.75);padding:0.7em;border:solid 1px #7dbf21;border-radius:2px;color:#314f00;margin:1em 0;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-msg{top:-2em}}.mg-upc-dg-error{display:block;background:rgba(255,48,48,0.75);padding:0.7em;border:solid 1px #bf2121;border-radius:2px;color:#4f0001;margin:1em 0;position:sticky;top:-1em;z-index:5;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-error{top:-2em}}.mg-upc-dg-alert-close{float:right;color:#fff;text-decoration:none;text-shadow:0 0 2px #ffff}.mg-upc-dg-wait{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.7);z-index:9;display:none}.mg-upc-dg-wait:before{content:'';position:absolute;top:50%;right:50%;margin:-1em 0 0 -1em;width:2em;height:2em;border-radius:50%;border-top:2px solid #5583f8;border-bottom:2px solid #345fc9;border-right:2px solid transparent;animation:loading-spinner .6s linear infinite}.mg-upc-dg-status-loading{max-height:90vh;min-height:50px;overflow:hidden}@keyframes loading-spinner{to{transform:rotate(360deg)}}.mg-upc-dg-dn{display:none !important}.mg-upc-dg-content ul{padding:0;margin:1em 0.3em}.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{display:flex;padding:0.6em;margin:0.2em;justify-content:flex-start;align-content:stretch;align-items:center;border:solid 1px #e5e5e5;cursor:pointer}.mg-upc-dg-item-list:hover,.mg-upc-dg-item-list:focus,.mg-upc-dg-item-list-type:hover,.mg-upc-dg-item-list-type:focus{border:solid 1px #a9a9a9;background:#fafafa}.mg-upc-dg-item-list .mg-upc-dg-item-type,.mg-upc-dg-item-list-type .mg-upc-dg-item-type{width:30px;height:30px;font-size:24px;line-height:30px;text-align:center}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{display:flex;flex-direction:column;color:#333;flex-grow:2;text-align:start;padding:0.1em 1em;word-break:break-word}.mg-upc-dg-item-list .mg-upc-dg-item-title>span:nth-child(2),.mg-upc-dg-item-list-type .mg-upc-dg-item-title>span:nth-child(2){opacity:0.6}.mg-upc-dg-item-list .mg-upc-dg-item-count,.mg-upc-dg-item-list-type .mg-upc-dg-item-count{width:3em;text-align:center;opacity:0.5}@media screen and (max-width: 400px){.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{flex-direction:column}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{text-align:center}}.mg-upc-dg-item-type:before{content:""}.mg-upc-dg-item-type-numbered:before{content:""}.mg-upc-dg-item-type-vote:before{content:""}.mg-upc-dg-item-type-favorites:before{content:""}.mg-upc-dg-item-type-bookmarks:before{content:""}.mg-upc-dg-item-type-cart:before{content:""}.mg-upc-dg-item-type-none:before{content:""}.mg-upg-edit{float:right}ul.mg-upc-dg-list::before{content:'';display:block;clear:both}.mg-upc-dg-title{margin-top:0;word-break:break-word}.mg-upc-dg-title>a{vertical-align:middle;font-size:1em;text-decoration:none}.mg-upc-dg-top-action{margin:1em 0;display:flex;align-items:center;align-content:stretch;flex-direction:row-reverse}.mg-upc-dg-top-action button{margin:0.5em;flex-grow:2}@media (max-width: 550px){.mg-upc-dg-top-action{align-items:stretch;flex-direction:column}}.mg-upc-dg-total-votes{text-align:right;display:block;margin-bottom:2em}.mg-list-edit label{color:#000000;display:block;margin-top:0.5em}.mg-list-edit input[type=text],.mg-list-edit textarea,.mg-list-edit select{width:100%;margin-bottom:0.5em;display:block;min-height:2em}.mg-list-edit textarea{height:8em}.mg-list-edit button{margin:0.7em 0;float:left}.mg-list-edit button:first-of-type{float:right}@media (max-width: 550px){.mg-list-edit button{width:100%}}.mg-upc-dg-list-desc-edit-count{display:block;text-align:right}.mg-upc-dg-item{display:flex;align-items:center;margin:2em 0}.mg-upc-dg-item>*{flex-shrink:0}.mg-upc-dg-item>.mg-upc-dg-item-data{flex-grow:1;flex-shrink:2}.mg-upc-dg-item button{margin:0.3em}@media (max-width: 550px){.mg-upc-dg-item{flex-direction:column;text-align:center}.mg-upc-dg-item .mg-upc-dg-item-number{position:relative;top:0.1em;height:0;font-size:3em;color:#fff;font-weight:700;text-shadow:0 0 4px black}.mg-upc-dg-item .mg-upc-dg-item-image{height:7em;width:7em}.mg-upc-dg-item .mg-upc-dg-stock>*,.mg-upc-dg-item .mg-upc-dg-price{float:none;margin:auto;display:block}}.mg-upc-dg-item-adding{margin:0.5em;opacity:0.7;padding:0.3em 1em;background:#eaeaea}.mg-upc-dg-item-handle{padding:0.5em;white-space:nowrap;cursor:move}.mg-upc-dg-item-number{width:3em;text-align:center;flex-shrink:0}.mg-upc-dg-item-image{height:5em;width:5em;max-width:none;object-fit:cover;background:#d5d5d5}.mg-upc-dg-item-data{padding-right:1em;padding-left:1em}.mg-upc-dg-item-data button{font-size:small}.mg-upc-dg-item-data>p{margin:0}.mg-upc-dg-btn-item-desc{width:100%}.mg-upc-dg-btn-item-desc-cancel,.mg-upc-dg-btn-item-desc-save{width:46%;margin:2%;float:left}.mg-upc-dg-price{float:right;margin-left:1em}.mg-upc-dg-price del{opacity:0.5}.mg-upc-dg-stock>*{margin:0;float:right}.mg-upc-dg-pagination-div{display:flex;align-content:stretch;justify-content:center;align-items:center}.mg-upc-dg-hidden{opacity:0.2}.mg-upc-dg-pagination-div.mg-upc-dg-hidden{display:none}.mg-upc-dg-pagination-div::after{content:'';clear:both;display:block}.mg-upc-dg-pagination,.mg-upc-dg-pagination-current{width:39%;text-align:center;position:relative}.mg-upc-dg-pagination-current{width:10%}.mg-upc-dg-pagination .sortable-chosen{position:absolute;top:0;left:0;bottom:0;right:0;margin:0;overflow:hidden;background:#ececd0}.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-handle,.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-number,.mg-upc-dg-pagination .sortable-chosen button{display:none}@keyframes mg-upc-dg-loading-skeleton{100%{transform:translateX(100%)}}.mg-upc-dg-loading-skeleton{--base-color: #ebebeb;--highlight-color: #f5f5f5;--animation-duration: 1.5s;--animation-direction: normal;--pseudo-element-display: block;background-color:var(--base-color);width:100%;border-radius:0.25rem;display:inline-flex;line-height:1;position:relative;overflow:hidden;z-index:1}.mg-upc-dg-loading-skeleton::after{content:' ';display:var(--pseudo-element-display);position:absolute;top:0;left:0;right:0;height:100%;background-repeat:no-repeat;background-image:linear-gradient(90deg, var(--base-color), var(--highlight-color), var(--base-color));transform:translateX(-100%);animation-name:mg-upc-dg-loading-skeleton;animation-direction:var(--animation-direction);animation-duration:var(--animation-duration);animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-dg-loading-skeleton,.mg-upc-dg-on-loading{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-desc,.mg-upc-dg-status-loading .mg-upc-dg-pagination-div,.mg-upc-dg-status-loading button{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-of-lists,.mg-upc-dg-status-loading .mg-upc-dg-list{visibility:hidden}.mg-upc-dg-status-loading .mg-upc-dg-on-loading{display:block}.mg-upc-dg-status-loading .mg-upc-dg-loading-skeleton{display:inline-flex}@keyframes share-animate{from{max-height:0;transform:scaleY(0);opacity:0}to{max-height:125px;transform:scaleY(1);opacity:1}}.mg-upc-dg-share-link{margin:1em 0;max-height:none;animation:share-animate .3s linear;text-align:center}.mg-upc-dg-share-link input{width:70%;font-size:16px;height:40px;border:none;background:#e2e2e2;color:#333;margin:0;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link button{width:30%;font-size:16px;padding:2px !important;height:40px !important;line-height:36px !important;border:none;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link .mg-upc-dg-share{display:inline-block;margin:2% 0}.mg-upc-zero-quantity{opacity:0.3}.mg-upc-dg-quantity{width:4em;display:flex;flex-direction:column;text-align:center;margin:1em}.mg-upc-dg-quantity small{opacity:0.5}.mg-upc-dg-quantity input{text-align:center}.mg-upc-err-required_logged_in .mg-list-new,.mg-upc-err-required_logged_in .mg-upc-dg-alert-close{display:none}.mg-upc-share-btn-img{height:64px;width:64px;display:inline-block;vertical-align:middle;background-size:100%}.mg-upc-share-link{display:block;text-align:right;margin:1em 0}.mg-upc-share-link::after{content:'';display:block;clear:both}.mg-upc-share{text-decoration:none}.mg-upc-dg-share:hover .mg-upc-share-btn-img,.mg-upc-dg-share:focus .mg-upc-share-btn-img,.mg-upc-share:hover .mg-upc-share-btn-img,.mg-upc-share:focus .mg-upc-share-btn-img{transform:scale(1.3);transition:transform 0.3s}.mg-upc-share-facebook{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%233b5998%27%3E%3C/rect%3E%3Cpath d=%27M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-twitter{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300aced%27%3E%3C/rect%3E%3Cpath d=%27M48,22.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6 C41.7,19.8,40,19,38.2,19c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5c-5.5-0.3-10.3-2.9-13.5-6.9c-0.6,1-0.9,2.1-0.9,3.3 c0,2.3,1.2,4.3,2.9,5.5c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1 c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1c2.9,1.9,6.4,2.9,10.1,2.9c12.1,0,18.7-10,18.7-18.7 c0-0.3,0-0.6,0-0.8C46,24.5,47.1,23.4,48,22.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-whatsapp{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2325D366%27%3E%3C/rect%3E%3Cpath d=%27m42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-telegram{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2337aee2%27%3E%3C/rect%3E%3Cpath d=%27m45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-line{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300b800%27%3E%3C/rect%3E%3Cpath d=%27M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-email{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23b2b2b2%27%3E%3C/rect%3E%3Cpath d=%27M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-pinterest{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23dc0000%27/%3E%3Cpath d=%27M32.9 12.4c-10.4 0-15.6 7.6-15.6 13.7 0 3.7 1.5 7.1 4.5 8.3.6.3 1 0 1.1-.5l.4-1.8c.2-.5.2-.8-.2-1.2-1-1-1.6-2.3-1.6-4.3 0-5.6 4.1-10.5 10.8-10.5 6 0 9.2 3.6 9.2 8.4 0 6.2-2.9 11.6-7 11.6-2.2 0-4-2-3.4-4.3.7-2.7 2-5.7 2-7.7 0-1.8-1-3.3-3-3.3-2.4 0-4.3 2.3-4.3 5.6 0 2 .7 3.4.7 3.4l-2.9 11.9c-.4 1.6-1 8.3-1 9.8.9.4 2.2-1.6 3.5-3.8.7-1.2 1.6-2.8 2-4.4l1.5-6c.7 1.5 3 2.7 5.3 2.7 7 0 11.8-6.4 11.8-15 0-6.5-5.5-12.6-13.8-12.6z%27 fill=%27%23fff%27 paint-order=%27fill markers stroke%27/%3E%3C/svg%3E")} 2 2 -
user-post-collections/tags/0.8.29/javascript/mg-upc-client/dist/main.js
r2770005 r2770186 1 !function(){"use strict";var t,e,n,i,o,s,a,l={},r=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function u(t,e){for(var n in e)t[n]=e[n];return t}function d(t){var e=t.parentNode;e&&e.removeChild(t)}function p(e,n,i){var o,s,a,l={};for(a in n)"key"==a?o=n[a]:"ref"==a?s=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return _(e,l,o,s,null)}function _(t,i,o,s,a){var l={type:t,props:i,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function m(t){return t.children}function f(t,e){this.props=t,this.context=e}function g(t,e){if(null==e)return t.__?g(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?g(t):null}function h(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return h(t)}}function v(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!y.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||o)(y)}function y(){for(var t;y.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,o,s,a;t.__d&&(s=(o=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=u({},o)).__v=o.__v+1,S(a,o,i,e.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?g(o):s,o.__h),T(n,o),o.__e!=s&&h(o)))}))}function b(t,e,n,i,o,s,a,c,u,d){var p,f,h,v,y,b,P,C=i&&i.__k||r,N=C.length;for(n.__k=[],p=0;p<e.length;p++)if(null!=(v=n.__k[p]=null==(v=e[p])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?_(null,v,null,null,v):Array.isArray(v)?_(m,{children:v},null,null,null):v.__b>0?_(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=C[p])||h&&v.key==h.key&&v.type===h.type)C[p]=void 0;else for(f=0;f<N;f++){if((h=C[f])&&v.key==h.key&&v.type===h.type){C[f]=void 0;break}h=null}S(t,v,h=h||l,o,s,a,c,u,d),y=v.__e,(f=v.ref)&&h.ref!=f&&(P||(P=[]),h.ref&&P.push(h.ref,null,v),P.push(f,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=w(v,u,t):u=k(t,v,h,C,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=g(h))}for(n.__e=b,p=N;p--;)null!=C[p]&&("function"==typeof n.type&&null!=C[p].__e&&C[p].__e==n.__d&&(n.__d=g(i,p+1)),L(C[p],C[p]));if(P)for(p=0;p<P.length;p++)E(P[p],P[++p],P[++p])}function w(t,e,n){for(var i,o=t.__k,s=0;o&&s<o.length;s++)(i=o[s])&&(i.__=t,e="function"==typeof i.type?w(i,e,n):k(n,i,i,o,i.__e,e));return e}function P(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){P(t,e)})):e.push(t)),e}function k(t,e,n,i,o,s){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||o!=s||null==o.parentNode)t:if(null==s||s.parentNode!==t)t.appendChild(o),a=null;else{for(l=s,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==o)break t;t.insertBefore(o,s),a=s}return void 0!==a?a:o.nextSibling}function C(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function N(t,e,n,i,o){var s;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||C(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i||t.addEventListener(e,s?I:x,s):t.removeEventListener(e,s?I:x,s);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function x(t){this.l[t.type+!1](e.event?e.event(t):t)}function I(t){this.l[t.type+!0](e.event?e.event(t):t)}function S(t,n,i,o,s,a,l,r,c){var d,p,_,g,h,v,y,w,P,k,C,N=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(c=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof N){if(w=n.props,P=(d=N.contextType)&&o[d.__c],k=d?P?P.props.value:d.__:o,i.__c?y=(p=n.__c=i.__c).__=p.__E:("prototype"in N&&N.prototype.render?n.__c=p=new N(w,k):(n.__c=p=new f(w,k),p.constructor=N,p.render=D),P&&P.sub(p),p.props=w,p.state||(p.state={}),p.context=k,p.__n=o,_=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=N.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=u({},p.__s)),u(p.__s,N.getDerivedStateFromProps(w,p.__s))),g=p.props,h=p.state,_)null==N.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==N.getDerivedStateFromProps&&w!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,k),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,k)||n.__v===i.__v){p.props=w,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,k),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}p.context=k,p.props=w,p.state=p.__s,(d=e.__r)&&d(n),p.__d=!1,p.__v=n,p.__P=t,d=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(o=u(u({},o),p.getChildContext())),_||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),C=null!=d&&d.type===m&&null==d.key?d.props.children:d,b(t,Array.isArray(C)?C:[C],n,i,o,s,a,l,r,c),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),y&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=A(i.__e,n,i,o,s,a,l,c);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(c||null!=a)&&(n.__e=r,n.__h=!!c,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function T(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function A(e,n,i,o,s,a,r,c){var u,p,_,m=i.props,f=n.props,h=n.type,v=0;if("svg"===h&&(s=!0),null!=a)for(;v<a.length;v++)if((u=a[v])&&"setAttribute"in u==!!h&&(h?u.localName===h:3===u.nodeType)){e=u,a[v]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=s?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),a=null,c=!1}if(null===h)m===f||c&&e.data===f||(e.data=f);else{if(a=a&&t.call(e.childNodes),p=(m=i.props||l).dangerouslySetInnerHTML,_=f.dangerouslySetInnerHTML,!c){if(null!=a)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,o){var s;for(s in n)"children"===s||"key"===s||s in e||N(t,s,null,n[s],i);for(s in e)o&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||N(t,s,e[s],n[s],i)}(e,f,m,s,c),_)n.__k=[];else if(v=n.props.children,b(e,Array.isArray(v)?v:[v],n,i,o,s&&"foreignObject"!==h,a,r,a?a[0]:i.__k&&g(i,0),c),null!=a)for(v=a.length;v--;)null!=a[v]&&d(a[v]);c||("value"in f&&void 0!==(v=f.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&N(e,"value",v,m.value,!1),"checked"in f&&void 0!==(v=f.checked)&&v!==e.checked&&N(e,"checked",v,m.checked,!1))}return e}function E(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function L(t,n,i){var o,s;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||E(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&L(o[s],n,"function"!=typeof t.type);i||null==t.__e||d(t.__e),t.__e=t.__d=void 0}function D(t,e,n){return this.constructor(t,n)}function O(n,i,o){var s,a,r;e.__&&e.__(n,i),a=(s="function"==typeof o)?null:o&&o.__k||i.__k,r=[],S(i,n=(!s&&o||i).__k=p(m,null,[n]),a||l,l,void 0!==i.ownerSVGElement,!s&&o?[o]:a?null:i.firstChild?t.call(i.childNodes):null,r,!s&&o?o:a?a.__e:i.firstChild,s),T(r,n)}t=r.slice,e={__e:function(t,e,n,i){for(var o,s,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&null!=s.getDerivedStateFromError&&(o.setState(s.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,f.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},n),this.props)),t&&u(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),v(this))},f.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),v(this))},f.prototype.render=m,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y.__r=0,a=0;var U,R,W,j=0,$=[],H=e.__b,M=e.__r,B=e.diffed,F=e.__c,q=e.unmount;function Q(t,n){e.__h&&e.__h(R,t,j||n),j=0;var i=R.__H||(R.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function X(t){return j=1,V(ot,t)}function V(t,e,n){var i=Q(U++,2);return i.t=t,i.__c||(i.__=[n?n(e):ot(void 0,e),function(t){var e=i.t(i.__[0],t);i.__[0]!==e&&(i.__=[e,i.__[1]],i.__c.setState({}))}],i.__c=R),i.__}function K(t,n){var i=Q(U++,3);!e.__s&&it(i.__H,n)&&(i.__=t,i.__H=n,R.__H.__h.push(i))}function G(t){return j=5,z((function(){return{current:t}}),[])}function z(t,e){var n=Q(U++,7);return it(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function J(t,e){return j=8,z((function(){return t}),e)}function Y(t){var e=R.context[t.__c],n=Q(U++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(R)),e.props.value):t.__}function Z(){for(var t;t=$.shift();)if(t.__P)try{t.__H.__h.forEach(et),t.__H.__h.forEach(nt),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){R=null,H&&H(t)},e.__r=function(t){M&&M(t),U=0;var e=(R=t.__c).__H;e&&(e.__h.forEach(et),e.__h.forEach(nt),e.__h=[])},e.diffed=function(t){B&&B(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==$.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),tt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);tt&&(e=requestAnimationFrame(n))})(Z)),R=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(et),t.__h=t.__h.filter((function(t){return!t.__||nt(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),F&&F(t,n)},e.unmount=function(t){q&&q(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{et(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var tt="function"==typeof requestAnimationFrame;function et(t){var e=R,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),R=e}function nt(t){var e=R;t.__c=t.__(),R=e}function it(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function ot(t,e){return"function"==typeof e?e(t):e}var st=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t};const at="ui/reset",lt="ui/error",rt="ui/message",ct="ui/editing",ut="listOfLists/set",dt="listOfLists/remove",pt="listOfLists/create",_t="listOfList/addingPost",mt="listOfList/setPage",ft="listOfList/setTotalPages",gt="list/set",ht="list/update",vt="list/setPage",yt="list/setTotalPages",bt="list/setItems",wt="list/removeItem",Pt="list/addItem",kt="list/updateItem",Ct="list/moveItem",Nt="list/cart";var xt=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Lt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Lt().ajaxUrl,e),i=await n.json();i.nonce&&(Lt().nonce=i.nonce),i.user_id&&(Lt().user_id=i.user_id)}const o={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Lt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(o.body=JSON.stringify(n));const s=await fetch(Lt().root+i+e,o);s.headers.get("x-wp-nonce")&&(Lt().nonce=s.headers.get("x-wp-nonce"));const a=await s.json();return{data:a,headers:s.headers,status:s.status}};function It(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Lt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class St extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function Tt(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var o;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new St(null==t||null===(o=t.data)||void 0===o?void 0:o.message,t)}let At={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt("GET","/My"+It(t),{}).then((function(t){return Tt(t),t}))},discover:function(t){return xt("GET","/"+It(t),{}).then((function(t){return Tt(t),t}))},get:function(t){return xt("GET","/"+t,{}).then((function(t){return Tt(t),t}))},cart:function(t){return xt("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return Tt(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt("GET","/"+t+"/items"+It(e),{}).then((function(t){return Tt(t),t}))},delete:function(t){return xt("DELETE","/"+t,{}).then((function(t){return Tt(t),t}))},create:function(t){return xt("POST","",t).then((function(t){return Tt(t),t}))},update:function(t){let e=t.id;return delete t.id,xt("PATCH","/"+e,t).then((function(t){return Tt(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),xt("POST","/"+t+"/items"+It(n),e).then((function(t){return Tt(t),t}))},quit:function(t,e){return xt("DELETE","/"+t+"/items/"+e,{}).then((function(t){return Tt(t),t}))},updateItem:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,n).then((function(t){return Tt(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return xt("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return Tt(t),t}))},move:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return Tt(t),t}))}};var Et=At;function Lt(){return MgUserPostCollections}function Dt(){var t;return null===(t=Lt())||void 0===t?void 0:t.sortable}function Ot(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Ut(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function Rt(t,e){return!!t.type&&jt(t.type,e)}function Wt(t){var e;const n=[],i=null===(e=Lt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(jt(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function jt(t,e){const n=Ot(t);return!(!n||!n.supports)&&n.supports.includes(e)}const $t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function Ht(t){return JSON.parse(JSON.stringify(t))}function Mt(t){return"string"!=typeof t?"":t.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2")}function Bt(t){return Et.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}function Ft(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";if(!jQuery)return!1;const n=jQuery("<div>").addClass("mg-upc-alert mg-upc-alert-"+e);n.append(jQuery("<p>").html(t));const i=jQuery('<a class="mg-upc-alert-close" href="#"><span class="mg-upc-icon upc-font-close"></span></a>').on("click",(function(){return n.remove(),!1}));return n.append(i),n}function qt(t,e){const{type:n,payload:i}=e;let o=!1;const s=t=>(o=a({status:"failed"}),t.error&&(o.error=t.error.message?t.error.message:"",o.errorCode=t.error.code?t.error.code:""),o),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=Ht(t)),e)for(const t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);return o};let l=function(t,e){const{type:n,payload:i}=e;let o,s;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=!1===t?{}:Ht(t)),e)for(const t in e)s[t]=e[t];return s};switch(n){case gt:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case ht:return i.items=Ht(t.items),i;case pt:return i;case bt:return a({items:i});case"list/addItem/failed":case Pt:return null!=i&&i.list?a(i.list):t;case kt:const e=!!i.item&&i.item;return o=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:o});case wt:if(1===t.items.length||!1===i)return t;if(s=a(),o=s.items.filter((t=>t.post_id!==i)),jt(t.type,"sortable")){const e=parseInt(t.items[0].position,10);o.forEach(((t,n)=>{o[n].position=e+n}))}if(jt(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(s.vote_counter=s.vote_counter-e.votes)}return{...s,items:o};case Ct:const n=parseInt(t.items[0].position,10);o=a().items.slice();const l=a().items[i.oldIndex];return o.splice(i.oldIndex,1),o.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(o.forEach(((t,e)=>{o[e].position=n+e})),a({items:o}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case ut:return i;case Pt:case gt:return!1;case dt:return!1===i?t:Ht(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(o=a({listOfList:r,list:l}),t.addingPost||(o.title=o.list?o.list.title:Kt.title)),n){case"ui/mode":return a({mode:i});case at:return{...Kt,mode:t.mode};case lt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case rt:return a(!1===i?{message:!1,errorCode:!1}:{message:i});case Nt:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case ct:return a({editing:i});case _t:return o=a(),o.addingPost=i,i&&(o.title="Add to..."),o;case pt:o=a(),o.title=i.title?i.title:Kt.title,o.listTotalPages=1,o.listPage=1,o.addingPost=!1;break;case Pt:if(o=a(),null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Kt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(o.error=i.message,o.status="failed"),o.addingPost=!1;break;case mt:return a({page:i});case ft:return a({totalPages:i});case vt:return a({listPage:i});case yt:return a({listTotalPages:i});case"list/set/loading":return o=a(),o.status="loading",o.listOfList=!1,"object"==typeof i?(o.list=i,i.title&&(o.title=i.title)):o.list={ID:i},o;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case pt+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return o=a(),o.addingPost=!1,o.status="succeeded",o.error=!1,o.errorCode=!1,o.title=o.list?o.list.title:Kt.title,o;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case pt+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case pt+"/failed":return o=a({status:"failed"}),e.error&&e.error.message&&(o.error=e.error.message),o;case"list/addItem/failed":if(o=a(),o.addingPost=!1,o.title=o.list?o.list.title:Kt.title,null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Kt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(o.error=i.message,o.status="failed"),s(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return s(e)}return!1!==o?o:t}const Qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:o}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Vt=(t,e)=>n=>{let i;if((o=n)&&"object"==typeof o&&!0===o.asyncThunk){let o={dispatch:Vt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,o)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var o;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Kt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:st("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},Gt=function(t,e){var n={__c:e="__cC"+a++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(v)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function zt(t){return new Date(t).toLocaleDateString()}var Jt,Yt,Zt,te=function(t){const{state:e,dispatch:n}=Y(Gt);return p("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),p("div",{className:"mg-upc-dg-item-title"},p("span",null,t.list.title),"my"!==e.mode&&p(m,null,p("span",null,p("a",{href:"#",onClick:function(e){!function(t){t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault()}(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),p("span",{className:"mg-upc-list-dates"},p("i",null," ",p("b",null,"Created:")," ",zt(t.list.created)),p("i",null," ",p("b",null,"Modified:")," ",zt(t.list.modified)))))),p("span",{className:"mg-upc-dg-item-count"},t.list.count),p("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&p("button",{"aria-label":st("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},p("span",{className:"mg-upc-icon upc-font-trash"}))))};class ee extends f{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(p("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return p("span",null,e?t.map(((t,n)=>p(e,{key:n},t,""))):t)}}Zt={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(Yt="defaultProps")in(Jt=ee)?Object.defineProperty(Jt,Yt,{value:Zt,enumerable:!0,configurable:!0,writable:!0}):Jt[Yt]=Zt;var ne=function(t){return p("div",{className:"mg-upc-dg-pagination-div"},p("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":st("Previous page"),title:st("Previous page"),onClick:t.onPreview},p("span",{className:"mg-upc-icon upc-font-arrow_left"})),p("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),p("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":st("Next page"),title:st("Next page"),onClick:t.onNext},p("span",{className:"mg-upc-icon upc-font-arrow_right"})))};const ie=()=>({type:at,payload:null}),oe=t=>({type:_t,payload:t}),se=t=>({type:ct,payload:t}),ae=Qt(Nt,(async function(t,e){return await Bt(t)})),le=Qt(ut,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Et.my(t).then((t=>re(t,e,i)))}));function re(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(ue(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(de(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},o={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in o){const n=t.headers.get(e);n&&(i[o[e]]=decodeURIComponent(n))}e.dispatch(oe(i))}return t.data}Qt(ut,(async function(t,e){return null===t&&(t={}),await Et.discover(t).then((t=>re(t,e,!1)))}));const ce=Qt(dt,(async function(t,e){return await Et.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(le({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(le({page:n-1}))}return!1}return t}))})),ue=t=>({type:mt,payload:t}),de=t=>({type:ft,payload:t}),pe=t=>({type:vt,payload:t}),_e=t=>({type:yt,payload:t}),me=Qt(gt,(async function(t,e){return!1===t||!0===t?t:await Et.get("object"==typeof t?t.ID:t).then((t=>(Ce(t,e.dispatch),t.data)))})),fe=Qt(ht,(async function(t,e){return await Et.update(t).then((t=>(e.dispatch(se(!1)),Ce(t,e.dispatch),t.data)))})),ge=Qt(pt,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(oe({id:t.addingPost})),await Et.create(t).then((t=>(e.dispatch(se(!1)),Ce(t,e.dispatch),t.data)))})),he=Qt(bt,(async function(t,e){return await Et.items(e.getState().list.ID,t).then((t=>(Ce(t,e.dispatch),t.data)))})),ve=Qt(wt,(async function(t,e){const n=e.getState();return await Et.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(he({page:t})):t===i&&e.dispatch(he({page:Math.max(1,t-1)})),!1}return t}))})),ye=Qt(Pt,(async function(t,e){let n=e.extra[0],i=!1;try{await Et.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var o;const n=null==t||null===(o=t.response)||void 0===o?void 0:o.data;i=e.rejectWithValue(n)}return i})),be=Qt(kt,(async function(t,e){const n=e.extra[0];return await Et.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),we=Qt(Ct,(async function(t,e){const n=e.extra[0],i=e.extra[1],o=n.items[t],s=o.position-t+i;return await Et.move(n.ID,o.post_id,s).then((e=>({oldIndex:t,newIndex:i})))})),Pe=Qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Et.move(n.ID,o.post_id,i+1),await e.dispatch(he({page:e.getState().listPage})),t})),ke=Qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Et.move(n.ID,o.post_id,i-1),await e.dispatch(he({page:e.getState().listPage})),t}));function Ce(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(pe(parseInt(t.headers.get("x-wp-page"),10))),e(_e(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(pe(parseInt(t.data.items_page["X-WP-Page"],10))),e(_e(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}var Ne=function(t){const{state:e,dispatch:n}=Y(Gt);return p(m,null,p("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>p("li",{className:"mg-upc-dg-item-list"},p("div",null,p(ee,{width:"1.5em",height:"1.5em"})),p("div",{className:"mg-upc-dg-item-title"},p(ee,null)),p("div",{className:"mg-upc-dg-item-count"},p(ee,null)))))),p("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>p(te,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&p(ne,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},xe=function(t){var e,n,i;const[o,s]=X(!1),[a,l]=X(""),r=G({});return K((()=>{l(t.item.description)}),[t.item]),K((()=>{o&&r.current.focus()}),[o]),p(m,null,p("span",null,p("br",null),"Adding item:"),p("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null," "),p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t}),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!o&&p("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!o&&p("button",{onClick:()=>{s(!0)}},""===a&&p("span",null,st("Add Comment")),""!==a&&p("span",null,st("Edit Comment"))),p("input",{ref:r,className:o?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),o&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{s(!1),l(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,st("Cancel"))),o&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{s(!1),t.onSaveItemDescription(a)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,st("Save"))))),p("span",null,st("Select where the item will be added:")))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ie.apply(this,arguments)}function Se(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Te(t){this.props=t}(Te.prototype=new f).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(t,e){return Se(this.props,t)||Se(this.state,e)};var Ae=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ae&&Ae(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ee=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var o,s=e;s=s.__;)if((o=s.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Ee(t,e,n,i)};var Le=e.unmount;function De(){this.__u=0,this.t=null,this.__b=null}function Oe(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Ue(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),Le&&Le(t)},(De.prototype=new f).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=Oe(i.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__e){var t=i.state.__e;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__e:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(a,a)},De.prototype.componentWillUnmount=function(){this.t=[]},De.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__e&&p(m,null,t.fallback);return o&&(o.__h=null),[p(m,null,e.__e?null:t.children),o]};var Re=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function We(t){return this.getChildContext=function(){return t.context},t.children}function je(t){var e=this,n=t.i;e.componentWillUnmount=function(){O(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),O(p(We,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Ue.prototype=new f).__e=function(t){var e=this,n=Oe(e.__v),i=e.o.get(t);return i[0]++,function(o){var s=function(){e.props.revealOrder?(i.push(o),Re(e,t,i)):o()};n?n(s):s()}},Ue.prototype.render=function(t){this.u=null,this.o=new Map;var e=P(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Ue.prototype.componentDidUpdate=Ue.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Re(t,n,e)}))};var $e="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,He=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Me="undefined"!=typeof document,Be=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};f.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(f.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Fe=e.event;function qe(){}function Qe(){return this.cancelBubble}function Xe(){return this.defaultPrevented}e.event=function(t){return Fe&&(t=Fe(t)),t.persist=qe,t.isPropagationStopped=Qe,t.isDefaultPrevented=Xe,t.nativeEvent=t};var Ve={configurable:!0,get:function(){return this.class}},Ke=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var o=-1===e.indexOf("-");for(var s in i={},n){var a=n[s];Me&&"children"===s&&"noscript"===e||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!Be(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():o&&He.test(s)?s=s.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),i[s]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=P(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Ve.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Ve))}t.$$typeof=$e,Ke&&Ke(t)};var Ge=e.__r;e.__r=function(t){Ge&&Ge(t),t.__c};var ze=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Je(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ye(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function Ze(t){(t.querySelector("[autofocus]")||t).focus()}function tn(){Ye("[data-a11y-dialog]").forEach((function(t){new Je(t)}))}Je.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ye('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ye("[data-a11y-dialog-hide]",this.$el).concat(Ye('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Je.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,Ze(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Je.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Je.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Je.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Je.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Je.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Je.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&27===t.which&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&9===t.which&&function(t,e){var n=function(t){return Ye(ze.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Je.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||Ze(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",tn):window.requestAnimationFrame?window.requestAnimationFrame(tn):window.setTimeout(tn,16));const en=t=>{const e=(()=>{const[t,e]=X(!1);return K((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=X(null);return[t,J((t=>{null!==t&&e(new Je(t))}),[])]})(),i=J((()=>e.hide()),[e]),o=t.role||"dialog",s="alertdialog"===o,a=t.titleId||t.id+"-title";return K((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:o,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:s?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:o}=t;if(K((()=>(n&&o(n),()=>o(void 0))),[o,n]),!e)return null;const s=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=p("h2",Ie({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&p("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=p("button",Ie({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=p(je,{__v:t,i:e});return n.containerInfo=e,n}(p("div",Ie({},i.container,{className:t.classNames.container}),p("div",Ie({},i.overlay,{className:t.classNames.overlay})),p("div",Ie({},i.dialog,{className:t.classNames.dialog}),r)),s)};en.defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}},function(t){function e(e,i,o,s){const a=o||s.parent(),l=a.find(".mg-upc-item-vote").attr("disabled",!0);mgUpcApiClient.vote(e,i,{context:"web",posts:n(a)}).then((function(e){t(document.body).trigger("mg_upc_vote_response",[e,a])})).catch((function(t){var e,n;l.attr("disabled",!1),null!==(e=t.response)&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.message&&(s?s.append(Ft(t.response.data.message)):a.before(Ft(t.response.data.message)))}))}function n(e){return[...e.children().map((function(){return t(this).data("pid")}))].join(",")}t(".mg-upc-item-vote").on("click",(function(){const n=t(this).data("vote").split(",");return 2===n.length&&e(n[0],n[1],!1,t(this).closest(".mg-upc-item")),!1})),t((function(){t(".mg-upc-vote").each((function(){const n=t(this);e(n.data("id"),0,n.find(".mg-upc-items-container"),!1)}))})),t(document.body).on("mg_upc_vote_response",(function(e,n,i){if(!n.data)return;const o=parseInt(n.data.vote_counter,10),s=i.find(".mg-upc-item-vote");i.data("votes",o),n.data.can_vote?s.attr("disabled",!1).show():s.animate({width:0,padding:0,opacity:0},200,(function(){s.remove()})),n.data.posts.forEach((function(e){const n=i.find(".mg-upc-item[data-pid="+e.post_id+"]"),s=parseInt(e.votes,10);t(document.body).trigger("mg_upc_item_vote_set",[n,s,o])}))})),t(document.body).on("mg_upc_item_vote_set",(function(t,e,n,i){const o=i>0?Math.round(1e3*n/i)/10:0,s=e.find(".mg-upc-votes");s.find(".mg-upc-item-votes-number").html(n),s.find(".mg-upc-item-percent").html(o+"%"),s.find(".mg-upc-item-bar-progress").animate({width:o+"%"}),s.show()}))}(jQuery),function(t){t(".mg-upc-add-product-to-list").on("click",(function(){let e=t(this).data("id");const n=t(this).closest(".product,.summary").find("[name='variation_id']");return n.length>0&&parseInt(n.val(),10)>0&&(e=n.val()),window.addItemToList(e),!1}));const e="mg-upc-btn-loading",n="mg-upc-product-added",i="mg-upc-product-error",o="Sorry, an error occurred.";function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(st("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(st("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}t((function(){if("undefined"==typeof wc_add_to_cart_params)return!1;t(".mg-upc-item-product").removeClass("mg-upc-hide").on("click",(function(e){return s(e,t(this),!1)})),t(".mg-upc-add-list-to-cart").removeClass("mg-upc-hide").on("click",(function(s){const a=t(this);return a.hasClass(e)||(a.removeClass(n+" "+i).addClass(e),window.mgUpcAddListToCart(t(this).data("id")).then((function(i){a.removeClass(e),i.err&&a.before(Ft(Mt(i.err))),i.msg&&a.before(Ft(Mt(i.msg),"success")),a.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,a])})).catch((t=>{var n,i;a.removeClass(e),null!==(n=t.response)&&void 0!==n&&null!==(i=n.data)&&void 0!==i&&i.message?a.before(Ft(Mt(t.response.data.message))):alert(o)}))),!1}))}))}(jQuery);var nn=function(t){var e;const[n,i]=X(""),[o,s]=X(""),[a,l]=X(""),[r,c]=X(""),u=z((()=>Wt(t.addingPost)),[t.addingPost]);function d(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&d(u[0]),K((()=>{i(t.list.title),s(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),K((()=>{var t;null!==(t=Ot(a))&&void 0!==t&&t.available_statuses&&-1===Ot(a).available_statuses.indexOf(r)&&c(Ot(a).available_statuses[0])}),[a]),p("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&p(m,null,p("label",null,st("Select a list type:")),p("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>p("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>d(t),onKeyPress:e=>{13===e.keyCode&&d(t)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,t.label),p("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&jt(a,"editable_title")&&p(m,null,p("label",{htmlFor:`title-${t.list.ID}`},st("Title")),p("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&jt(a,"editable_content")&&p(m,null,p("label",{htmlFor:`content-${t.list.ID}`},st("Description")),p("textarea",{id:`content-${t.list.ID}`,value:o,onChange:function(t){s(t.target.value)},maxLength:500}),p("span",{className:"mg-upc-dg-list-desc-edit-count"},p("i",null,null==o?void 0:o.length),"/500")),""!==a&&!Ot(a)&&p("span",null,st("Unknown List Type...")),""!==a&&(null===(e=Ot(a))||void 0===e?void 0:e.available_statuses)&&Ot(a).available_statuses.length>1&&p(m,null,p("label",{htmlFor:`status-${t.list.ID}`},st("Status")),p("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ot(a).available_statuses.map(((t,e)=>{if(function(t){const e=Ut(t);return e&&e.show_in_status_list}(t))return p("option",{value:t},function(t){const e=Ut(t);return e?e.label:t}(t))})))),""!==a&&Ot(a)&&p("div",{className:"mg-upc-dg-edit-actions"},p("button",{onClick:()=>t.onSave({title:n,content:o,type:a,status:r})},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,st("Save"))),p("button",{onClick:()=>t.onCancel()},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,st("Cancel")))))},on=function(t){var e;const[n,i]=X(!1),[o,s]=X(""),[a,l]=X(null===(e=t.item)||void 0===e?void 0:e.quantity),r=G({});K((()=>{s(t.item.description)}),[t.item]),K((()=>{n&&r.current.focus()}),[n]);const c=G(!1);return K((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),p("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},Rt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),p("span",{className:"mg-upc-dg-item-number"},t.item.position)),Rt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return Rt(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),p("a",{href:t.item.link},p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t})),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:t.item.link},t.item.title),t.item.price_html&&p("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&p("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&p("p",null,t.item.description),t.editable&&!n&&Rt(t.list,"editable_item_description")&&p("button",{onClick:()=>{i(!0)}},p("span",{className:"mg-upc-icon upc-font-edit"}),""===o&&p("span",null,st("Add Comment")),""!==o&&p("span",null,st("Edit Comment"))),p("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:o,onChange:function(t){s(t.target.value)},maxLength:400}),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),s(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,st("Cancel"))),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(o)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,st("Save")))),t.editable&&Rt(t.list,"quantity")&&p("div",{className:"mg-upc-dg-quantity"},p("small",null,st("Quantity")),p("input",{"aria-label":st("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&p("div",null,p("button",{"aria-label":"Remove item",onClick:t.onRemove},p("span",{className:"mg-upc-icon upc-font-trash"}))))},sn=function(t){return new Promise((function(e,n){const i=document.createElement("script");let o=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){o||this.readyState&&"complete"!=this.readyState||(o=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},an=function(t){var e,n,i;const o=G(null),s=G((e=>{t.onMove(e)}));return K((()=>{s.current=t.onMove})),K((()=>{let e=!1;if(Rt(t.list,"sortable")){const t=()=>{e=Sortable.create(o.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){s.current(t)}})};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),p(m,null,p("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>p("li",{className:"mg-upc-dg-item"},Rt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",p(ee,{width:"1.5em"})," "),p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(ee,{width:"1em"})," ")),Rt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(ee,{width:"1em"})," ")),p("div",{className:"mg-upc-dg-item-skeleton-image"},p(ee,{width:"5em",height:"5em"})),p("div",{className:"mg-upc-dg-item-data"},p(ee,{count:2})))))),p("ul",{ref:o,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&p("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>p(on,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),Rt(t.list,"vote")&&p("span",{className:"mg-upc-dg-total-votes"}," ",st("Total votes:")," ",p("span",null," ",t.list.vote_counter)))},ln=function(t){const e=G(null),n=G(null),i=st("Copy"),[o,s]=X(i);K((()=>{let t=null;o!==i&&(t=setTimeout((()=>{s(i),clearTimeout(t)}),2e3))}),[o]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:st("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Lt().shareButtons&&(r=r.filter((t=>Lt().shareButtons.includes(t.slug||t.name.toLowerCase())))),p("div",{className:"mg-upc-dg-share-link"},p("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),p("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?s(st("Copied!")):s("Error!")}},p("span",{className:"mg-upc-icon upc-font-copy"}),p("span",null,o)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),p("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},p("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},rn=function(t){var e;const{state:n,dispatch:i}=Y(Gt),[o,s]=X(!1),a=G(!1),l=G(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(he({page:t}))}return K((()=>{const t=n.list;let e=!1,o=!1;if(t&&Rt(t,"sortable")){const t=()=>{n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(Pe(t.oldIndex))}})),n.listPage>1&&(o=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(ke(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy(),o&&o.destroy()}}),[n.list,n.listPage,n.listTotalPages]),K((()=>{s(!1)}),[n.editing,n.list,n.addingPost]),p(m,null,n.editing&&p(nn,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const o={};o.title=t.title,o.content=t.content,o.type=t.type,o.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(o.adding=n.addingPost.post_id),i(ge(o))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(fe(e))}},onCancel:function(){i(se(!1)),-1===n.list.ID&&(i(me(!1)),i(ie()),i(le()))}}),!n.editing&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return jt(i,"editable_title")||jt(i,"editable_content")||(null===(e=Ot(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&p("button",{className:"mg-upg-edit",onClick:()=>i(se(!0))},p("span",{className:"mg-upc-icon upc-font-edit"}),p("span",null,st("Edit"))),n.list.link&&p("button",{className:"mg-upg-share",onClick:()=>s(!o)},p("span",{className:"mg-upc-icon upc-font-share"}),p("span",null,st("Share"))),"cart"===n.list.type&&p("button",{className:"mg-upg-share",onClick:function(){i(ae(n.list.ID))}},p("span",{className:"mg-upc-icon upc-font-cart"}),p("span",null,st("Add all to cart")))),o&&n.list.link&&p(ln,{link:n.list.link,title:n.list.title}),n.list.content&&p("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:Mt(n.list.content)}}),p(ee,{count:3}),p(an,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(we(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ve(e.post_id))},onSaveItemDescription:function(t,e,n){i(be(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(be(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&p(ne,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}))};function cn(t){return parseInt(t.author,10)===parseInt(Lt().user_id,10)}function un(){"replaceState"in history?(history.replaceState("",document.title,location.pathname),history.go(-1)):location.hash=""}O(p((t=>{const[e,n]=V(qt,Kt);return p(Gt.Provider,{value:{state:e,dispatch:Vt(n,(()=>e))}},t.children)}),null,p((function(){const{state:t,dispatch:e}=Y(Gt),n=z((()=>Wt(t.addingPost)),[t.addingPost]),i=G(!1);let o="listOfList";if(t.addingPost)o=t.editing?"addingToNew":"adding";else if(t.editing){var s;o=-1!==(null===(s=t.list)||void 0===s?void 0:s.ID)?"edit":"new"}else o=t.list?"list":"listOfList";const a={container:"mg-upc-dg-container",overlay:"mg-upc-dg-overlay",dialog:"mg-upc-dg-content"+(t.errorCode?" mg-upc-err-"+t.errorCode:""),title:"mg-upc-dg-title",closeButton:"mg-upc-dg-close"};K((()=>{window.showMyLists=function(){l()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(ie()),n||r(t)},window.mgUpcAddListToCart=Bt}),[i.current,e]);const l=()=>{e(ie()),e(le()),i.current.show()},r=t=>{e(oe({post_id:t})),e(le({addingPost:t})),i.current.show()};function c(n){n<1||n>t.totalPages||"loading"===t.status||e(ue(n))}const u="list"===o||"new"===o||"edit"===o||"addingToNew"===o;return p(en,{id:"mg-upc-dg-dialog",dialogRef:function(t){i.current=t},title:t.title,classNames:a,onBack:!!u&&function(){switch(o){case"list":default:l();break;case"new":e(me(!1)),e(se(!1)),l();break;case"edit":e(se(!1));break;case"addingToNew":e(me(!1)),e(se(!1)),e(le({addingPost:t.addingPost.post_id}))}}},p("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+o},p("div",{className:"mg-upc-dg-wait"}),t.message&&p("div",{className:"mg-upc-dg-msg"},t.message,p("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:rt,payload:null})}},p("span",{className:"mg-upc-icon upc-font-close"}))),t.error&&p("div",{className:"mg-upc-dg-error"},t.error,p("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:lt,payload:null})}},p("span",{className:"mg-upc-icon upc-font-close"}))),p("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&p(xe,{item:t.addingPost,onSaveItemDescription:function(n){e(oe({...t.addingPost,description:n}))}}),("listOfList"===o||"adding"===o)&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},n.length>0&&p("button",{className:"mg-list-new",onClick:function(t){e(se(!0)),e(me(!0)),i.current.show()}},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null,st("Create List")))),p(Ne,{lists:t.listOfList,onSelect:function(n){e(se(!1)),t.addingPost?e(ye(n.ID,t.addingPost)):(e(me(n)),i.current.show())},onRemove:!t.addingPost&&function(t){e(ce(t.ID))},loadPreview:function(){c(t.page-1)},loadNext:function(){c(t.page+1)}})),t.list&&p(rn,{editable:cn(t.list)}))))}),null)," "),document.querySelector("body")),"#my-lists"===location.hash&&un(),window.addEventListener("hashchange",(function(){"#my-lists"===location.hash&&(window.showMyLists(),un())}),!1),window.mgUpcApiClient=Et}();1 (()=>{"use strict";var t,e,n,i,o,s,a={},l=[],r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c(t,e){for(var n in e)t[n]=e[n];return t}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function d(e,n,i){var o,s,a,l={};for(a in n)"key"==a?o=n[a]:"ref"==a?s=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return p(e,l,o,s,null)}function p(t,i,o,s,a){var l={type:t,props:i,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function _(t){return t.children}function m(t,e){this.props=t,this.context=e}function f(t,e){if(null==e)return t.__?f(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?f(t):null}function g(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return g(t)}}function h(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!v.__r++||o!==e.debounceRendering)&&((o=e.debounceRendering)||setTimeout)(v)}function v(){for(var t;v.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,o,s,a;t.__d&&(s=(o=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=c({},o)).__v=o.__v+1,I(a,o,i,e.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?f(o):s,o.__h),S(n,o),o.__e!=s&&g(o)))}))}function y(t,e,n,i,o,s,r,c,u,d){var m,g,h,v,y,w,N,k=i&&i.__k||l,C=k.length;for(n.__k=[],m=0;m<e.length;m++)if(null!=(v=n.__k[m]=null==(v=e[m])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?p(null,v,null,null,v):Array.isArray(v)?p(_,{children:v},null,null,null):v.__b>0?p(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=k[m])||h&&v.key==h.key&&v.type===h.type)k[m]=void 0;else for(g=0;g<C;g++){if((h=k[g])&&v.key==h.key&&v.type===h.type){k[g]=void 0;break}h=null}I(t,v,h=h||a,o,s,r,c,u,d),y=v.__e,(g=v.ref)&&h.ref!=g&&(N||(N=[]),h.ref&&N.push(h.ref,null,v),N.push(g,v.__c||y,v)),null!=y?(null==w&&(w=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=b(v,u,t):u=P(t,v,h,k,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=f(h))}for(n.__e=w,m=C;m--;)null!=k[m]&&("function"==typeof n.type&&null!=k[m].__e&&k[m].__e==n.__d&&(n.__d=f(i,m+1)),E(k[m],k[m]));if(N)for(m=0;m<N.length;m++)A(N[m],N[++m],N[++m])}function b(t,e,n){for(var i,o=t.__k,s=0;o&&s<o.length;s++)(i=o[s])&&(i.__=t,e="function"==typeof i.type?b(i,e,n):P(n,i,i,o,i.__e,e));return e}function w(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){w(t,e)})):e.push(t)),e}function P(t,e,n,i,o,s){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||o!=s||null==o.parentNode)t:if(null==s||s.parentNode!==t)t.appendChild(o),a=null;else{for(l=s,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==o)break t;t.insertBefore(o,s),a=s}return void 0!==a?a:o.nextSibling}function N(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||r.test(e)?n:n+"px"}function k(t,e,n,i,o){var s;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||N(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||N(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i||t.addEventListener(e,s?x:C,s):t.removeEventListener(e,s?x:C,s);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function C(t){this.l[t.type+!1](e.event?e.event(t):t)}function x(t){this.l[t.type+!0](e.event?e.event(t):t)}function I(t,n,i,o,s,a,l,r,u){var d,p,f,g,h,v,b,w,P,N,k,C,x,I=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(u=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof I){if(w=n.props,P=(d=I.contextType)&&o[d.__c],N=d?P?P.props.value:d.__:o,i.__c?b=(p=n.__c=i.__c).__=p.__E:("prototype"in I&&I.prototype.render?n.__c=p=new I(w,N):(n.__c=p=new m(w,N),p.constructor=I,p.render=L),P&&P.sub(p),p.props=w,p.state||(p.state={}),p.context=N,p.__n=o,f=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=c({},p.__s)),c(p.__s,I.getDerivedStateFromProps(w,p.__s))),g=p.props,h=p.state,f)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&w!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,N),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,N)||n.__v===i.__v){p.props=w,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,N),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}if(p.context=N,p.props=w,p.__v=n,p.__P=t,k=e.__r,C=0,"prototype"in I&&I.prototype.render)p.state=p.__s,p.__d=!1,k&&k(n),d=p.render(p.props,p.state,p.context);else do{p.__d=!1,k&&k(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++C<25);p.state=p.__s,null!=p.getChildContext&&(o=c(c({},o),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),x=null!=d&&d.type===_&&null==d.key?d.props.children:d,y(t,Array.isArray(x)?x:[x],n,i,o,s,a,l,r,u),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=T(i.__e,n,i,o,s,a,l,u);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(u||null!=a)&&(n.__e=r,n.__h=!!u,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function S(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function T(e,n,i,o,s,l,r,c){var d,p,_,m=i.props,g=n.props,h=n.type,v=0;if("svg"===h&&(s=!0),null!=l)for(;v<l.length;v++)if((d=l[v])&&"setAttribute"in d==!!h&&(h?d.localName===h:3===d.nodeType)){e=d,l[v]=null;break}if(null==e){if(null===h)return document.createTextNode(g);e=s?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,g.is&&g),l=null,c=!1}if(null===h)m===g||c&&e.data===g||(e.data=g);else{if(l=l&&t.call(e.childNodes),p=(m=i.props||a).dangerouslySetInnerHTML,_=g.dangerouslySetInnerHTML,!c){if(null!=l)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,o){var s;for(s in n)"children"===s||"key"===s||s in e||k(t,s,null,n[s],i);for(s in e)o&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||k(t,s,e[s],n[s],i)}(e,g,m,s,c),_)n.__k=[];else if(v=n.props.children,y(e,Array.isArray(v)?v:[v],n,i,o,s&&"foreignObject"!==h,l,r,l?l[0]:i.__k&&f(i,0),c),null!=l)for(v=l.length;v--;)null!=l[v]&&u(l[v]);c||("value"in g&&void 0!==(v=g.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&k(e,"value",v,m.value,!1),"checked"in g&&void 0!==(v=g.checked)&&v!==e.checked&&k(e,"checked",v,m.checked,!1))}return e}function A(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function E(t,n,i){var o,s;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||A(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&E(o[s],n,"function"!=typeof t.type);i||null==t.__e||u(t.__e),t.__e=t.__d=void 0}function L(t,e,n){return this.constructor(t,n)}function D(n,i,o){var s,l,r;e.__&&e.__(n,i),l=(s="function"==typeof o)?null:o&&o.__k||i.__k,r=[],I(i,n=(!s&&o||i).__k=d(_,null,[n]),l||a,a,void 0!==i.ownerSVGElement,!s&&o?[o]:l?null:i.firstChild?t.call(i.childNodes):null,r,!s&&o?o:l?l.__e:i.firstChild,s),S(r,n)}t=l.slice,e={__e:function(t,e,n,i){for(var o,s,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&null!=s.getDerivedStateFromError&&(o.setState(s.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,m.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c({},this.state),"function"==typeof t&&(t=t(c({},n),this.props)),t&&c(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),h(this))},m.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),h(this))},m.prototype.render=_,i=[],v.__r=0,s=0;var O,U,R,W,j=0,H=[],$=[],M=e.__b,B=e.__r,F=e.diffed,q=e.__c,V=e.unmount;function Q(t,n){e.__h&&e.__h(U,t,j||n),j=0;var i=U.__H||(U.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:$}),i.__[t]}function X(t){return j=1,K(st,t)}function K(t,e,n){var i=Q(O++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):st(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=U,!i.__c.u)){i.__c.__H.u=!0;var o=i.__c.shouldComponentUpdate;i.__c.shouldComponentUpdate=function(t,e,n){if(!i.__c.__H)return!0;var s=i.__c.__H.__.filter((function(t){return t.__c}));return(s.every((function(t){return!t.__N}))||!s.every((function(t){if(!t.__N)return!0;var e=t.__[0];return t.__=t.__N,t.__N=void 0,e===t.__[0]})))&&(!o||o(t,e,n))}}return i.__N||i.__}function G(t,n){var i=Q(O++,3);!e.__s&&ot(i.__H,n)&&(i.__=t,i.i=n,U.__H.__h.push(i))}function z(t){return j=5,J((function(){return{current:t}}),[])}function J(t,e){var n=Q(O++,7);return ot(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Y(t,e){return j=8,J((function(){return t}),e)}function Z(t){var e=U.context[t.__c],n=Q(O++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(U)),e.props.value):t.__}function tt(){for(var t;t=H.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(nt),t.__H.__h.forEach(it),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){U=null,M&&M(t)},e.__r=function(t){B&&B(t),O=0;var e=(U=t.__c).__H;e&&(R===U?(e.__h=[],U.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=$,t.__N=t.i=void 0}))):(e.__h.forEach(nt),e.__h.forEach(it),e.__h=[])),R=U},e.diffed=function(t){F&&F(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(1!==H.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),et&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);et&&(e=requestAnimationFrame(n))})(tt)),n.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==$&&(t.__=t.__V),t.i=void 0,t.__V=$}))),R=U=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(nt),t.__h=t.__h.filter((function(t){return!t.__||it(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),q&&q(t,n)},e.unmount=function(t){V&&V(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{nt(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var et="function"==typeof requestAnimationFrame;function nt(t){var e=U,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),U=e}function it(t){var e=U;t.__c=t.__(),U=e}function ot(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function st(t,e){return"function"==typeof e?e(t):e}const at=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t},lt="ui/reset",rt="ui/error",ct="ui/message",ut="ui/editing",dt="listOfLists/set",pt="listOfLists/remove",_t="listOfLists/create",mt="listOfList/addingPost",ft="listOfList/setPage",gt="listOfList/setTotalPages",ht="list/set",vt="list/update",yt="list/setPage",bt="list/setTotalPages",wt="list/setItems",Pt="list/removeItem",Nt="list/addItem",kt="list/updateItem",Ct="list/moveItem",xt="list/cart",It=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Dt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Dt().ajaxUrl,e),i=await n.json();i.nonce&&(Dt().nonce=i.nonce),i.user_id&&(Dt().user_id=i.user_id)}const o={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Dt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(o.body=JSON.stringify(n));const s=await fetch(Dt().root+i+e,o);s.headers.get("x-wp-nonce")&&(Dt().nonce=s.headers.get("x-wp-nonce"));const a=await s.json();return{data:a,headers:s.headers,status:s.status}};function St(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Dt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class Tt extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function At(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var o;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new Tt(null==t||null===(o=t.data)||void 0===o?void 0:o.message,t)}let Et={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return It("GET","/My"+St(t),{}).then((function(t){return At(t),t}))},discover:function(t){return It("GET","/"+St(t),{}).then((function(t){return At(t),t}))},get:function(t){return It("GET","/"+t,{}).then((function(t){return At(t),t}))},cart:function(t){return It("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return At(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return It("GET","/"+t+"/items"+St(e),{}).then((function(t){return At(t),t}))},delete:function(t){return It("DELETE","/"+t,{}).then((function(t){return At(t),t}))},create:function(t){return It("POST","",t).then((function(t){return At(t),t}))},update:function(t){let e=t.id;return delete t.id,It("PATCH","/"+e,t).then((function(t){return At(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),It("POST","/"+t+"/items"+St(n),e).then((function(t){return At(t),t}))},quit:function(t,e){return It("DELETE","/"+t+"/items/"+e,{}).then((function(t){return At(t),t}))},updateItem:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,n).then((function(t){return At(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return It("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return At(t),t}))},move:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return At(t),t}))}};const Lt=Et;function Dt(){return MgUserPostCollections}function Ot(){var t;return null===(t=Dt())||void 0===t?void 0:t.sortable}function Ut(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Rt(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function Wt(t,e){return!!t.type&&Ht(t.type,e)}function jt(t){var e;const n=[],i=null===(e=Dt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(Ht(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function Ht(t,e){const n=Ut(t);return!(!n||!n.supports)&&n.supports.includes(e)}const $t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function Mt(t){return JSON.parse(JSON.stringify(t))}function Bt(t){return"string"!=typeof t?"":t.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2")}function Ft(t){return Lt.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}function qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";if(!jQuery)return!1;const n=jQuery("<div>").addClass("mg-upc-alert mg-upc-alert-"+e);n.append(jQuery("<p>").html(t));const i=jQuery('<a class="mg-upc-alert-close" href="#"><span class="mg-upc-icon upc-font-close"></span></a>').on("click",(function(){return n.remove(),!1}));return n.append(i),n}function Vt(t,e){const{type:n,payload:i}=e;let o=!1;const s=t=>(o=a({status:"failed"}),t.error&&(o.error=t.error.message?t.error.message:"",o.errorCode=t.error.code?t.error.code:""),o),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=Mt(t)),e)for(const t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);return o};let l=function(t,e){const{type:n,payload:i}=e;let o,s;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=!1===t?{}:Mt(t)),e)for(const t in e)s[t]=e[t];return s};switch(n){case ht:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case vt:return i.items=Mt(t.items),i;case _t:return i;case wt:return a({items:i});case"list/addItem/failed":case Nt:return null!=i&&i.list?a(i.list):t;case kt:const e=!!i.item&&i.item;return o=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:o});case Pt:if(1===t.items.length||!1===i)return t;if(s=a(),o=s.items.filter((t=>t.post_id!==i)),Ht(t.type,"sortable")){const e=parseInt(t.items[0].position,10);o.forEach(((t,n)=>{o[n].position=e+n}))}if(Ht(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(s.vote_counter=s.vote_counter-e.votes)}return{...s,items:o};case Ct:const n=parseInt(t.items[0].position,10);o=a().items.slice();const l=a().items[i.oldIndex];return o.splice(i.oldIndex,1),o.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(o.forEach(((t,e)=>{o[e].position=n+e})),a({items:o}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case dt:return i;case Nt:case ht:return!1;case pt:return!1===i?t:Mt(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(o=a({listOfList:r,list:l}),t.addingPost||(o.title=o.list?o.list.title:Gt.title)),n){case"ui/mode":return a({mode:i});case lt:return{...Gt,mode:t.mode};case rt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case ct:return a(!1===i?{message:!1,errorCode:!1}:{message:i});case xt:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case ut:return a({editing:i});case mt:return o=a(),o.addingPost=i,i&&(o.title="Add to..."),o;case _t:o=a(),o.title=i.title?i.title:Gt.title,o.listTotalPages=1,o.listPage=1,o.addingPost=!1;break;case Nt:if(o=a(),null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Gt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(o.error=i.message,o.status="failed"),o.addingPost=!1;break;case ft:return a({page:i});case gt:return a({totalPages:i});case yt:return a({listPage:i});case bt:return a({listTotalPages:i});case"list/set/loading":return o=a(),o.status="loading",o.listOfList=!1,"object"==typeof i?(o.list=i,i.title&&(o.title=i.title)):o.list={ID:i},o;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case _t+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return o=a(),o.addingPost=!1,o.status="succeeded",o.error=!1,o.errorCode=!1,o.title=o.list?o.list.title:Gt.title,o;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case _t+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case _t+"/failed":return o=a({status:"failed"}),e.error&&e.error.message&&(o.error=e.error.message),o;case"list/addItem/failed":if(o=a(),o.addingPost=!1,o.title=o.list?o.list.title:Gt.title,null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Gt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(o.error=i.message,o.status="failed"),s(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return s(e)}return!1!==o?o:t}const Qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:o}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Kt=(t,e)=>n=>{let i;if((o=n)&&"object"==typeof o&&!0===o.asyncThunk){let o={dispatch:Kt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,o)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var o;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Gt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:at("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},zt=function(t,e){var n={__c:e="__cC"+s++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(h)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function Jt(t){return new Date(t).toLocaleDateString()}const Yt=function(t){const{state:e,dispatch:n}=Z(zt);return d("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),d("div",{className:"mg-upc-dg-item-title"},d("span",null,t.list.title),"my"!==e.mode&&d(_,null,d("span",null,d("a",{href:"#",onClick:function(e){!function(t){t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault()}(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),d("span",{className:"mg-upc-list-dates"},d("i",null," ",d("b",null,"Created:")," ",Jt(t.list.created)),d("i",null," ",d("b",null,"Modified:")," ",Jt(t.list.modified)))))),d("span",{className:"mg-upc-dg-item-count"},t.list.count),d("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&d("button",{"aria-label":at("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},d("span",{className:"mg-upc-icon upc-font-trash"}))))};class Zt extends m{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(d("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return d("span",null,e?t.map(((t,n)=>d(e,{key:n},t,""))):t)}}var te,ee,ne;ne={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(ee="defaultProps")in(te=Zt)?Object.defineProperty(te,ee,{value:ne,enumerable:!0,configurable:!0,writable:!0}):te[ee]=ne;const ie=function(t){return d("div",{className:"mg-upc-dg-pagination-div"},d("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":at("Previous page"),title:at("Previous page"),onClick:t.onPreview},d("span",{className:"mg-upc-icon upc-font-arrow_left"})),d("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),d("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":at("Next page"),title:at("Next page"),onClick:t.onNext},d("span",{className:"mg-upc-icon upc-font-arrow_right"})))},oe=()=>({type:lt,payload:null}),se=t=>({type:mt,payload:t}),ae=t=>({type:ut,payload:t}),le=Qt(xt,(async function(t,e){return await Ft(t)})),re=Qt(dt,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Lt.my(t).then((t=>ce(t,e,i)))}));function ce(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(de(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(pe(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},o={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in o){const n=t.headers.get(e);n&&(i[o[e]]=decodeURIComponent(n))}e.dispatch(se(i))}return t.data}Qt(dt,(async function(t,e){return null===t&&(t={}),await Lt.discover(t).then((t=>ce(t,e,!1)))}));const ue=Qt(pt,(async function(t,e){return await Lt.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(re({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(re({page:n-1}))}return!1}return t}))})),de=t=>({type:ft,payload:t}),pe=t=>({type:gt,payload:t}),_e=t=>({type:yt,payload:t}),me=t=>({type:bt,payload:t}),fe=Qt(ht,(async function(t,e){return!1===t||!0===t?t:await Lt.get("object"==typeof t?t.ID:t).then((t=>(Ce(t,e.dispatch),t.data)))})),ge=Qt(vt,(async function(t,e){return await Lt.update(t).then((t=>(e.dispatch(ae(!1)),Ce(t,e.dispatch),t.data)))})),he=Qt(_t,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(se({id:t.addingPost})),await Lt.create(t).then((t=>(e.dispatch(ae(!1)),Ce(t,e.dispatch),t.data)))})),ve=Qt(wt,(async function(t,e){return await Lt.items(e.getState().list.ID,t).then((t=>(Ce(t,e.dispatch),t.data)))})),ye=Qt(Pt,(async function(t,e){const n=e.getState();return await Lt.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(ve({page:t})):t===i&&e.dispatch(ve({page:Math.max(1,t-1)})),!1}return t}))})),be=Qt(Nt,(async function(t,e){let n=e.extra[0],i=!1;try{await Lt.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var o;const n=null==t||null===(o=t.response)||void 0===o?void 0:o.data;i=e.rejectWithValue(n)}return i})),we=Qt(kt,(async function(t,e){const n=e.extra[0];return await Lt.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),Pe=Qt(Ct,(async function(t,e){const n=e.extra[0],i=e.extra[1],o=n.items[t],s=o.position-t+i;return await Lt.move(n.ID,o.post_id,s).then((e=>({oldIndex:t,newIndex:i})))})),Ne=Qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Lt.move(n.ID,o.post_id,i+1),await e.dispatch(ve({page:e.getState().listPage})),t})),ke=Qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Lt.move(n.ID,o.post_id,i-1),await e.dispatch(ve({page:e.getState().listPage})),t}));function Ce(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(_e(parseInt(t.headers.get("x-wp-page"),10))),e(me(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(_e(parseInt(t.data.items_page["X-WP-Page"],10))),e(me(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}const xe=function(t){const{state:e,dispatch:n}=Z(zt);return d(_,null,d("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>d("li",{className:"mg-upc-dg-item-list"},d("div",null,d(Zt,{width:"1.5em",height:"1.5em"})),d("div",{className:"mg-upc-dg-item-title"},d(Zt,null)),d("div",{className:"mg-upc-dg-item-count"},d(Zt,null)))))),d("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>d(Yt,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&d(ie,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},Ie=function(t){var e,n,i;const[o,s]=X(!1),[a,l]=X(""),r=z({});return G((()=>{l(t.item.description)}),[t.item]),G((()=>{o&&r.current.focus()}),[o]),d(_,null,d("span",null,d("br",null),"Adding item:"),d("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null," "),d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t}),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!o&&d("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!o&&d("button",{onClick:()=>{s(!0)}},""===a&&d("span",null,at("Add Comment")),""!==a&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:o?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),o&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{s(!1),l(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),o&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{s(!1),t.onSaveItemDescription(a)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))))),d("span",null,at("Select where the item will be added:")))};function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Se.apply(this,arguments)}function Te(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Ae(t){this.props=t}(Ae.prototype=new m).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(t,e){return Te(this.props,t)||Te(this.state,e)};var Ee=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ee&&Ee(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Le=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var o,s=e;s=s.__;)if((o=s.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Le(t,e,n,i)};var De=e.unmount;function Oe(){this.__u=0,this.t=null,this.__b=null}function Ue(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Re(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),De&&De(t)},(Oe.prototype=new m).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=Ue(i.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},Oe.prototype.componentWillUnmount=function(){this.t=[]},Oe.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__a&&d(_,null,t.fallback);return o&&(o.__h=null),[d(_,null,e.__a?null:t.children),o]};var We=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function je(t){return this.getChildContext=function(){return t.context},t.children}function He(t){var e=this,n=t.i;e.componentWillUnmount=function(){D(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),D(d(je,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Re.prototype=new m).__a=function(t){var e=this,n=Ue(e.__v),i=e.o.get(t);return i[0]++,function(o){var s=function(){e.props.revealOrder?(i.push(o),We(e,t,i)):o()};n?n(s):s()}},Re.prototype.render=function(t){this.u=null,this.o=new Map;var e=w(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Re.prototype.componentDidUpdate=Re.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){We(t,n,e)}))};var $e="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,Fe=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(m.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var qe=e.event;function Ve(){}function Qe(){return this.cancelBubble}function Xe(){return this.defaultPrevented}e.event=function(t){return qe&&(t=qe(t)),t.persist=Ve,t.isPropagationStopped=Qe,t.isDefaultPrevented=Xe,t.nativeEvent=t};var Ke={configurable:!0,get:function(){return this.class}},Ge=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var o=-1===e.indexOf("-");for(var s in i={},n){var a=n[s];Be&&"children"===s&&"noscript"===e||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!Fe(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():o&&Me.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),i[s]&&(s="oninputCapture")),i[s]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=w(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=w(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Ke.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Ke))}t.$$typeof=$e,Ge&&Ge(t)};var ze=e.__r;e.__r=function(t){ze&&ze(t),t.__c};var Je=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Ye(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ze(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function tn(t){(t.querySelector("[autofocus]")||t).focus()}function en(){Ze("[data-a11y-dialog]").forEach((function(t){new Ye(t)}))}Ye.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ze('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ze("[data-a11y-dialog-hide]",this.$el).concat(Ze('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Ye.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,tn(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Ye.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Ye.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Ye.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Ye.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Ye.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Ye.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&"Escape"===t.key&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&"Tab"===t.key&&function(t,e){var n=function(t){return Ze(Je.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Ye.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||tn(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",en):window.requestAnimationFrame?window.requestAnimationFrame(en):window.setTimeout(en,16));const nn=t=>{const e=(()=>{const[t,e]=X(!1);return G((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=X(null);return[t,Y((t=>{null!==t&&e(new Ye(t))}),[])]})(),i=Y((()=>e.hide()),[e]),o=t.role||"dialog",s="alertdialog"===o,a=t.titleId||t.id+"-title";return G((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:o,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:s?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:o}=t;if(G((()=>(n&&o(n),()=>o(void 0))),[o,n]),!e)return null;const s=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=d("h2",Se({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&d("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=d("button",Se({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=d(He,{__v:t,i:e});return n.containerInfo=e,n}(d("div",Se({},i.container,{className:t.classNames.container}),d("div",Se({},i.overlay,{className:t.classNames.overlay})),d("div",Se({},i.dialog,{className:t.classNames.dialog}),r)),s)};nn.defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}},function(t){function e(e,i,o,s){const a=o||s.parent(),l=a.find(".mg-upc-item-vote").attr("disabled",!0);mgUpcApiClient.vote(e,i,{context:"web",posts:n(a)}).then((function(e){t(document.body).trigger("mg_upc_vote_response",[e,a])})).catch((function(t){var e,n;l.attr("disabled",!1),null!==(e=t.response)&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.message&&(s?s.append(qt(t.response.data.message)):a.before(qt(t.response.data.message)))}))}function n(e){return[...e.children().map((function(){return t(this).data("pid")}))].join(",")}t(".mg-upc-item-vote").on("click",(function(){const n=t(this).data("vote").split(",");return 2===n.length&&e(n[0],n[1],!1,t(this).closest(".mg-upc-item")),!1})),t((function(){t(".mg-upc-vote").each((function(){const n=t(this);e(n.data("id"),0,n.find(".mg-upc-items-container"),!1)}))})),t(document.body).on("mg_upc_vote_response",(function(e,n,i){if(!n.data)return;const o=parseInt(n.data.vote_counter,10),s=i.find(".mg-upc-item-vote");i.data("votes",o),n.data.can_vote?s.attr("disabled",!1).show():s.animate({width:0,padding:0,opacity:0},200,(function(){s.remove()})),n.data.posts.forEach((function(e){const n=i.find(".mg-upc-item[data-pid="+e.post_id+"]"),s=parseInt(e.votes,10);t(document.body).trigger("mg_upc_item_vote_set",[n,s,o])}))})),t(document.body).on("mg_upc_item_vote_set",(function(t,e,n,i){const o=i>0?Math.round(1e3*n/i)/10:0,s=e.find(".mg-upc-votes");s.find(".mg-upc-item-votes-number").html(n),s.find(".mg-upc-item-percent").html(o+"%"),s.find(".mg-upc-item-bar-progress").animate({width:o+"%"}),s.show()}))}(jQuery),function(t){t(".mg-upc-add-product-to-list").on("click",(function(){let e=t(this).data("id");const n=t(this).closest(".product,.summary").find("[name='variation_id']");return n.length>0&&parseInt(n.val(),10)>0&&(e=n.val()),window.addItemToList(e),!1}));const e="mg-upc-btn-loading",n="mg-upc-product-added",i="mg-upc-product-error",o="Sorry, an error occurred.";function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(at("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(at("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}t((function(){if("undefined"==typeof wc_add_to_cart_params)return!1;t(".mg-upc-item-product").removeClass("mg-upc-hide").on("click",(function(e){return s(e,t(this),!1)})),t(".mg-upc-add-list-to-cart").removeClass("mg-upc-hide").on("click",(function(s){const a=t(this);return a.hasClass(e)||(a.removeClass(n+" "+i).addClass(e),window.mgUpcAddListToCart(t(this).data("id")).then((function(i){a.removeClass(e),i.err&&a.before(qt(Bt(i.err))),i.msg&&a.before(qt(Bt(i.msg),"success")),a.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,a])})).catch((t=>{var n,i;a.removeClass(e),null!==(n=t.response)&&void 0!==n&&null!==(i=n.data)&&void 0!==i&&i.message?a.before(qt(Bt(t.response.data.message))):alert(o)}))),!1}))}))}(jQuery);const on=function(t){var e;const[n,i]=X(""),[o,s]=X(""),[a,l]=X(""),[r,c]=X(""),u=J((()=>jt(t.addingPost)),[t.addingPost]);function p(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&p(u[0]),G((()=>{i(t.list.title),s(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),G((()=>{var t;null!==(t=Ut(a))&&void 0!==t&&t.available_statuses&&-1===Ut(a).available_statuses.indexOf(r)&&c(Ut(a).available_statuses[0])}),[a]),d("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&d(_,null,d("label",null,at("Select a list type:")),d("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>d("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>p(t),onKeyPress:e=>{13===e.keyCode&&p(t)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,t.label),d("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&Ht(a,"editable_title")&&d(_,null,d("label",{htmlFor:`title-${t.list.ID}`},at("Title")),d("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&Ht(a,"editable_content")&&d(_,null,d("label",{htmlFor:`content-${t.list.ID}`},at("Description")),d("textarea",{id:`content-${t.list.ID}`,value:o,onChange:function(t){s(t.target.value)},maxLength:500}),d("span",{className:"mg-upc-dg-list-desc-edit-count"},d("i",null,null==o?void 0:o.length),"/500")),""!==a&&!Ut(a)&&d("span",null,at("Unknown List Type...")),""!==a&&(null===(e=Ut(a))||void 0===e?void 0:e.available_statuses)&&Ut(a).available_statuses.length>1&&d(_,null,d("label",{htmlFor:`status-${t.list.ID}`},at("Status")),d("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ut(a).available_statuses.map(((t,e)=>{if(function(t){const e=Rt(t);return e&&e.show_in_status_list}(t))return d("option",{value:t},function(t){const e=Rt(t);return e?e.label:t}(t))})))),""!==a&&Ut(a)&&d("div",{className:"mg-upc-dg-edit-actions"},d("button",{onClick:()=>t.onSave({title:n,content:o,type:a,status:r})},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))),d("button",{onClick:()=>t.onCancel()},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel")))))},sn=function(t){var e;const[n,i]=X(!1),[o,s]=X(""),[a,l]=X(null===(e=t.item)||void 0===e?void 0:e.quantity),r=z({});G((()=>{s(t.item.description)}),[t.item]),G((()=>{n&&r.current.focus()}),[n]);const c=z(!1);return G((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),d("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},Wt(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),d("span",{className:"mg-upc-dg-item-number"},t.item.position)),Wt(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return Wt(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),d("a",{href:t.item.link},d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t})),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:t.item.link},t.item.title),t.item.price_html&&d("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&d("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&d("p",null,t.item.description),t.editable&&!n&&Wt(t.list,"editable_item_description")&&d("button",{onClick:()=>{i(!0)}},d("span",{className:"mg-upc-icon upc-font-edit"}),""===o&&d("span",null,at("Add Comment")),""!==o&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:o,onChange:function(t){s(t.target.value)},maxLength:400}),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),s(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(o)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save")))),t.editable&&Wt(t.list,"quantity")&&d("div",{className:"mg-upc-dg-quantity"},d("small",null,at("Quantity")),d("input",{"aria-label":at("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&d("div",null,d("button",{"aria-label":"Remove item",onClick:t.onRemove},d("span",{className:"mg-upc-icon upc-font-trash"}))))},an=function(t){return new Promise((function(e,n){const i=document.createElement("script");let o=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){o||this.readyState&&"complete"!=this.readyState||(o=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},ln=function(t){var e,n,i;const o=z(null),s=z((e=>{t.onMove(e)}));return G((()=>{s.current=t.onMove})),G((()=>{let e=!1;if(Wt(t.list,"sortable")){const t=()=>{e=Sortable.create(o.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){s.current(t)}})};"undefined"!=typeof Sortable?t():an(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),d(_,null,d("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>d("li",{className:"mg-upc-dg-item"},Wt(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",d(Zt,{width:"1.5em"})," "),d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Zt,{width:"1em"})," ")),Wt(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Zt,{width:"1em"})," ")),d("div",{className:"mg-upc-dg-item-skeleton-image"},d(Zt,{width:"5em",height:"5em"})),d("div",{className:"mg-upc-dg-item-data"},d(Zt,{count:2})))))),d("ul",{ref:o,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&d("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>d(sn,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),Wt(t.list,"vote")&&d("span",{className:"mg-upc-dg-total-votes"}," ",at("Total votes:")," ",d("span",null," ",t.list.vote_counter)))},rn=function(t){const e=z(null),n=z(null),i=at("Copy"),[o,s]=X(i);G((()=>{let t=null;o!==i&&(t=setTimeout((()=>{s(i),clearTimeout(t)}),2e3))}),[o]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:at("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Dt().shareButtons&&(r=r.filter((t=>Dt().shareButtons.includes(t.slug||t.name.toLowerCase())))),d("div",{className:"mg-upc-dg-share-link"},d("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),d("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?s(at("Copied!")):s("Error!")}},d("span",{className:"mg-upc-icon upc-font-copy"}),d("span",null,o)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),d("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},d("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},cn=function(t){var e;const{state:n,dispatch:i}=Z(zt),[o,s]=X(!1),a=z(!1),l=z(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(ve({page:t}))}return G((()=>{const t=n.list;let e=!1,o=!1;if(t&&Wt(t,"sortable")){const t=()=>{a.current&&n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(Ne(t.oldIndex))}})),a.current&&n.listPage>1&&(o=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(ke(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():an(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy(),o&&o.destroy()}}),[n.list,n.listPage,n.listTotalPages]),G((()=>{s(!1)}),[n.editing,n.list,n.addingPost]),d(_,null,n.editing&&d(on,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const o={};o.title=t.title,o.content=t.content,o.type=t.type,o.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(o.adding=n.addingPost.post_id),i(he(o))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(ge(e))}},onCancel:function(){i(ae(!1)),-1===n.list.ID&&(i(fe(!1)),i(oe()),i(re()))}}),!n.editing&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return Ht(i,"editable_title")||Ht(i,"editable_content")||(null===(e=Ut(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&d("button",{className:"mg-upg-edit",onClick:()=>i(ae(!0))},d("span",{className:"mg-upc-icon upc-font-edit"}),d("span",null,at("Edit"))),n.list.link&&d("button",{className:"mg-upg-share",onClick:()=>s(!o)},d("span",{className:"mg-upc-icon upc-font-share"}),d("span",null,at("Share"))),"cart"===n.list.type&&d("button",{className:"mg-upg-share",onClick:function(){i(le(n.list.ID))}},d("span",{className:"mg-upc-icon upc-font-cart"}),d("span",null,at("Add all to cart")))),o&&n.list.link&&d(rn,{link:n.list.link,title:n.list.title}),n.list.content&&d("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:Bt(n.list.content)}}),d(Zt,{count:3}),d(ln,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(Pe(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ye(e.post_id))},onSaveItemDescription:function(t,e,n){i(we(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(we(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&d(ie,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}))};function un(t){return parseInt(t.author,10)===parseInt(Dt().user_id,10)}function dn(){"replaceState"in history?(history.replaceState("",document.title,location.pathname),history.go(-1)):location.hash=""}D(d((t=>{const[e,n]=K(Vt,Gt);return d(zt.Provider,{value:{state:e,dispatch:Kt(n,(()=>e))}},t.children)}),null,d((function(){const{state:t,dispatch:e}=Z(zt),n=J((()=>jt(t.addingPost)),[t.addingPost]),i=z(!1);let o="listOfList";if(t.addingPost)o=t.editing?"addingToNew":"adding";else if(t.editing){var s;o=-1!==(null===(s=t.list)||void 0===s?void 0:s.ID)?"edit":"new"}else o=t.list?"list":"listOfList";const a={container:"mg-upc-dg-container",overlay:"mg-upc-dg-overlay",dialog:"mg-upc-dg-content"+(t.errorCode?" mg-upc-err-"+t.errorCode:""),title:"mg-upc-dg-title",closeButton:"mg-upc-dg-close"};G((()=>{window.showMyLists=function(){l()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(oe()),n||r(t)},window.mgUpcAddListToCart=Ft}),[i.current,e]);const l=()=>{e(oe()),e(re()),i.current.show()},r=t=>{e(se({post_id:t})),e(re({addingPost:t})),i.current.show()};function c(n){n<1||n>t.totalPages||"loading"===t.status||e(de(n))}const u="list"===o||"new"===o||"edit"===o||"addingToNew"===o;return d(nn,{id:"mg-upc-dg-dialog",dialogRef:function(t){i.current=t},title:t.title,classNames:a,onBack:!!u&&function(){switch(o){case"list":default:l();break;case"new":e(fe(!1)),e(ae(!1)),l();break;case"edit":e(ae(!1));break;case"addingToNew":e(fe(!1)),e(ae(!1)),e(re({addingPost:t.addingPost.post_id}))}}},d("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+o},d("div",{className:"mg-upc-dg-wait"}),t.message&&d("div",{className:"mg-upc-dg-msg"},t.message,d("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:ct,payload:null})}},d("span",{className:"mg-upc-icon upc-font-close"}))),t.error&&d("div",{className:"mg-upc-dg-error"},t.error,d("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:rt,payload:null})}},d("span",{className:"mg-upc-icon upc-font-close"}))),d("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&d(Ie,{item:t.addingPost,onSaveItemDescription:function(n){e(se({...t.addingPost,description:n}))}}),("listOfList"===o||"adding"===o)&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},n.length>0&&d("button",{className:"mg-list-new",onClick:function(t){e(ae(!0)),e(fe(!0)),i.current.show()}},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null,at("Create List")))),d(xe,{lists:t.listOfList,onSelect:function(n){e(ae(!1)),t.addingPost?e(be(n.ID,t.addingPost)):(e(fe(n)),i.current.show())},onRemove:!t.addingPost&&function(t){e(ue(t.ID))},loadPreview:function(){c(t.page-1)},loadNext:function(){c(t.page+1)}})),t.list&&d(cn,{editable:un(t.list)}))))}),null)," "),document.querySelector("body")),"#my-lists"===location.hash&&dn(),window.addEventListener("hashchange",(function(){"#my-lists"===location.hash&&(window.showMyLists(),dn())}),!1),window.mgUpcApiClient=Lt})(); -
user-post-collections/tags/0.8.29/readme.txt
r2770005 r2770186 6 6 Tags: User lists, Post Collections, Woocommerce Wishlist 7 7 Tested up to: 6.0 8 Stable tag: 0.8.2 88 Stable tag: 0.8.29 9 9 Requires PHP: 7.0 10 10 … … 68 68 == Changelog == 69 69 70 = 0.8.29 = 71 * Update preact 72 70 73 = 0.8.28 = 71 74 * Fix some uninstall options -
user-post-collections/tags/0.8.29/user-post-collections.php
r2770005 r2770186 4 4 Plugin URI: https://galetto.info/user-post-collections 5 5 Description: Allows users to create their post collections. 6 Version: 0.8.2 86 Version: 0.8.29 7 7 Author: Mauricio Galetto 8 8 Author URI: https://galetto.info/ -
user-post-collections/trunk/classes/user-post-collections.php
r2770005 r2770186 16 16 public $model; 17 17 18 const VERSION = '0.8.2 8';18 const VERSION = '0.8.29'; 19 19 20 20 /** -
user-post-collections/trunk/controllers/mg-list-page-alt.php
r2770005 r2770186 481 481 return home_url( '/' . trim( $val, '/' ) . '/' . rawurlencode( $slug ) ); 482 482 } 483 return home_url( '/' . add_query_arg( array( 'list' => $slug), $val ) );483 return home_url( '/' . add_query_arg( array( 'list' => rawurlencode( $slug ) ), $val ) ); 484 484 } 485 485 } -
user-post-collections/trunk/javascript/mg-upc-client/dist/admin.js
r2770005 r2770186 1 !function(){"use strict";var t,e,n,i,s,o,a,l={},r=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function u(t,e){for(var n in e)t[n]=e[n];return t}function d(t){var e=t.parentNode;e&&e.removeChild(t)}function p(e,n,i){var s,o,a,l={};for(a in n)"key"==a?s=n[a]:"ref"==a?o=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return _(e,l,s,o,null)}function _(t,i,s,o,a){var l={type:t,props:i,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function m(t){return t.children}function f(t,e){this.props=t,this.context=e}function g(t,e){if(null==e)return t.__?g(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?g(t):null}function h(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return h(t)}}function v(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!y.__r++||o!==e.debounceRendering)&&((o=e.debounceRendering)||s)(y)}function y(){for(var t;y.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,s,o,a;t.__d&&(o=(s=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=u({},s)).__v=s.__v+1,S(a,s,i,e.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,n,null==o?g(s):o,s.__h),T(n,s),s.__e!=o&&h(s)))}))}function b(t,e,n,i,s,o,a,c,u,d){var p,f,h,v,y,b,w,k=i&&i.__k||r,C=k.length;for(n.__k=[],p=0;p<e.length;p++)if(null!=(v=n.__k[p]=null==(v=e[p])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?_(null,v,null,null,v):Array.isArray(v)?_(m,{children:v},null,null,null):v.__b>0?_(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=k[p])||h&&v.key==h.key&&v.type===h.type)k[p]=void 0;else for(f=0;f<C;f++){if((h=k[f])&&v.key==h.key&&v.type===h.type){k[f]=void 0;break}h=null}S(t,v,h=h||l,s,o,a,c,u,d),y=v.__e,(f=v.ref)&&h.ref!=f&&(w||(w=[]),h.ref&&w.push(h.ref,null,v),w.push(f,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=P(v,u,t):u=N(t,v,h,k,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=g(h))}for(n.__e=b,p=C;p--;)null!=k[p]&&("function"==typeof n.type&&null!=k[p].__e&&k[p].__e==n.__d&&(n.__d=g(i,p+1)),L(k[p],k[p]));if(w)for(p=0;p<w.length;p++)E(w[p],w[++p],w[++p])}function P(t,e,n){for(var i,s=t.__k,o=0;s&&o<s.length;o++)(i=s[o])&&(i.__=t,e="function"==typeof i.type?P(i,e,n):N(n,i,i,s,i.__e,e));return e}function w(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){w(t,e)})):e.push(t)),e}function N(t,e,n,i,s,o){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||s!=o||null==s.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(s),a=null;else{for(l=o,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==s)break t;t.insertBefore(s,o),a=o}return void 0!==a?a:s.nextSibling}function k(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function C(t,e,n,i,s){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||k(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||k(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?I:x,o):t.removeEventListener(e,o?I:x,o);else if("dangerouslySetInnerHTML"!==e){if(s)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function x(t){this.l[t.type+!1](e.event?e.event(t):t)}function I(t){this.l[t.type+!0](e.event?e.event(t):t)}function S(t,n,i,s,o,a,l,r,c){var d,p,_,g,h,v,y,P,w,N,k,C=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(c=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof C){if(P=n.props,w=(d=C.contextType)&&s[d.__c],N=d?w?w.props.value:d.__:s,i.__c?y=(p=n.__c=i.__c).__=p.__E:("prototype"in C&&C.prototype.render?n.__c=p=new C(P,N):(n.__c=p=new f(P,N),p.constructor=C,p.render=D),w&&w.sub(p),p.props=P,p.state||(p.state={}),p.context=N,p.__n=s,_=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=C.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=u({},p.__s)),u(p.__s,C.getDerivedStateFromProps(P,p.__s))),g=p.props,h=p.state,_)null==C.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==C.getDerivedStateFromProps&&P!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(P,N),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(P,p.__s,N)||n.__v===i.__v){p.props=P,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(P,p.__s,N),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}p.context=N,p.props=P,p.state=p.__s,(d=e.__r)&&d(n),p.__d=!1,p.__v=n,p.__P=t,d=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(s=u(u({},s),p.getChildContext())),_||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),k=null!=d&&d.type===m&&null==d.key?d.props.children:d,b(t,Array.isArray(k)?k:[k],n,i,s,o,a,l,r,c),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),y&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=A(i.__e,n,i,s,o,a,l,c);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(c||null!=a)&&(n.__e=r,n.__h=!!c,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function T(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function A(e,n,i,s,o,a,r,c){var u,p,_,m=i.props,f=n.props,h=n.type,v=0;if("svg"===h&&(o=!0),null!=a)for(;v<a.length;v++)if((u=a[v])&&"setAttribute"in u==!!h&&(h?u.localName===h:3===u.nodeType)){e=u,a[v]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=o?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),a=null,c=!1}if(null===h)m===f||c&&e.data===f||(e.data=f);else{if(a=a&&t.call(e.childNodes),p=(m=i.props||l).dangerouslySetInnerHTML,_=f.dangerouslySetInnerHTML,!c){if(null!=a)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,s){var o;for(o in n)"children"===o||"key"===o||o in e||C(t,o,null,n[o],i);for(o in e)s&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||C(t,o,e[o],n[o],i)}(e,f,m,o,c),_)n.__k=[];else if(v=n.props.children,b(e,Array.isArray(v)?v:[v],n,i,s,o&&"foreignObject"!==h,a,r,a?a[0]:i.__k&&g(i,0),c),null!=a)for(v=a.length;v--;)null!=a[v]&&d(a[v]);c||("value"in f&&void 0!==(v=f.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&C(e,"value",v,m.value,!1),"checked"in f&&void 0!==(v=f.checked)&&v!==e.checked&&C(e,"checked",v,m.checked,!1))}return e}function E(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function L(t,n,i){var s,o;if(e.unmount&&e.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||E(s,null,n)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(t){e.__e(t,n)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&L(s[o],n,"function"!=typeof t.type);i||null==t.__e||d(t.__e),t.__e=t.__d=void 0}function D(t,e,n){return this.constructor(t,n)}function O(n,i,s){var o,a,r;e.__&&e.__(n,i),a=(o="function"==typeof s)?null:s&&s.__k||i.__k,r=[],S(i,n=(!o&&s||i).__k=p(m,null,[n]),a||l,l,void 0!==i.ownerSVGElement,!o&&s?[s]:a?null:i.firstChild?t.call(i.childNodes):null,r,!o&&s?s:a?a.__e:i.firstChild,o),T(r,n)}t=r.slice,e={__e:function(t,e,n,i){for(var s,o,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(t)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(t,i||{}),a=s.__d),a)return s.__E=s}catch(e){t=e}throw t}},n=0,f.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},n),this.props)),t&&u(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),v(this))},f.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),v(this))},f.prototype.render=m,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y.__r=0,a=0;var R,U,W,$=0,H=[],M=e.__b,j=e.__r,B=e.diffed,F=e.__c,q=e.unmount;function X(t,n){e.__h&&e.__h(U,t,$||n),$=0;var i=U.__H||(U.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function K(t){return $=1,V(st,t)}function V(t,e,n){var i=X(R++,2);return i.t=t,i.__c||(i.__=[n?n(e):st(void 0,e),function(t){var e=i.t(i.__[0],t);i.__[0]!==e&&(i.__=[e,i.__[1]],i.__c.setState({}))}],i.__c=U),i.__}function Q(t,n){var i=X(R++,3);!e.__s&&it(i.__H,n)&&(i.__=t,i.__H=n,U.__H.__h.push(i))}function G(t){return $=5,z((function(){return{current:t}}),[])}function z(t,e){var n=X(R++,7);return it(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function J(t,e){return $=8,z((function(){return t}),e)}function Y(t){var e=U.context[t.__c],n=X(R++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(U)),e.props.value):t.__}function Z(){for(var t;t=H.shift();)if(t.__P)try{t.__H.__h.forEach(et),t.__H.__h.forEach(nt),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){U=null,M&&M(t)},e.__r=function(t){j&&j(t),R=0;var e=(U=t.__c).__H;e&&(e.__h.forEach(et),e.__h.forEach(nt),e.__h=[])},e.diffed=function(t){B&&B(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==H.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),tt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);tt&&(e=requestAnimationFrame(n))})(Z)),U=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(et),t.__h=t.__h.filter((function(t){return!t.__||nt(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),F&&F(t,n)},e.unmount=function(t){q&&q(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{et(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var tt="function"==typeof requestAnimationFrame;function et(t){var e=U,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),U=e}function nt(t){var e=U;t.__c=t.__(),U=e}function it(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function st(t,e){return"function"==typeof e?e(t):e}var ot=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t};const at="ui/reset",lt="ui/error",rt="ui/editing",ct="ui/mode",ut="listOfLists/set",dt="listOfLists/remove",pt="listOfLists/create",_t="listOfList/addingPost",mt="listOfList/setPage",ft="listOfList/setTotalPages",gt="list/set",ht="list/update",vt="list/setPage",yt="list/setTotalPages",bt="list/setItems",Pt="list/removeItem",wt="list/addItem",Nt="list/updateItem",kt="list/moveItem",Ct="list/cart";var xt=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Lt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Lt().ajaxUrl,e),i=await n.json();i.nonce&&(Lt().nonce=i.nonce),i.user_id&&(Lt().user_id=i.user_id)}const s={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Lt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(s.body=JSON.stringify(n));const o=await fetch(Lt().root+i+e,s);o.headers.get("x-wp-nonce")&&(Lt().nonce=o.headers.get("x-wp-nonce"));const a=await o.json();return{data:a,headers:o.headers,status:o.status}};function It(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Lt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class St extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function Tt(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var s;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new St(null==t||null===(s=t.data)||void 0===s?void 0:s.message,t)}let At={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt("GET","/My"+It(t),{}).then((function(t){return Tt(t),t}))},discover:function(t){return xt("GET","/"+It(t),{}).then((function(t){return Tt(t),t}))},get:function(t){return xt("GET","/"+t,{}).then((function(t){return Tt(t),t}))},cart:function(t){return xt("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return Tt(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt("GET","/"+t+"/items"+It(e),{}).then((function(t){return Tt(t),t}))},delete:function(t){return xt("DELETE","/"+t,{}).then((function(t){return Tt(t),t}))},create:function(t){return xt("POST","",t).then((function(t){return Tt(t),t}))},update:function(t){let e=t.id;return delete t.id,xt("PATCH","/"+e,t).then((function(t){return Tt(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),xt("POST","/"+t+"/items"+It(n),e).then((function(t){return Tt(t),t}))},quit:function(t,e){return xt("DELETE","/"+t+"/items/"+e,{}).then((function(t){return Tt(t),t}))},updateItem:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,n).then((function(t){return Tt(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return xt("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return Tt(t),t}))},move:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return Tt(t),t}))}};var Et=At;function Lt(){return MgUserPostCollections}function Dt(){var t;return null===(t=Lt())||void 0===t?void 0:t.sortable}function Ot(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Rt(){var t;return Object.values(null===(t=Lt())||void 0===t?void 0:t.statuses)}function Ut(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function Wt(t,e){return!!t.type&&Ht(t.type,e)}function $t(t){var e;const n=[],i=null===(e=Lt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(Ht(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function Ht(t,e){const n=Ot(t);return!(!n||!n.supports)&&n.supports.includes(e)}const Mt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function jt(t){return JSON.parse(JSON.stringify(t))}function Bt(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Ft(t,e){const{type:n,payload:i}=e;let s=!1;const o=t=>(s=a({status:"failed"}),t.error&&(s.error=t.error.message?t.error.message:"",s.errorCode=t.error.code?t.error.code:""),s),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=jt(t)),e)for(const t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);return s};let l=function(t,e){const{type:n,payload:i}=e;let s,o;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=!1===t?{}:jt(t)),e)for(const t in e)o[t]=e[t];return o};switch(n){case gt:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case ht:return i.items=jt(t.items),i;case pt:return i;case bt:return a({items:i});case"list/addItem/failed":case wt:return null!=i&&i.list?a(i.list):t;case Nt:const e=!!i.item&&i.item;return s=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:s});case Pt:if(1===t.items.length||!1===i)return t;if(o=a(),s=o.items.filter((t=>t.post_id!==i)),Ht(t.type,"sortable")){const e=parseInt(t.items[0].position,10);s.forEach(((t,n)=>{s[n].position=e+n}))}if(Ht(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(o.vote_counter=o.vote_counter-e.votes)}return{...o,items:s};case kt:const n=parseInt(t.items[0].position,10);s=a().items.slice();const l=a().items[i.oldIndex];return s.splice(i.oldIndex,1),s.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(s.forEach(((t,e)=>{s[e].position=n+e})),a({items:s}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case ut:return i;case wt:case gt:return!1;case dt:return!1===i?t:jt(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(s=a({listOfList:r,list:l}),t.addingPost||(s.title=s.list?s.list.title:Vt.title)),n){case ct:return a({mode:i});case at:return{...Vt,mode:t.mode};case lt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case"ui/message":return a(!1===i?{message:!1,errorCode:!1}:{message:i});case Ct:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case rt:return a({editing:i});case _t:return s=a(),s.addingPost=i,i&&(s.title="Add to..."),s;case pt:s=a(),s.title=i.title?i.title:Vt.title,s.listTotalPages=1,s.listPage=1,s.addingPost=!1;break;case wt:if(s=a(),null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Vt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(s.error=i.message,s.status="failed"),s.addingPost=!1;break;case mt:return a({page:i});case ft:return a({totalPages:i});case vt:return a({listPage:i});case yt:return a({listTotalPages:i});case"list/set/loading":return s=a(),s.status="loading",s.listOfList=!1,"object"==typeof i?(s.list=i,i.title&&(s.title=i.title)):s.list={ID:i},s;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case pt+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return s=a(),s.addingPost=!1,s.status="succeeded",s.error=!1,s.errorCode=!1,s.title=s.list?s.list.title:Vt.title,s;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case pt+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case pt+"/failed":return s=a({status:"failed"}),e.error&&e.error.message&&(s.error=e.error.message),s;case"list/addItem/failed":if(s=a(),s.addingPost=!1,s.title=s.list?s.list.title:Vt.title,null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Vt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(s.error=i.message,s.status="failed"),o(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return o(e)}return!1!==s?s:t}const qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:s}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Kt=(t,e)=>n=>{let i;if((s=n)&&"object"==typeof s&&!0===s.asyncThunk){let s={dispatch:Kt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,s)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var s;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Vt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:ot("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},Qt=function(t,e){var n={__c:e="__cC"+a++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(v)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function Gt(t){return new Date(t).toLocaleDateString()}var zt,Jt,Yt,Zt=function(t){const{state:e,dispatch:n}=Y(Qt);return p("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),p("div",{className:"mg-upc-dg-item-title"},p("span",null,t.list.title),"my"!==e.mode&&p(m,null,p("span",null,p("a",{href:"#",onClick:function(e){Bt(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),p("span",{className:"mg-upc-list-dates"},p("i",null," ",p("b",null,"Created:")," ",Gt(t.list.created)),p("i",null," ",p("b",null,"Modified:")," ",Gt(t.list.modified)))))),p("span",{className:"mg-upc-dg-item-count"},t.list.count),p("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&p("button",{"aria-label":ot("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},p("span",{className:"mg-upc-icon upc-font-trash"}))))};class te extends f{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(p("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return p("span",null,e?t.map(((t,n)=>p(e,{key:n},t,""))):t)}}Yt={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(Jt="defaultProps")in(zt=te)?Object.defineProperty(zt,Jt,{value:Yt,enumerable:!0,configurable:!0,writable:!0}):zt[Jt]=Yt;var ee=function(t){return p("div",{className:"mg-upc-dg-pagination-div"},p("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":ot("Previous page"),title:ot("Previous page"),onClick:t.onPreview},p("span",{className:"mg-upc-icon upc-font-arrow_left"})),p("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),p("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":ot("Next page"),title:ot("Next page"),onClick:t.onNext},p("span",{className:"mg-upc-icon upc-font-arrow_right"})))};const ne=()=>({type:at,payload:null}),ie=t=>({type:_t,payload:t}),se=t=>({type:rt,payload:t}),oe=qt(Ct,(async function(t,e){return await function(t){return Et.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}(t)})),ae=qt(ut,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Et.my(t).then((t=>re(t,e,i)))})),le=qt(ut,(async function(t,e){return null===t&&(t={}),await Et.discover(t).then((t=>re(t,e,!1)))}));function re(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(ue(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(de(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},s={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in s){const n=t.headers.get(e);n&&(i[s[e]]=decodeURIComponent(n))}e.dispatch(ie(i))}return t.data}const ce=qt(dt,(async function(t,e){return await Et.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(ae({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(ae({page:n-1}))}return!1}return t}))})),ue=t=>({type:mt,payload:t}),de=t=>({type:ft,payload:t}),pe=t=>({type:vt,payload:t}),_e=t=>({type:yt,payload:t}),me=qt(gt,(async function(t,e){return!1===t||!0===t?t:await Et.get("object"==typeof t?t.ID:t).then((t=>(ke(t,e.dispatch),t.data)))})),fe=qt(ht,(async function(t,e){return await Et.update(t).then((t=>(e.dispatch(se(!1)),ke(t,e.dispatch),t.data)))})),ge=qt(pt,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(ie({id:t.addingPost})),await Et.create(t).then((t=>(e.dispatch(se(!1)),ke(t,e.dispatch),t.data)))})),he=qt(bt,(async function(t,e){return await Et.items(e.getState().list.ID,t).then((t=>(ke(t,e.dispatch),t.data)))})),ve=qt(Pt,(async function(t,e){const n=e.getState();return await Et.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(he({page:t})):t===i&&e.dispatch(he({page:Math.max(1,t-1)})),!1}return t}))})),ye=qt(wt,(async function(t,e){let n=e.extra[0],i=!1;try{await Et.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var s;const n=null==t||null===(s=t.response)||void 0===s?void 0:s.data;i=e.rejectWithValue(n)}return i})),be=qt(Nt,(async function(t,e){const n=e.extra[0];return await Et.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),Pe=qt(kt,(async function(t,e){const n=e.extra[0],i=e.extra[1],s=n.items[t],o=s.position-t+i;return await Et.move(n.ID,s.post_id,o).then((e=>({oldIndex:t,newIndex:i})))})),we=qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Et.move(n.ID,s.post_id,i+1),await e.dispatch(he({page:e.getState().listPage})),t})),Ne=qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Et.move(n.ID,s.post_id,i-1),await e.dispatch(he({page:e.getState().listPage})),t}));function ke(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(pe(parseInt(t.headers.get("x-wp-page"),10))),e(_e(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(pe(parseInt(t.data.items_page["X-WP-Page"],10))),e(_e(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}var Ce=function(t){const{state:e,dispatch:n}=Y(Qt);return p(m,null,p("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>p("li",{className:"mg-upc-dg-item-list"},p("div",null,p(te,{width:"1.5em",height:"1.5em"})),p("div",{className:"mg-upc-dg-item-title"},p(te,null)),p("div",{className:"mg-upc-dg-item-count"},p(te,null)))))),p("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>p(Zt,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&p(ee,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},xe=function(t){var e,n,i;const[s,o]=K(!1),[a,l]=K(""),r=G({});return Q((()=>{l(t.item.description)}),[t.item]),Q((()=>{s&&r.current.focus()}),[s]),p(m,null,p("span",null,p("br",null),"Adding item:"),p("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null," "),p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:Mt}),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!s&&p("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!s&&p("button",{onClick:()=>{o(!0)}},""===a&&p("span",null,ot("Add Comment")),""!==a&&p("span",null,ot("Edit Comment"))),p("input",{ref:r,className:s?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),s&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{o(!1),l(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,ot("Cancel"))),s&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{o(!1),t.onSaveItemDescription(a)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,ot("Save"))))),p("span",null,ot("Select where the item will be added:")))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ie.apply(this,arguments)}function Se(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Te(t){this.props=t}(Te.prototype=new f).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(t,e){return Se(this.props,t)||Se(this.state,e)};var Ae=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ae&&Ae(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ee=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var s,o=e;o=o.__;)if((s=o.__c)&&s.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),s.__c(t,e);Ee(t,e,n,i)};var Le=e.unmount;function De(){this.__u=0,this.t=null,this.__b=null}function Oe(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Re(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),Le&&Le(t)},(De.prototype=new f).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var s=Oe(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,s?s(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__e){var t=i.state.__e;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__e:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(a,a)},De.prototype.componentWillUnmount=function(){this.t=[]},De.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var s=e.__e&&p(m,null,t.fallback);return s&&(s.__h=null),[p(m,null,e.__e?null:t.children),s]};var Ue=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function We(t){return this.getChildContext=function(){return t.context},t.children}function $e(t){var e=this,n=t.i;e.componentWillUnmount=function(){O(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),O(p(We,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Re.prototype=new f).__e=function(t){var e=this,n=Oe(e.__v),i=e.o.get(t);return i[0]++,function(s){var o=function(){e.props.revealOrder?(i.push(s),Ue(e,t,i)):s()};n?n(o):o()}},Re.prototype.render=function(t){this.u=null,this.o=new Map;var e=w(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Re.prototype.componentDidUpdate=Re.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Ue(t,n,e)}))};var He="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,je="undefined"!=typeof document,Be=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};f.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(f.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Fe=e.event;function qe(){}function Xe(){return this.cancelBubble}function Ke(){return this.defaultPrevented}e.event=function(t){return Fe&&(t=Fe(t)),t.persist=qe,t.isPropagationStopped=Xe,t.isDefaultPrevented=Ke,t.nativeEvent=t};var Ve={configurable:!0,get:function(){return this.class}},Qe=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var s=-1===e.indexOf("-");for(var o in i={},n){var a=n[o];je&&"children"===o&&"noscript"===e||"value"===o&&"defaultValue"in n&&null==a||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===a?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!Be(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():s&&Me.test(o)?o=o.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),i[o]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=w(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=w(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Ve.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Ve))}t.$$typeof=He,Qe&&Qe(t)};var Ge=e.__r;e.__r=function(t){Ge&&Ge(t),t.__c};var ze=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Je(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ye(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function Ze(t){(t.querySelector("[autofocus]")||t).focus()}function tn(){Ye("[data-a11y-dialog]").forEach((function(t){new Je(t)}))}Je.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ye('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ye("[data-a11y-dialog-hide]",this.$el).concat(Ye('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Je.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,Ze(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Je.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Je.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Je.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Je.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Je.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Je.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&27===t.which&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&9===t.which&&function(t,e){var n=function(t){return Ye(ze.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Je.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||Ze(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",tn):window.requestAnimationFrame?window.requestAnimationFrame(tn):window.setTimeout(tn,16));(t=>{const e=(()=>{const[t,e]=K(!1);return Q((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=K(null);return[t,J((t=>{null!==t&&e(new Je(t))}),[])]})(),i=J((()=>e.hide()),[e]),s=t.role||"dialog",o="alertdialog"===s,a=t.titleId||t.id+"-title";return Q((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:s,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:o?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:s}=t;if(Q((()=>(n&&s(n),()=>s(void 0))),[s,n]),!e)return null;const o=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=p("h2",Ie({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&p("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=p("button",Ie({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=p($e,{__v:t,i:e});return n.containerInfo=e,n}(p("div",Ie({},i.container,{className:t.classNames.container}),p("div",Ie({},i.overlay,{className:t.classNames.overlay})),p("div",Ie({},i.dialog,{className:t.classNames.dialog}),r)),o)}).defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}};var en=function(t){var e;const[n,i]=K(""),[s,o]=K(""),[a,l]=K(""),[r,c]=K(""),u=z((()=>$t(t.addingPost)),[t.addingPost]);function d(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&d(u[0]),Q((()=>{i(t.list.title),o(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),Q((()=>{var t;null!==(t=Ot(a))&&void 0!==t&&t.available_statuses&&-1===Ot(a).available_statuses.indexOf(r)&&c(Ot(a).available_statuses[0])}),[a]),p("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&p(m,null,p("label",null,ot("Select a list type:")),p("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>p("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>d(t),onKeyPress:e=>{13===e.keyCode&&d(t)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,t.label),p("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&Ht(a,"editable_title")&&p(m,null,p("label",{htmlFor:`title-${t.list.ID}`},ot("Title")),p("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&Ht(a,"editable_content")&&p(m,null,p("label",{htmlFor:`content-${t.list.ID}`},ot("Description")),p("textarea",{id:`content-${t.list.ID}`,value:s,onChange:function(t){o(t.target.value)},maxLength:500}),p("span",{className:"mg-upc-dg-list-desc-edit-count"},p("i",null,null==s?void 0:s.length),"/500")),""!==a&&!Ot(a)&&p("span",null,ot("Unknown List Type...")),""!==a&&(null===(e=Ot(a))||void 0===e?void 0:e.available_statuses)&&Ot(a).available_statuses.length>1&&p(m,null,p("label",{htmlFor:`status-${t.list.ID}`},ot("Status")),p("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ot(a).available_statuses.map(((t,e)=>{if(function(t){const e=Ut(t);return e&&e.show_in_status_list}(t))return p("option",{value:t},function(t){const e=Ut(t);return e?e.label:t}(t))})))),""!==a&&Ot(a)&&p("div",{className:"mg-upc-dg-edit-actions"},p("button",{onClick:()=>t.onSave({title:n,content:s,type:a,status:r})},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,ot("Save"))),p("button",{onClick:()=>t.onCancel()},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,ot("Cancel")))))},nn=function(t){var e;const[n,i]=K(!1),[s,o]=K(""),[a,l]=K(null===(e=t.item)||void 0===e?void 0:e.quantity),r=G({});Q((()=>{o(t.item.description)}),[t.item]),Q((()=>{n&&r.current.focus()}),[n]);const c=G(!1);return Q((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),p("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},Wt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),p("span",{className:"mg-upc-dg-item-number"},t.item.position)),Wt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return Wt(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),p("a",{href:t.item.link},p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:Mt})),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:t.item.link},t.item.title),t.item.price_html&&p("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&p("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&p("p",null,t.item.description),t.editable&&!n&&Wt(t.list,"editable_item_description")&&p("button",{onClick:()=>{i(!0)}},p("span",{className:"mg-upc-icon upc-font-edit"}),""===s&&p("span",null,ot("Add Comment")),""!==s&&p("span",null,ot("Edit Comment"))),p("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:s,onChange:function(t){o(t.target.value)},maxLength:400}),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),o(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,ot("Cancel"))),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(s)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,ot("Save")))),t.editable&&Wt(t.list,"quantity")&&p("div",{className:"mg-upc-dg-quantity"},p("small",null,ot("Quantity")),p("input",{"aria-label":ot("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&p("div",null,p("button",{"aria-label":"Remove item",onClick:t.onRemove},p("span",{className:"mg-upc-icon upc-font-trash"}))))},sn=function(t){return new Promise((function(e,n){const i=document.createElement("script");let s=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){s||this.readyState&&"complete"!=this.readyState||(s=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},on=function(t){var e,n,i;const s=G(null),o=G((e=>{t.onMove(e)}));return Q((()=>{o.current=t.onMove})),Q((()=>{let e=!1;if(Wt(t.list,"sortable")){const t=()=>{e=Sortable.create(s.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){o.current(t)}})};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),p(m,null,p("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>p("li",{className:"mg-upc-dg-item"},Wt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",p(te,{width:"1.5em"})," "),p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(te,{width:"1em"})," ")),Wt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(te,{width:"1em"})," ")),p("div",{className:"mg-upc-dg-item-skeleton-image"},p(te,{width:"5em",height:"5em"})),p("div",{className:"mg-upc-dg-item-data"},p(te,{count:2})))))),p("ul",{ref:s,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&p("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>p(nn,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),Wt(t.list,"vote")&&p("span",{className:"mg-upc-dg-total-votes"}," ",ot("Total votes:")," ",p("span",null," ",t.list.vote_counter)))},an=function(t){const e=G(null),n=G(null),i=ot("Copy"),[s,o]=K(i);Q((()=>{let t=null;s!==i&&(t=setTimeout((()=>{o(i),clearTimeout(t)}),2e3))}),[s]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:ot("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Lt().shareButtons&&(r=r.filter((t=>Lt().shareButtons.includes(t.slug||t.name.toLowerCase())))),p("div",{className:"mg-upc-dg-share-link"},p("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),p("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?o(ot("Copied!")):o("Error!")}},p("span",{className:"mg-upc-icon upc-font-copy"}),p("span",null,s)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),p("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},p("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},ln=function(t){var e;const{state:n,dispatch:i}=Y(Qt),[s,o]=K(!1),a=G(!1),l=G(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(he({page:t}))}return Q((()=>{const t=n.list;let e=!1,s=!1;if(t&&Wt(t,"sortable")){const t=()=>{n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(we(t.oldIndex))}})),n.listPage>1&&(s=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(Ne(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy(),s&&s.destroy()}}),[n.list,n.listPage,n.listTotalPages]),Q((()=>{o(!1)}),[n.editing,n.list,n.addingPost]),p(m,null,n.editing&&p(en,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const s={};s.title=t.title,s.content=t.content,s.type=t.type,s.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(s.adding=n.addingPost.post_id),i(ge(s))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(fe(e))}},onCancel:function(){i(se(!1)),-1===n.list.ID&&(i(me(!1)),i(ne()),i(ae()))}}),!n.editing&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return Ht(i,"editable_title")||Ht(i,"editable_content")||(null===(e=Ot(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&p("button",{className:"mg-upg-edit",onClick:()=>i(se(!0))},p("span",{className:"mg-upc-icon upc-font-edit"}),p("span",null,ot("Edit"))),n.list.link&&p("button",{className:"mg-upg-share",onClick:()=>o(!s)},p("span",{className:"mg-upc-icon upc-font-share"}),p("span",null,ot("Share"))),"cart"===n.list.type&&p("button",{className:"mg-upg-share",onClick:function(){i(oe(n.list.ID))}},p("span",{className:"mg-upc-icon upc-font-cart"}),p("span",null,ot("Add all to cart")))),s&&n.list.link&&p(an,{link:n.list.link,title:n.list.title}),n.list.content&&p("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:(c=n.list.content,"string"!=typeof c?"":c.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2"))}}),p(te,{count:3}),p(on,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(Pe(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ve(e.post_id))},onSaveItemDescription:function(t,e,n){i(be(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(be(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&p(ee,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}));var c};O(p((t=>{const[e,n]=V(Ft,Vt);return p(Qt.Provider,{value:{state:e,dispatch:Kt(n,(()=>e))}},t.children)}),null,p((function(){const{state:t,dispatch:e}=Y(Qt),[n,i]=K("any"),[s,o]=K("any"),[a,l]=K(""),[r,c]=K(null),u=G(!1),d=z((()=>$t(t.addingPost)),[t.addingPost]),_=z((()=>{return Object.values(null===(t=Lt())||void 0===t?void 0:t.types);var t}),[]);let f="listOfList";if(t.addingPost)f=t.editing?"addingToNew":"adding";else if(t.editing){var g;f=-1!==(null===(g=t.list)||void 0===g?void 0:g.ID)?"edit":"new"}else f=t.list?"list":"listOfList";Q((()=>{window.showMainLists=function(){e(ne()),h()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(ne()),n||P(t)}}),[e]);const h=()=>{const i={};n&&(i.types=n),s&&(i.status=s),r&&(i.search=r),a&&(i.author=a),t.page>1&&(i.page=t.page),e(le(i))};function v(){t.page>1&&e(ue(1))}function y(t){v(),i(t)}function b(t){v(),o(t)}Q((()=>{Vt.title="",e({type:ct,payload:"admin"});const t=function(t){const n=parseInt(("author",new URLSearchParams(document.location.hash.substring(1)).get("author")),10);n>0&&n!==a&&(t&&Bt(t),e(ue(1)),l(n),location.hash="")};return t(0),window.addEventListener("hashchange",t,!1),()=>{window.removeEventListener("hashchange",t)}}),[]),Q((()=>{t.list||h()}),[n,s,a,t.page]),Q((()=>{null!=r&&(clearTimeout(u.current),u.current=setTimeout((function(){h()}),300))}),[r]);const P=t=>{e(ie({post_id:t})),e(ae({addingPost:t}))};function w(n){n<1||n>t.totalPages||"loading"===t.status||e(ue(n))}const N=p("h2",{key:"title"},("list"===f||"new"===f||"edit"===f||"addingToNew"===f)&&p("a",{"aria-label":"Back",className:"mg-upc-dg-back",href:"#",onClick:n=>{n.preventDefault(),function(){switch(f){case"list":e(me(!1)),h();break;case"new":e(me(!1)),e(se(!1)),h();break;case"edit":e(se(!1));break;case"addingToNew":e(me(!1)),e(se(!1)),e(ae({addingPost:t.addingPost.post_id}));break;default:h()}}()}},"←")," ",t.title);return p(m,null,N,p("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+f},p("div",{className:"mg-upc-dg-wait"}),t.error&&p("div",{className:"mg-upc-dg-error"},t.error,p("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:lt,payload:null})}},p("span",{className:"mg-upc-icon upc-font-close"}))),p("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&p(xe,{item:t.addingPost,onSaveItemDescription:function(n){e(ie({...t.addingPost,description:n}))}}),("listOfList"===f||"adding"===f)&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},d.length>0&&p("button",{className:"mg-list-new",onClick:function(t){e(se(!0)),e(me(!0))}},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null,ot("Create List")))),p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Types"))),p("li",{className:"any"==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",onClick:()=>y("any"),onKeyPress:t=>{13===t.keyCode&&y("any")},tabIndex:"0"},p("i",{className:"mg-upc-icon upc-font-close mg-upc-dg-item-type mg-upc-dg-item-type-none"}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,"All"))),_.map(((t,e)=>p("li",{className:t.name==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",key:t.name,onClick:()=>y(t.name),onKeyPress:e=>{13===e.keyCode&&y(t.name)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,t.label)))))),Rt()&&p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Status"))),p("li",{className:"any"==s?"mg-upc-selected":"",onClick:()=>b("any"),onKeyPress:t=>{13===t.keyCode&&b("any")},tabIndex:"0"},p("div",{className:"mg-upc-dg-item-title"},p("strong",null,"All"))),Rt().map(((t,e)=>p("li",{className:t.name==s?"mg-upc-selected":"",key:t.name,onClick:()=>b(t.name),onKeyPress:e=>{13===e.keyCode&&b(t.name)},tabIndex:"0"},t.label)))),p("div",{className:"mg-upc-dg-df"},p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Search"))),p("input",{onChange:function(t){v(),c(t.target.value)},value:r})),p("ul",{className:"mg-upc-dg-filter"},p("li",{className:"mg-upc-dg-filter-label"},p("strong",null,ot("Author (ID)"))),p("input",{type:"number",onChange:function(t){v(),l(t.target.value)},value:a}))),p(Ce,{lists:t.listOfList,onSelect:function(n){e(se(!1)),t.addingPost?e(ye(n.ID,t.addingPost)):e(me(n))},onRemove:!t.addingPost&&function(t){e(ce(t.ID))},loadPreview:function(){w(t.page-1)},loadNext:function(){w(t.page+1)}})),t.list&&p(ln,{editable:(t.list,!0)}))))}),null)," "),document.getElementById("mg-upc-admin-app")),setTimeout(window.showMainLists,1e3)}();1 (()=>{"use strict";var t,e,n,i,s,o,a={},l=[],r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c(t,e){for(var n in e)t[n]=e[n];return t}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function d(e,n,i){var s,o,a,l={};for(a in n)"key"==a?s=n[a]:"ref"==a?o=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return p(e,l,s,o,null)}function p(t,i,s,o,a){var l={type:t,props:i,key:s,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function _(t){return t.children}function m(t,e){this.props=t,this.context=e}function f(t,e){if(null==e)return t.__?f(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?f(t):null}function g(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return g(t)}}function h(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!v.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||setTimeout)(v)}function v(){for(var t;v.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,s,o,a;t.__d&&(o=(s=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=c({},s)).__v=s.__v+1,I(a,s,i,e.__n,void 0!==a.ownerSVGElement,null!=s.__h?[o]:null,n,null==o?f(s):o,s.__h),S(n,s),s.__e!=o&&g(s)))}))}function y(t,e,n,i,s,o,r,c,u,d){var m,g,h,v,y,P,k,w=i&&i.__k||l,C=w.length;for(n.__k=[],m=0;m<e.length;m++)if(null!=(v=n.__k[m]=null==(v=e[m])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?p(null,v,null,null,v):Array.isArray(v)?p(_,{children:v},null,null,null):v.__b>0?p(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=w[m])||h&&v.key==h.key&&v.type===h.type)w[m]=void 0;else for(g=0;g<C;g++){if((h=w[g])&&v.key==h.key&&v.type===h.type){w[g]=void 0;break}h=null}I(t,v,h=h||a,s,o,r,c,u,d),y=v.__e,(g=v.ref)&&h.ref!=g&&(k||(k=[]),h.ref&&k.push(h.ref,null,v),k.push(g,v.__c||y,v)),null!=y?(null==P&&(P=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=b(v,u,t):u=N(t,v,h,w,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=f(h))}for(n.__e=P,m=C;m--;)null!=w[m]&&("function"==typeof n.type&&null!=w[m].__e&&w[m].__e==n.__d&&(n.__d=f(i,m+1)),E(w[m],w[m]));if(k)for(m=0;m<k.length;m++)A(k[m],k[++m],k[++m])}function b(t,e,n){for(var i,s=t.__k,o=0;s&&o<s.length;o++)(i=s[o])&&(i.__=t,e="function"==typeof i.type?b(i,e,n):N(n,i,i,s,i.__e,e));return e}function P(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){P(t,e)})):e.push(t)),e}function N(t,e,n,i,s,o){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||s!=o||null==s.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(s),a=null;else{for(l=o,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==s)break t;t.insertBefore(s,o),a=o}return void 0!==a?a:s.nextSibling}function k(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||r.test(e)?n:n+"px"}function w(t,e,n,i,s){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||k(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||k(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?x:C,o):t.removeEventListener(e,o?x:C,o);else if("dangerouslySetInnerHTML"!==e){if(s)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function C(t){this.l[t.type+!1](e.event?e.event(t):t)}function x(t){this.l[t.type+!0](e.event?e.event(t):t)}function I(t,n,i,s,o,a,l,r,u){var d,p,f,g,h,v,b,P,N,k,w,C,x,I=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(u=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof I){if(P=n.props,N=(d=I.contextType)&&s[d.__c],k=d?N?N.props.value:d.__:s,i.__c?b=(p=n.__c=i.__c).__=p.__E:("prototype"in I&&I.prototype.render?n.__c=p=new I(P,k):(n.__c=p=new m(P,k),p.constructor=I,p.render=L),N&&N.sub(p),p.props=P,p.state||(p.state={}),p.context=k,p.__n=s,f=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=c({},p.__s)),c(p.__s,I.getDerivedStateFromProps(P,p.__s))),g=p.props,h=p.state,f)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&P!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(P,k),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(P,p.__s,k)||n.__v===i.__v){p.props=P,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(P,p.__s,k),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}if(p.context=k,p.props=P,p.__v=n,p.__P=t,w=e.__r,C=0,"prototype"in I&&I.prototype.render)p.state=p.__s,p.__d=!1,w&&w(n),d=p.render(p.props,p.state,p.context);else do{p.__d=!1,w&&w(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++C<25);p.state=p.__s,null!=p.getChildContext&&(s=c(c({},s),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),x=null!=d&&d.type===_&&null==d.key?d.props.children:d,y(t,Array.isArray(x)?x:[x],n,i,s,o,a,l,r,u),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=T(i.__e,n,i,s,o,a,l,u);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(u||null!=a)&&(n.__e=r,n.__h=!!u,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function S(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function T(e,n,i,s,o,l,r,c){var d,p,_,m=i.props,g=n.props,h=n.type,v=0;if("svg"===h&&(o=!0),null!=l)for(;v<l.length;v++)if((d=l[v])&&"setAttribute"in d==!!h&&(h?d.localName===h:3===d.nodeType)){e=d,l[v]=null;break}if(null==e){if(null===h)return document.createTextNode(g);e=o?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,g.is&&g),l=null,c=!1}if(null===h)m===g||c&&e.data===g||(e.data=g);else{if(l=l&&t.call(e.childNodes),p=(m=i.props||a).dangerouslySetInnerHTML,_=g.dangerouslySetInnerHTML,!c){if(null!=l)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,s){var o;for(o in n)"children"===o||"key"===o||o in e||w(t,o,null,n[o],i);for(o in e)s&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||w(t,o,e[o],n[o],i)}(e,g,m,o,c),_)n.__k=[];else if(v=n.props.children,y(e,Array.isArray(v)?v:[v],n,i,s,o&&"foreignObject"!==h,l,r,l?l[0]:i.__k&&f(i,0),c),null!=l)for(v=l.length;v--;)null!=l[v]&&u(l[v]);c||("value"in g&&void 0!==(v=g.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&w(e,"value",v,m.value,!1),"checked"in g&&void 0!==(v=g.checked)&&v!==e.checked&&w(e,"checked",v,m.checked,!1))}return e}function A(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function E(t,n,i){var s,o;if(e.unmount&&e.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||A(s,null,n)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(t){e.__e(t,n)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&E(s[o],n,"function"!=typeof t.type);i||null==t.__e||u(t.__e),t.__e=t.__d=void 0}function L(t,e,n){return this.constructor(t,n)}function D(n,i,s){var o,l,r;e.__&&e.__(n,i),l=(o="function"==typeof s)?null:s&&s.__k||i.__k,r=[],I(i,n=(!o&&s||i).__k=d(_,null,[n]),l||a,a,void 0!==i.ownerSVGElement,!o&&s?[s]:l?null:i.firstChild?t.call(i.childNodes):null,r,!o&&s?s:l?l.__e:i.firstChild,o),S(r,n)}t=l.slice,e={__e:function(t,e,n,i){for(var s,o,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((o=s.constructor)&&null!=o.getDerivedStateFromError&&(s.setState(o.getDerivedStateFromError(t)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(t,i||{}),a=s.__d),a)return s.__E=s}catch(e){t=e}throw t}},n=0,m.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c({},this.state),"function"==typeof t&&(t=t(c({},n),this.props)),t&&c(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),h(this))},m.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),h(this))},m.prototype.render=_,i=[],v.__r=0,o=0;var O,U,R,W,$=0,H=[],M=[],j=e.__b,B=e.__r,F=e.diffed,V=e.__c,q=e.unmount;function X(t,n){e.__h&&e.__h(U,t,$||n),$=0;var i=U.__H||(U.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:M}),i.__[t]}function K(t){return $=1,Q(ot,t)}function Q(t,e,n){var i=X(O++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):ot(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=U,!i.__c.u)){i.__c.__H.u=!0;var s=i.__c.shouldComponentUpdate;i.__c.shouldComponentUpdate=function(t,e,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(t){return t.__c}));return(o.every((function(t){return!t.__N}))||!o.every((function(t){if(!t.__N)return!0;var e=t.__[0];return t.__=t.__N,t.__N=void 0,e===t.__[0]})))&&(!s||s(t,e,n))}}return i.__N||i.__}function G(t,n){var i=X(O++,3);!e.__s&&st(i.__H,n)&&(i.__=t,i.i=n,U.__H.__h.push(i))}function z(t){return $=5,J((function(){return{current:t}}),[])}function J(t,e){var n=X(O++,7);return st(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Y(t,e){return $=8,J((function(){return t}),e)}function Z(t){var e=U.context[t.__c],n=X(O++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(U)),e.props.value):t.__}function tt(){for(var t;t=H.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(nt),t.__H.__h.forEach(it),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){U=null,j&&j(t)},e.__r=function(t){B&&B(t),O=0;var e=(U=t.__c).__H;e&&(R===U?(e.__h=[],U.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=M,t.__N=t.i=void 0}))):(e.__h.forEach(nt),e.__h.forEach(it),e.__h=[])),R=U},e.diffed=function(t){F&&F(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(1!==H.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),et&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);et&&(e=requestAnimationFrame(n))})(tt)),n.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==M&&(t.__=t.__V),t.i=void 0,t.__V=M}))),R=U=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(nt),t.__h=t.__h.filter((function(t){return!t.__||it(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),V&&V(t,n)},e.unmount=function(t){q&&q(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{nt(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var et="function"==typeof requestAnimationFrame;function nt(t){var e=U,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),U=e}function it(t){var e=U;t.__c=t.__(),U=e}function st(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function ot(t,e){return"function"==typeof e?e(t):e}const at=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t},lt="ui/reset",rt="ui/error",ct="ui/editing",ut="ui/mode",dt="listOfLists/set",pt="listOfLists/remove",_t="listOfLists/create",mt="listOfList/addingPost",ft="listOfList/setPage",gt="listOfList/setTotalPages",ht="list/set",vt="list/update",yt="list/setPage",bt="list/setTotalPages",Pt="list/setItems",Nt="list/removeItem",kt="list/addItem",wt="list/updateItem",Ct="list/moveItem",xt="list/cart",It=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Dt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Dt().ajaxUrl,e),i=await n.json();i.nonce&&(Dt().nonce=i.nonce),i.user_id&&(Dt().user_id=i.user_id)}const s={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Dt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(s.body=JSON.stringify(n));const o=await fetch(Dt().root+i+e,s);o.headers.get("x-wp-nonce")&&(Dt().nonce=o.headers.get("x-wp-nonce"));const a=await o.json();return{data:a,headers:o.headers,status:o.status}};function St(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Dt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class Tt extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function At(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var s;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new Tt(null==t||null===(s=t.data)||void 0===s?void 0:s.message,t)}let Et={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return It("GET","/My"+St(t),{}).then((function(t){return At(t),t}))},discover:function(t){return It("GET","/"+St(t),{}).then((function(t){return At(t),t}))},get:function(t){return It("GET","/"+t,{}).then((function(t){return At(t),t}))},cart:function(t){return It("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return At(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return It("GET","/"+t+"/items"+St(e),{}).then((function(t){return At(t),t}))},delete:function(t){return It("DELETE","/"+t,{}).then((function(t){return At(t),t}))},create:function(t){return It("POST","",t).then((function(t){return At(t),t}))},update:function(t){let e=t.id;return delete t.id,It("PATCH","/"+e,t).then((function(t){return At(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),It("POST","/"+t+"/items"+St(n),e).then((function(t){return At(t),t}))},quit:function(t,e){return It("DELETE","/"+t+"/items/"+e,{}).then((function(t){return At(t),t}))},updateItem:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,n).then((function(t){return At(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return It("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return At(t),t}))},move:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return At(t),t}))}};const Lt=Et;function Dt(){return MgUserPostCollections}function Ot(){var t;return null===(t=Dt())||void 0===t?void 0:t.sortable}function Ut(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Rt(){var t;return Object.values(null===(t=Dt())||void 0===t?void 0:t.statuses)}function Wt(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function $t(t,e){return!!t.type&&Mt(t.type,e)}function Ht(t){var e;const n=[],i=null===(e=Dt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(Mt(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function Mt(t,e){const n=Ut(t);return!(!n||!n.supports)&&n.supports.includes(e)}const jt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function Bt(t){return JSON.parse(JSON.stringify(t))}function Ft(t){return t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault(),!1}function Vt(t,e){const{type:n,payload:i}=e;let s=!1;const o=t=>(s=a({status:"failed"}),t.error&&(s.error=t.error.message?t.error.message:"",s.errorCode=t.error.code?t.error.code:""),s),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=Bt(t)),e)for(const t in e)e.hasOwnProperty(t)&&(s[t]=e[t]);return s};let l=function(t,e){const{type:n,payload:i}=e;let s,o;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=!1===t?{}:Bt(t)),e)for(const t in e)o[t]=e[t];return o};switch(n){case ht:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case vt:return i.items=Bt(t.items),i;case _t:return i;case Pt:return a({items:i});case"list/addItem/failed":case kt:return null!=i&&i.list?a(i.list):t;case wt:const e=!!i.item&&i.item;return s=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:s});case Nt:if(1===t.items.length||!1===i)return t;if(o=a(),s=o.items.filter((t=>t.post_id!==i)),Mt(t.type,"sortable")){const e=parseInt(t.items[0].position,10);s.forEach(((t,n)=>{s[n].position=e+n}))}if(Mt(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(o.vote_counter=o.vote_counter-e.votes)}return{...o,items:s};case Ct:const n=parseInt(t.items[0].position,10);s=a().items.slice();const l=a().items[i.oldIndex];return s.splice(i.oldIndex,1),s.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(s.forEach(((t,e)=>{s[e].position=n+e})),a({items:s}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case dt:return i;case kt:case ht:return!1;case pt:return!1===i?t:Bt(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(s=a({listOfList:r,list:l}),t.addingPost||(s.title=s.list?s.list.title:Qt.title)),n){case ut:return a({mode:i});case lt:return{...Qt,mode:t.mode};case rt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case"ui/message":return a(!1===i?{message:!1,errorCode:!1}:{message:i});case xt:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case ct:return a({editing:i});case mt:return s=a(),s.addingPost=i,i&&(s.title="Add to..."),s;case _t:s=a(),s.title=i.title?i.title:Qt.title,s.listTotalPages=1,s.listPage=1,s.addingPost=!1;break;case kt:if(s=a(),null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Qt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(s.error=i.message,s.status="failed"),s.addingPost=!1;break;case ft:return a({page:i});case gt:return a({totalPages:i});case yt:return a({listPage:i});case bt:return a({listTotalPages:i});case"list/set/loading":return s=a(),s.status="loading",s.listOfList=!1,"object"==typeof i?(s.list=i,i.title&&(s.title=i.title)):s.list={ID:i},s;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case _t+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return s=a(),s.addingPost=!1,s.status="succeeded",s.error=!1,s.errorCode=!1,s.title=s.list?s.list.title:Qt.title,s;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case _t+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case _t+"/failed":return s=a({status:"failed"}),e.error&&e.error.message&&(s.error=e.error.message),s;case"list/addItem/failed":if(s=a(),s.addingPost=!1,s.title=s.list?s.list.title:Qt.title,null!=i&&i.list){const t=i.list;s.title=t.title?t.title:Qt.title;const e=null==t?void 0:t.items_page;e&&(s.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,s.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(s.error=i.message,s.status="failed"),o(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return o(e)}return!1!==s?s:t}const qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:s}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Kt=(t,e)=>n=>{let i;if((s=n)&&"object"==typeof s&&!0===s.asyncThunk){let s={dispatch:Kt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,s)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var s;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Qt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:at("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},Gt=function(t,e){var n={__c:e="__cC"+o++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(h)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function zt(t){return new Date(t).toLocaleDateString()}const Jt=function(t){const{state:e,dispatch:n}=Z(Gt);return d("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),d("div",{className:"mg-upc-dg-item-title"},d("span",null,t.list.title),"my"!==e.mode&&d(_,null,d("span",null,d("a",{href:"#",onClick:function(e){Ft(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),d("span",{className:"mg-upc-list-dates"},d("i",null," ",d("b",null,"Created:")," ",zt(t.list.created)),d("i",null," ",d("b",null,"Modified:")," ",zt(t.list.modified)))))),d("span",{className:"mg-upc-dg-item-count"},t.list.count),d("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&d("button",{"aria-label":at("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},d("span",{className:"mg-upc-icon upc-font-trash"}))))};class Yt extends m{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(d("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return d("span",null,e?t.map(((t,n)=>d(e,{key:n},t,""))):t)}}var Zt,te,ee;ee={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(te="defaultProps")in(Zt=Yt)?Object.defineProperty(Zt,te,{value:ee,enumerable:!0,configurable:!0,writable:!0}):Zt[te]=ee;const ne=function(t){return d("div",{className:"mg-upc-dg-pagination-div"},d("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":at("Previous page"),title:at("Previous page"),onClick:t.onPreview},d("span",{className:"mg-upc-icon upc-font-arrow_left"})),d("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),d("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":at("Next page"),title:at("Next page"),onClick:t.onNext},d("span",{className:"mg-upc-icon upc-font-arrow_right"})))},ie=()=>({type:lt,payload:null}),se=t=>({type:mt,payload:t}),oe=t=>({type:ct,payload:t}),ae=qt(xt,(async function(t,e){return await function(t){return Lt.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}(t)})),le=qt(dt,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Lt.my(t).then((t=>ce(t,e,i)))})),re=qt(dt,(async function(t,e){return null===t&&(t={}),await Lt.discover(t).then((t=>ce(t,e,!1)))}));function ce(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(de(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(pe(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},s={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in s){const n=t.headers.get(e);n&&(i[s[e]]=decodeURIComponent(n))}e.dispatch(se(i))}return t.data}const ue=qt(pt,(async function(t,e){return await Lt.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(le({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(le({page:n-1}))}return!1}return t}))})),de=t=>({type:ft,payload:t}),pe=t=>({type:gt,payload:t}),_e=t=>({type:yt,payload:t}),me=t=>({type:bt,payload:t}),fe=qt(ht,(async function(t,e){return!1===t||!0===t?t:await Lt.get("object"==typeof t?t.ID:t).then((t=>(Ce(t,e.dispatch),t.data)))})),ge=qt(vt,(async function(t,e){return await Lt.update(t).then((t=>(e.dispatch(oe(!1)),Ce(t,e.dispatch),t.data)))})),he=qt(_t,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(se({id:t.addingPost})),await Lt.create(t).then((t=>(e.dispatch(oe(!1)),Ce(t,e.dispatch),t.data)))})),ve=qt(Pt,(async function(t,e){return await Lt.items(e.getState().list.ID,t).then((t=>(Ce(t,e.dispatch),t.data)))})),ye=qt(Nt,(async function(t,e){const n=e.getState();return await Lt.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(ve({page:t})):t===i&&e.dispatch(ve({page:Math.max(1,t-1)})),!1}return t}))})),be=qt(kt,(async function(t,e){let n=e.extra[0],i=!1;try{await Lt.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var s;const n=null==t||null===(s=t.response)||void 0===s?void 0:s.data;i=e.rejectWithValue(n)}return i})),Pe=qt(wt,(async function(t,e){const n=e.extra[0];return await Lt.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),Ne=qt(Ct,(async function(t,e){const n=e.extra[0],i=e.extra[1],s=n.items[t],o=s.position-t+i;return await Lt.move(n.ID,s.post_id,o).then((e=>({oldIndex:t,newIndex:i})))})),ke=qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Lt.move(n.ID,s.post_id,i+1),await e.dispatch(ve({page:e.getState().listPage})),t})),we=qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const s=n.items[t];return await Lt.move(n.ID,s.post_id,i-1),await e.dispatch(ve({page:e.getState().listPage})),t}));function Ce(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(_e(parseInt(t.headers.get("x-wp-page"),10))),e(me(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(_e(parseInt(t.data.items_page["X-WP-Page"],10))),e(me(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}const xe=function(t){const{state:e,dispatch:n}=Z(Gt);return d(_,null,d("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>d("li",{className:"mg-upc-dg-item-list"},d("div",null,d(Yt,{width:"1.5em",height:"1.5em"})),d("div",{className:"mg-upc-dg-item-title"},d(Yt,null)),d("div",{className:"mg-upc-dg-item-count"},d(Yt,null)))))),d("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>d(Jt,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&d(ne,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},Ie=function(t){var e,n,i;const[s,o]=K(!1),[a,l]=K(""),r=z({});return G((()=>{l(t.item.description)}),[t.item]),G((()=>{s&&r.current.focus()}),[s]),d(_,null,d("span",null,d("br",null),"Adding item:"),d("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null," "),d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:jt}),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!s&&d("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!s&&d("button",{onClick:()=>{o(!0)}},""===a&&d("span",null,at("Add Comment")),""!==a&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:s?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),s&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{o(!1),l(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),s&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{o(!1),t.onSaveItemDescription(a)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))))),d("span",null,at("Select where the item will be added:")))};function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Se.apply(this,arguments)}function Te(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Ae(t){this.props=t}(Ae.prototype=new m).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(t,e){return Te(this.props,t)||Te(this.state,e)};var Ee=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ee&&Ee(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Le=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var s,o=e;o=o.__;)if((s=o.__c)&&s.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),s.__c(t,e);Le(t,e,n,i)};var De=e.unmount;function Oe(){this.__u=0,this.t=null,this.__b=null}function Ue(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Re(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),De&&De(t)},(Oe.prototype=new m).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var s=Ue(i.__v),o=!1,a=function(){o||(o=!0,n.__R=null,s?s(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},Oe.prototype.componentWillUnmount=function(){this.t=[]},Oe.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var s=e.__a&&d(_,null,t.fallback);return s&&(s.__h=null),[d(_,null,e.__a?null:t.children),s]};var We=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function $e(t){return this.getChildContext=function(){return t.context},t.children}function He(t){var e=this,n=t.i;e.componentWillUnmount=function(){D(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),D(d($e,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Re.prototype=new m).__a=function(t){var e=this,n=Ue(e.__v),i=e.o.get(t);return i[0]++,function(s){var o=function(){e.props.revealOrder?(i.push(s),We(e,t,i)):s()};n?n(o):o()}},Re.prototype.render=function(t){this.u=null,this.o=new Map;var e=P(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Re.prototype.componentDidUpdate=Re.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){We(t,n,e)}))};var Me="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,Fe=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(m.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Ve=e.event;function qe(){}function Xe(){return this.cancelBubble}function Ke(){return this.defaultPrevented}e.event=function(t){return Ve&&(t=Ve(t)),t.persist=qe,t.isPropagationStopped=Xe,t.isDefaultPrevented=Ke,t.nativeEvent=t};var Qe={configurable:!0,get:function(){return this.class}},Ge=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var s=-1===e.indexOf("-");for(var o in i={},n){var a=n[o];Be&&"children"===o&&"noscript"===e||"value"===o&&"defaultValue"in n&&null==a||("defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===a?a="":/ondoubleclick/i.test(o)?o="ondblclick":/^onchange(textarea|input)/i.test(o+e)&&!Fe(n.type)?o="oninput":/^onfocus$/i.test(o)?o="onfocusin":/^onblur$/i.test(o)?o="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(o)?o=o.toLowerCase():s&&je.test(o)?o=o.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(o)&&(o=o.toLowerCase(),i[o]&&(o="oninputCapture")),i[o]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=P(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Qe.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Qe))}t.$$typeof=Me,Ge&&Ge(t)};var ze=e.__r;e.__r=function(t){ze&&ze(t),t.__c};var Je=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Ye(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ze(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function tn(t){(t.querySelector("[autofocus]")||t).focus()}function en(){Ze("[data-a11y-dialog]").forEach((function(t){new Ye(t)}))}Ye.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ze('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ze("[data-a11y-dialog-hide]",this.$el).concat(Ze('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Ye.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,tn(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Ye.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Ye.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Ye.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Ye.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Ye.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Ye.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&"Escape"===t.key&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&"Tab"===t.key&&function(t,e){var n=function(t){return Ze(Je.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Ye.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||tn(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",en):window.requestAnimationFrame?window.requestAnimationFrame(en):window.setTimeout(en,16));(t=>{const e=(()=>{const[t,e]=K(!1);return G((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=K(null);return[t,Y((t=>{null!==t&&e(new Ye(t))}),[])]})(),i=Y((()=>e.hide()),[e]),s=t.role||"dialog",o="alertdialog"===s,a=t.titleId||t.id+"-title";return G((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:s,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:o?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:s}=t;if(G((()=>(n&&s(n),()=>s(void 0))),[s,n]),!e)return null;const o=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=d("h2",Se({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&d("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=d("button",Se({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=d(He,{__v:t,i:e});return n.containerInfo=e,n}(d("div",Se({},i.container,{className:t.classNames.container}),d("div",Se({},i.overlay,{className:t.classNames.overlay})),d("div",Se({},i.dialog,{className:t.classNames.dialog}),r)),o)}).defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}};const nn=function(t){var e;const[n,i]=K(""),[s,o]=K(""),[a,l]=K(""),[r,c]=K(""),u=J((()=>Ht(t.addingPost)),[t.addingPost]);function p(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&p(u[0]),G((()=>{i(t.list.title),o(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),G((()=>{var t;null!==(t=Ut(a))&&void 0!==t&&t.available_statuses&&-1===Ut(a).available_statuses.indexOf(r)&&c(Ut(a).available_statuses[0])}),[a]),d("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&d(_,null,d("label",null,at("Select a list type:")),d("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>d("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>p(t),onKeyPress:e=>{13===e.keyCode&&p(t)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,t.label),d("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&Mt(a,"editable_title")&&d(_,null,d("label",{htmlFor:`title-${t.list.ID}`},at("Title")),d("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&Mt(a,"editable_content")&&d(_,null,d("label",{htmlFor:`content-${t.list.ID}`},at("Description")),d("textarea",{id:`content-${t.list.ID}`,value:s,onChange:function(t){o(t.target.value)},maxLength:500}),d("span",{className:"mg-upc-dg-list-desc-edit-count"},d("i",null,null==s?void 0:s.length),"/500")),""!==a&&!Ut(a)&&d("span",null,at("Unknown List Type...")),""!==a&&(null===(e=Ut(a))||void 0===e?void 0:e.available_statuses)&&Ut(a).available_statuses.length>1&&d(_,null,d("label",{htmlFor:`status-${t.list.ID}`},at("Status")),d("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ut(a).available_statuses.map(((t,e)=>{if(function(t){const e=Wt(t);return e&&e.show_in_status_list}(t))return d("option",{value:t},function(t){const e=Wt(t);return e?e.label:t}(t))})))),""!==a&&Ut(a)&&d("div",{className:"mg-upc-dg-edit-actions"},d("button",{onClick:()=>t.onSave({title:n,content:s,type:a,status:r})},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))),d("button",{onClick:()=>t.onCancel()},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel")))))},sn=function(t){var e;const[n,i]=K(!1),[s,o]=K(""),[a,l]=K(null===(e=t.item)||void 0===e?void 0:e.quantity),r=z({});G((()=>{o(t.item.description)}),[t.item]),G((()=>{n&&r.current.focus()}),[n]);const c=z(!1);return G((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),d("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},$t(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),d("span",{className:"mg-upc-dg-item-number"},t.item.position)),$t(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return $t(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),d("a",{href:t.item.link},d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:jt})),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:t.item.link},t.item.title),t.item.price_html&&d("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&d("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&d("p",null,t.item.description),t.editable&&!n&&$t(t.list,"editable_item_description")&&d("button",{onClick:()=>{i(!0)}},d("span",{className:"mg-upc-icon upc-font-edit"}),""===s&&d("span",null,at("Add Comment")),""!==s&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:s,onChange:function(t){o(t.target.value)},maxLength:400}),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),o(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(s)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save")))),t.editable&&$t(t.list,"quantity")&&d("div",{className:"mg-upc-dg-quantity"},d("small",null,at("Quantity")),d("input",{"aria-label":at("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&d("div",null,d("button",{"aria-label":"Remove item",onClick:t.onRemove},d("span",{className:"mg-upc-icon upc-font-trash"}))))},on=function(t){return new Promise((function(e,n){const i=document.createElement("script");let s=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){s||this.readyState&&"complete"!=this.readyState||(s=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},an=function(t){var e,n,i;const s=z(null),o=z((e=>{t.onMove(e)}));return G((()=>{o.current=t.onMove})),G((()=>{let e=!1;if($t(t.list,"sortable")){const t=()=>{e=Sortable.create(s.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){o.current(t)}})};"undefined"!=typeof Sortable?t():on(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),d(_,null,d("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>d("li",{className:"mg-upc-dg-item"},$t(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",d(Yt,{width:"1.5em"})," "),d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Yt,{width:"1em"})," ")),$t(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Yt,{width:"1em"})," ")),d("div",{className:"mg-upc-dg-item-skeleton-image"},d(Yt,{width:"5em",height:"5em"})),d("div",{className:"mg-upc-dg-item-data"},d(Yt,{count:2})))))),d("ul",{ref:s,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&d("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>d(sn,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),$t(t.list,"vote")&&d("span",{className:"mg-upc-dg-total-votes"}," ",at("Total votes:")," ",d("span",null," ",t.list.vote_counter)))},ln=function(t){const e=z(null),n=z(null),i=at("Copy"),[s,o]=K(i);G((()=>{let t=null;s!==i&&(t=setTimeout((()=>{o(i),clearTimeout(t)}),2e3))}),[s]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:at("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Dt().shareButtons&&(r=r.filter((t=>Dt().shareButtons.includes(t.slug||t.name.toLowerCase())))),d("div",{className:"mg-upc-dg-share-link"},d("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),d("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?o(at("Copied!")):o("Error!")}},d("span",{className:"mg-upc-icon upc-font-copy"}),d("span",null,s)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),d("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},d("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},rn=function(t){var e;const{state:n,dispatch:i}=Z(Gt),[s,o]=K(!1),a=z(!1),l=z(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(ve({page:t}))}return G((()=>{const t=n.list;let e=!1,s=!1;if(t&&$t(t,"sortable")){const t=()=>{a.current&&n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(ke(t.oldIndex))}})),a.current&&n.listPage>1&&(s=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(we(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():on(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy(),s&&s.destroy()}}),[n.list,n.listPage,n.listTotalPages]),G((()=>{o(!1)}),[n.editing,n.list,n.addingPost]),d(_,null,n.editing&&d(nn,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const s={};s.title=t.title,s.content=t.content,s.type=t.type,s.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(s.adding=n.addingPost.post_id),i(he(s))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(ge(e))}},onCancel:function(){i(oe(!1)),-1===n.list.ID&&(i(fe(!1)),i(ie()),i(le()))}}),!n.editing&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return Mt(i,"editable_title")||Mt(i,"editable_content")||(null===(e=Ut(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&d("button",{className:"mg-upg-edit",onClick:()=>i(oe(!0))},d("span",{className:"mg-upc-icon upc-font-edit"}),d("span",null,at("Edit"))),n.list.link&&d("button",{className:"mg-upg-share",onClick:()=>o(!s)},d("span",{className:"mg-upc-icon upc-font-share"}),d("span",null,at("Share"))),"cart"===n.list.type&&d("button",{className:"mg-upg-share",onClick:function(){i(ae(n.list.ID))}},d("span",{className:"mg-upc-icon upc-font-cart"}),d("span",null,at("Add all to cart")))),s&&n.list.link&&d(ln,{link:n.list.link,title:n.list.title}),n.list.content&&d("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:(c=n.list.content,"string"!=typeof c?"":c.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2"))}}),d(Yt,{count:3}),d(an,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(Ne(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ye(e.post_id))},onSaveItemDescription:function(t,e,n){i(Pe(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(Pe(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&d(ne,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}));var c};D(d((t=>{const[e,n]=Q(Vt,Qt);return d(Gt.Provider,{value:{state:e,dispatch:Kt(n,(()=>e))}},t.children)}),null,d((function(){const{state:t,dispatch:e}=Z(Gt),[n,i]=K("any"),[s,o]=K("any"),[a,l]=K(""),[r,c]=K(null),u=z(!1),p=J((()=>Ht(t.addingPost)),[t.addingPost]),m=J((()=>{return Object.values(null===(t=Dt())||void 0===t?void 0:t.types);var t}),[]);let f="listOfList";if(t.addingPost)f=t.editing?"addingToNew":"adding";else if(t.editing){var g;f=-1!==(null===(g=t.list)||void 0===g?void 0:g.ID)?"edit":"new"}else f=t.list?"list":"listOfList";G((()=>{window.showMainLists=function(){e(ie()),h()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(ie()),n||P(t)}}),[e]);const h=()=>{const i={};n&&(i.types=n),s&&(i.status=s),r&&(i.search=r),a&&(i.author=a),t.page>1&&(i.page=t.page),e(re(i))};function v(){t.page>1&&e(de(1))}function y(t){v(),i(t)}function b(t){v(),o(t)}G((()=>{Qt.title="",e({type:ut,payload:"admin"});const t=function(t){const n=parseInt(("author",new URLSearchParams(document.location.hash.substring(1)).get("author")),10);n>0&&n!==a&&(t&&Ft(t),e(de(1)),l(n),location.hash="")};return t(0),window.addEventListener("hashchange",t,!1),()=>{window.removeEventListener("hashchange",t)}}),[]),G((()=>{t.list||h()}),[n,s,a,t.page]),G((()=>{null!=r&&(clearTimeout(u.current),u.current=setTimeout((function(){h()}),300))}),[r]);const P=t=>{e(se({post_id:t})),e(le({addingPost:t}))};function N(n){n<1||n>t.totalPages||"loading"===t.status||e(de(n))}const k=d("h2",{key:"title"},("list"===f||"new"===f||"edit"===f||"addingToNew"===f)&&d("a",{"aria-label":"Back",className:"mg-upc-dg-back",href:"#",onClick:n=>{n.preventDefault(),function(){switch(f){case"list":e(fe(!1)),h();break;case"new":e(fe(!1)),e(oe(!1)),h();break;case"edit":e(oe(!1));break;case"addingToNew":e(fe(!1)),e(oe(!1)),e(le({addingPost:t.addingPost.post_id}));break;default:h()}}()}},"←")," ",t.title);return d(_,null,k,d("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+f},d("div",{className:"mg-upc-dg-wait"}),t.error&&d("div",{className:"mg-upc-dg-error"},t.error,d("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:rt,payload:null})}},d("span",{className:"mg-upc-icon upc-font-close"}))),d("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&d(Ie,{item:t.addingPost,onSaveItemDescription:function(n){e(se({...t.addingPost,description:n}))}}),("listOfList"===f||"adding"===f)&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},p.length>0&&d("button",{className:"mg-list-new",onClick:function(t){e(oe(!0)),e(fe(!0))}},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null,at("Create List")))),d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Types"))),d("li",{className:"any"==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",onClick:()=>y("any"),onKeyPress:t=>{13===t.keyCode&&y("any")},tabIndex:"0"},d("i",{className:"mg-upc-icon upc-font-close mg-upc-dg-item-type mg-upc-dg-item-type-none"}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,"All"))),m.map(((t,e)=>d("li",{className:t.name==n?"mg-upc-dg-item-list-type mg-upc-selected":"mg-upc-dg-item-list-type",key:t.name,onClick:()=>y(t.name),onKeyPress:e=>{13===e.keyCode&&y(t.name)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,t.label)))))),Rt()&&d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Status"))),d("li",{className:"any"==s?"mg-upc-selected":"",onClick:()=>b("any"),onKeyPress:t=>{13===t.keyCode&&b("any")},tabIndex:"0"},d("div",{className:"mg-upc-dg-item-title"},d("strong",null,"All"))),Rt().map(((t,e)=>d("li",{className:t.name==s?"mg-upc-selected":"",key:t.name,onClick:()=>b(t.name),onKeyPress:e=>{13===e.keyCode&&b(t.name)},tabIndex:"0"},t.label)))),d("div",{className:"mg-upc-dg-df"},d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Search"))),d("input",{onChange:function(t){v(),c(t.target.value)},value:r})),d("ul",{className:"mg-upc-dg-filter"},d("li",{className:"mg-upc-dg-filter-label"},d("strong",null,at("Author (ID)"))),d("input",{type:"number",onChange:function(t){v(),l(t.target.value)},value:a}))),d(xe,{lists:t.listOfList,onSelect:function(n){e(oe(!1)),t.addingPost?e(be(n.ID,t.addingPost)):e(fe(n))},onRemove:!t.addingPost&&function(t){e(ue(t.ID))},loadPreview:function(){N(t.page-1)},loadNext:function(){N(t.page+1)}})),t.list&&d(rn,{editable:(t.list,!0)}))))}),null)," "),document.getElementById("mg-upc-admin-app")),setTimeout(window.showMainLists,1e3)})(); -
user-post-collections/trunk/javascript/mg-upc-client/dist/css/styles.css
r2770005 r2770186 1 .mg-upc-single-template .mg-upc-description{margin-top:1em}.mg-upc-single-template .mg-upc-author-box{margin:1em 0}.mg-upc-page-inner{flex-grow:2}.mg-upc-page-inner .mg-upc-author-box{padding:12px 10px 32px 120px;position:relative;min-height:120px}.mg-upc-page-inner .mg-upc-author-box .mg-upc-author-avatar{width:96px;height:96px;object-fit:cover;position:absolute;top:12px;left:0}.mg-upc-page-inner .mg-upc-author-box h4{font-size:21px;margin:12px 0 8px}.mg-upc-items-container{margin-left:0;margin-bottom:0;clear:both}.mg-upc-item{display:flex;flex-direction:row;position:relative;align-items:center;margin:40px 0}.mg-upc-item::after{content:' ';position:absolute;bottom:-20px;left:50%;width:80%;background:rgba(0,0,0,0.15);height:1px;margin-left:-40%}.mg-upc-item:last-child::after{display:none}.mg-upc-item .mg-upc-list-item-price{display:inline-block;margin-right:1em}.mg-upc-item p.stock{margin:0;display:inline-block;float:right}.mg-upc-item-data{flex-grow:1;flex-shrink:2;padding-right:1em;padding-left:1em}.mg-upc-item-data header h2{margin:10px 0 5px;font-size:20px;font-weight:600}.mg-upc-item-data header a{text-decoration:none}@media (max-width: 500px){.mg-upc-item{flex-direction:column;text-align:center;align-items:stretch}.mg-upc-item-actions button,.mg-upc-item-actions>a{width:100%}}.mg-upc-item-img{width:15%;min-width:100px;margin:auto}.mg-upc-item-img figure{margin:0}.mg-upc-item-img img{min-height:130px;width:100%;background:#6f7277;object-fit:cover;object-position:center}.mg-upc-item-desc{margin:0;line-height:1.3;font-weight:300;clear:both}.mg-upc-item-number{font-size:2em;min-width:2em;text-align:center}.mg-upc-item-quantity{margin:0.3em 1em}.mg-upc-item-quantity>*{display:block;text-align:center;padding:0.1em 0.5em}.mg-upc-item-quantity small{opacity:0.5}.mg-upc-item-actions{display:flex;flex-direction:column;row-gap:0.5em;padding:1em 0}.mg-upc-item-actions button,.mg-upc-item-actions>a{min-width:9em;text-align:center;white-space:nowrap}.mg-upc-votes{width:100%;height:45px;position:relative;clear:both}.mg-upc-item-bar{width:100%;height:10px;position:absolute;top:24px}.mg-upc-item-bar-progress,.mg-upc-item-bar-fill{display:block;width:100%;height:100%;background:#ededed;border:solid 1px #ccc;position:absolute;top:0}.mg-upc-item-bar-fill{box-shadow:0 0 3px #aaa}.mg-upc-item-bar-progress{background:#380;border-color:#286103}.mg-upc-item-percent{right:0;position:absolute;line-height:24px;font-size:20px}.mg-upc-item-votes{display:block;font-size:12px;left:0;position:absolute;line-height:25px;top:3px}.mg-upc-items-pagination{padding:1em 0;border:1px solid rgba(0,0,0,0.05);border-width:1px 0;text-align:center;clear:both}.mg-upc-items-pagination ul.page-numbers::after,.mg-upc-items-pagination ul.page-numbers::before{content:'';display:table}.mg-upc-items-pagination ul.page-numbers::after{clear:both}.mg-upc-items-pagination .page-numbers{list-style:none;margin:0}.mg-upc-items-pagination .page-numbers li{display:inline-block}.mg-upc-items-pagination .page-numbers li .page-numbers{border-left-width:0;display:inline-block;padding:.3342343017em .875em;background-color:rgba(0,0,0,0.025);color:#43454b}.mg-upc-items-pagination .page-numbers li .page-numbers.current{background-color:#474747;border-color:#474747;color:#fff}.mg-upc-items-pagination .page-numbers li .page-numbers.dots{background-color:transparent}.mg-upc-items-pagination .page-numbers li .page-numbers.next,.mg-upc-items-pagination .page-numbers li .page-numbers.prev{padding-left:1em;padding-right:1em}.mg-upc-items-pagination .page-numbers li a.page-numbers:hover{background-color:rgba(0,0,0,0.05)}.rtl .mg-upc-items-pagination a.next,.rtl .mg-upc-items-pagination a.prev{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}@keyframes mg-upc-alert{0%{transform:scaleY(0);margin-bottom:-19px}100%{transform:scaleY(1);margin-bottom:0}}.mg-upc-alert{padding:10px 40px 10px 1em;border:solid 1px #017401;background:rgba(154,240,173,0.8);color:#000;margin:1em 0;animation:mg-upc-alert 0.3s 1 ease-in-out both}.mg-upc-alert p{margin:0}.mg-upc-item .mg-upc-alert{position:absolute;bottom:-19px;left:0;right:0;margin:0}.mg-upc-alert-error{border-color:#d50000;background:rgba(255,121,121,0.8)}.mg-upc-alert-close{position:absolute;top:10px;right:15px;text-decoration:none !important;color:black}.mg-upc-hide{display:none}.mg-upc-product-added{background-color:#a3e8a3;color:#445e18}.mg-upc-product-error{color:#740000;background-color:#f89a9a}@keyframes mg-upc-btn-loading{100%{transform:translateX(100%)}}.mg-upc-btn-loading{background-color:#c7c7c7;position:relative;overflow:hidden;z-index:1;vertical-align:middle}.mg-upc-btn-loading::before,.mg-upc-btn-loading::after{content:' ';display:block !important;position:absolute;top:0;left:0;right:0;height:100%;background-color:#c7c7c7;z-index:2}.mg-upc-btn-loading::after{background-repeat:no-repeat;background-image:linear-gradient(90deg, #c7c7c7, #f5f5f5, #c7c7c7);transform:translateX(-100%);animation-name:mg-upc-btn-loading;animation-duration:0.8s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-add-product-to-list{margin-bottom:0.236em;margin-top:0.236em}.post-adding{margin:1em;text-align:center}.mg-upc-add-list-to-cart{margin:1em 1em 1em 0}.mg-upc-dg-container,.mg-upc-dg-overlay{position:fixed;top:0;right:0;bottom:0;left:0}.mg-upc-dg-container{z-index:999999;display:flex}.mg-upc-dg-container[aria-hidden='true']{display:none}.mg-upc-dg-overlay{background-color:rgba(43,46,56,0.9);animation:fade-in 200ms both}.mg-upc-dg-content{margin:auto;z-index:2;position:relative;background-color:#fff;color:#333;overflow-y:auto;animation:fade-in 400ms 200ms both, slide-up 400ms 200ms both;padding:1em;max-width:90%;max-height:80%;width:800px;border-radius:2px}.mg-upc-dg-content p{color:#333}.mg-upc-dg-content::after,.mg-list-edit::after{content:'';display:block;clear:both}@media screen and (min-width: 700px){.mg-upc-dg-content{padding:2em 1.5em}}.mg-upc-dg-close{position:absolute;top:0.5em;right:0.5em;border:0;padding:0;background-color:transparent;color:#000;font-weight:bold;font-size:1.25em;line-height:1.25em;min-width:1.2em;min-height:1.2em;text-align:center;cursor:pointer;transition:0.15s}@media screen and (min-width: 700px){.mg-upc-dg-close{top:1em;right:1em}}.mg-upc-dialog-content-wrapper{position:relative}@keyframes fade-in{from{opacity:0}}@keyframes slide-up{from{transform:translateY(10%)}}@font-face{font-family:"mgupc";src:url(../fd323a61b0577418b63a.eot?3p2eq6);src:url(../fd323a61b0577418b63a.eot?3p2eq6#iefix) format("embedded-opentype"),url(../aeaf4155903c2239613b.ttf?3p2eq6) format("truetype"),url(../d90b677af57f791b2998.woff?3p2eq6) format("woff"),url(../2f74331407887267c9f0.svg?3p2eq6#mgupc) format("svg");font-weight:normal;font-style:normal;font-display:block}.mg-upc-icon{font-family:"mgupc" !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.upc-font-close:before{content:""}.upc-font-copy:before{content:""}.upc-font-first_page:before{content:""}.upc-font-last_page:before{content:""}.upc-font-arrow_left:before{content:""}.upc-font-arrow_right:before{content:""}.upc-font-poll:before{content:""}.upc-font-numbered:before{content:""}.upc-font-cart:before{content:""}.upc-font-bookmark:before{content:""}.upc-font-heart:before{content:""}.upc-font-save:before{content:""}.upc-font-edit:before{content:""}.upc-font-share:before{content:""}.upc-font-list:before{content:""}.upc-font-add:before{content:""}.upc-font-trash:before{content:""}.mg-upc-icon+span{margin-left:0.6em;vertical-align:middle}.mg-upc-icon{vertical-align:middle}.mg-upc-dg-content button{min-height:30px}.mg-upc-dg-msg{display:block;background:rgba(172,205,100,0.75);padding:0.7em;border:solid 1px #7dbf21;border-radius:2px;color:#314f00;margin:1em 0;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-msg{top:-2em}}.mg-upc-dg-error{display:block;background:rgba(255,48,48,0.75);padding:0.7em;border:solid 1px #bf2121;border-radius:2px;color:#4f0001;margin:1em 0;position:sticky;top:-1em;z-index:5;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-error{top:-2em}}.mg-upc-dg-alert-close{float:right;color:#fff;text-decoration:none;text-shadow:0 0 2px #ffff}.mg-upc-dg-wait{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.7);z-index:9;display:none}.mg-upc-dg-wait:before{content:'';position:absolute;top:50%;right:50%;margin:-1em 0 0 -1em;width:2em;height:2em;border-radius:50%;border-top:2px solid #5583f8;border-bottom:2px solid #345fc9;border-right:2px solid transparent;animation:loading-spinner .6s linear infinite}.mg-upc-dg-status-loading{max-height:90vh;min-height:50px;overflow:hidden}@keyframes loading-spinner{to{transform:rotate(360deg)}}.mg-upc-dg-dn{display:none !important}.mg-upc-dg-content ul{padding:0;margin:1em 0.3em}.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{display:flex;padding:0.6em;margin:0.2em;justify-content:flex-start;align-content:stretch;align-items:center;border:solid 1px #e5e5e5;cursor:pointer}.mg-upc-dg-item-list:hover,.mg-upc-dg-item-list:focus,.mg-upc-dg-item-list-type:hover,.mg-upc-dg-item-list-type:focus{border:solid 1px #a9a9a9;background:#fafafa}.mg-upc-dg-item-list .mg-upc-dg-item-type,.mg-upc-dg-item-list-type .mg-upc-dg-item-type{width:30px;height:30px;font-size:24px;line-height:30px;text-align:center}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{display:flex;flex-direction:column;color:#333;flex-grow:2;text-align:start;padding:0.1em 1em;word-break:break-word}.mg-upc-dg-item-list .mg-upc-dg-item-title>span:nth-child(2),.mg-upc-dg-item-list-type .mg-upc-dg-item-title>span:nth-child(2){opacity:0.6}.mg-upc-dg-item-list .mg-upc-dg-item-count,.mg-upc-dg-item-list-type .mg-upc-dg-item-count{width:3em;text-align:center;opacity:0.5}@media screen and (max-width: 400px){.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{flex-direction:column}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{text-align:center}}.mg-upc-dg-item-type:before{content:""}.mg-upc-dg-item-type-numbered:before{content:""}.mg-upc-dg-item-type-vote:before{content:""}.mg-upc-dg-item-type-favorites:before{content:""}.mg-upc-dg-item-type-bookmarks:before{content:""}.mg-upc-dg-item-type-cart:before{content:""}.mg-upc-dg-item-type-none:before{content:""}.mg-upg-edit{float:right}ul.mg-upc-dg-list::before{content:'';display:block;clear:both}.mg-upc-dg-title{margin-top:0;word-break:break-word}.mg-upc-dg-title>a{vertical-align:middle;font-size:1em;text-decoration:none}.mg-upc-dg-top-action{margin:1em 0;display:flex;align-items:center;align-content:stretch;flex-direction:row-reverse}.mg-upc-dg-top-action button{margin:0.5em;flex-grow:2}@media (max-width: 550px){.mg-upc-dg-top-action{align-items:stretch;flex-direction:column}}.mg-upc-dg-total-votes{text-align:right;display:block;margin-bottom:2em}.mg-list-edit label{color:#000000;display:block;margin-top:0.5em}.mg-list-edit input[type=text],.mg-list-edit textarea,.mg-list-edit select{width:100%;margin-bottom:0.5em;display:block;min-height:2em}.mg-list-edit textarea{height:8em}.mg-list-edit button{margin:0.7em 0;float:left}.mg-list-edit button:first-of-type{float:right}@media (max-width: 550px){.mg-list-edit button{width:100%}}.mg-upc-dg-list-desc-edit-count{display:block;text-align:right}.mg-upc-dg-item{display:flex;align-items:center;margin:2em 0}.mg-upc-dg-item>*{flex-shrink:0}.mg-upc-dg-item>.mg-upc-dg-item-data{flex-grow:1;flex-shrink:2}.mg-upc-dg-item button{margin:0.3em}@media (max-width: 550px){.mg-upc-dg-item{flex-direction:column;text-align:center}.mg-upc-dg-item .mg-upc-dg-item-number{position:relative;top:0.1em;height:0;font-size:3em;color:#fff;font-weight:700;text-shadow:0 0 4px black}.mg-upc-dg-item .mg-upc-dg-item-image{height:7em;width:7em}.mg-upc-dg-item .mg-upc-dg-stock>*,.mg-upc-dg-item .mg-upc-dg-price{float:none;margin:auto;display:block}}.mg-upc-dg-item-adding{margin:0.5em;opacity:0.7;padding:0.3em 1em;background:#eaeaea}.mg-upc-dg-item-handle{padding:0.5em;white-space:nowrap;cursor:move}.mg-upc-dg-item-number{width:3em;text-align:center;flex-shrink:0}.mg-upc-dg-item-image{height:5em;width:5em;max-width:none;object-fit:cover;background:#d5d5d5}.mg-upc-dg-item-data{padding-right:1em;padding-left:1em}.mg-upc-dg-item-data button{font-size:small}.mg-upc-dg-item-data>p{margin:0}.mg-upc-dg-btn-item-desc{width:100%}.mg-upc-dg-btn-item-desc-cancel,.mg-upc-dg-btn-item-desc-save{width:46%;margin:2%;float:left}.mg-upc-dg-price{float:right;margin-left:1em}.mg-upc-dg-price del{opacity:0.5}.mg-upc-dg-stock>*{margin:0;float:right}.mg-upc-dg-pagination-div{display:flex;align-content:stretch;justify-content:center;align-items:center}.mg-upc-dg-hidden{opacity:0.2}.mg-upc-dg-pagination-div.mg-upc-dg-hidden{display:none}.mg-upc-dg-pagination-div::after{content:'';clear:both;display:block}.mg-upc-dg-pagination,.mg-upc-dg-pagination-current{width:39%;text-align:center;position:relative}.mg-upc-dg-pagination-current{width:10%}.mg-upc-dg-pagination .sortable-chosen{position:absolute;top:0;left:0;bottom:0;right:0;margin:0;overflow:hidden;background:#ececd0}.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-handle,.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-number,.mg-upc-dg-pagination .sortable-chosen button{display:none}@keyframes mg-upc-dg-loading-skeleton{100%{transform:translateX(100%)}}.mg-upc-dg-loading-skeleton{--base-color: #ebebeb;--highlight-color: #f5f5f5;--animation-duration: 1.5s;--animation-direction: normal;--pseudo-element-display: block;background-color:var(--base-color);width:100%;border-radius:0.25rem;display:inline-flex;line-height:1;position:relative;overflow:hidden;z-index:1}.mg-upc-dg-loading-skeleton::after{content:' ';display:var(--pseudo-element-display);position:absolute;top:0;left:0;right:0;height:100%;background-repeat:no-repeat;background-image:linear-gradient(90deg, var(--base-color), var(--highlight-color), var(--base-color));transform:translateX(-100%);animation-name:mg-upc-dg-loading-skeleton;animation-direction:var(--animation-direction);animation-duration:var(--animation-duration);animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-dg-loading-skeleton,.mg-upc-dg-on-loading{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-desc,.mg-upc-dg-status-loading .mg-upc-dg-pagination-div,.mg-upc-dg-status-loading button{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-of-lists,.mg-upc-dg-status-loading .mg-upc-dg-list{visibility:hidden}.mg-upc-dg-status-loading .mg-upc-dg-on-loading{display:block}.mg-upc-dg-status-loading .mg-upc-dg-loading-skeleton{display:inline-flex}@keyframes share-animate{from{max-height:0;transform:scaleY(0);opacity:0}to{max-height:125px;transform:scaleY(1);opacity:1}}.mg-upc-dg-share-link{margin:1em 0;max-height:none;animation:share-animate .3s linear;text-align:center}.mg-upc-dg-share-link input{width:70%;font-size:16px;height:40px;border:none;background:#e2e2e2;color:#333;margin:0;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link button{width:30%;font-size:16px;padding:2px ;height:40px;line-height:36px;border:none;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link .mg-upc-dg-share{display:inline-block;margin:2% 0}.mg-upc-zero-quantity{opacity:0.3}.mg-upc-dg-quantity{width:4em;display:flex;flex-direction:column;text-align:center;margin:1em}.mg-upc-dg-quantity small{opacity:0.5}.mg-upc-dg-quantity input{text-align:center}.mg-upc-err-required_logged_in .mg-list-new,.mg-upc-err-required_logged_in .mg-upc-dg-alert-close{display:none}.mg-upc-share-btn-img{height:64px;width:64px;display:inline-block;vertical-align:middle;background-size:100%}.mg-upc-share-link{display:block;text-align:right;margin:1em 0}.mg-upc-share-link::after{content:'';display:block;clear:both}.mg-upc-share{text-decoration:none}.mg-upc-dg-share:hover .mg-upc-share-btn-img,.mg-upc-dg-share:focus .mg-upc-share-btn-img,.mg-upc-share:hover .mg-upc-share-btn-img,.mg-upc-share:focus .mg-upc-share-btn-img{transform:scale(1.3);transition:transform 0.3s}.mg-upc-share-facebook{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%233b5998%27%3E%3C/rect%3E%3Cpath d=%27M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-twitter{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300aced%27%3E%3C/rect%3E%3Cpath d=%27M48,22.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6 C41.7,19.8,40,19,38.2,19c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5c-5.5-0.3-10.3-2.9-13.5-6.9c-0.6,1-0.9,2.1-0.9,3.3 c0,2.3,1.2,4.3,2.9,5.5c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1 c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1c2.9,1.9,6.4,2.9,10.1,2.9c12.1,0,18.7-10,18.7-18.7 c0-0.3,0-0.6,0-0.8C46,24.5,47.1,23.4,48,22.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-whatsapp{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2325D366%27%3E%3C/rect%3E%3Cpath d=%27m42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-telegram{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2337aee2%27%3E%3C/rect%3E%3Cpath d=%27m45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-line{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300b800%27%3E%3C/rect%3E%3Cpath d=%27M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-email{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23b2b2b2%27%3E%3C/rect%3E%3Cpath d=%27M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-pinterest{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23dc0000%27/%3E%3Cpath d=%27M32.9 12.4c-10.4 0-15.6 7.6-15.6 13.7 0 3.7 1.5 7.1 4.5 8.3.6.3 1 0 1.1-.5l.4-1.8c.2-.5.2-.8-.2-1.2-1-1-1.6-2.3-1.6-4.3 0-5.6 4.1-10.5 10.8-10.5 6 0 9.2 3.6 9.2 8.4 0 6.2-2.9 11.6-7 11.6-2.2 0-4-2-3.4-4.3.7-2.7 2-5.7 2-7.7 0-1.8-1-3.3-3-3.3-2.4 0-4.3 2.3-4.3 5.6 0 2 .7 3.4.7 3.4l-2.9 11.9c-.4 1.6-1 8.3-1 9.8.9.4 2.2-1.6 3.5-3.8.7-1.2 1.6-2.8 2-4.4l1.5-6c.7 1.5 3 2.7 5.3 2.7 7 0 11.8-6.4 11.8-15 0-6.5-5.5-12.6-13.8-12.6z%27 fill=%27%23fff%27 paint-order=%27fill markers stroke%27/%3E%3C/svg%3E")}1 .mg-upc-single-template .mg-upc-description{margin-top:1em}.mg-upc-single-template .mg-upc-author-box{margin:1em 0}.mg-upc-page-inner{flex-grow:2}.mg-upc-page-inner .mg-upc-author-box{padding:12px 10px 32px 120px;position:relative;min-height:120px}.mg-upc-page-inner .mg-upc-author-box .mg-upc-author-avatar{width:96px;height:96px;object-fit:cover;position:absolute;top:12px;left:0}.mg-upc-page-inner .mg-upc-author-box h4{font-size:21px;margin:12px 0 8px}.mg-upc-items-container{margin-left:0;margin-bottom:0;clear:both}.mg-upc-item{display:flex;flex-direction:row;position:relative;align-items:center;margin:40px 0}.mg-upc-item::after{content:' ';position:absolute;bottom:-20px;left:50%;width:80%;background:rgba(0,0,0,0.15);height:1px;margin-left:-40%}.mg-upc-item:last-child::after{display:none}.mg-upc-item .mg-upc-list-item-price{display:inline-block;margin-right:1em}.mg-upc-item p.stock{margin:0;display:inline-block;float:right}.mg-upc-item-data{flex-grow:1;flex-shrink:2;padding-right:1em;padding-left:1em}.mg-upc-item-data header h2{margin:10px 0 5px;font-size:20px;font-weight:600}.mg-upc-item-data header a{text-decoration:none}@media (max-width: 500px){.mg-upc-item{flex-direction:column;text-align:center;align-items:stretch}.mg-upc-item-actions button,.mg-upc-item-actions>a{width:100%}}.mg-upc-item-img{width:15%;min-width:100px;margin:auto}.mg-upc-item-img figure{margin:0}.mg-upc-item-img img{min-height:130px;width:100%;background:#6f7277;object-fit:cover;object-position:center}.mg-upc-item-desc{margin:0;line-height:1.3;font-weight:300;clear:both}.mg-upc-item-number{font-size:2em;min-width:2em;text-align:center}.mg-upc-item-quantity{margin:0.3em 1em}.mg-upc-item-quantity>*{display:block;text-align:center;padding:0.1em 0.5em}.mg-upc-item-quantity small{opacity:0.5}.mg-upc-item-actions{display:flex;flex-direction:column;row-gap:0.5em;padding:1em 0}.mg-upc-item-actions button,.mg-upc-item-actions>a{min-width:9em;text-align:center;white-space:nowrap}.mg-upc-votes{width:100%;height:45px;position:relative;clear:both}.mg-upc-item-bar{width:100%;height:10px;position:absolute;top:24px}.mg-upc-item-bar-progress,.mg-upc-item-bar-fill{display:block;width:100%;height:100%;background:#ededed;border:solid 1px #ccc;position:absolute;top:0}.mg-upc-item-bar-fill{box-shadow:0 0 3px #aaa}.mg-upc-item-bar-progress{background:#380;border-color:#286103}.mg-upc-item-percent{right:0;position:absolute;line-height:24px;font-size:20px}.mg-upc-item-votes{display:block;font-size:12px;left:0;position:absolute;line-height:25px;top:3px}.mg-upc-items-pagination{padding:1em 0;border:1px solid rgba(0,0,0,0.05);border-width:1px 0;text-align:center;clear:both}.mg-upc-items-pagination ul.page-numbers::after,.mg-upc-items-pagination ul.page-numbers::before{content:'';display:table}.mg-upc-items-pagination ul.page-numbers::after{clear:both}.mg-upc-items-pagination .page-numbers{list-style:none;margin:0}.mg-upc-items-pagination .page-numbers li{display:inline-block}.mg-upc-items-pagination .page-numbers li .page-numbers{border-left-width:0;display:inline-block;padding:.3342343017em .875em;background-color:rgba(0,0,0,0.025);color:#43454b}.mg-upc-items-pagination .page-numbers li .page-numbers.current{background-color:#474747;border-color:#474747;color:#fff}.mg-upc-items-pagination .page-numbers li .page-numbers.dots{background-color:transparent}.mg-upc-items-pagination .page-numbers li .page-numbers.next,.mg-upc-items-pagination .page-numbers li .page-numbers.prev{padding-left:1em;padding-right:1em}.mg-upc-items-pagination .page-numbers li a.page-numbers:hover{background-color:rgba(0,0,0,0.05)}.rtl .mg-upc-items-pagination a.next,.rtl .mg-upc-items-pagination a.prev{-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}@keyframes mg-upc-alert{0%{transform:scaleY(0);margin-bottom:-19px}100%{transform:scaleY(1);margin-bottom:0}}.mg-upc-alert{padding:10px 40px 10px 1em;border:solid 1px #017401;background:rgba(154,240,173,0.8);color:#000;margin:1em 0;animation:mg-upc-alert 0.3s 1 ease-in-out both}.mg-upc-alert p{margin:0}.mg-upc-item .mg-upc-alert{position:absolute;bottom:-19px;left:0;right:0;margin:0}.mg-upc-alert-error{border-color:#d50000;background:rgba(255,121,121,0.8)}.mg-upc-alert-close{position:absolute;top:10px;right:15px;text-decoration:none !important;color:black}.mg-upc-hide{display:none}.mg-upc-product-added{background-color:#a3e8a3;color:#445e18}.mg-upc-product-error{color:#740000;background-color:#f89a9a}@keyframes mg-upc-btn-loading{100%{transform:translateX(100%)}}.mg-upc-btn-loading{background-color:#c7c7c7;position:relative;overflow:hidden;z-index:1;vertical-align:middle}.mg-upc-btn-loading::before,.mg-upc-btn-loading::after{content:' ';display:block !important;position:absolute;top:0;left:0;right:0;height:100%;background-color:#c7c7c7;z-index:2}.mg-upc-btn-loading::after{background-repeat:no-repeat;background-image:linear-gradient(90deg, #c7c7c7, #f5f5f5, #c7c7c7);transform:translateX(-100%);animation-name:mg-upc-btn-loading;animation-duration:0.8s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-add-product-to-list{margin-bottom:0.236em;margin-top:0.236em}.post-adding{margin:1em;text-align:center}.mg-upc-add-list-to-cart{margin:1em 1em 1em 0}.mg-upc-dg-container,.mg-upc-dg-overlay{position:fixed;top:0;right:0;bottom:0;left:0}.mg-upc-dg-container{z-index:999999;display:flex}.mg-upc-dg-container[aria-hidden='true']{display:none}.mg-upc-dg-overlay{background-color:rgba(43,46,56,0.9);animation:fade-in 200ms both}.mg-upc-dg-content{margin:auto;z-index:2;position:relative;background-color:#fff;color:#333;overflow-y:auto;animation:fade-in 400ms 200ms both, slide-up 400ms 200ms both;padding:1em;max-width:90%;max-height:80%;width:800px;border-radius:2px}.mg-upc-dg-content p{color:#333}.mg-upc-dg-content::after,.mg-list-edit::after{content:'';display:block;clear:both}@media screen and (min-width: 700px){.mg-upc-dg-content{padding:2em 1.5em}}.mg-upc-dg-close{position:absolute;top:0.5em;right:0.5em;border:0;padding:0;background-color:transparent;color:#000;font-weight:bold;font-size:1.25em;line-height:1.25em;min-width:1.2em;min-height:1.2em;text-align:center;cursor:pointer;transition:0.15s}@media screen and (min-width: 700px){.mg-upc-dg-close{top:1em;right:1em}}.mg-upc-dialog-content-wrapper{position:relative}@keyframes fade-in{from{opacity:0}}@keyframes slide-up{from{transform:translateY(10%)}}@font-face{font-family:"mgupc";src:url(../fd323a61b0577418b63a.eot?3p2eq6);src:url(../fd323a61b0577418b63a.eot?3p2eq6#iefix) format("embedded-opentype"),url(../aeaf4155903c2239613b.ttf?3p2eq6) format("truetype"),url(../d90b677af57f791b2998.woff?3p2eq6) format("woff"),url(../2f74331407887267c9f0.svg?3p2eq6#mgupc) format("svg");font-weight:normal;font-style:normal;font-display:block}.mg-upc-icon{font-family:"mgupc" !important;speak:never;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.upc-font-close:before{content:""}.upc-font-copy:before{content:""}.upc-font-first_page:before{content:""}.upc-font-last_page:before{content:""}.upc-font-arrow_left:before{content:""}.upc-font-arrow_right:before{content:""}.upc-font-poll:before{content:""}.upc-font-numbered:before{content:""}.upc-font-cart:before{content:""}.upc-font-bookmark:before{content:""}.upc-font-heart:before{content:""}.upc-font-save:before{content:""}.upc-font-edit:before{content:""}.upc-font-share:before{content:""}.upc-font-list:before{content:""}.upc-font-add:before{content:""}.upc-font-trash:before{content:""}.mg-upc-icon+span{margin-left:0.6em;vertical-align:middle}.mg-upc-icon{vertical-align:middle}.mg-upc-dg-content button{min-height:30px}.mg-upc-dg-msg{display:block;background:rgba(172,205,100,0.75);padding:0.7em;border:solid 1px #7dbf21;border-radius:2px;color:#314f00;margin:1em 0;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-msg{top:-2em}}.mg-upc-dg-error{display:block;background:rgba(255,48,48,0.75);padding:0.7em;border:solid 1px #bf2121;border-radius:2px;color:#4f0001;margin:1em 0;position:sticky;top:-1em;z-index:5;white-space:pre-line}@media screen and (min-width: 700px){.mg-upc-dg-error{top:-2em}}.mg-upc-dg-alert-close{float:right;color:#fff;text-decoration:none;text-shadow:0 0 2px #ffff}.mg-upc-dg-wait{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.7);z-index:9;display:none}.mg-upc-dg-wait:before{content:'';position:absolute;top:50%;right:50%;margin:-1em 0 0 -1em;width:2em;height:2em;border-radius:50%;border-top:2px solid #5583f8;border-bottom:2px solid #345fc9;border-right:2px solid transparent;animation:loading-spinner .6s linear infinite}.mg-upc-dg-status-loading{max-height:90vh;min-height:50px;overflow:hidden}@keyframes loading-spinner{to{transform:rotate(360deg)}}.mg-upc-dg-dn{display:none !important}.mg-upc-dg-content ul{padding:0;margin:1em 0.3em}.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{display:flex;padding:0.6em;margin:0.2em;justify-content:flex-start;align-content:stretch;align-items:center;border:solid 1px #e5e5e5;cursor:pointer}.mg-upc-dg-item-list:hover,.mg-upc-dg-item-list:focus,.mg-upc-dg-item-list-type:hover,.mg-upc-dg-item-list-type:focus{border:solid 1px #a9a9a9;background:#fafafa}.mg-upc-dg-item-list .mg-upc-dg-item-type,.mg-upc-dg-item-list-type .mg-upc-dg-item-type{width:30px;height:30px;font-size:24px;line-height:30px;text-align:center}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{display:flex;flex-direction:column;color:#333;flex-grow:2;text-align:start;padding:0.1em 1em;word-break:break-word}.mg-upc-dg-item-list .mg-upc-dg-item-title>span:nth-child(2),.mg-upc-dg-item-list-type .mg-upc-dg-item-title>span:nth-child(2){opacity:0.6}.mg-upc-dg-item-list .mg-upc-dg-item-count,.mg-upc-dg-item-list-type .mg-upc-dg-item-count{width:3em;text-align:center;opacity:0.5}@media screen and (max-width: 400px){.mg-upc-dg-item-list,.mg-upc-dg-item-list-type{flex-direction:column}.mg-upc-dg-item-list .mg-upc-dg-item-title,.mg-upc-dg-item-list-type .mg-upc-dg-item-title{text-align:center}}.mg-upc-dg-item-type:before{content:""}.mg-upc-dg-item-type-numbered:before{content:""}.mg-upc-dg-item-type-vote:before{content:""}.mg-upc-dg-item-type-favorites:before{content:""}.mg-upc-dg-item-type-bookmarks:before{content:""}.mg-upc-dg-item-type-cart:before{content:""}.mg-upc-dg-item-type-none:before{content:""}.mg-upg-edit{float:right}ul.mg-upc-dg-list::before{content:'';display:block;clear:both}.mg-upc-dg-title{margin-top:0;word-break:break-word}.mg-upc-dg-title>a{vertical-align:middle;font-size:1em;text-decoration:none}.mg-upc-dg-top-action{margin:1em 0;display:flex;align-items:center;align-content:stretch;flex-direction:row-reverse}.mg-upc-dg-top-action button{margin:0.5em;flex-grow:2}@media (max-width: 550px){.mg-upc-dg-top-action{align-items:stretch;flex-direction:column}}.mg-upc-dg-total-votes{text-align:right;display:block;margin-bottom:2em}.mg-list-edit label{color:#000000;display:block;margin-top:0.5em}.mg-list-edit input[type=text],.mg-list-edit textarea,.mg-list-edit select{width:100%;margin-bottom:0.5em;display:block;min-height:2em}.mg-list-edit textarea{height:8em}.mg-list-edit button{margin:0.7em 0;float:left}.mg-list-edit button:first-of-type{float:right}@media (max-width: 550px){.mg-list-edit button{width:100%}}.mg-upc-dg-list-desc-edit-count{display:block;text-align:right}.mg-upc-dg-item{display:flex;align-items:center;margin:2em 0}.mg-upc-dg-item>*{flex-shrink:0}.mg-upc-dg-item>.mg-upc-dg-item-data{flex-grow:1;flex-shrink:2}.mg-upc-dg-item button{margin:0.3em}@media (max-width: 550px){.mg-upc-dg-item{flex-direction:column;text-align:center}.mg-upc-dg-item .mg-upc-dg-item-number{position:relative;top:0.1em;height:0;font-size:3em;color:#fff;font-weight:700;text-shadow:0 0 4px black}.mg-upc-dg-item .mg-upc-dg-item-image{height:7em;width:7em}.mg-upc-dg-item .mg-upc-dg-stock>*,.mg-upc-dg-item .mg-upc-dg-price{float:none;margin:auto;display:block}}.mg-upc-dg-item-adding{margin:0.5em;opacity:0.7;padding:0.3em 1em;background:#eaeaea}.mg-upc-dg-item-handle{padding:0.5em;white-space:nowrap;cursor:move}.mg-upc-dg-item-number{width:3em;text-align:center;flex-shrink:0}.mg-upc-dg-item-image{height:5em;width:5em;max-width:none;object-fit:cover;background:#d5d5d5}.mg-upc-dg-item-data{padding-right:1em;padding-left:1em}.mg-upc-dg-item-data button{font-size:small}.mg-upc-dg-item-data>p{margin:0}.mg-upc-dg-btn-item-desc{width:100%}.mg-upc-dg-btn-item-desc-cancel,.mg-upc-dg-btn-item-desc-save{width:46%;margin:2%;float:left}.mg-upc-dg-price{float:right;margin-left:1em}.mg-upc-dg-price del{opacity:0.5}.mg-upc-dg-stock>*{margin:0;float:right}.mg-upc-dg-pagination-div{display:flex;align-content:stretch;justify-content:center;align-items:center}.mg-upc-dg-hidden{opacity:0.2}.mg-upc-dg-pagination-div.mg-upc-dg-hidden{display:none}.mg-upc-dg-pagination-div::after{content:'';clear:both;display:block}.mg-upc-dg-pagination,.mg-upc-dg-pagination-current{width:39%;text-align:center;position:relative}.mg-upc-dg-pagination-current{width:10%}.mg-upc-dg-pagination .sortable-chosen{position:absolute;top:0;left:0;bottom:0;right:0;margin:0;overflow:hidden;background:#ececd0}.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-handle,.mg-upc-dg-pagination .sortable-chosen .mg-upc-dg-item-number,.mg-upc-dg-pagination .sortable-chosen button{display:none}@keyframes mg-upc-dg-loading-skeleton{100%{transform:translateX(100%)}}.mg-upc-dg-loading-skeleton{--base-color: #ebebeb;--highlight-color: #f5f5f5;--animation-duration: 1.5s;--animation-direction: normal;--pseudo-element-display: block;background-color:var(--base-color);width:100%;border-radius:0.25rem;display:inline-flex;line-height:1;position:relative;overflow:hidden;z-index:1}.mg-upc-dg-loading-skeleton::after{content:' ';display:var(--pseudo-element-display);position:absolute;top:0;left:0;right:0;height:100%;background-repeat:no-repeat;background-image:linear-gradient(90deg, var(--base-color), var(--highlight-color), var(--base-color));transform:translateX(-100%);animation-name:mg-upc-dg-loading-skeleton;animation-direction:var(--animation-direction);animation-duration:var(--animation-duration);animation-timing-function:ease-in-out;animation-iteration-count:infinite}.mg-upc-dg-loading-skeleton,.mg-upc-dg-on-loading{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-desc,.mg-upc-dg-status-loading .mg-upc-dg-pagination-div,.mg-upc-dg-status-loading button{display:none}.mg-upc-dg-status-loading .mg-upc-dg-list-of-lists,.mg-upc-dg-status-loading .mg-upc-dg-list{visibility:hidden}.mg-upc-dg-status-loading .mg-upc-dg-on-loading{display:block}.mg-upc-dg-status-loading .mg-upc-dg-loading-skeleton{display:inline-flex}@keyframes share-animate{from{max-height:0;transform:scaleY(0);opacity:0}to{max-height:125px;transform:scaleY(1);opacity:1}}.mg-upc-dg-share-link{margin:1em 0;max-height:none;animation:share-animate .3s linear;text-align:center}.mg-upc-dg-share-link input{width:70%;font-size:16px;height:40px;border:none;background:#e2e2e2;color:#333;margin:0;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link button{width:30%;font-size:16px;padding:2px !important;height:40px !important;line-height:36px !important;border:none;display:inline-block;vertical-align:bottom;box-sizing:border-box}.mg-upc-dg-share-link .mg-upc-dg-share{display:inline-block;margin:2% 0}.mg-upc-zero-quantity{opacity:0.3}.mg-upc-dg-quantity{width:4em;display:flex;flex-direction:column;text-align:center;margin:1em}.mg-upc-dg-quantity small{opacity:0.5}.mg-upc-dg-quantity input{text-align:center}.mg-upc-err-required_logged_in .mg-list-new,.mg-upc-err-required_logged_in .mg-upc-dg-alert-close{display:none}.mg-upc-share-btn-img{height:64px;width:64px;display:inline-block;vertical-align:middle;background-size:100%}.mg-upc-share-link{display:block;text-align:right;margin:1em 0}.mg-upc-share-link::after{content:'';display:block;clear:both}.mg-upc-share{text-decoration:none}.mg-upc-dg-share:hover .mg-upc-share-btn-img,.mg-upc-dg-share:focus .mg-upc-share-btn-img,.mg-upc-share:hover .mg-upc-share-btn-img,.mg-upc-share:focus .mg-upc-share-btn-img{transform:scale(1.3);transition:transform 0.3s}.mg-upc-share-facebook{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%233b5998%27%3E%3C/rect%3E%3Cpath d=%27M34.1,47V33.3h4.6l0.7-5.3h-5.3v-3.4c0-1.5,0.4-2.6,2.6-2.6l2.8,0v-4.8c-0.5-0.1-2.2-0.2-4.1-0.2 c-4.1,0-6.9,2.5-6.9,7V28H24v5.3h4.6V47H34.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-twitter{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300aced%27%3E%3C/rect%3E%3Cpath d=%27M48,22.1c-1.2,0.5-2.4,0.9-3.8,1c1.4-0.8,2.4-2.1,2.9-3.6c-1.3,0.8-2.7,1.3-4.2,1.6 C41.7,19.8,40,19,38.2,19c-3.6,0-6.6,2.9-6.6,6.6c0,0.5,0.1,1,0.2,1.5c-5.5-0.3-10.3-2.9-13.5-6.9c-0.6,1-0.9,2.1-0.9,3.3 c0,2.3,1.2,4.3,2.9,5.5c-1.1,0-2.1-0.3-3-0.8c0,0,0,0.1,0,0.1c0,3.2,2.3,5.8,5.3,6.4c-0.6,0.1-1.1,0.2-1.7,0.2c-0.4,0-0.8,0-1.2-0.1 c0.8,2.6,3.3,4.5,6.1,4.6c-2.2,1.8-5.1,2.8-8.2,2.8c-0.5,0-1.1,0-1.6-0.1c2.9,1.9,6.4,2.9,10.1,2.9c12.1,0,18.7-10,18.7-18.7 c0-0.3,0-0.6,0-0.8C46,24.5,47.1,23.4,48,22.1z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-whatsapp{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2325D366%27%3E%3C/rect%3E%3Cpath d=%27m42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-telegram{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2337aee2%27%3E%3C/rect%3E%3Cpath d=%27m45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-line{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%2300b800%27%3E%3C/rect%3E%3Cpath d=%27M52.62 30.138c0 3.693-1.432 7.019-4.42 10.296h.001c-4.326 4.979-14 11.044-16.201 11.972-2.2.927-1.876-.591-1.786-1.112l.294-1.765c.069-.527.142-1.343-.066-1.865-.232-.574-1.146-.872-1.817-1.016-9.909-1.31-17.245-8.238-17.245-16.51 0-9.226 9.251-16.733 20.62-16.733 11.37 0 20.62 7.507 20.62 16.733zM27.81 25.68h-1.446a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-8.985a.402.402 0 0 0-.402-.401zm9.956 0H36.32a.402.402 0 0 0-.402.401v5.338L31.8 25.858a.39.39 0 0 0-.031-.04l-.002-.003-.024-.025-.008-.007a.313.313 0 0 0-.032-.026.255.255 0 0 1-.021-.014l-.012-.007-.021-.012-.013-.006-.023-.01-.013-.005-.024-.008-.014-.003-.023-.005-.017-.002-.021-.003-.021-.002h-1.46a.402.402 0 0 0-.402.401v8.985c0 .221.18.4.402.4h1.446a.401.401 0 0 0 .402-.4v-5.337l4.123 5.568c.028.04.063.072.101.099l.004.003a.236.236 0 0 0 .025.015l.012.006.019.01a.154.154 0 0 1 .019.008l.012.004.028.01.005.001a.442.442 0 0 0 .104.013h1.446a.4.4 0 0 0 .401-.4v-8.985a.402.402 0 0 0-.401-.401zm-13.442 7.537h-3.93v-7.136a.401.401 0 0 0-.401-.401h-1.447a.4.4 0 0 0-.401.401v8.984a.392.392 0 0 0 .123.29c.072.068.17.111.278.111h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401zm21.429-5.287c.222 0 .401-.18.401-.402v-1.446a.401.401 0 0 0-.401-.402h-5.778a.398.398 0 0 0-.279.113l-.005.004-.006.008a.397.397 0 0 0-.111.276v8.984c0 .108.043.206.112.278l.005.006a.401.401 0 0 0 .284.117h5.778a.4.4 0 0 0 .401-.401v-1.447a.401.401 0 0 0-.401-.401h-3.93v-1.519h3.93c.222 0 .401-.18.401-.402V29.85a.401.401 0 0 0-.401-.402h-3.93V27.93h3.93z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-email{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 64 64%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23b2b2b2%27%3E%3C/rect%3E%3Cpath d=%27M17,22v20h30V22H17z M41.1,25L32,32.1L22.9,25H41.1z M20,39V26.6l12,9.3l12-9.3V39H20z%27 fill=%27white%27%3E%3C/path%3E%3C/svg%3E")}.mg-upc-share-pinterest{background-image:url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2764%27 height=%2764%27%3E%3Crect width=%2764%27 height=%2764%27 rx=%270%27 ry=%270%27 fill=%27%23dc0000%27/%3E%3Cpath d=%27M32.9 12.4c-10.4 0-15.6 7.6-15.6 13.7 0 3.7 1.5 7.1 4.5 8.3.6.3 1 0 1.1-.5l.4-1.8c.2-.5.2-.8-.2-1.2-1-1-1.6-2.3-1.6-4.3 0-5.6 4.1-10.5 10.8-10.5 6 0 9.2 3.6 9.2 8.4 0 6.2-2.9 11.6-7 11.6-2.2 0-4-2-3.4-4.3.7-2.7 2-5.7 2-7.7 0-1.8-1-3.3-3-3.3-2.4 0-4.3 2.3-4.3 5.6 0 2 .7 3.4.7 3.4l-2.9 11.9c-.4 1.6-1 8.3-1 9.8.9.4 2.2-1.6 3.5-3.8.7-1.2 1.6-2.8 2-4.4l1.5-6c.7 1.5 3 2.7 5.3 2.7 7 0 11.8-6.4 11.8-15 0-6.5-5.5-12.6-13.8-12.6z%27 fill=%27%23fff%27 paint-order=%27fill markers stroke%27/%3E%3C/svg%3E")} 2 2 -
user-post-collections/trunk/javascript/mg-upc-client/dist/main.js
r2770005 r2770186 1 !function(){"use strict";var t,e,n,i,o,s,a,l={},r=[],c=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function u(t,e){for(var n in e)t[n]=e[n];return t}function d(t){var e=t.parentNode;e&&e.removeChild(t)}function p(e,n,i){var o,s,a,l={};for(a in n)"key"==a?o=n[a]:"ref"==a?s=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return _(e,l,o,s,null)}function _(t,i,o,s,a){var l={type:t,props:i,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function m(t){return t.children}function f(t,e){this.props=t,this.context=e}function g(t,e){if(null==e)return t.__?g(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?g(t):null}function h(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return h(t)}}function v(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!y.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||o)(y)}function y(){for(var t;y.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,o,s,a;t.__d&&(s=(o=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=u({},o)).__v=o.__v+1,S(a,o,i,e.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?g(o):s,o.__h),T(n,o),o.__e!=s&&h(o)))}))}function b(t,e,n,i,o,s,a,c,u,d){var p,f,h,v,y,b,P,C=i&&i.__k||r,N=C.length;for(n.__k=[],p=0;p<e.length;p++)if(null!=(v=n.__k[p]=null==(v=e[p])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?_(null,v,null,null,v):Array.isArray(v)?_(m,{children:v},null,null,null):v.__b>0?_(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=C[p])||h&&v.key==h.key&&v.type===h.type)C[p]=void 0;else for(f=0;f<N;f++){if((h=C[f])&&v.key==h.key&&v.type===h.type){C[f]=void 0;break}h=null}S(t,v,h=h||l,o,s,a,c,u,d),y=v.__e,(f=v.ref)&&h.ref!=f&&(P||(P=[]),h.ref&&P.push(h.ref,null,v),P.push(f,v.__c||y,v)),null!=y?(null==b&&(b=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=w(v,u,t):u=k(t,v,h,C,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=g(h))}for(n.__e=b,p=N;p--;)null!=C[p]&&("function"==typeof n.type&&null!=C[p].__e&&C[p].__e==n.__d&&(n.__d=g(i,p+1)),L(C[p],C[p]));if(P)for(p=0;p<P.length;p++)E(P[p],P[++p],P[++p])}function w(t,e,n){for(var i,o=t.__k,s=0;o&&s<o.length;s++)(i=o[s])&&(i.__=t,e="function"==typeof i.type?w(i,e,n):k(n,i,i,o,i.__e,e));return e}function P(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){P(t,e)})):e.push(t)),e}function k(t,e,n,i,o,s){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||o!=s||null==o.parentNode)t:if(null==s||s.parentNode!==t)t.appendChild(o),a=null;else{for(l=s,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==o)break t;t.insertBefore(o,s),a=s}return void 0!==a?a:o.nextSibling}function C(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||c.test(e)?n:n+"px"}function N(t,e,n,i,o){var s;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||C(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i||t.addEventListener(e,s?I:x,s):t.removeEventListener(e,s?I:x,s);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function x(t){this.l[t.type+!1](e.event?e.event(t):t)}function I(t){this.l[t.type+!0](e.event?e.event(t):t)}function S(t,n,i,o,s,a,l,r,c){var d,p,_,g,h,v,y,w,P,k,C,N=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(c=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof N){if(w=n.props,P=(d=N.contextType)&&o[d.__c],k=d?P?P.props.value:d.__:o,i.__c?y=(p=n.__c=i.__c).__=p.__E:("prototype"in N&&N.prototype.render?n.__c=p=new N(w,k):(n.__c=p=new f(w,k),p.constructor=N,p.render=D),P&&P.sub(p),p.props=w,p.state||(p.state={}),p.context=k,p.__n=o,_=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=N.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=u({},p.__s)),u(p.__s,N.getDerivedStateFromProps(w,p.__s))),g=p.props,h=p.state,_)null==N.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==N.getDerivedStateFromProps&&w!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,k),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,k)||n.__v===i.__v){p.props=w,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,k),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}p.context=k,p.props=w,p.state=p.__s,(d=e.__r)&&d(n),p.__d=!1,p.__v=n,p.__P=t,d=p.render(p.props,p.state,p.context),p.state=p.__s,null!=p.getChildContext&&(o=u(u({},o),p.getChildContext())),_||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),C=null!=d&&d.type===m&&null==d.key?d.props.children:d,b(t,Array.isArray(C)?C:[C],n,i,o,s,a,l,r,c),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),y&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=A(i.__e,n,i,o,s,a,l,c);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(c||null!=a)&&(n.__e=r,n.__h=!!c,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function T(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function A(e,n,i,o,s,a,r,c){var u,p,_,m=i.props,f=n.props,h=n.type,v=0;if("svg"===h&&(s=!0),null!=a)for(;v<a.length;v++)if((u=a[v])&&"setAttribute"in u==!!h&&(h?u.localName===h:3===u.nodeType)){e=u,a[v]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=s?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),a=null,c=!1}if(null===h)m===f||c&&e.data===f||(e.data=f);else{if(a=a&&t.call(e.childNodes),p=(m=i.props||l).dangerouslySetInnerHTML,_=f.dangerouslySetInnerHTML,!c){if(null!=a)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,o){var s;for(s in n)"children"===s||"key"===s||s in e||N(t,s,null,n[s],i);for(s in e)o&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||N(t,s,e[s],n[s],i)}(e,f,m,s,c),_)n.__k=[];else if(v=n.props.children,b(e,Array.isArray(v)?v:[v],n,i,o,s&&"foreignObject"!==h,a,r,a?a[0]:i.__k&&g(i,0),c),null!=a)for(v=a.length;v--;)null!=a[v]&&d(a[v]);c||("value"in f&&void 0!==(v=f.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&N(e,"value",v,m.value,!1),"checked"in f&&void 0!==(v=f.checked)&&v!==e.checked&&N(e,"checked",v,m.checked,!1))}return e}function E(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function L(t,n,i){var o,s;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||E(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&L(o[s],n,"function"!=typeof t.type);i||null==t.__e||d(t.__e),t.__e=t.__d=void 0}function D(t,e,n){return this.constructor(t,n)}function O(n,i,o){var s,a,r;e.__&&e.__(n,i),a=(s="function"==typeof o)?null:o&&o.__k||i.__k,r=[],S(i,n=(!s&&o||i).__k=p(m,null,[n]),a||l,l,void 0!==i.ownerSVGElement,!s&&o?[o]:a?null:i.firstChild?t.call(i.childNodes):null,r,!s&&o?o:a?a.__e:i.firstChild,s),T(r,n)}t=r.slice,e={__e:function(t,e,n,i){for(var o,s,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&null!=s.getDerivedStateFromError&&(o.setState(s.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,f.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},n),this.props)),t&&u(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),v(this))},f.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),v(this))},f.prototype.render=m,i=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y.__r=0,a=0;var U,R,W,j=0,$=[],H=e.__b,M=e.__r,B=e.diffed,F=e.__c,q=e.unmount;function Q(t,n){e.__h&&e.__h(R,t,j||n),j=0;var i=R.__H||(R.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({}),i.__[t]}function X(t){return j=1,V(ot,t)}function V(t,e,n){var i=Q(U++,2);return i.t=t,i.__c||(i.__=[n?n(e):ot(void 0,e),function(t){var e=i.t(i.__[0],t);i.__[0]!==e&&(i.__=[e,i.__[1]],i.__c.setState({}))}],i.__c=R),i.__}function K(t,n){var i=Q(U++,3);!e.__s&&it(i.__H,n)&&(i.__=t,i.__H=n,R.__H.__h.push(i))}function G(t){return j=5,z((function(){return{current:t}}),[])}function z(t,e){var n=Q(U++,7);return it(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function J(t,e){return j=8,z((function(){return t}),e)}function Y(t){var e=R.context[t.__c],n=Q(U++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(R)),e.props.value):t.__}function Z(){for(var t;t=$.shift();)if(t.__P)try{t.__H.__h.forEach(et),t.__H.__h.forEach(nt),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){R=null,H&&H(t)},e.__r=function(t){M&&M(t),U=0;var e=(R=t.__c).__H;e&&(e.__h.forEach(et),e.__h.forEach(nt),e.__h=[])},e.diffed=function(t){B&&B(t);var n=t.__c;n&&n.__H&&n.__H.__h.length&&(1!==$.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),tt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);tt&&(e=requestAnimationFrame(n))})(Z)),R=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(et),t.__h=t.__h.filter((function(t){return!t.__||nt(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),F&&F(t,n)},e.unmount=function(t){q&&q(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{et(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var tt="function"==typeof requestAnimationFrame;function et(t){var e=R,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),R=e}function nt(t){var e=R;t.__c=t.__(),R=e}function it(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function ot(t,e){return"function"==typeof e?e(t):e}var st=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t};const at="ui/reset",lt="ui/error",rt="ui/message",ct="ui/editing",ut="listOfLists/set",dt="listOfLists/remove",pt="listOfLists/create",_t="listOfList/addingPost",mt="listOfList/setPage",ft="listOfList/setTotalPages",gt="list/set",ht="list/update",vt="list/setPage",yt="list/setTotalPages",bt="list/setItems",wt="list/removeItem",Pt="list/addItem",kt="list/updateItem",Ct="list/moveItem",Nt="list/cart";var xt=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Lt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Lt().ajaxUrl,e),i=await n.json();i.nonce&&(Lt().nonce=i.nonce),i.user_id&&(Lt().user_id=i.user_id)}const o={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Lt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(o.body=JSON.stringify(n));const s=await fetch(Lt().root+i+e,o);s.headers.get("x-wp-nonce")&&(Lt().nonce=s.headers.get("x-wp-nonce"));const a=await s.json();return{data:a,headers:s.headers,status:s.status}};function It(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Lt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class St extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function Tt(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var o;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new St(null==t||null===(o=t.data)||void 0===o?void 0:o.message,t)}let At={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return xt("GET","/My"+It(t),{}).then((function(t){return Tt(t),t}))},discover:function(t){return xt("GET","/"+It(t),{}).then((function(t){return Tt(t),t}))},get:function(t){return xt("GET","/"+t,{}).then((function(t){return Tt(t),t}))},cart:function(t){return xt("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return Tt(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return xt("GET","/"+t+"/items"+It(e),{}).then((function(t){return Tt(t),t}))},delete:function(t){return xt("DELETE","/"+t,{}).then((function(t){return Tt(t),t}))},create:function(t){return xt("POST","",t).then((function(t){return Tt(t),t}))},update:function(t){let e=t.id;return delete t.id,xt("PATCH","/"+e,t).then((function(t){return Tt(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),xt("POST","/"+t+"/items"+It(n),e).then((function(t){return Tt(t),t}))},quit:function(t,e){return xt("DELETE","/"+t+"/items/"+e,{}).then((function(t){return Tt(t),t}))},updateItem:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,n).then((function(t){return Tt(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return xt("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return Tt(t),t}))},move:function(t,e,n){return xt("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return Tt(t),t}))}};var Et=At;function Lt(){return MgUserPostCollections}function Dt(){var t;return null===(t=Lt())||void 0===t?void 0:t.sortable}function Ot(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Ut(t){var e;const n=null===(e=Lt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function Rt(t,e){return!!t.type&&jt(t.type,e)}function Wt(t){var e;const n=[],i=null===(e=Lt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(jt(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function jt(t,e){const n=Ot(t);return!(!n||!n.supports)&&n.supports.includes(e)}const $t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function Ht(t){return JSON.parse(JSON.stringify(t))}function Mt(t){return"string"!=typeof t?"":t.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2")}function Bt(t){return Et.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}function Ft(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";if(!jQuery)return!1;const n=jQuery("<div>").addClass("mg-upc-alert mg-upc-alert-"+e);n.append(jQuery("<p>").html(t));const i=jQuery('<a class="mg-upc-alert-close" href="#"><span class="mg-upc-icon upc-font-close"></span></a>').on("click",(function(){return n.remove(),!1}));return n.append(i),n}function qt(t,e){const{type:n,payload:i}=e;let o=!1;const s=t=>(o=a({status:"failed"}),t.error&&(o.error=t.error.message?t.error.message:"",o.errorCode=t.error.code?t.error.code:""),o),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=Ht(t)),e)for(const t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);return o};let l=function(t,e){const{type:n,payload:i}=e;let o,s;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=!1===t?{}:Ht(t)),e)for(const t in e)s[t]=e[t];return s};switch(n){case gt:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case ht:return i.items=Ht(t.items),i;case pt:return i;case bt:return a({items:i});case"list/addItem/failed":case Pt:return null!=i&&i.list?a(i.list):t;case kt:const e=!!i.item&&i.item;return o=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:o});case wt:if(1===t.items.length||!1===i)return t;if(s=a(),o=s.items.filter((t=>t.post_id!==i)),jt(t.type,"sortable")){const e=parseInt(t.items[0].position,10);o.forEach(((t,n)=>{o[n].position=e+n}))}if(jt(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(s.vote_counter=s.vote_counter-e.votes)}return{...s,items:o};case Ct:const n=parseInt(t.items[0].position,10);o=a().items.slice();const l=a().items[i.oldIndex];return o.splice(i.oldIndex,1),o.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(o.forEach(((t,e)=>{o[e].position=n+e})),a({items:o}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case ut:return i;case Pt:case gt:return!1;case dt:return!1===i?t:Ht(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(o=a({listOfList:r,list:l}),t.addingPost||(o.title=o.list?o.list.title:Kt.title)),n){case"ui/mode":return a({mode:i});case at:return{...Kt,mode:t.mode};case lt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case rt:return a(!1===i?{message:!1,errorCode:!1}:{message:i});case Nt:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case ct:return a({editing:i});case _t:return o=a(),o.addingPost=i,i&&(o.title="Add to..."),o;case pt:o=a(),o.title=i.title?i.title:Kt.title,o.listTotalPages=1,o.listPage=1,o.addingPost=!1;break;case Pt:if(o=a(),null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Kt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(o.error=i.message,o.status="failed"),o.addingPost=!1;break;case mt:return a({page:i});case ft:return a({totalPages:i});case vt:return a({listPage:i});case yt:return a({listTotalPages:i});case"list/set/loading":return o=a(),o.status="loading",o.listOfList=!1,"object"==typeof i?(o.list=i,i.title&&(o.title=i.title)):o.list={ID:i},o;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case pt+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return o=a(),o.addingPost=!1,o.status="succeeded",o.error=!1,o.errorCode=!1,o.title=o.list?o.list.title:Kt.title,o;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case pt+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case pt+"/failed":return o=a({status:"failed"}),e.error&&e.error.message&&(o.error=e.error.message),o;case"list/addItem/failed":if(o=a(),o.addingPost=!1,o.title=o.list?o.list.title:Kt.title,null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Kt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(o.error=i.message,o.status="failed"),s(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return s(e)}return!1!==o?o:t}const Qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:o}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Vt=(t,e)=>n=>{let i;if((o=n)&&"object"==typeof o&&!0===o.asyncThunk){let o={dispatch:Vt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,o)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var o;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Kt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:st("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},Gt=function(t,e){var n={__c:e="__cC"+a++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(v)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function zt(t){return new Date(t).toLocaleDateString()}var Jt,Yt,Zt,te=function(t){const{state:e,dispatch:n}=Y(Gt);return p("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),p("div",{className:"mg-upc-dg-item-title"},p("span",null,t.list.title),"my"!==e.mode&&p(m,null,p("span",null,p("a",{href:"#",onClick:function(e){!function(t){t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault()}(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),p("span",{className:"mg-upc-list-dates"},p("i",null," ",p("b",null,"Created:")," ",zt(t.list.created)),p("i",null," ",p("b",null,"Modified:")," ",zt(t.list.modified)))))),p("span",{className:"mg-upc-dg-item-count"},t.list.count),p("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&p("button",{"aria-label":st("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},p("span",{className:"mg-upc-icon upc-font-trash"}))))};class ee extends f{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(p("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return p("span",null,e?t.map(((t,n)=>p(e,{key:n},t,""))):t)}}Zt={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(Yt="defaultProps")in(Jt=ee)?Object.defineProperty(Jt,Yt,{value:Zt,enumerable:!0,configurable:!0,writable:!0}):Jt[Yt]=Zt;var ne=function(t){return p("div",{className:"mg-upc-dg-pagination-div"},p("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":st("Previous page"),title:st("Previous page"),onClick:t.onPreview},p("span",{className:"mg-upc-icon upc-font-arrow_left"})),p("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),p("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":st("Next page"),title:st("Next page"),onClick:t.onNext},p("span",{className:"mg-upc-icon upc-font-arrow_right"})))};const ie=()=>({type:at,payload:null}),oe=t=>({type:_t,payload:t}),se=t=>({type:ct,payload:t}),ae=Qt(Nt,(async function(t,e){return await Bt(t)})),le=Qt(ut,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Et.my(t).then((t=>re(t,e,i)))}));function re(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(ue(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(de(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},o={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in o){const n=t.headers.get(e);n&&(i[o[e]]=decodeURIComponent(n))}e.dispatch(oe(i))}return t.data}Qt(ut,(async function(t,e){return null===t&&(t={}),await Et.discover(t).then((t=>re(t,e,!1)))}));const ce=Qt(dt,(async function(t,e){return await Et.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(le({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(le({page:n-1}))}return!1}return t}))})),ue=t=>({type:mt,payload:t}),de=t=>({type:ft,payload:t}),pe=t=>({type:vt,payload:t}),_e=t=>({type:yt,payload:t}),me=Qt(gt,(async function(t,e){return!1===t||!0===t?t:await Et.get("object"==typeof t?t.ID:t).then((t=>(Ce(t,e.dispatch),t.data)))})),fe=Qt(ht,(async function(t,e){return await Et.update(t).then((t=>(e.dispatch(se(!1)),Ce(t,e.dispatch),t.data)))})),ge=Qt(pt,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(oe({id:t.addingPost})),await Et.create(t).then((t=>(e.dispatch(se(!1)),Ce(t,e.dispatch),t.data)))})),he=Qt(bt,(async function(t,e){return await Et.items(e.getState().list.ID,t).then((t=>(Ce(t,e.dispatch),t.data)))})),ve=Qt(wt,(async function(t,e){const n=e.getState();return await Et.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(he({page:t})):t===i&&e.dispatch(he({page:Math.max(1,t-1)})),!1}return t}))})),ye=Qt(Pt,(async function(t,e){let n=e.extra[0],i=!1;try{await Et.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var o;const n=null==t||null===(o=t.response)||void 0===o?void 0:o.data;i=e.rejectWithValue(n)}return i})),be=Qt(kt,(async function(t,e){const n=e.extra[0];return await Et.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),we=Qt(Ct,(async function(t,e){const n=e.extra[0],i=e.extra[1],o=n.items[t],s=o.position-t+i;return await Et.move(n.ID,o.post_id,s).then((e=>({oldIndex:t,newIndex:i})))})),Pe=Qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Et.move(n.ID,o.post_id,i+1),await e.dispatch(he({page:e.getState().listPage})),t})),ke=Qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Et.move(n.ID,o.post_id,i-1),await e.dispatch(he({page:e.getState().listPage})),t}));function Ce(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(pe(parseInt(t.headers.get("x-wp-page"),10))),e(_e(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(pe(parseInt(t.data.items_page["X-WP-Page"],10))),e(_e(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}var Ne=function(t){const{state:e,dispatch:n}=Y(Gt);return p(m,null,p("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>p("li",{className:"mg-upc-dg-item-list"},p("div",null,p(ee,{width:"1.5em",height:"1.5em"})),p("div",{className:"mg-upc-dg-item-title"},p(ee,null)),p("div",{className:"mg-upc-dg-item-count"},p(ee,null)))))),p("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>p(te,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&p(ne,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},xe=function(t){var e,n,i;const[o,s]=X(!1),[a,l]=X(""),r=G({});return K((()=>{l(t.item.description)}),[t.item]),K((()=>{o&&r.current.focus()}),[o]),p(m,null,p("span",null,p("br",null),"Adding item:"),p("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null," "),p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t}),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!o&&p("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!o&&p("button",{onClick:()=>{s(!0)}},""===a&&p("span",null,st("Add Comment")),""!==a&&p("span",null,st("Edit Comment"))),p("input",{ref:r,className:o?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),o&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{s(!1),l(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,st("Cancel"))),o&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{s(!1),t.onSaveItemDescription(a)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,st("Save"))))),p("span",null,st("Select where the item will be added:")))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ie.apply(this,arguments)}function Se(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Te(t){this.props=t}(Te.prototype=new f).isPureReactComponent=!0,Te.prototype.shouldComponentUpdate=function(t,e){return Se(this.props,t)||Se(this.state,e)};var Ae=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ae&&Ae(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Ee=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var o,s=e;s=s.__;)if((o=s.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Ee(t,e,n,i)};var Le=e.unmount;function De(){this.__u=0,this.t=null,this.__b=null}function Oe(t){var e=t.__.__c;return e&&e.__e&&e.__e(t)}function Ue(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),Le&&Le(t)},(De.prototype=new f).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=Oe(i.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__e){var t=i.state.__e;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__e:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__e:i.__b=i.__v.__k[0]}),t.then(a,a)},De.prototype.componentWillUnmount=function(){this.t=[]},De.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__e&&p(m,null,t.fallback);return o&&(o.__h=null),[p(m,null,e.__e?null:t.children),o]};var Re=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function We(t){return this.getChildContext=function(){return t.context},t.children}function je(t){var e=this,n=t.i;e.componentWillUnmount=function(){O(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),O(p(We,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Ue.prototype=new f).__e=function(t){var e=this,n=Oe(e.__v),i=e.o.get(t);return i[0]++,function(o){var s=function(){e.props.revealOrder?(i.push(o),Re(e,t,i)):o()};n?n(s):s()}},Ue.prototype.render=function(t){this.u=null,this.o=new Map;var e=P(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Ue.prototype.componentDidUpdate=Ue.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){Re(t,n,e)}))};var $e="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,He=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Me="undefined"!=typeof document,Be=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};f.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(f.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Fe=e.event;function qe(){}function Qe(){return this.cancelBubble}function Xe(){return this.defaultPrevented}e.event=function(t){return Fe&&(t=Fe(t)),t.persist=qe,t.isPropagationStopped=Qe,t.isDefaultPrevented=Xe,t.nativeEvent=t};var Ve={configurable:!0,get:function(){return this.class}},Ke=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var o=-1===e.indexOf("-");for(var s in i={},n){var a=n[s];Me&&"children"===s&&"noscript"===e||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!Be(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():o&&He.test(s)?s=s.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),i[s]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=P(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=P(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Ve.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Ve))}t.$$typeof=$e,Ke&&Ke(t)};var Ge=e.__r;e.__r=function(t){Ge&&Ge(t),t.__c};var ze=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Je(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ye(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function Ze(t){(t.querySelector("[autofocus]")||t).focus()}function tn(){Ye("[data-a11y-dialog]").forEach((function(t){new Je(t)}))}Je.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ye('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ye("[data-a11y-dialog-hide]",this.$el).concat(Ye('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Je.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,Ze(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Je.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Je.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Je.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Je.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Je.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Je.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&27===t.which&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&9===t.which&&function(t,e){var n=function(t){return Ye(ze.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Je.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||Ze(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",tn):window.requestAnimationFrame?window.requestAnimationFrame(tn):window.setTimeout(tn,16));const en=t=>{const e=(()=>{const[t,e]=X(!1);return K((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=X(null);return[t,J((t=>{null!==t&&e(new Je(t))}),[])]})(),i=J((()=>e.hide()),[e]),o=t.role||"dialog",s="alertdialog"===o,a=t.titleId||t.id+"-title";return K((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:o,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:s?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:o}=t;if(K((()=>(n&&o(n),()=>o(void 0))),[o,n]),!e)return null;const s=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=p("h2",Ie({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&p("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=p("button",Ie({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=p(je,{__v:t,i:e});return n.containerInfo=e,n}(p("div",Ie({},i.container,{className:t.classNames.container}),p("div",Ie({},i.overlay,{className:t.classNames.overlay})),p("div",Ie({},i.dialog,{className:t.classNames.dialog}),r)),s)};en.defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}},function(t){function e(e,i,o,s){const a=o||s.parent(),l=a.find(".mg-upc-item-vote").attr("disabled",!0);mgUpcApiClient.vote(e,i,{context:"web",posts:n(a)}).then((function(e){t(document.body).trigger("mg_upc_vote_response",[e,a])})).catch((function(t){var e,n;l.attr("disabled",!1),null!==(e=t.response)&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.message&&(s?s.append(Ft(t.response.data.message)):a.before(Ft(t.response.data.message)))}))}function n(e){return[...e.children().map((function(){return t(this).data("pid")}))].join(",")}t(".mg-upc-item-vote").on("click",(function(){const n=t(this).data("vote").split(",");return 2===n.length&&e(n[0],n[1],!1,t(this).closest(".mg-upc-item")),!1})),t((function(){t(".mg-upc-vote").each((function(){const n=t(this);e(n.data("id"),0,n.find(".mg-upc-items-container"),!1)}))})),t(document.body).on("mg_upc_vote_response",(function(e,n,i){if(!n.data)return;const o=parseInt(n.data.vote_counter,10),s=i.find(".mg-upc-item-vote");i.data("votes",o),n.data.can_vote?s.attr("disabled",!1).show():s.animate({width:0,padding:0,opacity:0},200,(function(){s.remove()})),n.data.posts.forEach((function(e){const n=i.find(".mg-upc-item[data-pid="+e.post_id+"]"),s=parseInt(e.votes,10);t(document.body).trigger("mg_upc_item_vote_set",[n,s,o])}))})),t(document.body).on("mg_upc_item_vote_set",(function(t,e,n,i){const o=i>0?Math.round(1e3*n/i)/10:0,s=e.find(".mg-upc-votes");s.find(".mg-upc-item-votes-number").html(n),s.find(".mg-upc-item-percent").html(o+"%"),s.find(".mg-upc-item-bar-progress").animate({width:o+"%"}),s.show()}))}(jQuery),function(t){t(".mg-upc-add-product-to-list").on("click",(function(){let e=t(this).data("id");const n=t(this).closest(".product,.summary").find("[name='variation_id']");return n.length>0&&parseInt(n.val(),10)>0&&(e=n.val()),window.addItemToList(e),!1}));const e="mg-upc-btn-loading",n="mg-upc-product-added",i="mg-upc-product-error",o="Sorry, an error occurred.";function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(st("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(st("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}t((function(){if("undefined"==typeof wc_add_to_cart_params)return!1;t(".mg-upc-item-product").removeClass("mg-upc-hide").on("click",(function(e){return s(e,t(this),!1)})),t(".mg-upc-add-list-to-cart").removeClass("mg-upc-hide").on("click",(function(s){const a=t(this);return a.hasClass(e)||(a.removeClass(n+" "+i).addClass(e),window.mgUpcAddListToCart(t(this).data("id")).then((function(i){a.removeClass(e),i.err&&a.before(Ft(Mt(i.err))),i.msg&&a.before(Ft(Mt(i.msg),"success")),a.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,a])})).catch((t=>{var n,i;a.removeClass(e),null!==(n=t.response)&&void 0!==n&&null!==(i=n.data)&&void 0!==i&&i.message?a.before(Ft(Mt(t.response.data.message))):alert(o)}))),!1}))}))}(jQuery);var nn=function(t){var e;const[n,i]=X(""),[o,s]=X(""),[a,l]=X(""),[r,c]=X(""),u=z((()=>Wt(t.addingPost)),[t.addingPost]);function d(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&d(u[0]),K((()=>{i(t.list.title),s(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),K((()=>{var t;null!==(t=Ot(a))&&void 0!==t&&t.available_statuses&&-1===Ot(a).available_statuses.indexOf(r)&&c(Ot(a).available_statuses[0])}),[a]),p("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&p(m,null,p("label",null,st("Select a list type:")),p("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>p("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>d(t),onKeyPress:e=>{13===e.keyCode&&d(t)},tabIndex:"0"},p("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),p("div",{className:"mg-upc-dg-item-title"},p("strong",null,t.label),p("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&jt(a,"editable_title")&&p(m,null,p("label",{htmlFor:`title-${t.list.ID}`},st("Title")),p("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&jt(a,"editable_content")&&p(m,null,p("label",{htmlFor:`content-${t.list.ID}`},st("Description")),p("textarea",{id:`content-${t.list.ID}`,value:o,onChange:function(t){s(t.target.value)},maxLength:500}),p("span",{className:"mg-upc-dg-list-desc-edit-count"},p("i",null,null==o?void 0:o.length),"/500")),""!==a&&!Ot(a)&&p("span",null,st("Unknown List Type...")),""!==a&&(null===(e=Ot(a))||void 0===e?void 0:e.available_statuses)&&Ot(a).available_statuses.length>1&&p(m,null,p("label",{htmlFor:`status-${t.list.ID}`},st("Status")),p("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ot(a).available_statuses.map(((t,e)=>{if(function(t){const e=Ut(t);return e&&e.show_in_status_list}(t))return p("option",{value:t},function(t){const e=Ut(t);return e?e.label:t}(t))})))),""!==a&&Ot(a)&&p("div",{className:"mg-upc-dg-edit-actions"},p("button",{onClick:()=>t.onSave({title:n,content:o,type:a,status:r})},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,st("Save"))),p("button",{onClick:()=>t.onCancel()},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,st("Cancel")))))},on=function(t){var e;const[n,i]=X(!1),[o,s]=X(""),[a,l]=X(null===(e=t.item)||void 0===e?void 0:e.quantity),r=G({});K((()=>{s(t.item.description)}),[t.item]),K((()=>{n&&r.current.focus()}),[n]);const c=G(!1);return K((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),p("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},Rt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),p("span",{className:"mg-upc-dg-item-number"},t.item.position)),Rt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return Rt(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),p("a",{href:t.item.link},p("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t})),p("div",{className:"mg-upc-dg-item-data"},p("a",{href:t.item.link},t.item.title),t.item.price_html&&p("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&p("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&p("p",null,t.item.description),t.editable&&!n&&Rt(t.list,"editable_item_description")&&p("button",{onClick:()=>{i(!0)}},p("span",{className:"mg-upc-icon upc-font-edit"}),""===o&&p("span",null,st("Add Comment")),""!==o&&p("span",null,st("Edit Comment"))),p("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:o,onChange:function(t){s(t.target.value)},maxLength:400}),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),s(t.item.description)}},p("span",{className:"mg-upc-icon upc-font-close"}),p("span",null,st("Cancel"))),t.editable&&n&&p("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(o)}},p("span",{className:"mg-upc-icon upc-font-save"}),p("span",null,st("Save")))),t.editable&&Rt(t.list,"quantity")&&p("div",{className:"mg-upc-dg-quantity"},p("small",null,st("Quantity")),p("input",{"aria-label":st("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&p("div",null,p("button",{"aria-label":"Remove item",onClick:t.onRemove},p("span",{className:"mg-upc-icon upc-font-trash"}))))},sn=function(t){return new Promise((function(e,n){const i=document.createElement("script");let o=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){o||this.readyState&&"complete"!=this.readyState||(o=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},an=function(t){var e,n,i;const o=G(null),s=G((e=>{t.onMove(e)}));return K((()=>{s.current=t.onMove})),K((()=>{let e=!1;if(Rt(t.list,"sortable")){const t=()=>{e=Sortable.create(o.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){s.current(t)}})};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),p(m,null,p("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>p("li",{className:"mg-upc-dg-item"},Rt(t.list,"sortable")&&p(m,null,p("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",p(ee,{width:"1.5em"})," "),p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(ee,{width:"1em"})," ")),Rt(t.list,"vote")&&p(m,null,p("span",{className:"mg-upc-dg-item-number-skeleton"}," ",p(ee,{width:"1em"})," ")),p("div",{className:"mg-upc-dg-item-skeleton-image"},p(ee,{width:"5em",height:"5em"})),p("div",{className:"mg-upc-dg-item-data"},p(ee,{count:2})))))),p("ul",{ref:o,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&p("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>p(on,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),Rt(t.list,"vote")&&p("span",{className:"mg-upc-dg-total-votes"}," ",st("Total votes:")," ",p("span",null," ",t.list.vote_counter)))},ln=function(t){const e=G(null),n=G(null),i=st("Copy"),[o,s]=X(i);K((()=>{let t=null;o!==i&&(t=setTimeout((()=>{s(i),clearTimeout(t)}),2e3))}),[o]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:st("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Lt().shareButtons&&(r=r.filter((t=>Lt().shareButtons.includes(t.slug||t.name.toLowerCase())))),p("div",{className:"mg-upc-dg-share-link"},p("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),p("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?s(st("Copied!")):s("Error!")}},p("span",{className:"mg-upc-icon upc-font-copy"}),p("span",null,o)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),p("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},p("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},rn=function(t){var e;const{state:n,dispatch:i}=Y(Gt),[o,s]=X(!1),a=G(!1),l=G(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(he({page:t}))}return K((()=>{const t=n.list;let e=!1,o=!1;if(t&&Rt(t,"sortable")){const t=()=>{n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(Pe(t.oldIndex))}})),n.listPage>1&&(o=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(ke(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():sn(Dt()).then((()=>{t()}))}return()=>{e&&e.destroy(),o&&o.destroy()}}),[n.list,n.listPage,n.listTotalPages]),K((()=>{s(!1)}),[n.editing,n.list,n.addingPost]),p(m,null,n.editing&&p(nn,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const o={};o.title=t.title,o.content=t.content,o.type=t.type,o.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(o.adding=n.addingPost.post_id),i(ge(o))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(fe(e))}},onCancel:function(){i(se(!1)),-1===n.list.ID&&(i(me(!1)),i(ie()),i(le()))}}),!n.editing&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return jt(i,"editable_title")||jt(i,"editable_content")||(null===(e=Ot(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&p("button",{className:"mg-upg-edit",onClick:()=>i(se(!0))},p("span",{className:"mg-upc-icon upc-font-edit"}),p("span",null,st("Edit"))),n.list.link&&p("button",{className:"mg-upg-share",onClick:()=>s(!o)},p("span",{className:"mg-upc-icon upc-font-share"}),p("span",null,st("Share"))),"cart"===n.list.type&&p("button",{className:"mg-upg-share",onClick:function(){i(ae(n.list.ID))}},p("span",{className:"mg-upc-icon upc-font-cart"}),p("span",null,st("Add all to cart")))),o&&n.list.link&&p(ln,{link:n.list.link,title:n.list.title}),n.list.content&&p("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:Mt(n.list.content)}}),p(ee,{count:3}),p(an,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(we(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ve(e.post_id))},onSaveItemDescription:function(t,e,n){i(be(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(be(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&p(ne,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}))};function cn(t){return parseInt(t.author,10)===parseInt(Lt().user_id,10)}function un(){"replaceState"in history?(history.replaceState("",document.title,location.pathname),history.go(-1)):location.hash=""}O(p((t=>{const[e,n]=V(qt,Kt);return p(Gt.Provider,{value:{state:e,dispatch:Vt(n,(()=>e))}},t.children)}),null,p((function(){const{state:t,dispatch:e}=Y(Gt),n=z((()=>Wt(t.addingPost)),[t.addingPost]),i=G(!1);let o="listOfList";if(t.addingPost)o=t.editing?"addingToNew":"adding";else if(t.editing){var s;o=-1!==(null===(s=t.list)||void 0===s?void 0:s.ID)?"edit":"new"}else o=t.list?"list":"listOfList";const a={container:"mg-upc-dg-container",overlay:"mg-upc-dg-overlay",dialog:"mg-upc-dg-content"+(t.errorCode?" mg-upc-err-"+t.errorCode:""),title:"mg-upc-dg-title",closeButton:"mg-upc-dg-close"};K((()=>{window.showMyLists=function(){l()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(ie()),n||r(t)},window.mgUpcAddListToCart=Bt}),[i.current,e]);const l=()=>{e(ie()),e(le()),i.current.show()},r=t=>{e(oe({post_id:t})),e(le({addingPost:t})),i.current.show()};function c(n){n<1||n>t.totalPages||"loading"===t.status||e(ue(n))}const u="list"===o||"new"===o||"edit"===o||"addingToNew"===o;return p(en,{id:"mg-upc-dg-dialog",dialogRef:function(t){i.current=t},title:t.title,classNames:a,onBack:!!u&&function(){switch(o){case"list":default:l();break;case"new":e(me(!1)),e(se(!1)),l();break;case"edit":e(se(!1));break;case"addingToNew":e(me(!1)),e(se(!1)),e(le({addingPost:t.addingPost.post_id}))}}},p("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+o},p("div",{className:"mg-upc-dg-wait"}),t.message&&p("div",{className:"mg-upc-dg-msg"},t.message,p("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:rt,payload:null})}},p("span",{className:"mg-upc-icon upc-font-close"}))),t.error&&p("div",{className:"mg-upc-dg-error"},t.error,p("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:lt,payload:null})}},p("span",{className:"mg-upc-icon upc-font-close"}))),p("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&p(xe,{item:t.addingPost,onSaveItemDescription:function(n){e(oe({...t.addingPost,description:n}))}}),("listOfList"===o||"adding"===o)&&p(m,null,p("div",{className:"mg-upc-dg-top-action"},n.length>0&&p("button",{className:"mg-list-new",onClick:function(t){e(se(!0)),e(me(!0)),i.current.show()}},p("span",{className:"mg-upc-icon upc-font-add"}),p("span",null,st("Create List")))),p(Ne,{lists:t.listOfList,onSelect:function(n){e(se(!1)),t.addingPost?e(ye(n.ID,t.addingPost)):(e(me(n)),i.current.show())},onRemove:!t.addingPost&&function(t){e(ce(t.ID))},loadPreview:function(){c(t.page-1)},loadNext:function(){c(t.page+1)}})),t.list&&p(rn,{editable:cn(t.list)}))))}),null)," "),document.querySelector("body")),"#my-lists"===location.hash&&un(),window.addEventListener("hashchange",(function(){"#my-lists"===location.hash&&(window.showMyLists(),un())}),!1),window.mgUpcApiClient=Et}();1 (()=>{"use strict";var t,e,n,i,o,s,a={},l=[],r=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function c(t,e){for(var n in e)t[n]=e[n];return t}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function d(e,n,i){var o,s,a,l={};for(a in n)"key"==a?o=n[a]:"ref"==a?s=n[a]:l[a]=n[a];if(arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===l[a]&&(l[a]=e.defaultProps[a]);return p(e,l,o,s,null)}function p(t,i,o,s,a){var l={type:t,props:i,key:o,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++n:a};return null==a&&null!=e.vnode&&e.vnode(l),l}function _(t){return t.children}function m(t,e){this.props=t,this.context=e}function f(t,e){if(null==e)return t.__?f(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?f(t):null}function g(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return g(t)}}function h(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!v.__r++||o!==e.debounceRendering)&&((o=e.debounceRendering)||setTimeout)(v)}function v(){for(var t;v.__r=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,n,i,o,s,a;t.__d&&(s=(o=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=c({},o)).__v=o.__v+1,I(a,o,i,e.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,n,null==s?f(o):s,o.__h),S(n,o),o.__e!=s&&g(o)))}))}function y(t,e,n,i,o,s,r,c,u,d){var m,g,h,v,y,w,N,k=i&&i.__k||l,C=k.length;for(n.__k=[],m=0;m<e.length;m++)if(null!=(v=n.__k[m]=null==(v=e[m])||"boolean"==typeof v?null:"string"==typeof v||"number"==typeof v||"bigint"==typeof v?p(null,v,null,null,v):Array.isArray(v)?p(_,{children:v},null,null,null):v.__b>0?p(v.type,v.props,v.key,null,v.__v):v)){if(v.__=n,v.__b=n.__b+1,null===(h=k[m])||h&&v.key==h.key&&v.type===h.type)k[m]=void 0;else for(g=0;g<C;g++){if((h=k[g])&&v.key==h.key&&v.type===h.type){k[g]=void 0;break}h=null}I(t,v,h=h||a,o,s,r,c,u,d),y=v.__e,(g=v.ref)&&h.ref!=g&&(N||(N=[]),h.ref&&N.push(h.ref,null,v),N.push(g,v.__c||y,v)),null!=y?(null==w&&(w=y),"function"==typeof v.type&&v.__k===h.__k?v.__d=u=b(v,u,t):u=P(t,v,h,k,y,u),"function"==typeof n.type&&(n.__d=u)):u&&h.__e==u&&u.parentNode!=t&&(u=f(h))}for(n.__e=w,m=C;m--;)null!=k[m]&&("function"==typeof n.type&&null!=k[m].__e&&k[m].__e==n.__d&&(n.__d=f(i,m+1)),E(k[m],k[m]));if(N)for(m=0;m<N.length;m++)A(N[m],N[++m],N[++m])}function b(t,e,n){for(var i,o=t.__k,s=0;o&&s<o.length;s++)(i=o[s])&&(i.__=t,e="function"==typeof i.type?b(i,e,n):P(n,i,i,o,i.__e,e));return e}function w(t,e){return e=e||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){w(t,e)})):e.push(t)),e}function P(t,e,n,i,o,s){var a,l,r;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||o!=s||null==o.parentNode)t:if(null==s||s.parentNode!==t)t.appendChild(o),a=null;else{for(l=s,r=0;(l=l.nextSibling)&&r<i.length;r+=2)if(l==o)break t;t.insertBefore(o,s),a=s}return void 0!==a?a:o.nextSibling}function N(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||r.test(e)?n:n+"px"}function k(t,e,n,i,o){var s;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||N(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||N(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i||t.addEventListener(e,s?x:C,s):t.removeEventListener(e,s?x:C,s);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null!=n&&(!1!==n||"a"===e[0]&&"r"===e[1])?t.setAttribute(e,n):t.removeAttribute(e))}}function C(t){this.l[t.type+!1](e.event?e.event(t):t)}function x(t){this.l[t.type+!0](e.event?e.event(t):t)}function I(t,n,i,o,s,a,l,r,u){var d,p,f,g,h,v,b,w,P,N,k,C,x,I=n.type;if(void 0!==n.constructor)return null;null!=i.__h&&(u=i.__h,r=n.__e=i.__e,n.__h=null,a=[r]),(d=e.__b)&&d(n);try{t:if("function"==typeof I){if(w=n.props,P=(d=I.contextType)&&o[d.__c],N=d?P?P.props.value:d.__:o,i.__c?b=(p=n.__c=i.__c).__=p.__E:("prototype"in I&&I.prototype.render?n.__c=p=new I(w,N):(n.__c=p=new m(w,N),p.constructor=I,p.render=L),P&&P.sub(p),p.props=w,p.state||(p.state={}),p.context=N,p.__n=o,f=p.__d=!0,p.__h=[]),null==p.__s&&(p.__s=p.state),null!=I.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=c({},p.__s)),c(p.__s,I.getDerivedStateFromProps(w,p.__s))),g=p.props,h=p.state,f)null==I.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==I.getDerivedStateFromProps&&w!==g&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,N),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,N)||n.__v===i.__v){p.props=w,p.state=p.__s,n.__v!==i.__v&&(p.__d=!1),p.__v=n,n.__e=i.__e,n.__k=i.__k,n.__k.forEach((function(t){t&&(t.__=n)})),p.__h.length&&l.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,N),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(g,h,v)}))}if(p.context=N,p.props=w,p.__v=n,p.__P=t,k=e.__r,C=0,"prototype"in I&&I.prototype.render)p.state=p.__s,p.__d=!1,k&&k(n),d=p.render(p.props,p.state,p.context);else do{p.__d=!1,k&&k(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++C<25);p.state=p.__s,null!=p.getChildContext&&(o=c(c({},o),p.getChildContext())),f||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(g,h)),x=null!=d&&d.type===_&&null==d.key?d.props.children:d,y(t,Array.isArray(x)?x:[x],n,i,o,s,a,l,r,u),p.base=n.__e,n.__h=null,p.__h.length&&l.push(p),b&&(p.__E=p.__=null),p.__e=!1}else null==a&&n.__v===i.__v?(n.__k=i.__k,n.__e=i.__e):n.__e=T(i.__e,n,i,o,s,a,l,u);(d=e.diffed)&&d(n)}catch(t){n.__v=null,(u||null!=a)&&(n.__e=r,n.__h=!!u,a[a.indexOf(r)]=null),e.__e(t,n,i)}}function S(t,n){e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function T(e,n,i,o,s,l,r,c){var d,p,_,m=i.props,g=n.props,h=n.type,v=0;if("svg"===h&&(s=!0),null!=l)for(;v<l.length;v++)if((d=l[v])&&"setAttribute"in d==!!h&&(h?d.localName===h:3===d.nodeType)){e=d,l[v]=null;break}if(null==e){if(null===h)return document.createTextNode(g);e=s?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,g.is&&g),l=null,c=!1}if(null===h)m===g||c&&e.data===g||(e.data=g);else{if(l=l&&t.call(e.childNodes),p=(m=i.props||a).dangerouslySetInnerHTML,_=g.dangerouslySetInnerHTML,!c){if(null!=l)for(m={},v=0;v<e.attributes.length;v++)m[e.attributes[v].name]=e.attributes[v].value;(_||p)&&(_&&(p&&_.__html==p.__html||_.__html===e.innerHTML)||(e.innerHTML=_&&_.__html||""))}if(function(t,e,n,i,o){var s;for(s in n)"children"===s||"key"===s||s in e||k(t,s,null,n[s],i);for(s in e)o&&"function"!=typeof e[s]||"children"===s||"key"===s||"value"===s||"checked"===s||n[s]===e[s]||k(t,s,e[s],n[s],i)}(e,g,m,s,c),_)n.__k=[];else if(v=n.props.children,y(e,Array.isArray(v)?v:[v],n,i,o,s&&"foreignObject"!==h,l,r,l?l[0]:i.__k&&f(i,0),c),null!=l)for(v=l.length;v--;)null!=l[v]&&u(l[v]);c||("value"in g&&void 0!==(v=g.value)&&(v!==e.value||"progress"===h&&!v||"option"===h&&v!==m.value)&&k(e,"value",v,m.value,!1),"checked"in g&&void 0!==(v=g.checked)&&v!==e.checked&&k(e,"checked",v,m.checked,!1))}return e}function A(t,n,i){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,i)}}function E(t,n,i){var o,s;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||A(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&E(o[s],n,"function"!=typeof t.type);i||null==t.__e||u(t.__e),t.__e=t.__d=void 0}function L(t,e,n){return this.constructor(t,n)}function D(n,i,o){var s,l,r;e.__&&e.__(n,i),l=(s="function"==typeof o)?null:o&&o.__k||i.__k,r=[],I(i,n=(!s&&o||i).__k=d(_,null,[n]),l||a,a,void 0!==i.ownerSVGElement,!s&&o?[o]:l?null:i.firstChild?t.call(i.childNodes):null,r,!s&&o?o:l?l.__e:i.firstChild,s),S(r,n)}t=l.slice,e={__e:function(t,e,n,i){for(var o,s,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&null!=s.getDerivedStateFromError&&(o.setState(s.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,m.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=c({},this.state),"function"==typeof t&&(t=t(c({},n),this.props)),t&&c(n,t),null!=t&&this.__v&&(e&&this.__h.push(e),h(this))},m.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),h(this))},m.prototype.render=_,i=[],v.__r=0,s=0;var O,U,R,W,j=0,H=[],$=[],M=e.__b,B=e.__r,F=e.diffed,q=e.__c,V=e.unmount;function Q(t,n){e.__h&&e.__h(U,t,j||n),j=0;var i=U.__H||(U.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:$}),i.__[t]}function X(t){return j=1,K(st,t)}function K(t,e,n){var i=Q(O++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):st(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=U,!i.__c.u)){i.__c.__H.u=!0;var o=i.__c.shouldComponentUpdate;i.__c.shouldComponentUpdate=function(t,e,n){if(!i.__c.__H)return!0;var s=i.__c.__H.__.filter((function(t){return t.__c}));return(s.every((function(t){return!t.__N}))||!s.every((function(t){if(!t.__N)return!0;var e=t.__[0];return t.__=t.__N,t.__N=void 0,e===t.__[0]})))&&(!o||o(t,e,n))}}return i.__N||i.__}function G(t,n){var i=Q(O++,3);!e.__s&&ot(i.__H,n)&&(i.__=t,i.i=n,U.__H.__h.push(i))}function z(t){return j=5,J((function(){return{current:t}}),[])}function J(t,e){var n=Q(O++,7);return ot(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Y(t,e){return j=8,J((function(){return t}),e)}function Z(t){var e=U.context[t.__c],n=Q(O++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(U)),e.props.value):t.__}function tt(){for(var t;t=H.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(nt),t.__H.__h.forEach(it),t.__H.__h=[]}catch(n){t.__H.__h=[],e.__e(n,t.__v)}}e.__b=function(t){U=null,M&&M(t)},e.__r=function(t){B&&B(t),O=0;var e=(U=t.__c).__H;e&&(R===U?(e.__h=[],U.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=$,t.__N=t.i=void 0}))):(e.__h.forEach(nt),e.__h.forEach(it),e.__h=[])),R=U},e.diffed=function(t){F&&F(t);var n=t.__c;n&&n.__H&&(n.__H.__h.length&&(1!==H.push(n)&&W===e.requestAnimationFrame||((W=e.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(i),et&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);et&&(e=requestAnimationFrame(n))})(tt)),n.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==$&&(t.__=t.__V),t.i=void 0,t.__V=$}))),R=U=null},e.__c=function(t,n){n.some((function(t){try{t.__h.forEach(nt),t.__h=t.__h.filter((function(t){return!t.__||it(t)}))}catch(i){n.some((function(t){t.__h&&(t.__h=[])})),n=[],e.__e(i,t.__v)}})),q&&q(t,n)},e.unmount=function(t){V&&V(t);var n,i=t.__c;i&&i.__H&&(i.__H.__.forEach((function(t){try{nt(t)}catch(t){n=t}})),n&&e.__e(n,i.__v))};var et="function"==typeof requestAnimationFrame;function nt(t){var e=U,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),U=e}function it(t){var e=U;t.__c=t.__(),U=e}function ot(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function st(t,e){return"function"==typeof e?e(t):e}const at=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return MgUpcTexts&&MgUpcTexts[t]?e?e.reduce((function(t,e){return t.replace(/%s/,e)}),MgUpcTexts[t]):MgUpcTexts[t]:t},lt="ui/reset",rt="ui/error",ct="ui/message",ut="ui/editing",dt="listOfLists/set",pt="listOfLists/remove",_t="listOfLists/create",mt="listOfList/addingPost",ft="listOfList/setPage",gt="listOfList/setTotalPages",ht="list/set",vt="list/update",yt="list/setPage",bt="list/setTotalPages",wt="list/setItems",Pt="list/removeItem",Nt="list/addItem",kt="list/updateItem",Ct="list/moveItem",xt="list/cart",It=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"mg-upc/v1/lists";if(void 0===Dt().nonce){const t=new FormData;t.append("action","mg_upc_user");const e={method:"POST",credentials:"same-origin",referrerPolicy:"no-referrer",body:t},n=await fetch(Dt().ajaxUrl,e),i=await n.json();i.nonce&&(Dt().nonce=i.nonce),i.user_id&&(Dt().user_id=i.user_id)}const o={method:t,credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":Dt().nonce},referrerPolicy:"no-referrer"};"GET"!==t&&n&&(o.body=JSON.stringify(n));const s=await fetch(Dt().root+i+e,o);s.headers.get("x-wp-nonce")&&(Dt().nonce=s.headers.get("x-wp-nonce"));const a=await s.json();return{data:a,headers:s.headers,status:s.status}};function St(t){const e=Object.entries(t).filter((t=>{let[,e]=t;return null!=e})).map((t=>{let[e,n]=t;return`${encodeURIComponent(e)}=${encodeURIComponent(String(n))}`})),n=-1!==Dt().root.indexOf("?")?"&":"?";return e.length>0?`${n}${e.join("&")}`:""}class Tt extends Error{constructor(t,e){var n;super(t),this.name="MgApiError",this.code=null==e||null===(n=e.data)||void 0===n?void 0:n.code,this.response=e}}function At(t){var e,n;let i=null==t||null===(e=t.data)||void 0===e||null===(n=e.data)||void 0===n?void 0:n.status;var o;if(!i&&t.status&&(i=t.status),400===i||401===i||403===i||404===i||409===i||500===i)throw new Tt(null==t||null===(o=t.data)||void 0===o?void 0:o.message,t)}let Et={my:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return It("GET","/My"+St(t),{}).then((function(t){return At(t),t}))},discover:function(t){return It("GET","/"+St(t),{}).then((function(t){return At(t),t}))},get:function(t){return It("GET","/"+t,{}).then((function(t){return At(t),t}))},cart:function(t){return It("POST","/cart",{list:t},"mg-upc/v1").then((function(t){return At(t),t}))},items:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return It("GET","/"+t+"/items"+St(e),{}).then((function(t){return At(t),t}))},delete:function(t){return It("DELETE","/"+t,{}).then((function(t){return At(t),t}))},create:function(t){return It("POST","",t).then((function(t){return At(t),t}))},update:function(t){let e=t.id;return delete t.id,It("PATCH","/"+e,t).then((function(t){return At(t),t}))},add:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"object"!=typeof e&&(e={post_id:e}),It("POST","/"+t+"/items"+St(n),e).then((function(t){return At(t),t}))},quit:function(t,e){return It("DELETE","/"+t+"/items/"+e,{}).then((function(t){return At(t),t}))},updateItem:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,n).then((function(t){return At(t),t}))},vote:function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return It("POST","/"+t+"/items/"+e+"/vote",n).then((function(t){return At(t),t}))},move:function(t,e,n){return It("PATCH","/"+t+"/items/"+e,{position:n}).then((function(t){return At(t),t}))}};const Lt=Et;function Dt(){return MgUserPostCollections}function Ot(){var t;return null===(t=Dt())||void 0===t?void 0:t.sortable}function Ut(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.types;return!(!n||!n[t])&&n[t]}function Rt(t){var e;const n=null===(e=Dt())||void 0===e?void 0:e.statuses;return!(!n||!n[t])&&n[t]}function Wt(t,e){return!!t.type&&Ht(t.type,e)}function jt(t){var e;const n=[],i=null===(e=Dt())||void 0===e?void 0:e.types;for(const e in i)i.hasOwnProperty(e)&&(Ht(e,"always_exists")||(null!=t&&t.type?i[e].available_post_types.includes(t.type)&&n.push(i[e]):n.push(i[e])));return n}function Ht(t,e){const n=Ut(t);return!(!n||!n.supports)&&n.supports.includes(e)}const $t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";function Mt(t){return JSON.parse(JSON.stringify(t))}function Bt(t){return"string"!=typeof t?"":t.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2")}function Ft(t){return Lt.cart(t).then((t=>(jQuery&&t.data.fragments&&t.data.cart_hash&&jQuery(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash]),t.data)))}function qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error";if(!jQuery)return!1;const n=jQuery("<div>").addClass("mg-upc-alert mg-upc-alert-"+e);n.append(jQuery("<p>").html(t));const i=jQuery('<a class="mg-upc-alert-close" href="#"><span class="mg-upc-icon upc-font-close"></span></a>').on("click",(function(){return n.remove(),!1}));return n.append(i),n}function Vt(t,e){const{type:n,payload:i}=e;let o=!1;const s=t=>(o=a({status:"failed"}),t.error&&(o.error=t.error.message?t.error.message:"",o.errorCode=t.error.code?t.error.code:""),o),a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(o||(o=Mt(t)),e)for(const t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);return o};let l=function(t,e){const{type:n,payload:i}=e;let o,s;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s||(s=!1===t?{}:Mt(t)),e)for(const t in e)s[t]=e[t];return s};switch(n){case ht:return!0===i?{ID:-1,title:"",content:"",status:"",type:""}:i;case vt:return i.items=Mt(t.items),i;case _t:return i;case wt:return a({items:i});case"list/addItem/failed":case Nt:return null!=i&&i.list?a(i.list):t;case kt:const e=!!i.item&&i.item;return o=a().items.map((t=>t.post_id===i.post_id?e||Object.assign({},t,i):{...t})),a({items:o});case Pt:if(1===t.items.length||!1===i)return t;if(s=a(),o=s.items.filter((t=>t.post_id!==i)),Ht(t.type,"sortable")){const e=parseInt(t.items[0].position,10);o.forEach(((t,n)=>{o[n].position=e+n}))}if(Ht(t.type,"vote")){const e=t.items.find((t=>t.post_id==i));e&&(s.vote_counter=s.vote_counter-e.votes)}return{...s,items:o};case Ct:const n=parseInt(t.items[0].position,10);o=a().items.slice();const l=a().items[i.oldIndex];return o.splice(i.oldIndex,1),o.splice(i.newIndex,0,l),isNaN(n)?(alert("positions error!"),t):(o.forEach(((t,e)=>{o[e].position=n+e})),a({items:o}));default:return t}}(t.list,e),r=function(t,e){const{type:n,payload:i}=e;switch(n){case dt:return i;case Nt:case ht:return!1;case pt:return!1===i?t:Mt(t.filter((t=>t.ID!=i)));default:return t}}(t.listOfList,e);switch(t.list===l&&r===t.listOfList||(o=a({listOfList:r,list:l}),t.addingPost||(o.title=o.list?o.list.title:Gt.title)),n){case"ui/mode":return a({mode:i});case lt:return{...Gt,mode:t.mode};case rt:return a(!1===i?{error:!1,errorCode:!1}:{error:i});case ct:return a(!1===i?{message:!1,errorCode:!1}:{message:i});case xt:const n=a();return i.msg&&(n.message=i.msg),i.err&&(n.error=i.err),n;case ut:return a({editing:i});case mt:return o=a(),o.addingPost=i,i&&(o.title="Add to..."),o;case _t:o=a(),o.title=i.title?i.title:Gt.title,o.listTotalPages=1,o.listPage=1,o.addingPost=!1;break;case Nt:if(o=a(),null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Gt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}i.message&&(o.error=i.message,o.status="failed"),o.addingPost=!1;break;case ft:return a({page:i});case gt:return a({totalPages:i});case yt:return a({listPage:i});case bt:return a({listTotalPages:i});case"list/set/loading":return o=a(),o.status="loading",o.listOfList=!1,"object"==typeof i?(o.list=i,i.title&&(o.title=i.title)):o.list={ID:i},o;case"listOfLists/set/loading":case"list/setItems/loading":case"list/updateItem/loading":case"list/removeItem/loading":case"list/addItem/loading":case"list/moveItemNext/loading":case"list/moveItemPrev/loading":case"list/update/loading":case _t+"/loading":case"list/cart/loading":return a({status:"loading"});case"list/addItem/succeeded":return o=a(),o.addingPost=!1,o.status="succeeded",o.error=!1,o.errorCode=!1,o.title=o.list?o.list.title:Gt.title,o;case"list/cart/succeeded":return a({status:"succeeded",errorCode:!1});case"list/set/succeeded":if(!1===t.list)break;return a({status:"succeeded",error:!1,errorCode:!1});case"listOfLists/set/succeeded":case"list/setItems/succeeded":case"list/updateItem/succeeded":case"list/removeItem/succeeded":case"list/moveItem/succeeded":case"list/moveItemNext/succeeded":case"list/moveItemPrev/succeeded":case"list/update/succeeded":case _t+"/succeeded":return a({status:"succeeded",error:!1,errorCode:!1});case _t+"/failed":return o=a({status:"failed"}),e.error&&e.error.message&&(o.error=e.error.message),o;case"list/addItem/failed":if(o=a(),o.addingPost=!1,o.title=o.list?o.list.title:Gt.title,null!=i&&i.list){const t=i.list;o.title=t.title?t.title:Gt.title;const e=null==t?void 0:t.items_page;e&&(o.listTotalPages=e["X-WP-TotalPages"]?e["X-WP-TotalPages"]:1,o.listPage=e["X-WP-Page"]?e["X-WP-Page"]:1)}return i.message&&(o.error=i.message,o.status="failed"),s(e);case"listOfLists/set/failed":case"list/setItems/failed":case"list/updateItem/failed":case"list/removeItem/failed":case"list/moveItem/failed":case"list/moveItemNext/failed":case"list/moveItemPrev/failed":case"list/update/failed":case"list/set/failed":case"list/cart/failed":return s(e)}return!1!==o?o:t}const Qt=(t,e)=>function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return{asyncThunk:!0,payload:e,type:t,arg:n,extra:o}};class Xt extends Error{constructor(t,e){super(t),this.name="MgUpcRejectWithValue",this.value=e}}const Kt=(t,e)=>n=>{let i;if((o=n)&&"object"==typeof o&&!0===o.asyncThunk){let o={dispatch:Kt(t,e),getState:e,extra:n.extra,rejectWithValue:t=>new Xt(n.type+": rejectWithValue",t)};t({type:n.type+"/loading",payload:n.arg}),i=n.payload(n.arg,o)}else{if(!(t=>!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then)(n.payload))return void t(n);t({type:n.type+"/loading"}),i=n.payload}var o;i.then((e=>{e instanceof Xt?t({type:n.type+"/failed",payload:e.value}):(t({type:n.type,payload:e}),t({type:n.type+"/succeeded"}))})).catch((e=>{t(e instanceof Xt?{type:n.type+"/failed",payload:e.value}:{type:n.type+"/failed",error:e})}))},Gt={list:!1,listOfList:!1,addingPost:null,status:"idle",error:null,message:null,errorCode:null,editing:!1,title:at("My Lists"),actualAction:"init",page:1,totalPages:1,listPage:1,listTotalPages:1,mode:"my"},zt=function(t,e){var n={__c:e="__cC"+s++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(h)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}({});function Jt(t){return new Date(t).toLocaleDateString()}const Yt=function(t){const{state:e,dispatch:n}=Z(zt);return d("li",{className:"mg-upc-dg-item-list",onClick:t.onClick,onKeyPress:e=>{13===e.keyCode&&t.onClick(e)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.list.type}),d("div",{className:"mg-upc-dg-item-title"},d("span",null,t.list.title),"my"!==e.mode&&d(_,null,d("span",null,d("a",{href:"#",onClick:function(e){!function(t){t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.stopPropagation&&t.stopPropagation(),t.preventDefault()}(e),function(t,e){const n=new URLSearchParams(document.location.hash.substring(1));n.set("author",e);let i=n.toString();""!==i&&(i="#"+i),window.location.hash=i}(0,t.list.author)}},t.list.user_login),d("span",{className:"mg-upc-list-dates"},d("i",null," ",d("b",null,"Created:")," ",Jt(t.list.created)),d("i",null," ",d("b",null,"Modified:")," ",Jt(t.list.modified)))))),d("span",{className:"mg-upc-dg-item-count"},t.list.count),d("span",{className:"mg-upc-dg-item-actions"},t.onRemove&&d("button",{"aria-label":at("Remove List"),onClick:e=>{e.stopPropagation(),t.onRemove(t.list)}},d("span",{className:"mg-upc-icon upc-font-trash"}))))};class Zt extends m{render(){const t=[];for(let e=0;e<this.props.count;e++){let n=this.props.styles?this.props.styles:{};null!=this.props.width&&(n.width=this.props.width),null!=this.props.height&&(n.height=this.props.height),null!==this.props.width&&null!==this.props.height&&this.props.circle&&(n.borderRadius="50%"),t.push(d("span",{key:e,className:"mg-upc-dg-loading-skeleton",style:n},""))}const e=this.props.wrapper;return d("span",null,e?t.map(((t,n)=>d(e,{key:n},t,""))):t)}}var te,ee,ne;ne={count:1,duration:1.2,width:null,wrapper:null,height:null,circle:!1},(ee="defaultProps")in(te=Zt)?Object.defineProperty(te,ee,{value:ne,enumerable:!0,configurable:!0,writable:!0}):te[ee]=ne;const ie=function(t){return d("div",{className:"mg-upc-dg-pagination-div"},d("button",{className:1===t.page?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.prevRef,disabled:1===t.page,"aria-label":at("Previous page"),title:at("Previous page"),onClick:t.onPreview},d("span",{className:"mg-upc-icon upc-font-arrow_left"})),d("span",{className:t.totalPages>1?"mg-upc-dg-pagination-current":"mg-upc-dg-hidden mg-upc-dg-pagination-current"},t.page),d("button",{className:t.page>=t.totalPages?"mg-upc-dg-hidden mg-upc-dg-pagination":"mg-upc-dg-pagination",ref:t.nextRef,disabled:t.page>=t.totalPages,"aria-label":at("Next page"),title:at("Next page"),onClick:t.onNext},d("span",{className:"mg-upc-icon upc-font-arrow_right"})))},oe=()=>({type:lt,payload:null}),se=t=>({type:mt,payload:t}),ae=t=>({type:ut,payload:t}),le=Qt(xt,(async function(t,e){return await Ft(t)})),re=Qt(dt,(async function(t,e){var n;const i=null===(n=t)||void 0===n?void 0:n.addingPost;return null===t&&(t={}),t.addingPost?t.adding=t.addingPost:(t.adding="",delete t.adding),await Lt.my(t).then((t=>ce(t,e,i)))}));function ce(t,e,n){if(t.headers.get("x-wp-page")&&(e.dispatch(de(parseInt(t.headers.get("x-wp-page"),10))),e.dispatch(pe(parseInt(t.headers.get("X-WP-TotalPages"),10)))),n&&t.headers.get("X-WP-Post-Type")){const i={post_id:n},o={"X-WP-Post-Type":"type","X-WP-Post-Title":"title","X-WP-Post-Image":"image"};for(const e in o){const n=t.headers.get(e);n&&(i[o[e]]=decodeURIComponent(n))}e.dispatch(se(i))}return t.data}Qt(dt,(async function(t,e){return null===t&&(t={}),await Lt.discover(t).then((t=>ce(t,e,!1)))}));const ue=Qt(pt,(async function(t,e){return await Lt.delete(t).then((n=>{if(1===e.getState().listOfList.length){const n=e.getState().page,i=e.getState().totalPages;if(n<i)e.dispatch(re({page:n}));else{if(!(n>1&&n===i))return t;e.dispatch(re({page:n-1}))}return!1}return t}))})),de=t=>({type:ft,payload:t}),pe=t=>({type:gt,payload:t}),_e=t=>({type:yt,payload:t}),me=t=>({type:bt,payload:t}),fe=Qt(ht,(async function(t,e){return!1===t||!0===t?t:await Lt.get("object"==typeof t?t.ID:t).then((t=>(Ce(t,e.dispatch),t.data)))})),ge=Qt(vt,(async function(t,e){return await Lt.update(t).then((t=>(e.dispatch(ae(!1)),Ce(t,e.dispatch),t.data)))})),he=Qt(_t,(async function(t,e){return null===t&&(t={}),t.adding&&t.adding!==e.getState().addingPost&&e.dispatch(se({id:t.addingPost})),await Lt.create(t).then((t=>(e.dispatch(ae(!1)),Ce(t,e.dispatch),t.data)))})),ve=Qt(wt,(async function(t,e){return await Lt.items(e.getState().list.ID,t).then((t=>(Ce(t,e.dispatch),t.data)))})),ye=Qt(Pt,(async function(t,e){const n=e.getState();return await Lt.quit(n.list.ID,t).then((i=>{if(1===n.list.items.length){const t=n.listPage,i=n.listTotalPages;return t<i?e.dispatch(ve({page:t})):t===i&&e.dispatch(ve({page:Math.max(1,t-1)})),!1}return t}))})),be=Qt(Nt,(async function(t,e){let n=e.extra[0],i=!1;try{await Lt.add(t,n,{context:"view"}).then((t=>{i=t.data}))}catch(t){var o;const n=null==t||null===(o=t.response)||void 0===o?void 0:o.data;i=e.rejectWithValue(n)}return i})),we=Qt(kt,(async function(t,e){const n=e.extra[0];return await Lt.updateItem(e.getState().list.ID,t,n).then((e=>{var i;return{...n,post_id:t,item:null==e||null===(i=e.data)||void 0===i?void 0:i.item}}))})),Pe=Qt(Ct,(async function(t,e){const n=e.extra[0],i=e.extra[1],o=n.items[t],s=o.position-t+i;return await Lt.move(n.ID,o.post_id,s).then((e=>({oldIndex:t,newIndex:i})))})),Ne=Qt("list/moveItemNext",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[n.items.length-1].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Lt.move(n.ID,o.post_id,i+1),await e.dispatch(ve({page:e.getState().listPage})),t})),ke=Qt("list/moveItemPrev",(async function(t,e){const n=e.getState().list,i=parseInt(n.items[0].position,10);if(isNaN(i))throw alert("positions error!"),"positions error!";const o=n.items[t];return await Lt.move(n.ID,o.post_id,i-1),await e.dispatch(ve({page:e.getState().listPage})),t}));function Ce(t,e){!t.data.items_page&&t.headers.get("x-wp-page")?(e(_e(parseInt(t.headers.get("x-wp-page"),10))),e(me(parseInt(t.headers.get("X-WP-TotalPages"),10)))):t.data.items_page&&(e(_e(parseInt(t.data.items_page["X-WP-Page"],10))),e(me(parseInt(t.data.items_page["X-WP-TotalPages"],10))))}const xe=function(t){const{state:e,dispatch:n}=Z(zt);return d(_,null,d("ul",{className:"mg-upc-dg-list-of-lists-fake mg-upc-dg-on-loading"},[0,1,2].map((t=>d("li",{className:"mg-upc-dg-item-list"},d("div",null,d(Zt,{width:"1.5em",height:"1.5em"})),d("div",{className:"mg-upc-dg-item-title"},d(Zt,null)),d("div",{className:"mg-upc-dg-item-count"},d(Zt,null)))))),d("ul",{className:"mg-upc-dg-list-of-lists"},t.lists&&t.lists.map((e=>d(Yt,{list:e,onClick:()=>t.onSelect(e),onRemove:t.onRemove,key:e.ID})))),e.totalPages>1&&d(ie,{totalPages:e.totalPages,page:e.page,onPreview:t.loadPreview,onNext:t.loadNext}))},Ie=function(t){var e,n,i;const[o,s]=X(!1),[a,l]=X(""),r=z({});return G((()=>{l(t.item.description)}),[t.item]),G((()=>{o&&r.current.focus()}),[o]),d(_,null,d("span",null,d("br",null),"Adding item:"),d("div",{className:"mg-upc-dg-item mg-upc-dg-item-adding","data-post_id":t.item.post_id},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null," "),d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t}),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:null===(e=t.item)||void 0===e?void 0:e.link},null===(n=t.item)||void 0===n?void 0:n.title),!o&&d("p",null,null===(i=t.item)||void 0===i?void 0:i.description),!o&&d("button",{onClick:()=>{s(!0)}},""===a&&d("span",null,at("Add Comment")),""!==a&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:o?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:a,onChange:function(t){l(t.target.value)},maxLength:400}),o&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{s(!1),l(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),o&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{s(!1),t.onSaveItemDescription(a)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))))),d("span",null,at("Select where the item will be added:")))};function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Se.apply(this,arguments)}function Te(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var i in e)if("__source"!==i&&t[i]!==e[i])return!0;return!1}function Ae(t){this.props=t}(Ae.prototype=new m).isPureReactComponent=!0,Ae.prototype.shouldComponentUpdate=function(t,e){return Te(this.props,t)||Te(this.state,e)};var Ee=e.__b;e.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Ee&&Ee(t)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var Le=e.__e;e.__e=function(t,e,n,i){if(t.then)for(var o,s=e;s=s.__;)if((o=s.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Le(t,e,n,i)};var De=e.unmount;function Oe(){this.__u=0,this.t=null,this.__b=null}function Ue(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Re(){this.u=null,this.o=null}e.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&!0===t.__h&&(t.type=null),De&&De(t)},(Oe.prototype=new m).__c=function(t,e){var n=e.__c,i=this;null==i.t&&(i.t=[]),i.t.push(n);var o=Ue(i.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(l):l())};n.__R=a;var l=function(){if(!--i.__u){if(i.state.__a){var t=i.state.__a;i.__v.__k[0]=function t(e,n,i){return e&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)})),e.__c&&e.__c.__P===n&&(e.__e&&i.insertBefore(e.__e,e.__d),e.__c.__e=!0,e.__c.__P=i)),e}(t,t.__c.__P,t.__c.__O)}var e;for(i.setState({__a:i.__b=null});e=i.t.pop();)e.forceUpdate()}},r=!0===e.__h;i.__u++||r||i.setState({__a:i.__b=i.__v.__k[0]}),t.then(a,a)},Oe.prototype.componentWillUnmount=function(){this.t=[]},Oe.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=function t(e,n,i){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),e.__c.__H=null),null!=(e=function(t,e){for(var n in e)t[n]=e[n];return t}({},e)).__c&&(e.__c.__P===i&&(e.__c.__P=n),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return t(e,n,i)}))),e}(this.__b,n,i.__O=i.__P)}this.__b=null}var o=e.__a&&d(_,null,t.fallback);return o&&(o.__h=null),[d(_,null,e.__a?null:t.children),o]};var We=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};function je(t){return this.getChildContext=function(){return t.context},t.children}function He(t){var e=this,n=t.i;e.componentWillUnmount=function(){D(null,e.l),e.l=null,e.i=null},e.i&&e.i!==n&&e.componentWillUnmount(),t.__v?(e.l||(e.i=n,e.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(t){this.childNodes.push(t),e.i.appendChild(t)},insertBefore:function(t,n){this.childNodes.push(t),e.i.appendChild(t)},removeChild:function(t){this.childNodes.splice(this.childNodes.indexOf(t)>>>1,1),e.i.removeChild(t)}}),D(d(je,{context:e.context},t.__v),e.l)):e.l&&e.componentWillUnmount()}(Re.prototype=new m).__a=function(t){var e=this,n=Ue(e.__v),i=e.o.get(t);return i[0]++,function(o){var s=function(){e.props.revealOrder?(i.push(o),We(e,t,i)):o()};n?n(s):s()}},Re.prototype.render=function(t){this.u=null,this.o=new Map;var e=w(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Re.prototype.componentDidUpdate=Re.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){We(t,n,e)}))};var $e="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Me=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Be="undefined"!=typeof document,Fe=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(t)};m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(m.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var qe=e.event;function Ve(){}function Qe(){return this.cancelBubble}function Xe(){return this.defaultPrevented}e.event=function(t){return qe&&(t=qe(t)),t.persist=Ve,t.isPropagationStopped=Qe,t.isDefaultPrevented=Xe,t.nativeEvent=t};var Ke={configurable:!0,get:function(){return this.class}},Ge=e.vnode;e.vnode=function(t){var e=t.type,n=t.props,i=n;if("string"==typeof e){var o=-1===e.indexOf("-");for(var s in i={},n){var a=n[s];Be&&"children"===s&&"noscript"===e||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!Fe(n.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():o&&Me.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():null===a&&(a=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),i[s]&&(s="oninputCapture")),i[s]=a)}"select"==e&&i.multiple&&Array.isArray(i.value)&&(i.value=w(n.children).forEach((function(t){t.props.selected=-1!=i.value.indexOf(t.props.value)}))),"select"==e&&null!=i.defaultValue&&(i.value=w(n.children).forEach((function(t){t.props.selected=i.multiple?-1!=i.defaultValue.indexOf(t.props.value):i.defaultValue==t.props.value}))),t.props=i,n.class!=n.className&&(Ke.enumerable="className"in n,null!=n.className&&(i.class=n.className),Object.defineProperty(i,"className",Ke))}t.$$typeof=$e,Ge&&Ge(t)};var ze=e.__r;e.__r=function(t){ze&&ze(t),t.__c};var Je=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'];function Ye(t){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=t,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}function Ze(t,e){return n=(e||document).querySelectorAll(t),Array.prototype.slice.call(n);var n}function tn(t){(t.querySelector("[autofocus]")||t).focus()}function en(){Ze("[data-a11y-dialog]").forEach((function(t){new Ye(t)}))}Ye.prototype.create=function(){return this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=Ze('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this)),this._closers=Ze("[data-a11y-dialog-hide]",this.$el).concat(Ze('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},Ye.prototype.show=function(t){return this.shown||(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,tn(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",t)),this},Ye.prototype.hide=function(t){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",t),this):this},Ye.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(t){t.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(t){t.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},Ye.prototype.on=function(t,e){return void 0===this._listeners[t]&&(this._listeners[t]=[]),this._listeners[t].push(e),this},Ye.prototype.off=function(t,e){var n=(this._listeners[t]||[]).indexOf(e);return n>-1&&this._listeners[t].splice(n,1),this},Ye.prototype._fire=function(t,e){var n=this._listeners[t]||[],i=new CustomEvent(t,{detail:e});this.$el.dispatchEvent(i),n.forEach(function(t){t(this.$el,e)}.bind(this))},Ye.prototype._bindKeypress=function(t){this.$el.contains(document.activeElement)&&(this.shown&&"Escape"===t.key&&"alertdialog"!==this.$el.getAttribute("role")&&(t.preventDefault(),this.hide(t)),this.shown&&"Tab"===t.key&&function(t,e){var n=function(t){return Ze(Je.join(","),t).filter((function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}))}(t),i=n.indexOf(document.activeElement);e.shiftKey&&0===i?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||i!==n.length-1||(n[0].focus(),e.preventDefault())}(this.$el,t))},Ye.prototype._maintainFocus=function(t){!this.shown||t.target.closest('[aria-modal="true"]')||t.target.closest("[data-a11y-dialog-ignore-focus-trap]")||tn(this.$el)},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",en):window.requestAnimationFrame?window.requestAnimationFrame(en):window.setTimeout(en,16));const nn=t=>{const e=(()=>{const[t,e]=X(!1);return G((()=>e(!0)),[]),t})(),[n,i]=(t=>{const[e,n]=(()=>{const[t,e]=X(null);return[t,Y((t=>{null!==t&&e(new Ye(t))}),[])]})(),i=Y((()=>e.hide()),[e]),o=t.role||"dialog",s="alertdialog"===o,a=t.titleId||t.id+"-title";return G((()=>()=>{e&&e.destroy()}),[e]),[e,{container:{id:t.id,ref:n,role:o,tabIndex:-1,"aria-modal":!0,"aria-hidden":!0,"aria-labelledby":a},overlay:{onClick:s?void 0:i},dialog:{role:"document"},closeButton:{type:"button",onClick:i},title:{role:"heading","aria-level":1,id:a}}]})(t),{dialogRef:o}=t;if(G((()=>(n&&o(n),()=>o(void 0))),[o,n]),!e)return null;const s=t.dialogRoot?document.querySelector(t.dialogRoot):document.body,a=d("h2",Se({},i.title,{className:t.classNames.title,key:"title"}),t.onBack&&d("a",{"aria-label":t.backButtonLabel,href:"#",onClick:e=>{e.preventDefault(),t.onBack(e)}},"←")," ",t.title),l=d("button",Se({},i.closeButton,{className:t.classNames.closeButton,"aria-label":t.closeButtonLabel,key:"button"}),t.closeButtonContent),r=["first"===t.closeButtonPosition&&l,a,t.children,"last"===t.closeButtonPosition&&l].filter(Boolean);return function(t,e){var n=d(He,{__v:t,i:e});return n.containerInfo=e,n}(d("div",Se({},i.container,{className:t.classNames.container}),d("div",Se({},i.overlay,{className:t.classNames.overlay})),d("div",Se({},i.dialog,{className:t.classNames.dialog}),r)),s)};nn.defaultProps={role:"dialog",closeButtonLabel:"Close this dialog window",closeButtonContent:"×",closeButtonPosition:"first",classNames:{},backButtonLabel:"Back",dialogRef:()=>{}},function(t){function e(e,i,o,s){const a=o||s.parent(),l=a.find(".mg-upc-item-vote").attr("disabled",!0);mgUpcApiClient.vote(e,i,{context:"web",posts:n(a)}).then((function(e){t(document.body).trigger("mg_upc_vote_response",[e,a])})).catch((function(t){var e,n;l.attr("disabled",!1),null!==(e=t.response)&&void 0!==e&&null!==(n=e.data)&&void 0!==n&&n.message&&(s?s.append(qt(t.response.data.message)):a.before(qt(t.response.data.message)))}))}function n(e){return[...e.children().map((function(){return t(this).data("pid")}))].join(",")}t(".mg-upc-item-vote").on("click",(function(){const n=t(this).data("vote").split(",");return 2===n.length&&e(n[0],n[1],!1,t(this).closest(".mg-upc-item")),!1})),t((function(){t(".mg-upc-vote").each((function(){const n=t(this);e(n.data("id"),0,n.find(".mg-upc-items-container"),!1)}))})),t(document.body).on("mg_upc_vote_response",(function(e,n,i){if(!n.data)return;const o=parseInt(n.data.vote_counter,10),s=i.find(".mg-upc-item-vote");i.data("votes",o),n.data.can_vote?s.attr("disabled",!1).show():s.animate({width:0,padding:0,opacity:0},200,(function(){s.remove()})),n.data.posts.forEach((function(e){const n=i.find(".mg-upc-item[data-pid="+e.post_id+"]"),s=parseInt(e.votes,10);t(document.body).trigger("mg_upc_item_vote_set",[n,s,o])}))})),t(document.body).on("mg_upc_item_vote_set",(function(t,e,n,i){const o=i>0?Math.round(1e3*n/i)/10:0,s=e.find(".mg-upc-votes");s.find(".mg-upc-item-votes-number").html(n),s.find(".mg-upc-item-percent").html(o+"%"),s.find(".mg-upc-item-bar-progress").animate({width:o+"%"}),s.show()}))}(jQuery),function(t){t(".mg-upc-add-product-to-list").on("click",(function(){let e=t(this).data("id");const n=t(this).closest(".product,.summary").find("[name='variation_id']");return n.length>0&&parseInt(n.val(),10)>0&&(e=n.val()),window.addItemToList(e),!1}));const e="mg-upc-btn-loading",n="mg-upc-product-added",i="mg-upc-product-error",o="Sorry, an error occurred.";function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(at("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}function s(a,l,r){if(l.hasClass(e))return!1;let c={product_id:l.data("product"),quantity:l.data("quantity")};if("0"==c.quantity){if(!r)return!!confirm(at("The quantity is zero! Do you want to add a unit?"))&&s(a,l,!0);c.quantity=1}t(document.body).trigger("adding_to_cart",[l,c]);const u=woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart");return t.ajax({type:"POST",url:u,data:c,beforeSend:function(t){l.removeClass(n+" "+i).addClass(e)},success:function(i){l.removeClass(e),i&&(i.error&&i.product_url?alert(o):(l.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,l])))},error:function(){l.addClass(i).removeClass(e),alert(o)}}),!1}t((function(){if("undefined"==typeof wc_add_to_cart_params)return!1;t(".mg-upc-item-product").removeClass("mg-upc-hide").on("click",(function(e){return s(e,t(this),!1)})),t(".mg-upc-add-list-to-cart").removeClass("mg-upc-hide").on("click",(function(s){const a=t(this);return a.hasClass(e)||(a.removeClass(n+" "+i).addClass(e),window.mgUpcAddListToCart(t(this).data("id")).then((function(i){a.removeClass(e),i.err&&a.before(qt(Bt(i.err))),i.msg&&a.before(qt(Bt(i.msg),"success")),a.addClass(n),t(document.body).trigger("added_to_cart",[i.fragments,i.cart_hash,a])})).catch((t=>{var n,i;a.removeClass(e),null!==(n=t.response)&&void 0!==n&&null!==(i=n.data)&&void 0!==i&&i.message?a.before(qt(Bt(t.response.data.message))):alert(o)}))),!1}))}))}(jQuery);const on=function(t){var e;const[n,i]=X(""),[o,s]=X(""),[a,l]=X(""),[r,c]=X(""),u=J((()=>jt(t.addingPost)),[t.addingPost]);function p(t){t.default_title&&i(t.default_title),t.default_status&&c(t.default_status),l(t.name)}return""===a&&1===u.length&&p(u[0]),G((()=>{i(t.list.title),s(t.list.content),l(t.list.type),c(t.list.status)}),[t.list]),G((()=>{var t;null!==(t=Ut(a))&&void 0!==t&&t.available_statuses&&-1===Ut(a).available_statuses.indexOf(r)&&c(Ut(a).available_statuses[0])}),[a]),d("div",{className:"mg-list-edit"},-1===t.list.ID&&""===a&&d(_,null,d("label",null,at("Select a list type:")),d("ul",{id:`type-${t.list.ID}`},u.map(((t,e)=>d("li",{className:"mg-upc-dg-item-list-type",key:t.name,onClick:()=>p(t),onKeyPress:e=>{13===e.keyCode&&p(t)},tabIndex:"0"},d("i",{className:"mg-upc-icon mg-upc-dg-item-type mg-upc-dg-item-type-"+t.name}),d("div",{className:"mg-upc-dg-item-title"},d("strong",null,t.label),d("div",{className:"mg-upc-dg-item-desc"},t.description))))))),""!==a&&Ht(a,"editable_title")&&d(_,null,d("label",{htmlFor:`title-${t.list.ID}`},at("Title")),d("input",{id:`title-${t.list.ID}`,type:"text",value:n,onChange:function(t){i(t.target.value)},maxLength:100})),""!==a&&Ht(a,"editable_content")&&d(_,null,d("label",{htmlFor:`content-${t.list.ID}`},at("Description")),d("textarea",{id:`content-${t.list.ID}`,value:o,onChange:function(t){s(t.target.value)},maxLength:500}),d("span",{className:"mg-upc-dg-list-desc-edit-count"},d("i",null,null==o?void 0:o.length),"/500")),""!==a&&!Ut(a)&&d("span",null,at("Unknown List Type...")),""!==a&&(null===(e=Ut(a))||void 0===e?void 0:e.available_statuses)&&Ut(a).available_statuses.length>1&&d(_,null,d("label",{htmlFor:`status-${t.list.ID}`},at("Status")),d("select",{id:`status-${t.list.ID}`,value:r,onChange:function(t){c(t.target.value)}},Ut(a).available_statuses.map(((t,e)=>{if(function(t){const e=Rt(t);return e&&e.show_in_status_list}(t))return d("option",{value:t},function(t){const e=Rt(t);return e?e.label:t}(t))})))),""!==a&&Ut(a)&&d("div",{className:"mg-upc-dg-edit-actions"},d("button",{onClick:()=>t.onSave({title:n,content:o,type:a,status:r})},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save"))),d("button",{onClick:()=>t.onCancel()},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel")))))},sn=function(t){var e;const[n,i]=X(!1),[o,s]=X(""),[a,l]=X(null===(e=t.item)||void 0===e?void 0:e.quantity),r=z({});G((()=>{s(t.item.description)}),[t.item]),G((()=>{n&&r.current.focus()}),[n]);const c=z(!1);return G((()=>{t.item.quantity!==a&&(clearTimeout(c.current),c.current=setTimeout((function(){t.onSaveItemQuantity(a)}),600))}),[a]),d("li",{className:"mg-upc-dg-item","data-post_id":t.item.post_id},Wt(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle","aria-draggable":!0},"::"),d("span",{className:"mg-upc-dg-item-number"},t.item.position)),Wt(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number"},(()=>{const e=parseInt(t.list.vote_counter,10);return Wt(t.list,"vote")&&e>0?Math.round(100*parseInt(t.item.votes,10)/e)+"%":"0%"})())),d("a",{href:t.item.link},d("img",{className:"mg-upc-dg-item-image",src:t.item.image?t.item.image:$t})),d("div",{className:"mg-upc-dg-item-data"},d("a",{href:t.item.link},t.item.title),t.item.price_html&&d("span",{className:"mg-upc-dg-price",dangerouslySetInnerHTML:{__html:t.item.price_html}}),t.item.stock_html&&d("span",{className:"mg-upc-dg-stock",dangerouslySetInnerHTML:{__html:t.item.stock_html}}),t.editable&&!n&&d("p",null,t.item.description),t.editable&&!n&&Wt(t.list,"editable_item_description")&&d("button",{onClick:()=>{i(!0)}},d("span",{className:"mg-upc-icon upc-font-edit"}),""===o&&d("span",null,at("Add Comment")),""!==o&&d("span",null,at("Edit Comment"))),d("input",{ref:r,className:n?"mg-upc-dg-btn-item-desc":"mg-upc-dg-dn",type:"text",value:o,onChange:function(t){s(t.target.value)},maxLength:400}),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-cancel",onClick:()=>{i(!1),s(t.item.description)}},d("span",{className:"mg-upc-icon upc-font-close"}),d("span",null,at("Cancel"))),t.editable&&n&&d("button",{className:"mg-upc-dg-btn-item-desc-save",onClick:()=>{i(!1),t.onSaveItemDescription(o)}},d("span",{className:"mg-upc-icon upc-font-save"}),d("span",null,at("Save")))),t.editable&&Wt(t.list,"quantity")&&d("div",{className:"mg-upc-dg-quantity"},d("small",null,at("Quantity")),d("input",{"aria-label":at("Quantity"),type:"number",value:a,onChange:function(){l(event.target.value)}})),t.editable&&!n&&d("div",null,d("button",{"aria-label":"Remove item",onClick:t.onRemove},d("span",{className:"mg-upc-icon upc-font-trash"}))))},an=function(t){return new Promise((function(e,n){const i=document.createElement("script");let o=!1;i.type="text/javascript",i.src=t,i.async=!0,i.onerror=function(t){n(t,i)},i.onload=i.onreadystatechange=function(){o||this.readyState&&"complete"!=this.readyState||(o=!0,setTimeout((function(){e()}),100))},(document.head||document.body||document.documentElement).appendChild(i)}))},ln=function(t){var e,n,i;const o=z(null),s=z((e=>{t.onMove(e)}));return G((()=>{s.current=t.onMove})),G((()=>{let e=!1;if(Wt(t.list,"sortable")){const t=()=>{e=Sortable.create(o.current,{handle:".mg-upc-dg-item-handle",group:"shared",animation:150,onUpdate:function(t){s.current(t)}})};"undefined"!=typeof Sortable?t():an(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy()}})),d(_,null,d("ul",{className:"mg-upc-dg-list-fake mg-upc-dg-on-loading"},[0,1,2].map((e=>d("li",{className:"mg-upc-dg-item"},Wt(t.list,"sortable")&&d(_,null,d("span",{className:"mg-upc-dg-item-handle-skeleton"}," ",d(Zt,{width:"1.5em"})," "),d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Zt,{width:"1em"})," ")),Wt(t.list,"vote")&&d(_,null,d("span",{className:"mg-upc-dg-item-number-skeleton"}," ",d(Zt,{width:"1em"})," ")),d("div",{className:"mg-upc-dg-item-skeleton-image"},d(Zt,{width:"5em",height:"5em"})),d("div",{className:"mg-upc-dg-item-data"},d(Zt,{count:2})))))),d("ul",{ref:o,className:"mg-upc-dg-list"},0===(null==t||null===(e=t.items)||void 0===e?void 0:e.length)&&d("span",null,"There are no items in this list"),(null==t||null===(n=t.items)||void 0===n?void 0:n.length)>0&&(null===(i=t.items)||void 0===i?void 0:i.map)&&t.items.map((e=>d(sn,{list:t.list,item:e,editable:t.editable,onRemove:()=>t.onRemove(t.list,e),onSaveItemDescription:n=>t.onSaveItemDescription(t.list,e,n),onSaveItemQuantity:n=>t.onSaveItemQuantity(t.list,e,n),key:e.ID+":"+e.post_id})))),Wt(t.list,"vote")&&d("span",{className:"mg-upc-dg-total-votes"}," ",at("Total votes:")," ",d("span",null," ",t.list.vote_counter)))},rn=function(t){const e=z(null),n=z(null),i=at("Copy"),[o,s]=X(i);G((()=>{let t=null;o!==i&&(t=setTimeout((()=>{s(i),clearTimeout(t)}),2e3))}),[o]);const a=encodeURIComponent(t.link),l=encodeURIComponent(t.title);let r=[{name:"Twitter",url:"https://twitter.com/share?url="+a+"&text="+l},{name:"Facebook",url:"https://www.facebook.com/sharer/sharer.php?u="+a+""e="+l},{name:"Pinterest",url:"https://pinterest.com/pin/create/button/?url="+a+"&description="+l},{name:"Whatsapp",url:"whatsapp://send?text="+a},{name:"Telegram",url:"https://t.me/share/url?url="+a+"&text="+l},{name:"LiNE",url:"https://social-plugins.line.me/lineit/share?url="+a+"&text="+l},{slug:"email",name:at("Email"),url:"mailto:?subject="+l+"&body="+a}];return void 0!==Dt().shareButtons&&(r=r.filter((t=>Dt().shareButtons.includes(t.slug||t.name.toLowerCase())))),d("div",{className:"mg-upc-dg-share-link"},d("input",{ref:e,value:t.link,onClick:function(){e.current.setSelectionRange(0,e.current.value.length)},readOnly:!0}),d("button",{ref:n,onClick:function(t){var n;(n=e.current).focus(),n.setSelectionRange(0,n.value.length),document.execCommand&&document.execCommand("copy")?s(at("Copied!")):s("Error!")}},d("span",{className:"mg-upc-icon upc-font-copy"}),d("span",null,o)),r.map((function(t){return(e=t).slug||(e.slug=e.name.toLowerCase()),d("a",{href:e.url,title:"Share with "+e.name,className:"mg-upc-dg-share",target:"_blank",rel:"noopener"},d("div",{className:"mg-upc-share-btn-img mg-upc-share-"+e.slug}," "));var e})))},cn=function(t){var e;const{state:n,dispatch:i}=Z(zt),[o,s]=X(!1),a=z(!1),l=z(!1);function r(t){t<1||t>n.listTotalPages||"loading"===n.status||i(ve({page:t}))}return G((()=>{const t=n.list;let e=!1,o=!1;if(t&&Wt(t,"sortable")){const t=()=>{a.current&&n.listPage<n.listTotalPages&&(e=Sortable.create(a.current,{group:"shared",onAdd:t=>{i(Ne(t.oldIndex))}})),a.current&&n.listPage>1&&(o=Sortable.create(l.current,{group:"shared",onAdd:t=>{i(ke(t.oldIndex))}}))};"undefined"!=typeof Sortable?t():an(Ot()).then((()=>{t()}))}return()=>{e&&e.destroy(),o&&o.destroy()}}),[n.list,n.listPage,n.listTotalPages]),G((()=>{s(!1)}),[n.editing,n.list,n.addingPost]),d(_,null,n.editing&&d(on,{list:n.list,addingPost:n.addingPost,onSave:function(t){if(-1===n.list.ID||t.title!==n.list.title||t.content!==n.list.content||t.status!==n.list.status)if(-1===n.list.ID){var e;const o={};o.title=t.title,o.content=t.content,o.type=t.type,o.status=t.status,null!==(e=n.addingPost)&&void 0!==e&&e.post_id&&(o.adding=n.addingPost.post_id),i(he(o))}else{const e={id:n.list.ID};t.status!==n.list.status&&(e.status=t.status),t.title!==n.list.title&&(e.title=t.title),t.content!==n.list.content&&(e.content=t.content),i(ge(e))}},onCancel:function(){i(ae(!1)),-1===n.list.ID&&(i(fe(!1)),i(oe()),i(re()))}}),!n.editing&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},function(t){var e,n;const i=t.type;return Ht(i,"editable_title")||Ht(i,"editable_content")||(null===(e=Ut(i))||void 0===e||null===(n=e.available_statuses)||void 0===n?void 0:n.length)>1}(n.list)&&d("button",{className:"mg-upg-edit",onClick:()=>i(ae(!0))},d("span",{className:"mg-upc-icon upc-font-edit"}),d("span",null,at("Edit"))),n.list.link&&d("button",{className:"mg-upg-share",onClick:()=>s(!o)},d("span",{className:"mg-upc-icon upc-font-share"}),d("span",null,at("Share"))),"cart"===n.list.type&&d("button",{className:"mg-upg-share",onClick:function(){i(le(n.list.ID))}},d("span",{className:"mg-upc-icon upc-font-cart"}),d("span",null,at("Add all to cart")))),o&&n.list.link&&d(rn,{link:n.list.link,title:n.list.title}),n.list.content&&d("p",{className:"mg-upc-dg-list-desc",dangerouslySetInnerHTML:{__html:Bt(n.list.content)}}),d(Zt,{count:3}),d(ln,{list:n.list,items:(null===(e=n.list)||void 0===e?void 0:e.items)||[],onMove:function(t){i(Pe(t.oldIndex,n.list,t.newIndex))},onRemove:function(t,e){i(ye(e.post_id))},onSaveItemDescription:function(t,e,n){i(we(e.post_id,{description:n}))},onSaveItemQuantity:function(t,e,n){i(we(e.post_id,{quantity:n}))},editable:t.editable})),(!n.editing||!n.list)&&n.listTotalPages>1&&d(ie,{totalPages:n.listTotalPages,page:n.listPage,onPreview:function(){r(n.listPage-1)},onNext:function(){r(n.listPage+1)},prevRef:l,nextRef:a}))};function un(t){return parseInt(t.author,10)===parseInt(Dt().user_id,10)}function dn(){"replaceState"in history?(history.replaceState("",document.title,location.pathname),history.go(-1)):location.hash=""}D(d((t=>{const[e,n]=K(Vt,Gt);return d(zt.Provider,{value:{state:e,dispatch:Kt(n,(()=>e))}},t.children)}),null,d((function(){const{state:t,dispatch:e}=Z(zt),n=J((()=>jt(t.addingPost)),[t.addingPost]),i=z(!1);let o="listOfList";if(t.addingPost)o=t.editing?"addingToNew":"adding";else if(t.editing){var s;o=-1!==(null===(s=t.list)||void 0===s?void 0:s.ID)?"edit":"new"}else o=t.list?"list":"listOfList";const a={container:"mg-upc-dg-container",overlay:"mg-upc-dg-overlay",dialog:"mg-upc-dg-content"+(t.errorCode?" mg-upc-err-"+t.errorCode:""),title:"mg-upc-dg-title",closeButton:"mg-upc-dg-close"};G((()=>{window.showMyLists=function(){l()},window.addItemToList=function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e(oe()),n||r(t)},window.mgUpcAddListToCart=Ft}),[i.current,e]);const l=()=>{e(oe()),e(re()),i.current.show()},r=t=>{e(se({post_id:t})),e(re({addingPost:t})),i.current.show()};function c(n){n<1||n>t.totalPages||"loading"===t.status||e(de(n))}const u="list"===o||"new"===o||"edit"===o||"addingToNew"===o;return d(nn,{id:"mg-upc-dg-dialog",dialogRef:function(t){i.current=t},title:t.title,classNames:a,onBack:!!u&&function(){switch(o){case"list":default:l();break;case"new":e(fe(!1)),e(ae(!1)),l();break;case"edit":e(ae(!1));break;case"addingToNew":e(fe(!1)),e(ae(!1)),e(re({addingPost:t.addingPost.post_id}))}}},d("div",{className:"mg-upc-dg-content-wrapper mg-upc-dg-status-"+t.status+" mg-upc-dg-view-"+o},d("div",{className:"mg-upc-dg-wait"}),t.message&&d("div",{className:"mg-upc-dg-msg"},t.message,d("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:ct,payload:null})}},d("span",{className:"mg-upc-icon upc-font-close"}))),t.error&&d("div",{className:"mg-upc-dg-error"},t.error,d("a",{href:"#",className:"mg-upc-dg-alert-close","aria-label":"Hide alert",onClick:t=>{t.preventDefault(),e({type:rt,payload:null})}},d("span",{className:"mg-upc-icon upc-font-close"}))),d("div",{className:"mg-upc-dg-body"},!t.error&&t.addingPost&&d(Ie,{item:t.addingPost,onSaveItemDescription:function(n){e(se({...t.addingPost,description:n}))}}),("listOfList"===o||"adding"===o)&&d(_,null,d("div",{className:"mg-upc-dg-top-action"},n.length>0&&d("button",{className:"mg-list-new",onClick:function(t){e(ae(!0)),e(fe(!0)),i.current.show()}},d("span",{className:"mg-upc-icon upc-font-add"}),d("span",null,at("Create List")))),d(xe,{lists:t.listOfList,onSelect:function(n){e(ae(!1)),t.addingPost?e(be(n.ID,t.addingPost)):(e(fe(n)),i.current.show())},onRemove:!t.addingPost&&function(t){e(ue(t.ID))},loadPreview:function(){c(t.page-1)},loadNext:function(){c(t.page+1)}})),t.list&&d(cn,{editable:un(t.list)}))))}),null)," "),document.querySelector("body")),"#my-lists"===location.hash&&dn(),window.addEventListener("hashchange",(function(){"#my-lists"===location.hash&&(window.showMyLists(),dn())}),!1),window.mgUpcApiClient=Lt})(); -
user-post-collections/trunk/readme.txt
r2770005 r2770186 6 6 Tags: User lists, Post Collections, Woocommerce Wishlist 7 7 Tested up to: 6.0 8 Stable tag: 0.8.2 88 Stable tag: 0.8.29 9 9 Requires PHP: 7.0 10 10 … … 68 68 == Changelog == 69 69 70 = 0.8.29 = 71 * Update preact 72 70 73 = 0.8.28 = 71 74 * Fix some uninstall options -
user-post-collections/trunk/user-post-collections.php
r2770005 r2770186 4 4 Plugin URI: https://galetto.info/user-post-collections 5 5 Description: Allows users to create their post collections. 6 Version: 0.8.2 86 Version: 0.8.29 7 7 Author: Mauricio Galetto 8 8 Author URI: https://galetto.info/
Note: See TracChangeset
for help on using the changeset viewer.