whoami7 - Manager
:
/
home
/
dataiclx
/
vielorbe.com
/
wp-content
/
plugins
/
surecart
/
dist
/
components
/
components
/
Upload File:
files >> //home/dataiclx/vielorbe.com/wp-content/plugins/surecart/dist/components/components/dropdown.js
import{proxyCustomElement,HTMLElement,createEvent,h}from"@stencil/core/internal/client";import{s as speak}from"./index2.js";function getSide(t){return t.split("-")[0]}function getAlignment(t){return t.split("-")[1]}function getMainAxisFromPlacement(t){return["top","bottom"].includes(getSide(t))?"x":"y"}function getLengthFromAxis(t){return"y"===t?"height":"width"}function computeCoordsFromPlacement(t,e,n){let{reference:o,floating:i}=t;const s=o.x+o.width/2-i.width/2,r=o.y+o.height/2-i.height/2,l=getMainAxisFromPlacement(e),a=getLengthFromAxis(l),c=o[a]/2-i[a]/2,d="x"===l;let g;switch(getSide(e)){case"top":g={x:s,y:o.y-i.height};break;case"bottom":g={x:s,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:r};break;case"left":g={x:o.x-i.width,y:r};break;default:g={x:o.x,y:o.y}}switch(getAlignment(e)){case"start":g[l]-=c*(n&&d?-1:1);break;case"end":g[l]+=c*(n&&d?-1:1)}return g}const computePosition$1=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=await(null==r.isRTL?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:d}=computeCoordsFromPlacement(a,o,l),g=o,f={},m=0;for(let n=0;n<s.length;n++){const{name:p,fn:h}=s[n],{x:u,y:w,data:x,reset:y}=await h({x:c,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:f,rects:a,platform:r,elements:{reference:t,floating:e}});c=null!=u?u:c,d=null!=w?w:d,f={...f,[p]:{...f[p],...x}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(g=y.placement),y.rects&&(a=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:i}):y.rects),({x:c,y:d}=computeCoordsFromPlacement(a,g,l))),n=-1)}return{x:c,y:d,placement:g,strategy:i,middlewareData:f}};function expandPaddingObject(t){return{top:0,right:0,bottom:0,left:0,...t}}function getSideObjectFromPadding(t){return"number"!=typeof t?expandPaddingObject(t):{top:t,right:t,bottom:t,left:t}}function rectToClientRect(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function detectOverflow(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:g="floating",altBoundary:f=!1,padding:m=0}=e,p=getSideObjectFromPadding(m),h=l[f?"floating"===g?"reference":"floating":g],u=rectToClientRect(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(h)))||n?h:h.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:a})),w=rectToClientRect(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===g?{...r.floating,x:o,y:i}:r.reference,offsetParent:await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),strategy:a}):r[g]);return{top:u.top-w.top+p.top,bottom:w.bottom-u.bottom+p.bottom,left:u.left-w.left+p.left,right:w.right-u.right+p.right}}const min$1=Math.min,max$1=Math.max;function within(t,e,n){return max$1(t,min$1(e,n))}const hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(t){return t.replace(/left|right|bottom|top/g,(t=>hash$1[t]))}function getAlignmentSides(t,e,n){void 0===n&&(n=!1);const o=getAlignment(t),i=getMainAxisFromPlacement(t),s=getLengthFromAxis(i);let r="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=getOppositePlacement(r)),{main:r,cross:getOppositePlacement(r)}}const hash={start:"end",end:"start"};function getOppositeAlignmentPlacement(t){return t.replace(/start|end/g,(t=>hash[t]))}function getExpandedPlacements(t){const e=getOppositePlacement(t);return[getOppositeAlignmentPlacement(t),e,getOppositeAlignmentPlacement(e)]}const flip=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:o,middlewareData:i,rects:s,initialPlacement:r,platform:l,elements:a}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:f="bestFit",flipAlignment:m=!0,...p}=t,h=getSide(o),u=[r,...g||(h!==r&&m?getExpandedPlacements(r):[getOppositePlacement(r)])],w=await detectOverflow(e,p),x=[];let y=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&x.push(w[h]),d){const{main:t,cross:e}=getAlignmentSides(o,s,await(null==l.isRTL?void 0:l.isRTL(a.floating)));x.push(w[t],w[e])}if(y=[...y,{placement:o,overflows:x}],!x.every((t=>t<=0))){var v,b;const t=(null!=(v=null==(b=i.flip)?void 0:b.index)?v:0)+1,e=u[t];if(e)return{data:{index:t,overflows:y},reset:{placement:e}};let n="bottom";switch(f){case"bestFit":{var R;const t=null==(R=y.map((t=>[t,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:R[0].placement;t&&(n=t);break}case"initialPlacement":n=r}if(o!==n)return{reset:{placement:n}}}return{}}}};async function convertValueToCoords(t,e){const{placement:n,platform:o,elements:i}=t,s=await(null==o.isRTL?void 0:o.isRTL(i.floating)),r=getSide(n),l=getAlignment(n),a="x"===getMainAxisFromPlacement(n),c=["left","top"].includes(r)?-1:1,d=s&&a?-1:1,g="function"==typeof e?e(t):e;let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return l&&"number"==typeof p&&(m="end"===l?-1*p:p),a?{x:m*d,y:f*c}:{x:f*c,y:m*d}}const offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await convertValueToCoords(e,t);return{x:n+i.x,y:o+i.y,data:i}}}};function getCrossAxis(t){return"x"===t?"y":"x"}const shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...a}=t,c={x:n,y:o},d=await detectOverflow(e,a),g=getMainAxisFromPlacement(getSide(i)),f=getCrossAxis(g);let m=c[g],p=c[f];if(s){const t="y"===g?"bottom":"right";m=within(m+d["y"===g?"top":"left"],m,m-d[t])}if(r){const t="y"===f?"bottom":"right";p=within(p+d["y"===f?"top":"left"],p,p-d[t])}const h=l.fn({...e,[g]:m,[f]:p});return{...h,data:{x:h.x-n,y:h.y-o}}}}},size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:s}=e,{apply:r,...l}=t,a=await detectOverflow(e,l),c=getSide(n),d=getAlignment(n);let g,f;"top"===c||"bottom"===c?(g=c,f=d===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(f=c,g="end"===d?"top":"bottom");const m=max$1(a.left,0),p=max$1(a.right,0),h=max$1(a.top,0),u=max$1(a.bottom,0),w={availableHeight:o.floating.height-(["left","right"].includes(n)?2*(0!==h||0!==u?h+u:max$1(a.top,a.bottom)):a[g]),availableWidth:o.floating.width-(["top","bottom"].includes(n)?2*(0!==m||0!==p?m+p:max$1(a.left,a.right)):a[f])},x=await i.getDimensions(s.floating);null==r||r({...e,...w});const y=await i.getDimensions(s.floating);return x.width!==y.width||x.height!==y.height?{reset:{rects:!0}}:{}}}};function isWindow(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function getWindow(t){if(null==t)return window;if(!isWindow(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function getComputedStyle$1(t){return getWindow(t).getComputedStyle(t)}function getNodeName(t){return isWindow(t)?"":t?(t.nodeName||"").toLowerCase():""}function getUAString(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function isHTMLElement(t){return t instanceof getWindow(t).HTMLElement}function isElement(t){return t instanceof getWindow(t).Element}function isNode(t){return t instanceof getWindow(t).Node}function isShadowRoot(t){return"undefined"!=typeof ShadowRoot&&(t instanceof getWindow(t).ShadowRoot||t instanceof ShadowRoot)}function isOverflowElement(t){const{overflow:e,overflowX:n,overflowY:o}=getComputedStyle$1(t);return/auto|scroll|overlay|hidden/.test(e+o+n)}function isTableElement(t){return["table","td","th"].includes(getNodeName(t))}function isContainingBlock(t){const e=/firefox/i.test(getUAString()),n=getComputedStyle$1(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 isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}const min=Math.min,max=Math.max,round=Math.round;function getBoundingClientRect(t,e,n){var o,i,s,r;void 0===e&&(e=!1),void 0===n&&(n=!1);const l=t.getBoundingClientRect();let a=1,c=1;e&&isHTMLElement(t)&&(a=t.offsetWidth>0&&round(l.width)/t.offsetWidth||1,c=t.offsetHeight>0&&round(l.height)/t.offsetHeight||1);const d=isElement(t)?getWindow(t):window,g=!isLayoutViewport()&&n,f=(l.left+(g&&null!=(o=null==(i=d.visualViewport)?void 0:i.offsetLeft)?o:0))/a,m=(l.top+(g&&null!=(s=null==(r=d.visualViewport)?void 0:r.offsetTop)?s:0))/c,p=l.width/a,h=l.height/c;return{width:p,height:h,top:m,right:f+p,bottom:m+h,left:f,x:f,y:m}}function getDocumentElement(t){return((isNode(t)?t.ownerDocument:t.document)||window.document).documentElement}function getNodeScroll(t){return isElement(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function getWindowScrollBarX(t){return getBoundingClientRect(getDocumentElement(t)).left+getNodeScroll(t).scrollLeft}function isScaled(t){const e=getBoundingClientRect(t);return round(e.width)!==t.offsetWidth||round(e.height)!==t.offsetHeight}function getRectRelativeToOffsetParent(t,e,n){const o=isHTMLElement(e),i=getDocumentElement(e),s=getBoundingClientRect(t,o&&isScaled(e),"fixed"===n);let r={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(o||!o&&"fixed"!==n)if(("body"!==getNodeName(e)||isOverflowElement(i))&&(r=getNodeScroll(e)),isHTMLElement(e)){const t=getBoundingClientRect(e,!0);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&(l.x=getWindowScrollBarX(i));return{x:s.left+r.scrollLeft-l.x,y:s.top+r.scrollTop-l.y,width:s.width,height:s.height}}function getParentNode(t){return"html"===getNodeName(t)?t:t.assignedSlot||t.parentNode||(isShadowRoot(t)?t.host:null)||getDocumentElement(t)}function getTrueOffsetParent(t){return isHTMLElement(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function getContainingBlock(t){let e=getParentNode(t);for(isShadowRoot(e)&&(e=e.host);isHTMLElement(e)&&!["html","body"].includes(getNodeName(e));){if(isContainingBlock(e))return e;e=e.parentNode}return null}function getOffsetParent(t){const e=getWindow(t);let n=getTrueOffsetParent(t);for(;n&&isTableElement(n)&&"static"===getComputedStyle(n).position;)n=getTrueOffsetParent(n);return n&&("html"===getNodeName(n)||"body"===getNodeName(n)&&"static"===getComputedStyle(n).position&&!isContainingBlock(n))?e:n||getContainingBlock(t)||e}function getDimensions(t){if(isHTMLElement(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=getBoundingClientRect(t);return{width:e.width,height:e.height}}function convertOffsetParentRelativeRectToViewportRelativeRect(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=isHTMLElement(n),s=getDocumentElement(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((i||!i&&"fixed"!==o)&&(("body"!==getNodeName(n)||isOverflowElement(s))&&(r=getNodeScroll(n)),isHTMLElement(n))){const t=getBoundingClientRect(n,!0);l.x=t.x+n.clientLeft,l.y=t.y+n.clientTop}return{...e,x:e.x-r.scrollLeft+l.x,y:e.y-r.scrollTop+l.y}}function getViewportRect(t,e){const n=getWindow(t),o=getDocumentElement(t),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,a=0;if(i){s=i.width,r=i.height;const t=isLayoutViewport();(t||!t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}return{width:s,height:r,x:l,y:a}}function getDocumentRect(t){var e;const n=getDocumentElement(t),o=getNodeScroll(t),i=null==(e=t.ownerDocument)?void 0:e.body,s=max(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),r=max(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let l=-o.scrollLeft+getWindowScrollBarX(t);const a=-o.scrollTop;return"rtl"===getComputedStyle$1(i||n).direction&&(l+=max(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:r,x:l,y:a}}function getNearestOverflowAncestor(t){const e=getParentNode(t);return["html","body","#document"].includes(getNodeName(e))?t.ownerDocument.body:isHTMLElement(e)&&isOverflowElement(e)?e:getNearestOverflowAncestor(e)}function getOverflowAncestors(t,e){var n;void 0===e&&(e=[]);const o=getNearestOverflowAncestor(t),i=o===(null==(n=t.ownerDocument)?void 0:n.body),s=getWindow(o),r=i?[s].concat(s.visualViewport||[],isOverflowElement(o)?o:[]):o,l=e.concat(r);return i?l:l.concat(getOverflowAncestors(r))}function contains(t,e){const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&isShadowRoot(n)){let n=e;do{if(n&&t===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function getInnerBoundingClientRect(t,e){const n=getBoundingClientRect(t,!1,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft;return{top:o,left:i,x:i,y:o,right:i+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function getClientRectFromClippingAncestor(t,e,n){return"viewport"===e?rectToClientRect(getViewportRect(t,n)):isElement(e)?getInnerBoundingClientRect(e,n):rectToClientRect(getDocumentRect(getDocumentElement(t)))}function getClippingAncestors(t){const e=getOverflowAncestors(t),n=["absolute","fixed"].includes(getComputedStyle$1(t).position)&&isHTMLElement(t)?getOffsetParent(t):t;return isElement(n)?e.filter((t=>isElement(t)&&contains(t,n)&&"body"!==getNodeName(t))):[]}function getClippingRect(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[..."clippingAncestors"===n?getClippingAncestors(e):[].concat(n),o],r=s[0],l=s.reduce(((t,n)=>{const o=getClientRectFromClippingAncestor(e,n,i);return t.top=max(o.top,t.top),t.right=min(o.right,t.right),t.bottom=min(o.bottom,t.bottom),t.left=max(o.left,t.left),t}),getClientRectFromClippingAncestor(e,r,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const platform={getClippingRect:getClippingRect,convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,isElement:isElement,getDimensions:getDimensions,getOffsetParent:getOffsetParent,getDocumentElement:getDocumentElement,getElementRects:t=>{let{reference:e,floating:n,strategy:o}=t;return{reference:getRectRelativeToOffsetParent(e,getOffsetParent(n),o),floating:{...getDimensions(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===getComputedStyle$1(t).direction};function autoUpdate(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=!0,animationFrame:l=!1}=o,a=i&&!l,c=s&&!l,d=a||c?[...isElement(t)?getOverflowAncestors(t):[],...getOverflowAncestors(e)]:[];d.forEach((t=>{a&&t.addEventListener("scroll",n,{passive:!0}),c&&t.addEventListener("resize",n)}));let g,f=null;if(r){let o=!0;f=new ResizeObserver((()=>{o||n(),o=!1})),isElement(t)&&!l&&f.observe(t),f.observe(e)}let m=l?getBoundingClientRect(t):null;return l&&function e(){const o=getBoundingClientRect(t);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||n(),m=o,g=requestAnimationFrame(e)}(),n(),()=>{var t;d.forEach((t=>{a&&t.removeEventListener("scroll",n),c&&t.removeEventListener("resize",n)})),null==(t=f)||t.disconnect(),f=null,l&&cancelAnimationFrame(g)}}const computePosition=(t,e,n)=>computePosition$1(t,e,{platform:platform,...n}),dropdownCss=":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}",ScDropdownStyle0=dropdownCss;let itemIndex=0,arrowFlag="";const ScDropdown=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.scShow=createEvent(this,"scShow",7),this.scHide=createEvent(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}handleOpenChange(){this.open?this.show():this.hide()}handleOutsideClick(t){t.composedPath().some((t=>t===this.el))||(this.open=!1)}startPositioner(){this.stopPositioner(),this.updatePositioner(),this.positionerCleanup=autoUpdate(this.trigger,this.positioner,this.updatePositioner.bind(this))}updatePositioner(){this.open&&this.trigger&&this.positioner&&computePosition(this.trigger,this.positioner,{placement:this.placement,middleware:[offset({mainAxis:this.distance,crossAxis:this.skidding}),flip(),shift(),size({apply:({availableWidth:t,availableHeight:e})=>{Object.assign(this.panel.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})},padding:8})],strategy:this.hoist?"fixed":"absolute"}).then((({x:t,y:e,placement:n})=>{this.positioner.setAttribute("data-placement",n),Object.assign(this.positioner.style,{position:this.hoist?"fixed":"absolute",left:`${t}px`,top:`${e}px`,right:"auto"})}))}stopPositioner(){this.positionerCleanup&&(this.positionerCleanup(),this.positionerCleanup=void 0,this.positioner.removeAttribute("data-placement"))}show(){speak(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())}hide(){speak(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())}handleClick(t){this.closeOnSelect&&t.composedPath().some((t=>t.classList&&t.classList.contains("menu-item")))&&(this.open=!1)}componentWillLoad(){document.addEventListener("mousedown",(t=>this.handleOutsideClick(t)))}getMenu(){return this.el.shadowRoot.querySelector("slot").assignedNodes().find((t=>"sc-menu"===t.nodeName))}getItems(){return[...this.el.querySelectorAll("sc-menu-item")]}handleHide(){this.open=!1,itemIndex=0,this.trigger.focus()}handleKeyDown(t){const 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"==arrowFlag&&(itemIndex+=2),itemIndex>e.length-1&&(itemIndex=0),e[itemIndex].setFocus(),arrowFlag="down",void itemIndex++;if("ArrowUp"===t.key)return"down"==arrowFlag&&(itemIndex-=2),itemIndex<0&&(itemIndex=e.length-1),e[itemIndex].setFocus(),arrowFlag="up",void itemIndex--}"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()}render(){return h("div",{key:"1e7aca1ce79cc4a4c8971986cad5c6b8e01d0ed2",part:"base",class:{dropdown:!0,"dropdown--open":this.open,"dropdown--disabled":this.disabled}},h("span",{key:"a26f613ce09b4a7f8a6359000ec612b7bf44325e",part:"trigger",class:"dropdown__trigger",ref:t=>this.trigger=t,onClick:()=>{this.disabled||(this.open?this.hide():setTimeout((()=>{this.show()}),0))},"aria-expanded":this.open?"true":"false","aria-haspopup":"true"},h("slot",{key:"84ef48e1c9c8b85ff0ec205e5d8ed8689906dafc",name:"trigger"})),h("div",{key:"42301b117bbaaefb50acc37fb6b2e636db65833d",class:"dropdown__positioner",ref:t=>this.positioner=t},h("div",{key:"e25303b88a027f9c8624550c71bca32535da9e73",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:t=>this.handleClick(t),ref:t=>this.panel=t},h("slot",{key:"105ea2bf6ed0dff40f12938997b1241076da8de0"}))))}get el(){return this}static get watchers(){return{open:["handleOpenChange"]}}static get style(){return ScDropdownStyle0}},[1,"sc-dropdown",{clickEl:[16],disabled:[4],open:[1540],position:[1],placement:[513],distance:[2],skidding:[2],hoist:[4],closeOnSelect:[516,"close-on-select"],isVisible:[32]},[[0,"keydown","handleKeyDown"]],{open:["handleOpenChange"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-dropdown"].forEach((t=>{"sc-dropdown"===t&&(customElements.get(t)||customElements.define(t,ScDropdown))}))}export{ScDropdown as S,defineCustomElement as d};
Copyright ©2021 || Defacer Indonesia