FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
Edit File: 2865.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[2865],{9271:function(t,e,n){n.d(e,{a:function(){return ht},b:function(){return F},c:function(){return pt},f:function(){return T},o:function(){return B},s:function(){return W}});var i=n(9394),r=n(45),o=n(2284),a=n(4467),s=n(467),c=n(9280),l=n.n(c),u=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],f=["mainAxis","crossAxis","limiter"],d=["apply"];function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){(0,a.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t){return t.split("-")[0]}function v(t){return t.split("-")[1]}function g(t){return["top","bottom"].includes(m(t))?"x":"y"}function b(t){return"y"===t?"height":"width"}function y(t,e,n){var i,r=t.reference,o=t.floating,a=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,c=g(e),l=b(c),u=r[l]/2-o[l]/2,f="x"===c;switch(m(e)){case"top":i={x:a,y:r.y-o.height};break;case"bottom":i={x:a,y:r.y+r.height};break;case"right":i={x:r.x+r.width,y:s};break;case"left":i={x:r.x-o.width,y:s};break;default:i={x:r.x,y:r.y}}switch(v(e)){case"start":i[c]-=u*(n&&f?-1:1);break;case"end":i[c]+=u*(n&&f?-1:1)}return i}var x=function(){var t=(0,s.A)(l().mark((function t(e,n,i){var r,s,c,u,f,d,h,m,v,g,b,x,w,k,A,_,C,E,R,L,D,O,P,S,T;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.placement,s=void 0===r?"bottom":r,c=i.strategy,u=void 0===c?"absolute":c,f=i.middleware,d=void 0===f?[]:f,h=i.platform,t.next=3,null==h.isRTL?void 0:h.isRTL(n);case 3:return m=t.sent,t.next=6,h.getElementRects({reference:e,floating:n,strategy:u});case 6:v=t.sent,g=y(v,s,m),b=g.x,x=g.y,w=s,k={},A=0,_=0;case 12:if(!(_<d.length)){t.next=45;break}return C=d[_],E=C.name,R=C.fn,t.next=16,R({x:b,y:x,initialPlacement:s,placement:w,strategy:u,middlewareData:k,rects:v,platform:h,elements:{reference:e,floating:n}});case 16:if(L=t.sent,D=L.x,O=L.y,P=L.data,S=L.reset,b=null!=D?D:b,x=null!=O?O:x,k=p(p({},k),{},(0,a.A)({},E,p(p({},k[E]),P))),!(S&&A<=50)){t.next=42;break}if(A++,"object"!==(0,o.A)(S)){t.next=40;break}if(S.placement&&(w=S.placement),!S.rects){t.next=37;break}if(!0!==S.rects){t.next=35;break}return t.next=32,h.getElementRects({reference:e,floating:n,strategy:u});case 32:t.t0=t.sent,t.next=36;break;case 35:t.t0=S.rects;case 36:v=t.t0;case 37:T=y(v,w,m),b=T.x,x=T.y;case 40:return _=-1,t.abrupt("continue",42);case 42:_++,t.next=12;break;case 45:return t.abrupt("return",{x:b,y:x,placement:w,strategy:u,middlewareData:k});case 46:case"end":return t.stop()}}),t)})));return function(_x,e,n){return t.apply(this,arguments)}}();function w(t){return p(p({},t),{},{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}function k(t,e){return A.apply(this,arguments)}function A(){return A=(0,s.A)(l().mark((function t(e,n){var i,r,o,a,s,c,u,f,d,h,m,v,g,b,y,x,k,A,_,C,E,R;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===n&&(n={}),r=e.x,o=e.y,a=e.platform,s=e.rects,c=e.elements,u=e.strategy,d=(f=n).boundary,h=void 0===d?"clippingAncestors":d,m=f.rootBoundary,v=void 0===m?"viewport":m,g=f.elementContext,b=void 0===g?"floating":g,y=f.altBoundary,x=void 0!==y&&y,k=f.padding,A="number"!=typeof(l=void 0===k?0:k)?function(t){return p({top:0,right:0,bottom:0,left:0},t)}(l):{top:l,right:l,bottom:l,left:l},_="floating"===b?"reference":"floating",C=c[x?_:b],t.t0=w,t.t1=a,t.next=10,null==a.isElement?void 0:a.isElement(C);case 10:if(t.t2=i=t.sent,null==t.t2){t.next=15;break}t.t3=i,t.next=16;break;case 15:t.t3=!0;case 16:if(!t.t3){t.next=20;break}t.t4=C,t.next=26;break;case 20:if(t.t5=C.contextElement,t.t5){t.next=25;break}return t.next=24,null==a.getDocumentElement?void 0:a.getDocumentElement(c.floating);case 24:t.t5=t.sent;case 25:t.t4=t.t5;case 26:return t.t6=t.t4,t.t7=h,t.t8=v,t.t9=u,t.t10={element:t.t6,boundary:t.t7,rootBoundary:t.t8,strategy:t.t9},t.next=33,t.t1.getClippingRect.call(t.t1,t.t10);case 33:if(t.t11=t.sent,E=(0,t.t0)(t.t11),t.t12=w,!a.convertOffsetParentRelativeRectToViewportRelativeRect){t.next=49;break}return t.t14=a,t.t15="floating"===b?p(p({},s.floating),{},{x:r,y:o}):s.reference,t.next=41,null==a.getOffsetParent?void 0:a.getOffsetParent(c.floating);case 41:return t.t16=t.sent,t.t17=u,t.t18={rect:t.t15,offsetParent:t.t16,strategy:t.t17},t.next=46,t.t14.convertOffsetParentRelativeRectToViewportRelativeRect.call(t.t14,t.t18);case 46:t.t13=t.sent,t.next=50;break;case 49:t.t13=s[b];case 50:return t.t19=t.t13,R=(0,t.t12)(t.t19),t.abrupt("return",{top:E.top-R.top+A.top,bottom:R.bottom-E.bottom+A.bottom,left:E.left-R.left+A.left,right:R.right-E.right+A.right});case 53:case"end":return t.stop()}var l}),t)}))),A.apply(this,arguments)}var _=Math.min,C=Math.max;function E(t,e,n){return C(t,_(e,n))}var R={left:"right",right:"left",bottom:"top",top:"bottom"};function L(t){return t.replace(/left|right|bottom|top/g,(function(t){return R[t]}))}function D(t,e,n){void 0===n&&(n=!1);var i=v(t),r=g(t),o=b(r),a="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=L(a)),{main:a,cross:L(a)}}var O={start:"end",end:"start"};function P(t){return t.replace(/start|end/g,(function(t){return O[t]}))}function S(t){var e=L(t);return[P(t),e,P(e)]}var T=function(t){return void 0===t&&(t={}),{name:"flip",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var o,a,s,c,f,d,h,p,v,g,b,y,x,w,A,_,C,E,R,O,P,T,H,I,B,W,F,j,z,M,N,V,K,q,U;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.placement,s=e.middlewareData,c=e.rects,f=e.initialPlacement,d=e.platform,h=e.elements,v=(p=t).mainAxis,g=void 0===v||v,b=p.crossAxis,y=void 0===b||b,x=p.fallbackPlacements,w=p.fallbackStrategy,A=void 0===w?"bestFit":w,_=p.flipAlignment,C=void 0===_||_,E=(0,r.A)(p,u),R=m(a),O=R===f,P=x||(O||!C?[L(f)]:S(f)),T=[f].concat((0,i.A)(P)),n.next=8,k(e,E);case 8:if(H=n.sent,I=[],B=(null==(o=s.flip)?void 0:o.overflows)||[],g&&I.push(H[R]),!y){n.next=23;break}return n.t0=D,n.t1=a,n.t2=c,n.next=18,null==d.isRTL?void 0:d.isRTL(h.floating);case 18:n.t3=n.sent,W=(0,n.t0)(n.t1,n.t2,n.t3),F=W.main,j=W.cross,I.push(H[F],H[j]);case 23:if(B=[].concat((0,i.A)(B),[{placement:a,overflows:I}]),I.every((function(t){return t<=0}))){n.next=40;break}if(N=(null!=(z=null==(M=s.flip)?void 0:M.index)?z:0)+1,!(V=T[N])){n.next=29;break}return n.abrupt("return",{data:{index:N,overflows:B},reset:{placement:V}});case 29:K="bottom",n.t4=A,n.next="bestFit"===n.t4?33:"initialPlacement"===n.t4?36:38;break;case 33:return U=null==(q=B.map((function(t){return[t,t.overflows.filter((function(t){return t>0})).reduce((function(t,e){return t+e}),0)]})).sort((function(t,e){return t[1]-e[1]}))[0])?void 0:q[0].placement,U&&(K=U),n.abrupt("break",38);case 36:return K=f,n.abrupt("break",38);case 38:if(a===K){n.next=40;break}return n.abrupt("return",{reset:{placement:K}});case 40:return n.abrupt("return",{});case 41:case"end":return n.stop()}}),n)})))()}}};function H(t,e){return I.apply(this,arguments)}function I(){return I=(0,s.A)(l().mark((function t(e,n){var i,r,o,a,s,c,u,f,d,h,b,y,x,w;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.placement,r=e.platform,o=e.elements,t.next=3,null==r.isRTL?void 0:r.isRTL(o.floating);case 3:return a=t.sent,s=m(i),c=v(i),u="x"===g(i),f=["left","top"].includes(s)?-1:1,d=a&&u?-1:1,h="function"==typeof n?n(e):n,b="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:p({mainAxis:0,crossAxis:0,alignmentAxis:null},h),y=b.mainAxis,x=b.crossAxis,w=b.alignmentAxis,c&&"number"==typeof w&&(x="end"===c?-1*w:w),t.abrupt("return",u?{x:x*d,y:y*f}:{x:y*f,y:x*d});case 13:case"end":return t.stop()}}),t)}))),I.apply(this,arguments)}var B=function(t){return void 0===t&&(t=0),{name:"offset",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var i,r,o;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.x,r=e.y,n.next=3,H(e,t);case 3:return o=n.sent,n.abrupt("return",{x:i+o.x,y:r+o.y,data:o});case 5:case"end":return n.stop()}}),n)})))()}}},W=function(t){return void 0===t&&(t={}),{name:"shift",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var i,o,s,c,u,d,h,v,b,y,x,w,A,_,C,R,L,D,O,P,S,T,H,I;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.x,o=e.y,s=e.placement,u=(c=t).mainAxis,d=void 0===u||u,h=c.crossAxis,v=void 0!==h&&h,b=c.limiter,y=void 0===b?{fn:function(t){return{x:t.x,y:t.y}}}:b,x=(0,r.A)(c,f),w={x:i,y:o},n.next=5,k(e,x);case 5:return A=n.sent,_=g(m(s)),C="x"===_?"y":"x",R=w[_],L=w[C],d&&(D="y"===_?"bottom":"right",O=R+A["y"===_?"top":"left"],P=R-A[D],R=E(O,R,P)),v&&(S="y"===C?"bottom":"right",T=L+A["y"===C?"top":"left"],H=L-A[S],L=E(T,L,H)),I=y.fn(p(p({},e),{},(0,a.A)((0,a.A)({},_,R),C,L))),n.abrupt("return",p(p({},I),{},{data:{x:I.x-i,y:I.y-o}}));case 14:case"end":return n.stop()}}),n)})))()}}},F=function(t){return void 0===t&&(t={}),{name:"size",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var i,o,a,s,c,u,f,h,g,b,y,x,w,A,_,E,R,L,D;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=e.placement,o=e.rects,a=e.platform,s=e.elements,u=(c=t).apply,f=(0,r.A)(c,d),n.next=4,k(e,f);case 4:if(h=n.sent,g=m(i),b=v(i),"top"!==g&&"bottom"!==g){n.next=26;break}return y=g,n.t0=b,n.next=12,null==a.isRTL?void 0:a.isRTL(s.floating);case 12:if(!n.sent){n.next=16;break}n.t1="start",n.next=17;break;case 16:n.t1="end";case 17:if(n.t2=n.t1,n.t0!==n.t2){n.next=22;break}n.t3="left",n.next=23;break;case 22:n.t3="right";case 23:x=n.t3,n.next=28;break;case 26:x=g,y="end"===b?"top":"bottom";case 28:return w=C(h.left,0),A=C(h.right,0),_=C(h.top,0),E=C(h.bottom,0),R={availableHeight:o.floating.height-(["left","right"].includes(i)?2*(0!==_||0!==E?_+E:C(h.top,h.bottom)):h[y]),availableWidth:o.floating.width-(["top","bottom"].includes(i)?2*(0!==w||0!==A?w+A:C(h.left,h.right)):h[x])},n.next=35,a.getDimensions(s.floating);case 35:return L=n.sent,null==u||u(p(p({},e),R)),n.next=39,a.getDimensions(s.floating);case 39:if(D=n.sent,L.width===D.width&&L.height===D.height){n.next=42;break}return n.abrupt("return",{reset:{rects:!0}});case 42:return n.abrupt("return",{});case 43:case"end":return n.stop()}}),n)})))()}}};function j(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function z(t){if(null==t)return window;if(!j(t)){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function M(t){return z(t).getComputedStyle(t)}function N(t){return j(t)?"":t?(t.nodeName||"").toLowerCase():""}function V(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function K(t){return t instanceof z(t).HTMLElement}function q(t){return t instanceof z(t).Element}function U(t){return"undefined"!=typeof ShadowRoot&&(t instanceof z(t).ShadowRoot||t instanceof ShadowRoot)}function X(t){var e=M(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function Y(t){return["table","td","th"].includes(N(t))}function G(t){var e=/firefox/i.test(V()),n=M(t);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter}function J(){return!/^((?!chrome|android).)*safari/i.test(V())}var Q=Math.min,Z=Math.max,$=Math.round;function tt(t,e,n){var i,r,o,a;void 0===e&&(e=!1),void 0===n&&(n=!1);var s=t.getBoundingClientRect(),c=1,l=1;e&&K(t)&&(c=t.offsetWidth>0&&$(s.width)/t.offsetWidth||1,l=t.offsetHeight>0&&$(s.height)/t.offsetHeight||1);var u=q(t)?z(t):window,f=!J()&&n,d=(s.left+(f&&null!=(i=null==(r=u.visualViewport)?void 0:r.offsetLeft)?i:0))/c,h=(s.top+(f&&null!=(o=null==(a=u.visualViewport)?void 0:a.offsetTop)?o:0))/l,p=s.width/c,m=s.height/l;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d,x:d,y:h}}function et(t){return(e=t,(e instanceof z(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function nt(t){return q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function it(t){return tt(et(t)).left+nt(t).scrollLeft}function rt(t,e,n){var i=K(e),r=et(e),o=tt(t,i&&function(t){var e=tt(t);return $(e.width)!==t.offsetWidth||$(e.height)!==t.offsetHeight}(e),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(i||!i&&"fixed"!==n)if(("body"!==N(e)||X(r))&&(a=nt(e)),K(e)){var c=tt(e,!0);s.x=c.x+e.clientLeft,s.y=c.y+e.clientTop}else r&&(s.x=it(r));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function ot(t){return"html"===N(t)?t:t.assignedSlot||t.parentNode||(U(t)?t.host:null)||et(t)}function at(t){return K(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function st(t){for(var e=z(t),n=at(t);n&&Y(n)&&"static"===getComputedStyle(n).position;)n=at(n);return n&&("html"===N(n)||"body"===N(n)&&"static"===getComputedStyle(n).position&&!G(n))?e:n||function(t){var e=ot(t);for(U(e)&&(e=e.host);K(e)&&!["html","body"].includes(N(e));){if(G(e))return e;e=e.parentNode}return null}(t)||e}function ct(t){if(K(t))return{width:t.offsetWidth,height:t.offsetHeight};var e=tt(t);return{width:e.width,height:e.height}}function lt(t){var e=ot(t);return["html","body","#document"].includes(N(e))?t.ownerDocument.body:K(e)&&X(e)?e:lt(e)}function ut(t,e){var n;void 0===e&&(e=[]);var i=lt(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=z(i),a=r?[o].concat(o.visualViewport||[],X(i)?i:[]):i,s=e.concat(a);return r?s:s.concat(ut(a))}function ft(t,e,n){return"viewport"===e?w(function(t,e){var n=z(t),i=et(t),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,c=0;if(r){o=r.width,a=r.height;var l=J();(l||!l&&"fixed"===e)&&(s=r.offsetLeft,c=r.offsetTop)}return{width:o,height:a,x:s,y:c}}(t,n)):q(e)?function(t,e){var n=tt(t,!1,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft;return{top:i,left:r,x:r,y:i,right:r+t.clientWidth,bottom:i+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(e,n):w(function(t){var e,n=et(t),i=nt(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Z(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Z(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+it(t),c=-i.scrollTop;return"rtl"===M(r||n).direction&&(s+=Z(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}(et(t)))}var dt={getClippingRect:function(t){var e=t.element,n=t.boundary,r=t.rootBoundary,o=t.strategy,a="clippingAncestors"===n?function(t){var e=ut(t),n=["absolute","fixed"].includes(M(t).position)&&K(t)?st(t):t;return q(n)?e.filter((function(t){return q(t)&&function(t,e){var n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&U(n)){var i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}(t,n)&&"body"!==N(t)})):[]}(e):[].concat(n),s=[].concat((0,i.A)(a),[r]),c=s[0],l=s.reduce((function(t,n){var i=ft(e,n,o);return t.top=Z(i.top,t.top),t.right=Q(i.right,t.right),t.bottom=Q(i.bottom,t.bottom),t.left=Z(i.left,t.left),t}),ft(e,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){var e=t.rect,n=t.offsetParent,i=t.strategy,r=K(n),o=et(n);if(n===o)return e;var a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((r||!r&&"fixed"!==i)&&(("body"!==N(n)||X(o))&&(a=nt(n)),K(n))){var c=tt(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return p(p({},e),{},{x:e.x-a.scrollLeft+s.x,y:e.y-a.scrollTop+s.y})},isElement:q,getDimensions:ct,getOffsetParent:st,getDocumentElement:et,getElementRects:function(t){var e=t.reference,n=t.floating,i=t.strategy;return{reference:rt(e,st(n),i),floating:p(p({},ct(n)),{},{x:0,y:0})}},getClientRects:function(t){return Array.from(t.getClientRects())},isRTL:function(t){return"rtl"===M(t).direction}};function ht(t,e,n,r){void 0===r&&(r={});var o=r,a=o.ancestorScroll,s=void 0===a||a,c=o.ancestorResize,l=void 0===c||c,u=o.elementResize,f=void 0===u||u,d=o.animationFrame,h=void 0!==d&&d,p=s&&!h,m=l&&!h,v=p||m?[].concat((0,i.A)(q(t)?ut(t):[]),(0,i.A)(ut(e))):[];v.forEach((function(t){p&&t.addEventListener("scroll",n,{passive:!0}),m&&t.addEventListener("resize",n)}));var g,b=null;if(f){var y=!0;b=new ResizeObserver((function(){y||n(),y=!1})),q(t)&&!h&&b.observe(t),b.observe(e)}var x=h?tt(t):null;return h&&function e(){var i=tt(t);!x||i.x===x.x&&i.y===x.y&&i.width===x.width&&i.height===x.height||n(),x=i,g=requestAnimationFrame(e)}(),n(),function(){var t;v.forEach((function(t){p&&t.removeEventListener("scroll",n),m&&t.removeEventListener("resize",n)})),null==(t=b)||t.disconnect(),b=null,h&&cancelAnimationFrame(g)}}var pt=function(t,e,n){return x(t,e,p({platform:dt},n))}},6402:function(t,e,n){function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite",e=document.createElement("div");e.id="a11y-speak-".concat(t),e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");var n=document.body;return n&&n.appendChild(e),e}n.d(e,{s:function(){return a}});var r,o="";function a(t,e){!function(){for(var t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text"),n=0;n<t.length;n++)t[n].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/g," "),o===t&&(t+=" "),o=t,t}(t);var n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");i&&"assertive"===e?i.textContent=t:r&&(r.textContent=t),n&&n.removeAttribute("hidden")}r=function(){var t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){var t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=wp.i18n.__("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");var e=document.body;e&&e.appendChild(t)}(),null===e&&i("assertive"),null===n&&i("polite")},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",r):r())},4493:function(t,e,n){function i(){return"rtl"===document.dir}n.d(e,{i:function(){return i}})},2865:function(t,e,n){n.r(e),n.d(e,{sc_dropdown:function(){return m},sc_menu:function(){return v},sc_menu_item:function(){return g}});var i=n(467),r=n(9394),o=n(3029),a=n(2901),s=n(9280),c=n.n(s),l=n(1346),u=n(9271),f=n(6402),d=n(4493),h=0,p="",m=function(){return(0,a.A)((function t(e){(0,o.A)(this,t),(0,l.r)(this,e),this.scShow=(0,l.c)(this,"scShow",7),this.scHide=(0,l.c)(this,"scHide",7),this.clickEl=void 0,this.disabled=void 0,this.open=!1,this.position=void 0,this.placement="bottom-start",this.distance=10,this.skidding=0,this.hoist=!1,this.closeOnSelect=!0,this.isVisible=void 0}),[{key:"handleOpenChange",value:function(){this.open?this.show():this.hide()}},{key:"handleOutsideClick",value:function(t){var e=this;t.composedPath().some((function(t){return t===e.el}))||(this.open=!1)}},{key:"startPositioner",value:function(){this.stopPositioner(),this.updatePositioner(),this.positionerCleanup=(0,u.a)(this.trigger,this.positioner,this.updatePositioner.bind(this))}},{key:"updatePositioner",value:function(){var t=this;this.open&&this.trigger&&this.positioner&&(0,u.c)(this.trigger,this.positioner,{placement:this.placement,middleware:[(0,u.o)({mainAxis:this.distance,crossAxis:this.skidding}),(0,u.f)(),(0,u.s)(),(0,u.b)({apply:function(e){var n=e.availableWidth,i=e.availableHeight;Object.assign(t.panel.style,{maxWidth:"".concat(n,"px"),maxHeight:"".concat(i,"px")})},padding:8})],strategy:this.hoist?"fixed":"absolute"}).then((function(e){var n=e.x,i=e.y,r=e.placement;t.positioner.setAttribute("data-placement",r),Object.assign(t.positioner.style,{position:t.hoist?"fixed":"absolute",left:"".concat(n,"px"),top:"".concat(i,"px"),right:"auto"})}))}},{key:"stopPositioner",value:function(){this.positionerCleanup&&(this.positionerCleanup(),this.positionerCleanup=void 0,this.positioner.removeAttribute("data-placement"))}},{key:"show",value:function(){(0,f.s)(wp.i18n.__("Menu Selection Dropdown opened. Press Up/Down arrow to toggle between menu items.","surecart"),"assertive"),this.scShow.emit(),this.isVisible||(this.isVisible=!0,this.open=!0,this.startPositioner(),this.panel.focus())}},{key:"hide",value:function(){(0,f.s)(wp.i18n.__("Menu Selection Dropdown closed.","surecart"),"assertive"),this.scHide.emit(),this.isVisible&&(this.stopPositioner(),this.isVisible=!1,this.open=!1,this.el.shadowRoot.querySelector('slot[name="trigger"]').assignedElements({flatten:!0})[0].focus())}},{key:"handleClick",value:function(t){this.closeOnSelect&&t.composedPath().some((function(t){return t.classList&&t.classList.contains("menu-item")}))&&(this.open=!1)}},{key:"componentWillLoad",value:function(){var t=this;document.addEventListener("mousedown",(function(e){return t.handleOutsideClick(e)}))}},{key:"getMenu",value:function(){return this.el.shadowRoot.querySelector("slot").assignedNodes().find((function(t){return"sc-menu"===t.nodeName}))}},{key:"getItems",value:function(){return(0,r.A)(this.el.querySelectorAll("sc-menu-item"))}},{key:"handleHide",value:function(){this.open=!1,h=0,this.trigger.focus()}},{key:"handleKeyDown",value:function(t){var e=this.getItems();if("Tab"!==t.key){if(["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),t.stopImmediatePropagation(),this.open||(this.open=!0),"ArrowDown"===t.key)return"up"==p&&(h+=2),h>e.length-1&&(h=0),e[h].setFocus(),p="down",void h++;if("ArrowUp"===t.key)return"down"==p&&(h-=2),h<0&&(h=e.length-1),e[h].setFocus(),p="up",void h--}"Escape"!==t.key?("Enter"===t.key&&(this.open?this.handleHide():(t.stopImmediatePropagation(),t.preventDefault(),this.open=!0)),!t.ctrlKey&&t.metaKey):this.open&&this.handleHide()}else this.open&&this.handleHide()}},{key:"render",value:function(){var t=this;return(0,l.h)("div",{key:"3dea7e493e11ac1318d9b7b19cf7553748d93684",part:"base",class:{dropdown:!0,"dropdown--open":this.open,"dropdown--disabled":this.disabled}},(0,l.h)("span",{key:"abed75deab77bfeb4f3f41d5459cf70510287840",part:"trigger",class:"dropdown__trigger",ref:function(e){return t.trigger=e},onClick:function(){t.disabled||(t.open?t.hide():setTimeout((function(){t.show()}),0))},"aria-expanded":this.open?"true":"false","aria-haspopup":"true"},(0,l.h)("slot",{key:"356c58e3c99c410156dc8b05dc0518ae58d7a7bc",name:"trigger"})),(0,l.h)("div",{key:"946e5ee224af74ce9fa9419bb1ba68ac13553599",class:"dropdown__positioner",ref:function(e){return t.positioner=e}},(0,l.h)("div",{key:"0672633f41fb3a3cf964f0e60f4cce2b6566f9c0",part:"panel",class:{dropdown__panel:!0,"position--top-left":"top-left"===this.position,"position--top-right":"top-right"===this.position,"position--bottom-left":"bottom-left"===this.position,"position--bottom-right":"bottom-right"===this.position},"aria-orientation":"vertical",tabindex:"-1",onClick:function(e){return t.handleClick(e)},ref:function(e){return t.panel=e}},(0,l.h)("slot",{key:"8d11701d9361dfe1eb42d8889aea056c37230922"}))))}},{key:"el",get:function(){return(0,l.a)(this)}}],[{key:"watchers",get:function(){return{open:["handleOpenChange"]}}}])}();m.style=":host{display:inline-block;--panel-height:75vh;--panel-width:11rem}.dropdown{position:relative}.dropdown.dropdown--open .dropdown__positioner{visibility:visible;opacity:1;transform:scale(1)}.dropdown__trigger{display:block;cursor:pointer;border-width:0;outline:none;background-color:unset}.dropdown--disabled,.dropdown--disabled .dropdown__trigger{cursor:not-allowed}.dropdown__positioner{position:absolute;right:0;width:100%;z-index:var(--sc-z-index-dropdown);opacity:0;visibility:hidden;transform:scale(0.9);min-width:var(--panel-width)}.dropdown__panel{transform-origin:top left;box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);max-height:var(--panel-height);font-family:var(--sc-font-sans);font-size:var(--sc-font-size-medium);font-weight:var(--sc-font-weight-normal);color:var(--color);background-color:var(--sc-panel-background-color);border:solid 1px var(--sc-panel-border-color);border-radius:var(--sc-border-radius-medium);box-shadow:var(--sc-shadow-large);overflow:auto;overscroll-behavior:none;transition:var(--sc-transition-fast) opacity, var(--sc-transition-fast) transform;z-index:5}";var v=function(){return(0,a.A)((function t(e){(0,o.A)(this,t),(0,l.r)(this,e),this.scSelect=(0,l.c)(this,"scSelect",7),this.items=[],this.ariaLabel=void 0}),[{key:"handleClick",value:function(t){var e=t.target.closest("sc-menu-item");e&&!e.disabled&&this.scSelect.emit({item:e})}},{key:"handleKeyDown",value:function(t){if("Enter"===t.key){var e=this.getCurrentItem();t.preventDefault(),e&&this.scSelect.emit({item:e}),(0,f.s)(wp.i18n.sprintf(wp.i18n.__("Menu %s selected","surecart"),e.textContent),"assertive")}if(" "===t.key&&t.preventDefault(),["ArrowDown","ArrowUp","Home","End"].includes(t.key)){var n=this.getCurrentItem(),i=n?this.items.indexOf(n):0;if(this.items.length)return t.preventDefault(),"ArrowDown"===t.key?i++:"ArrowUp"===t.key?i--:"Home"===t.key?i=0:"End"===t.key&&(i=this.items.length-1),i<0&&(i=0),i>this.items.length-1&&(i=this.items.length-1),void this.setCurrentItem(this.items[i])}}},{key:"getCurrentItem",value:function(){return this.items.find((function(t){return"0"===t.getAttribute("tabindex")}))}},{key:"setCurrentItem",value:(t=(0,i.A)(c().mark((function t(e){var n;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.disabled?this.items[0]:e,this.items.forEach((function(t){t.setAttribute("tabindex",t===n?"0":"-1")}));case 2:case"end":return t.stop()}}),t,this)}))),function(_x){return t.apply(this,arguments)})},{key:"syncItems",value:function(){var t=this.el.shadowRoot.querySelector("slot").assignedElements({flatten:!0});this.items=t.filter((function(t){return"sc-menu-item"===t.nodeName}))}},{key:"handleSlotChange",value:function(){this.syncItems()}},{key:"render",value:function(){var t=this;return(0,l.h)("div",{key:"27ffe82cef0f11d1ce2bf17c39f658dc441c3caa",part:"base",class:"menu",tabindex:"0",onKeyDown:function(e){return t.handleKeyDown(e)}},(0,l.h)("slot",{key:"2a069a8c87c61a4f13a698ade04337bbd1c38f9f",onSlotchange:function(){return t.handleSlotChange()}}))}},{key:"el",get:function(){return(0,l.a)(this)}}]);var t}();v.style=":host{display:block}.menu{padding:var(--sc-spacing-x-small) 0}.menu:focus{outline:none}::slotted(sc-input){margin-top:-var(--sc-spacing-x-small)}::slotted(sc-divider){--spacing:var(--sc-spacing-x-small)}";var g=function(){return(0,a.A)((function t(e){(0,o.A)(this,t),(0,l.r)(this,e),this.hasFocus=!1,this.href=void 0,this.target=void 0,this.checked=!1,this.value="",this.disabled=!1}),[{key:"setFocus",value:(e=(0,i.A)(c().mark((function t(e){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.menuItem.focus(e);case 1:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"setBlur",value:(t=(0,i.A)(c().mark((function t(){return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.menuItem.blur();case 1:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"handleBlur",value:function(){this.hasFocus=!1}},{key:"handleFocus",value:function(){this.hasFocus=!0}},{key:"render",value:function(){var t=this,e=this.href?"a":"div";return(0,l.h)(e,{key:"f89b5d378b16723785f102b97c05769decc195c7",ref:function(e){return t.menuItem=e},part:"base",class:{"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--focused":this.hasFocus,"menu-item--is-rtl":(0,d.i)()},href:this.href,role:"menuitem","aria-disabled":this.disabled?"true":"false","aria-checked":this.checked?"true":"false",tabindex:this.disabled?void 0:"0",onFocus:function(){return t.handleFocus()},onBlur:function(){return t.handleBlur()},onMouseEnter:function(){return t.handleFocus()},onMouseLeave:function(){return t.handleBlur()},onKeyDown:function(e){" "!==e.key&&"Spacebar"!==e.key&&"Enter"!==e.key||t.menuItem.click()},"aria-label":this.el.innerText,target:this.target},(0,l.h)("span",{key:"d933bc5b9b0f76d393a9f32e846888cd2d182581",part:"checked-icon",class:"menu-item__check"},(0,l.h)("svg",{key:"4246de6473ed54a7de4477505b83e883b4aadc44",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-check",viewBox:"0 0 16 16"},(0,l.h)("path",{key:"e9ca638f0d8b480624bb816d2ce1de2b30ccad8d",d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"}))),(0,l.h)("span",{key:"8c18ef3d2f522852f471c40c51bea9c963ab1fbc",part:"prefix",class:"menu-item__prefix"},(0,l.h)("slot",{key:"271fdaf85b539bcc4cb078651dcd0c46d9b79f6e",name:"prefix"})),(0,l.h)("span",{key:"861e1a1fca1f9e1246cd1bc1d8de52305be81d8f",part:"label",class:"menu-item__label"},(0,l.h)("slot",{key:"a7a11ccccc1f8cf50e14ad629f80ea1620ba8ca8"})),(0,l.h)("span",{key:"173926dcf01b262fc38e5c7cc4372658221fe78a",part:"suffix",class:"menu-item__suffix"},(0,l.h)("slot",{key:"8fa9848d3432980111a10156be0c8c923636e937",name:"suffix"})))}},{key:"el",get:function(){return(0,l.a)(this)}}]);var t,e}();g.style=":host{display:block}.menu-item{position:relative;display:flex;align-items:stretch;font-family:var(--sc-font-sans);font-size:var(--sc-font-size-medium);font-weight:var(--sc-font-weight-normal);line-height:var(--sc-menu-item-line-height, var(--sc-line-height-normal));letter-spacing:var(--sc-letter-spacing-normal);text-align:left;color:var(--sc-menu-item-color, var(--sc-color-gray-700));padding:var(--sc-spacing-xx-small) var(--sc-spacing-x-large);transition:var(--sc-input-transition, var(--sc-transition-medium)) fill, var(--sc-input-transition, var(--sc-transition-medium)) background-color;user-select:none;white-space:var(--sc-menu-item-white-space, nowrap);text-wrap:auto;cursor:pointer;text-decoration:none}.menu-item.menu-item--focused:not(.menu-item--disabled){outline:none;background-color:var(--sc-menu-item-background-focused, var(--sc-color-primary-500));color:var(--sc-color-white)}.menu-item.menu-item--disabled{outline:none;color:var(--sc-color-gray-400);cursor:not-allowed}.menu-item .menu-item__label{flex:1 1 auto}.menu-item .menu-item__prefix{flex:0 0 auto;display:flex;align-items:center}.menu-item .menu-item__prefix ::slotted(*){display:inline-flex;margin-right:var(--sc-spacing-small)}.menu-item .menu-item__suffix{flex:0 0 auto;display:flex;align-items:center}.menu-item .menu-item__suffix ::slotted(*){margin-left:var(--sc-spacing-x-small);text-align:right}.menu-item .menu-item__check{display:flex;position:absolute;left:0.5em;top:0.6em;visibility:hidden;align-items:center;font-size:inherit}.menu-item--checked .menu-item__check{visibility:visible}.menu-item--is-rtl.menu-item{text-align:right}.menu-item--is-rtl.menu-item .menu-item__check{left:auto;right:0.5em}"}}]);
Save
Back