@worldresources/wri-design-systems 2.164.0 → 2.165.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +10 -11
- package/dist/index.esm.js +72 -73
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2431,15 +2431,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
2431
2431
|
*/
|
|
2432
2432
|
function Jd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jd(Object(n),!0).forEach((function(t){ep(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ep(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tp,np=(tp=[],{activateTrap:function(e){if(tp.length>0){var t=tp[tp.length-1];t!==e&&t.pause()}var n=tp.indexOf(e);-1===n||tp.splice(n,1),tp.push(e)},deactivateTrap:function(e){var t=tp.indexOf(e);-1!==t&&tp.splice(t,1),tp.length>0&&tp[tp.length-1].unpause()}}),rp=function(e){return setTimeout(e,0)},op=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},ip=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},ap=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},sp=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=Qd({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},a=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},s=function(e){return i.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];t=t.apply(void 0,i)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},c=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e)if(s(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},u=function(){if(i.containerGroups=i.containers.map((function(e){var t,n,r=Ud(e,o.tabbableOptions),i=(t=e,(n=(n=o.tabbableOptions)||{}).getShadowRoot?Nd([t],n.includeContainer,{filter:Zd.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):Vd(t,n.includeContainer,Zd.bind(null,n)));return{container:e,tabbableNodes:r,focusableNodes:i,firstTabbableNode:r.length>0?r[0]:null,lastTabbableNode:r.length>0?r[r.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i.findIndex((function(t){return t===e}));if(!(n<0))return t?i.slice(n+1).find((function(e){return Xd(e,o.tabbableOptions)})):i.slice(0,n).reverse().find((function(e){return Xd(e,o.tabbableOptions)}))}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},d=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},p=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},h=function(e){var t=ap(e);s(t)>=0||(ip(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!Kd(t,o.tabbableOptions)}):ip(o.allowOutsideClick,e)||e.preventDefault())},f=function(e){var t=ap(e),n=s(t)>=0;n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),d(i.mostRecentlyFocusedNode||c()))},x=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==ip(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=ap(e);u();var n=null;if(i.tabbableGroups.length>0){var r=s(t),a=r>=0?i.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=op(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(c<0&&(a.container===t||Kd(t,o.tabbableOptions)&&!Xd(t,o.tabbableOptions)&&!a.nextTabbableNode(t,!1))&&(c=r),c>=0){var p=0===c?i.tabbableGroups.length-1:c-1;n=i.tabbableGroups[p].lastTabbableNode}}else{var h=op(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(h<0&&(a.container===t||Kd(t,o.tabbableOptions)&&!Xd(t,o.tabbableOptions)&&!a.nextTabbableNode(t))&&(h=r),h>=0){var f=h===i.tabbableGroups.length-1?0:h+1;n=i.tabbableGroups[f].firstTabbableNode}}}else n=l("fallbackFocus");n&&(e.preventDefault(),d(n))}(e)},g=function(e){var t=ap(e);s(t)>=0||ip(o.clickOutsideDeactivates,e)||ip(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},v=function(){if(i.active)return np.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?rp((function(){d(c())})):d(c()),r.addEventListener("focusin",f,!0),r.addEventListener("mousedown",h,{capture:!0,passive:!1}),r.addEventListener("touchstart",h,{capture:!0,passive:!1}),r.addEventListener("click",g,{capture:!0,passive:!1}),r.addEventListener("keydown",x,{capture:!0,passive:!1}),n},m=function(){if(i.active)return r.removeEventListener("focusin",f,!0),r.removeEventListener("mousedown",h,!0),r.removeEventListener("touchstart",h,!0),r.removeEventListener("click",g,!0),r.removeEventListener("keydown",x,!0),n};return(n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=a(e,"onActivate"),n=a(e,"onPostActivate"),o=a(e,"checkCanFocusTrap");o||u(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var s=function(){o&&u(),v(),n&&n()};return o?(o(i.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!i.active)return this;var t=Qd({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,m(),i.active=!1,i.paused=!1,np.deactivateTrap(n);var r=a(t,"onDeactivate"),s=a(t,"onPostDeactivate"),l=a(t,"checkCanReturnFocus"),c=a(t,"returnFocus","returnFocusOnDeactivate");r&&r();var u=function(){rp((function(){c&&d(p(i.nodeFocusedBeforeActivation)),s&&s()}))};return c&&l?(l(p(i.nodeFocusedBeforeActivation)).then(u,u),this):(u(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,m()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,u(),v(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&u(),this}}).updateContainerElements(e),n};var lp=!1;if("undefined"!=typeof window){var cp={get passive(){lp=!0}};window.addEventListener("testPassive",null,cp),window.removeEventListener("testPassive",null,cp)}var up,dp="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),pp=[],hp=!1,fp=-1,xp=void 0,gp=void 0,vp=function(e){return pp.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},mp=function(e){var t=e||window.event;return!!vp(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},bp=function(e,t){if(e){if(!pp.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};pp=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(pp),[n]),dp?(e.ontouchstart=function(e){1===e.targetTouches.length&&(fp=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-fp;!vp(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?mp(e):e.stopPropagation())}(t,e)},hp||(document.addEventListener("touchmove",mp,lp?{passive:!1}:void 0),hp=!0)):function(e){if(void 0===gp){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(gp=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===xp&&(xp=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},yp=function(e){e?(pp=pp.filter((function(t){return t.targetElement!==e})),dp?(e.ontouchstart=null,e.ontouchmove=null,hp&&0===pp.length&&(document.removeEventListener("touchmove",mp,lp?{passive:!1}:void 0),hp=!1)):pp.length||(void 0!==gp&&(document.body.style.paddingRight=gp,gp=void 0),void 0!==xp&&(document.body.style.overflow=xp,xp=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},wp=[],Cp="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(up||(up={}));var jp,kp=function(e){return Object.freeze(e)},$p=function(e,t){this.inlineSize=e,this.blockSize=t,kp(this)},Sp=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,kp(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ep=function(e){return e instanceof SVGElement&&"getBBox"in e},Rp=function(e){if(Ep(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||e.getClientRects().length)},Lp=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Op="undefined"!=typeof window?window:{},Tp=new WeakMap,Pp=/auto|scroll/,Mp=/^tb|vertical/,_p=/msie|trident/i.test(Op.navigator&&Op.navigator.userAgent),Dp=function(e){return parseFloat(e||"0")},Ip=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new $p((n?t:e)||0,(n?e:t)||0)},Vp=kp({devicePixelContentBoxSize:Ip(),borderBoxSize:Ip(),contentBoxSize:Ip(),contentRect:new Sp(0,0,0,0)}),Np=function(e,t){if(void 0===t&&(t=!1),Tp.has(e)&&!t)return Tp.get(e);if(Rp(e))return Tp.set(e,Vp),Vp;var n=getComputedStyle(e),r=Ep(e)&&e.ownerSVGElement&&e.getBBox(),o=!_p&&"border-box"===n.boxSizing,i=Mp.test(n.writingMode||""),a=!r&&Pp.test(n.overflowY||""),s=!r&&Pp.test(n.overflowX||""),l=r?0:Dp(n.paddingTop),c=r?0:Dp(n.paddingRight),u=r?0:Dp(n.paddingBottom),d=r?0:Dp(n.paddingLeft),p=r?0:Dp(n.borderTopWidth),h=r?0:Dp(n.borderRightWidth),f=r?0:Dp(n.borderBottomWidth),x=d+c,g=l+u,v=(r?0:Dp(n.borderLeftWidth))+h,m=p+f,b=s?e.offsetHeight-m-e.clientHeight:0,y=a?e.offsetWidth-v-e.clientWidth:0,w=o?x+v:0,C=o?g+m:0,j=r?r.width:Dp(n.width)-w-y,k=r?r.height:Dp(n.height)-C-b,$=j+x+y+v,S=k+g+b+m,E=kp({devicePixelContentBoxSize:Ip(Math.round(j*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:Ip($,S,i),contentBoxSize:Ip(j,k,i),contentRect:new Sp(d,l,j,k)});return Tp.set(e,E),E},Ap=function(e,t,n){var r=Np(e,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case up.DEVICE_PIXEL_CONTENT_BOX:return a;case up.BORDER_BOX:return o;default:return i}},zp=function(e){var t=Np(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=kp([t.borderBoxSize]),this.contentBoxSize=kp([t.contentBoxSize]),this.devicePixelContentBoxSize=kp([t.devicePixelContentBoxSize])},Bp=function(e){if(Rp(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Hp=function(){var e=1/0,t=[];wp.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new zp(t.target),o=Bp(t.target);r.push(n),t.lastReportedSize=Ap(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},Fp=function(e){wp.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(Bp(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Zp=function(){var e=0;for(Fp(e);wp.some((function(e){return e.activeTargets.length>0}));)e=Hp(),Fp(e);return wp.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Cp}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Cp),window.dispatchEvent(e)}(),e>0},Wp=[],qp=function(e){if(!jp){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Wp.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),jp=function(){n.textContent="".concat(t?t--:t++)}}Wp.push(e),jp()},Gp=0,Up={attributes:!0,characterData:!0,childList:!0,subtree:!0},Xp=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Yp=function(e){return void 0===e&&(e=0),Date.now()+e},Kp=!1,Jp=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!Kp){Kp=!0;var n,r=Yp(e);n=function(){var n=!1;try{n=Zp()}finally{if(Kp=!1,e=r-Yp(),!Gp)return;n?t.run(1e3):e>0?t.run(e):t.start()}},qp((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Up)};document.body?t():Op.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Xp.forEach((function(t){return Op.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Xp.forEach((function(t){return Op.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),Qp=function(e){!Gp&&e>0&&Jp.start(),!(Gp+=e)&&Jp.stop()},eh=function(){function e(e,t){this.target=e,this.observedBox=t||up.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Ap(this.target,this.observedBox,!0);return function(e){return!Ep(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),th=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},nh=new WeakMap,rh=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},oh=function(){function e(){}return e.connect=function(e,t){var n=new th(e,t);nh.set(e,n)},e.observe=function(e,t,n){var r=nh.get(e),o=0===r.observationTargets.length;rh(r.observationTargets,t)<0&&(o&&wp.push(r),r.observationTargets.push(new eh(t,n&&n.box)),Qp(1),Jp.schedule())},e.unobserve=function(e,t){var n=nh.get(e),r=rh(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&wp.splice(wp.indexOf(n),1),n.observationTargets.splice(r,1),Qp(-1))},e.disconnect=function(e){var t=this,n=nh.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),ih=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");oh.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Lp(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");oh.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Lp(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");oh.unobserve(this,e)},e.prototype.disconnect=function(){oh.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function ah(){return ah=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ah.apply(this,arguments)}function sh(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var lh="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function ch(e,t,n){return t=(t=+t)==t?t:0,n=(n=+n)==n?n:0,(e=+e)==e&&(e=(e=e<=n?e:n)>=t?e:t),e}function uh(e){var t=Math.round(e);if(Number.isNaN(e))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return t}var dh={box:"border-box"};function ph(e,t){var r=t.label,o=t.enabled,i=t.resizeSourceRef,a=n.useState(0),s=a[0],l=a[1];n.useDebugValue(r+": "+s);var c=n.useCallback((function(e){l(e[0].borderBoxSize[0].blockSize),i.current="element"}),[i]);return lh((function(){if(e.current&&o){var t=new ih(c);return t.observe(e.current,dh),function(){t.disconnect()}}}),[e,c,o]),o?s:0}function hh(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout(t,e)}))}var fh={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},xh={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},gh=function(e,t,n){return void 0===n&&(n=e.context),new yc(e,t,n)}({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:ah({},fh,xh)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:ah({},fh,xh)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:ah({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[Cc({y:function(e,t){return t.payload.y},velocity:function(e,t){return t.payload.velocity},snapSource:function(e,t){var n=t.payload.source;return void 0===n?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(e,t){},onSnapCancel:function(e,t){},onResizeCancel:function(e,t){},onCloseCancel:function(e,t){},onOpenEnd:function(e,t){},onSnapEnd:function(e,t){},onRezizeEnd:function(e,t){}},services:{onSnapStart:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenStart:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseStart:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeStart:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onSnapEnd:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenEnd:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseEnd:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeEnd:function(){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},renderVisuallyHidden:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},activate:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},deactivate:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},openSmoothly:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},openImmediately:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},snapSmoothly:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},resizeSmoothly:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}},closeSmoothly:function(e,t){try{return Promise.resolve(hh()).then((function(){}))}catch(e){return Promise.reject(e)}}},guards:{initiallyClosed:function(e){return"CLOSED"===e.initialState},initiallyOpen:function(e){return"OPEN"===e.initialState}}}),vh=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],mh=["velocity"],bh=["onRest","config"],yh={tension:170,friction:26},wh=yh.tension,Ch=yh.friction,jh=n.forwardRef((function(e,t){var r=e.children,o=e.sibling,i=e.className,a=e.footer,s=e.header,l=e.open,c=e.initialState,u=e.lastSnapRef,d=e.initialFocusRef,p=e.onDismiss,h=e.maxHeight,f=e.defaultSnap,x=void 0===f?$h:f,g=e.snapPoints,v=void 0===g?Sh:g,m=e.blocking,b=void 0===m||m,y=e.scrollLocking,w=void 0===y||y,C=e.style,j=e.onSpringStart,k=e.onSpringCancel,$=e.onSpringEnd,S=e.reserveScrollBarGap,E=void 0===S?b:S,R=e.expandOnContentDrag,L=void 0!==R&&R,O=sh(e,vh),T=function(){var e=n.useState(!1),t=e[0],r=e[1],o=n.useState({}),i=o[0],a=o[1],s=n.useCallback((function(e){return a((function(t){var n;return ah({},t,((n={})[e]=!1,n))})),function(){a((function(t){var n;return ah({},t,((n={})[e]=!0,n))}))}}),[]);return n.useEffect((function(){var e=Object.values(i);0!==e.length&&e.every(Boolean)&&r(!0)}),[i]),{ready:t,registerReady:s}}(),P=T.ready,M=T.registerReady,_=n.useRef(!1),D=n.useRef(j),I=n.useRef(k),V=n.useRef($);n.useEffect((function(){D.current=j,I.current=k,V.current=$}),[k,j,$]);var N,A,z=uu((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),B=z[0],H=z[1],F=n.useRef(null),Z=n.useRef(null),W=n.useRef(null),q=n.useRef(null),G=n.useRef(null),U=n.useRef(null),X=n.useRef(0),Y=n.useRef(),K=n.useRef(!1),J=(N=n.useMemo((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),A=n.useRef(null==N?void 0:N.matches),n.useDebugValue(A.current?"reduce":"no-preference"),n.useEffect((function(){var e=function(e){A.current=e.matches};return null==N||N.addListener(e),function(){return null==N?void 0:N.removeListener(e)}}),[N]),A),Q=function(e){var t=e.targetRef,r=e.enabled,o=e.reserveScrollBarGap,i=n.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return n.useDebugValue(r?"Enabled":"Disabled"),n.useEffect((function(){if(!r)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var e=t.current,n=!1;i.current={activate:function(){n||(n=!0,bp(e,{allowTouchMove:function(e){return e.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:o}))},deactivate:function(){n&&(n=!1,yp(e))}}}),[r,t,o]),i}({targetRef:Z,enabled:P&&w,reserveScrollBarGap:E}),ee=function(e){var t=e.targetRef,r=e.enabled,o=n.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return n.useDebugValue(r?"Enabled":"Disabled"),n.useEffect((function(){if(!r)return o.current.deactivate(),void(o.current={activate:function(){},deactivate:function(){}});var e=t.current,n=!1,i=[],a=[];o.current={activate:function(){if(!n){n=!0;var t=e.parentNode;document.querySelectorAll("body > *").forEach((function(e){if(e!==t){var n=e.getAttribute("aria-hidden");null!==n&&"false"!==n||(i.push(n),a.push(e),e.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){n&&(n=!1,a.forEach((function(e,t){var n=i[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)})),i=[],a=[])}}}),[t,r]),o}({targetRef:F,enabled:P&&b}),te=function(e){var t=e.targetRef,r=e.fallbackRef,o=e.initialFocusRef,i=e.enabled,a=n.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return n.useDebugValue(i?"Enabled":"Disabled"),n.useEffect((function(){if(!i)return a.current.deactivate(),void(a.current={activate:function(){},deactivate:function(){}});var e=r.current,n=sp(t.current,{onActivate:void 0,initialFocus:o?function(){return(null==o?void 0:o.current)||e}:void 0,fallbackFocus:e,escapeDeactivates:!1,clickOutsideDeactivates:!1}),s=!1;a.current={activate:function(){try{return s?Promise.resolve():(s=!0,Promise.resolve(n.activate()).then((function(){return Promise.resolve(new Promise((function(e){return setTimeout((function(){return e(void 0)}),0)}))).then((function(){}))})))}catch(e){return Promise.reject(e)}},deactivate:function(){s&&(s=!1,n.deactivate())}}}),[i,r,o,t]),a}({targetRef:F,fallbackRef:U,initialFocusRef:d||void 0,enabled:P&&b&&!1!==d}),ne=function(e){var t=e.getSnapPoints,r=e.heightRef,o=e.lastSnapRef,i=e.ready,a=function(e){var t=e.contentRef,r=e.controlledMaxHeight,o=e.footerEnabled,i=e.footerRef,a=e.headerEnabled,s=e.headerRef,l=e.registerReady,c=e.resizeSourceRef,u=n.useMemo((function(){return l("contentHeight")}),[l]),d=function(e,t,r){var o=n.useMemo((function(){return t("maxHeight")}),[t]),i=n.useState((function(){return uh(e)||"undefined"!=typeof window?window.innerHeight:0})),a=i[0],s=i[1],l=a>0,c=n.useRef(0);return n.useDebugValue(e?"controlled":"auto"),n.useEffect((function(){l&&o()}),[l,o]),lh((function(){if(e)return s(uh(e)),void(r.current="maxheightprop");var t=function(){c.current||(c.current=requestAnimationFrame((function(){s(window.innerHeight),r.current="window",c.current=0})))};return window.addEventListener("resize",t),s(window.innerHeight),r.current="window",o(),function(){window.removeEventListener("resize",t),cancelAnimationFrame(c.current)}}),[e,o,r]),a}(r,l,c),p=ph(s,{label:"headerHeight",enabled:a,resizeSourceRef:c}),h=ph(t,{label:"contentHeight",enabled:!0,resizeSourceRef:c}),f=ph(i,{label:"footerHeight",enabled:o,resizeSourceRef:c}),x=Math.min(d-p-f,h)+p+f;n.useDebugValue("minHeight: "+x);var g=h>0;return n.useEffect((function(){g&&u()}),[g,u]),{maxHeight:d,minHeight:x,headerHeight:p,footerHeight:f}}({contentRef:e.contentRef,controlledMaxHeight:e.controlledMaxHeight,footerEnabled:e.footerEnabled,footerRef:e.footerRef,headerEnabled:e.headerEnabled,headerRef:e.headerRef,registerReady:e.registerReady,resizeSourceRef:e.resizeSourceRef}),s=a.maxHeight,l=a.minHeight,c=a.headerHeight,u=a.footerHeight,d=function(e,t){var n=[].concat(e).map(uh).reduce((function(e,n){return e.add(ch(n,0,t)),e}),new Set),r=Array.from(n),o=Math.min.apply(Math,r);if(Number.isNaN(o))throw new TypeError("minSnap is NaN");var i=Math.max.apply(Math,r);if(Number.isNaN(i))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:o,maxSnap:i}}(i?t({height:r.current,footerHeight:u,headerHeight:c,minHeight:l,maxHeight:s}):[0],s),p=d.snapPoints,h=d.minSnap,f=d.maxSnap;return n.useDebugValue("minSnap: "+h+", maxSnap:"+f),{minSnap:h,maxSnap:f,findSnap:function(e){var t=uh("function"==typeof e?e({footerHeight:u,headerHeight:c,height:r.current,minHeight:l,maxHeight:s,snapPoints:p,lastSnap:o.current}):e);return p.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}),h)},maxHeight:s}}({contentRef:W,controlledMaxHeight:h,footerEnabled:!!a,footerRef:G,getSnapPoints:v,headerEnabled:!1!==s,headerRef:q,heightRef:X,lastSnapRef:u,ready:P,registerReady:M,resizeSourceRef:Y}),re=ne.minSnap,oe=ne.maxSnap,ie=ne.maxHeight,ae=ne.findSnap,se=n.useRef(ie),le=n.useRef(re),ce=n.useRef(oe),ue=n.useRef(ae),de=n.useRef(0);lh((function(){se.current=ie,ce.current=oe,le.current=re,ue.current=ae,de.current=ae(x)}),[ae,x,ie,oe,re]);var pe=n.useCallback((function(e){var t=e.onRest,n=e.config,r=(n=void 0===n?{}:n).velocity,o=void 0===r?1:r,i=sh(n,mh),a=sh(e,bh);return new Promise((function(e){return H(ah({},a,{config:ah({velocity:o},i,{mass:1,tension:wh,friction:Math.max(Ch,Ch+(Ch-Ch*o))}),onRest:function(){var n=[].slice.call(arguments);e.apply(void 0,n),null==t||t.apply(void 0,n)}}))}))}),[H]),he=Dc(gh,{devTools:!1,actions:{onOpenCancel:n.useCallback((function(){return null==I.current?void 0:I.current({type:"OPEN"})}),[]),onSnapCancel:n.useCallback((function(e){return null==I.current?void 0:I.current({type:"SNAP",source:e.snapSource})}),[]),onCloseCancel:n.useCallback((function(){return null==I.current?void 0:I.current({type:"CLOSE"})}),[]),onResizeCancel:n.useCallback((function(){return null==I.current?void 0:I.current({type:"RESIZE",source:Y.current})}),[]),onOpenEnd:n.useCallback((function(){return null==V.current?void 0:V.current({type:"OPEN"})}),[]),onSnapEnd:n.useCallback((function(e,t){return null==V.current?void 0:V.current({type:"SNAP",source:e.snapSource})}),[]),onResizeEnd:n.useCallback((function(){return null==V.current?void 0:V.current({type:"RESIZE",source:Y.current})}),[])},context:{initialState:c},services:{onSnapStart:n.useCallback((function(e,t){try{return Promise.resolve(null==D.current?void 0:D.current({type:"SNAP",source:t.payload.source||"custom"}))}catch(e){return Promise.reject(e)}}),[]),onOpenStart:n.useCallback((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseStart:n.useCallback((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeStart:n.useCallback((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"RESIZE",source:Y.current}))}catch(e){return Promise.reject(e)}}),[]),onSnapEnd:n.useCallback((function(e,t){try{return Promise.resolve(null==V.current?void 0:V.current({type:"SNAP",source:e.snapSource}))}catch(e){return Promise.reject(e)}}),[]),onOpenEnd:n.useCallback((function(){try{return Promise.resolve(null==V.current?void 0:V.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseEnd:n.useCallback((function(){try{return Promise.resolve(null==V.current?void 0:V.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeEnd:n.useCallback((function(){try{return Promise.resolve(null==V.current?void 0:V.current({type:"RESIZE",source:Y.current}))}catch(e){return Promise.reject(e)}}),[]),renderVisuallyHidden:n.useCallback((function(e,t){try{return Promise.resolve(pe({y:de.current,ready:0,maxHeight:se.current,maxSnap:ce.current,minSnap:de.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe]),activate:n.useCallback((function(e,t){try{return _.current=!0,Promise.resolve(Promise.all([Q.current.activate(),te.current.activate(),ee.current.activate()])).then((function(){}))}catch(e){return Promise.reject(e)}}),[ee,te,Q]),deactivate:n.useCallback((function(){try{return Q.current.deactivate(),te.current.deactivate(),ee.current.deactivate(),_.current=!1,Promise.resolve()}catch(e){return Promise.reject(e)}}),[ee,te,Q]),openImmediately:n.useCallback((function(){try{return X.current=de.current,Promise.resolve(pe({y:de.current,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:de.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe]),openSmoothly:n.useCallback((function(){try{return Promise.resolve(pe({y:0,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:de.current,immediate:!0})).then((function(){return X.current=de.current,Promise.resolve(pe({y:de.current,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:de.current,immediate:J.current})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[pe,J]),snapSmoothly:n.useCallback((function(e,t){try{var n=ue.current(e.y);return X.current=n,u.current=n,Promise.resolve(pe({y:n,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:J.current,config:{velocity:e.velocity}})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe,u,J]),resizeSmoothly:n.useCallback((function(){try{var e=ue.current(X.current);return X.current=e,u.current=e,Promise.resolve(pe({y:e,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:"element"!==Y.current||J.current})).then((function(){}))}catch(e){return Promise.reject(e)}}),[pe,u,J]),closeSmoothly:n.useCallback((function(e,t){try{return pe({minSnap:X.current,immediate:!0}),X.current=0,Promise.resolve(pe({y:0,maxHeight:se.current,maxSnap:ce.current,immediate:J.current})).then((function(){return Promise.resolve(pe({ready:0,immediate:!0})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[pe,J])}}),fe=he[0],xe=he[1];n.useEffect((function(){P&&xe(l?"OPEN":"CLOSE")}),[l,xe,P]),lh((function(){(ie||oe||re)&&xe("RESIZE")}),[ie,oe,re,xe]),n.useEffect((function(){return function(){Q.current.deactivate(),te.current.deactivate(),ee.current.deactivate()}}),[ee,te,Q]),n.useImperativeHandle(t,(function(){return{snapTo:function(e,t){var n=void 0===t?{}:t,r=n.velocity,o=void 0===r?1:r,i=n.source,a=void 0===i?"custom":i;xe("SNAP",{payload:{y:ue.current(e),velocity:o,source:a}})},get height(){return X.current}}}),[xe]),n.useEffect((function(){var e=Z.current,t=function(e){K.current&&e.preventDefault()},n=function(t){e.scrollTop<0&&(requestAnimationFrame((function(){e.style.overflow="hidden",e.scrollTop=0,e.style.removeProperty("overflow")})),t.preventDefault())};return L&&(e.addEventListener("scroll",t),e.addEventListener("touchmove",t),e.addEventListener("touchstart",n)),function(){e.removeEventListener("scroll",t),e.removeEventListener("touchmove",t),e.removeEventListener("touchstart",n)}}),[L,Z]);var ge=Td((function(e){var t=e.args,n=(t=void 0===t?[]:t)[0],r=(n=void 0===n?{}:n).closeOnTap,o=void 0!==r&&r,i=n.isContentDragging,a=void 0!==i&&i,s=e.cancel,l=e.direction[1],c=e.down,u=e.first,d=e.last,h=e.memo,f=void 0===h?B.y.getValue():h,x=e.tap,g=e.velocity,v=-1*e.movement[1];if(!_.current)return s(),f;if(p&&o&&x)return s(),setTimeout((function(){return p()}),0),f;if(x)return f;var m=f+v,b=v*g,y=Math.max(le.current,Math.min(ce.current,m+2*b));if(!c&&p&&l>0&&m+b<le.current/2)return s(),p(),f;var w=c?p||le.current!==ce.current?qu(m,p?0:le.current,ce.current,.55):m<le.current?qu(m,le.current,2*ce.current,.55):qu(m,le.current/2,ce.current,.55):y;return L&&a?(w>=ce.current&&(w=ce.current),f===ce.current&&Z.current.scrollTop>0&&(w=ce.current),K.current=w<ce.current):K.current=!1,u&&xe("DRAG"),d?(xe("SNAP",{payload:{y:w,velocity:g>.05?g:1,source:"dragging"}}),f):(H({y:w,ready:1,maxHeight:se.current,maxSnap:ce.current,minSnap:le.current,immediate:!0,config:{velocity:g}}),f)}),{filterTaps:!0});if(Number.isNaN(ce.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(le.current))throw new TypeError("minSnapRef is NaN!!");var ve=function(e){var t,n=e.spring,r=ou([n.y,n.maxHeight],(function(e,t){return Math.round(ch(t-e,0,16))+"px"})),o=ou([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return ch(e,t,n)+"px"})),i=ou([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return e<t?t-e+"px":e>n?n-e+"px":"0px"})),a=ou([n.y,n.maxSnap],(function(e,t){return e>=t?Math.ceil(e-t):0})),s=ou([n.y,n.minSnap],(function(e,t){if(!t)return 0;var n=Math.max(t/2-45,0);return ch((e-n)*(1/(Math.min(t/2+45,t)-n)+0),0,1)})),l=ou([n.y,n.minSnap],(function(e,t){return t?ch(e/t,0,1):0}));return(t={})["--rsbs-content-opacity"]=s,t["--rsbs-backdrop-opacity"]=l,t["--rsbs-antigap-scale-y"]=a,t["--rsbs-overlay-translate-y"]=i,t["--rsbs-overlay-rounded"]=r,t["--rsbs-overlay-h"]=o,t}({spring:B});return n.createElement(zu.div,ah({},O,{"data-rsbs-root":!0,"data-rsbs-state":kh.find(fe.matches),"data-rsbs-is-blocking":b,"data-rsbs-is-dismissable":!!p,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!a,className:i,ref:F,style:ah({},ve,C,{opacity:B.ready})}),o,b&&n.createElement("div",ah({key:"backdrop","data-rsbs-backdrop":!0},ge({closeOnTap:!0}))),n.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:U,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),p&&p())}},!1!==s&&n.createElement("div",ah({key:"header","data-rsbs-header":!0,ref:q},ge()),s),n.createElement("div",ah({key:"scroll","data-rsbs-scroll":!0,ref:Z},L?ge({isContentDragging:!0}):{}),n.createElement("div",{"data-rsbs-content":!0,ref:W},r)),a&&n.createElement("div",ah({key:"footer",ref:G,"data-rsbs-footer":!0},ge()),a)))})),kh=["closed","opening","open","closing","dragging","snapping","resizing"];function $h(e){var t=e.lastSnap;return null!=t?t:Math.min.apply(Math,e.snapPoints)}function Sh(e){return e.minHeight}var Eh=["onSpringStart","onSpringEnd","skipInitialTransition"],Rh=n.forwardRef((function(e,t){var r=e.onSpringStart,o=e.onSpringEnd,i=e.skipInitialTransition,a=sh(e,Eh),s=n.useState(!1),l=s[0],c=s[1],u=n.useRef(),d=n.useRef(null),p=n.useRef(i&&a.open?"OPEN":"CLOSED");lh((function(){if(a.open)return cancelAnimationFrame(u.current),c(!0),function(){p.current="CLOSED"}}),[a.open]);var h=n.useCallback((function(e){return Promise.resolve(null==r?void 0:r(e)).then((function(){"OPEN"===e.type&&cancelAnimationFrame(u.current)}))}),[r]),f=n.useCallback((function(e){return Promise.resolve(null==o?void 0:o(e)).then((function(){"CLOSE"===e.type&&(u.current=requestAnimationFrame((function(){return c(!1)})))}))}),[o]);return l?n.createElement(ks,{"data-rsbs-portal":!0},n.createElement(jh,ah({},a,{lastSnapRef:d,ref:t,initialState:p.current,onSpringStart:h,onSpringEnd:f}))):null}));const Lh=r.css`
|
|
2433
2433
|
width: 40px;
|
|
2434
|
-
height: 6px;
|
|
2435
|
-
border-color: ${h("neutral",300)};
|
|
2436
2434
|
border-radius: 4px;
|
|
2437
|
-
|
|
2435
|
+
background: transparent;
|
|
2436
|
+
padding: 4px 6px;
|
|
2438
2437
|
cursor: grab;
|
|
2439
|
-
|
|
2440
|
-
&:focus {
|
|
2438
|
+
&:focus-visible {
|
|
2441
2439
|
outline-color: ${h("primary",700)};
|
|
2442
2440
|
}
|
|
2441
|
+
div {
|
|
2442
|
+
height: 2px;
|
|
2443
|
+
margin: 0px 0px;
|
|
2444
|
+
background: ${h("neutral",300)};
|
|
2445
|
+
}
|
|
2443
2446
|
`,Oh=(e,t)=>r.css`
|
|
2444
2447
|
[data-rsbs-overlay] {
|
|
2445
2448
|
border-top-left-radius: 16px;
|
|
@@ -2459,11 +2462,7 @@ function Jd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
2459
2462
|
}
|
|
2460
2463
|
|
|
2461
2464
|
[data-rsbs-header]:before {
|
|
2462
|
-
|
|
2463
|
-
height: 2px;
|
|
2464
|
-
width: 32px;
|
|
2465
|
-
background-color: ${h("neutral",300)};
|
|
2466
|
-
cursor: pointer;
|
|
2465
|
+
content: none;
|
|
2467
2466
|
}
|
|
2468
2467
|
|
|
2469
2468
|
[data-rsbs-footer] {
|
|
@@ -3622,4 +3621,4 @@ function Jd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
|
|
|
3622
3621
|
border: 1px solid ${h("neutral",300)};
|
|
3623
3622
|
border-radius: 4px;
|
|
3624
3623
|
${a?`background: ${a};`:""}
|
|
3625
|
-
`)}):t.jsx("div",{css:Si,children:e?.map(((e,r)=>t.jsx("div",{"data-test":`${e}-${n?.[r]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${n?.[r]}`)))}),t.jsx("div",{css:Ei,children:n?.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Ri,children:e})},e)))}),o&&o.length?t.jsx("div",{css:Ei,children:o.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Li,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:r,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s="200px",isLoading:l=!1,displayResults:c="text",onSelect:u,onQueryChange:d,onClear:p,renderResults:f})=>{const[x,g]=n.useState(""),{open:v,onOpen:m,onClose:b}=e.useDisclosure(),[y,w]=n.useState(a),[C,j]=n.useState(-1),k=n.useRef(null),$=`search-results-${n.useId()}`,S=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(u?.(t),g(""),b())};n.useEffect((()=>{if(d?.(x),!x)return void w(a);const e=a.filter((e=>e.id?.toLowerCase().includes(x.toLowerCase())||e.label.toLowerCase().includes(x.toLowerCase())||e.caption?.toLowerCase().includes(x.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>S(e.id||e.label)})));w(e),m()}),[x]),n.useEffect((()=>{function e(e){v&&k.current&&!k.current.contains(e.target)&&b()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const E=x.length?t.jsx(se,{style:{marginTop:"-12px"},onClick:()=>{g(""),p?.()}}):null,R="none"!==c&&!!x.length&&y.length>0&&v;return t.jsxs("div",{ref:k,style:{position:"relative",width:"100%"},children:[t.jsx(e.InputGroup,{startElement:t.jsx(ne,{fill:o?h("neutral",500):h("primary",700),style:{marginTop:"-12px"}}),endElement:E,children:t.jsx(Ct,{autoComplete:"off",placeholder:r||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},value:x,label:"",style:{paddingLeft:"40px"},type:"search","aria-label":r||"Search filter","aria-expanded":R,"aria-controls":$,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,onKeyDown:e=>{if(R){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,y.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),C>=0)){const e=y[C];S(e.id||e.label)}"Escape"===e.key&&b()}}})}),(R||l&&!!x.length)&&"custom"===c&&f&&!l&&f({items:y,highlightedIndex:C,query:x,onSelect:S}),(R||l&&!!x.length)&&t.jsx(e.Portal,{container:k,children:t.jsxs(e.Box,{position:"absolute",marginTop:"-20px",width:"100%",backgroundColor:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"md",boxShadow:"md",zIndex:1e3,overflowY:"auto",maxHeight:s,children:[l&&t.jsx(e.Box,{padding:"1rem",children:t.jsx(e.Spinner,{})}),"text"===c&&!l&&t.jsx(Sf,{highlightedIndex:C,items:y,query:x,onSelect:S}),"list"===c&&!l&&t.jsx(Fi,{items:y})]})})]})},exports.Select=Ut,exports.Sheet=({header:e,content:r,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:u="minimized",className:d,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),x=n.useRef([]),[g,v]=n.useState(null),m=window.innerWidth>768,b=x.current;let y="Expand sheet";if(null!=g){const e=Th(g,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==g||!b.length||Th(g,b)!==b.length-1);return t.jsx(Rh,{ref:f,css:Oh(!!e,h),className:d,open:i,onDismiss:a,header:t.jsxs("div",{children:[t.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Lh,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(m)return void f.current?.snapTo?.((()=>t));const n=g??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))}}),t.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return x.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(o?n:0):"full"===u&&(r=c||t-t/6),r},blocking:p,children:i?r:null})},exports.SimpleMapPin=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="simple-pin"})=>o.jsx(Ln,{count:r,mode:i,onClick:e,ref:t,showFocusState:n,variant:a}),exports.Slider=tt,exports.SliderInput=({label:e,caption:r,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,u=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>u?u:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>u?u:o)}r[t]=o,c(r),s&&s(r)};return t.jsxs("div",{children:[t.jsxs("p",{css:un(o),"aria-label":e,children:[a?t.jsx("span",{children:"*"}):null,e]}),r?t.jsx("p",{css:dn(o),"aria-label":r,children:r}):null,t.jsxs("div",{css:pn,children:[i.step&&i.marks?t.jsx(Ut,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):t.jsx(Ct,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),t.jsx(tt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?t.jsx(Ct,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:n})=>t.jsxs("div",{css:Yf,children:[e.map(((e,r)=>t.jsxs("div",{css:Kf,children:[t.jsx("button",{css:Jf(n>=r+1,n<r+1),type:"button",onClick:e.onClick,"aria-current":n===r+1,"aria-disabled":n<r+1,disabled:n<r+1,"aria-label":`Current Step ${r}${e.label?` ${e.label}`:""}`,"data-active":n>=r+1,children:n>r+1?t.jsx(C,{height:"16px",width:"16px"}):r+1}),e.label?t.jsx("p",{css:Qf(n===r+1),children:e.label}):null]},`${e.label}-${r}`))),t.jsx("div",{css:ex,children:t.jsx("div",{css:tx})})]}),exports.Switch=rt,exports.TabBar=({variant:r="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(jf(i,o)||0),u="view"===r;return t.jsx("div",{css:mf(r),children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(jf(i,t=e)),void(a&&a(t));var t},activationMode:s,children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((r,o)=>t.jsxs(n.Fragment,{children:[u&&1===o&&"left"===kf(l)?t.jsx("div",{css:wf}):null,t.jsx(e.Tabs.Trigger,{css:[bf,u?Cf:yf],"aria-label":r["aria-label"]||r.label,...r,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[r.icon,r.label]})},r.label),u&&1===o&&"right"===kf(l)?t.jsx("div",{css:wf}):null]},r.label)))})})})},exports.Table=({columns:r,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,variant:d="default",onSortColumn:p,onPageSizeChange:f,onPageChange:x,onAllItemsSelected:g,loading:v})=>{const[m,b]=n.useState({key:"",order:""}),{totalItems:y=o.length,currentPage:w=1,pageSize:C=10,showItemCount:j,showItemCountText:k}=l||{},S=(e,t)=>{b({key:e,order:t}),p&&p({key:e,order:t})},E=u?.length===o?.length,R=u&&u.length>0&&!E;return t.jsxs("div",{children:[t.jsxs(e.Table.Root,{css:Xi(d),striped:a,stickyHeader:s,interactive:!0,children:[t.jsx(e.Table.Header,{css:Yi(d),children:t.jsxs(e.Table.Row,{children:[c?t.jsx(e.Table.ColumnHeader,{children:t.jsx(Le,{name:"header-checkbox",checked:E,indeterminate:R,onCheckedChange:({checked:e})=>{g&&g(e)}})}):null,r.map((n=>t.jsx(e.Table.ColumnHeader,{role:n.sortable?"columnheader":void 0,"aria-sort":n.sortable&&"asc"===m.order?"ascending":n.sortable&&"desc"===m.order?"descending":void 0,children:t.jsxs("div",{css:Ki,children:[n.label,n.sortable?t.jsxs("div",{css:Ji,children:[t.jsx(ae,{css:Qi(m.key===n.key&&"asc"===m.order),icon:t.jsx($,{style:{transform:"rotate(180deg)"}}),onClick:()=>S(n.key,"asc"),"aria-label":"Ascending"}),t.jsx(ae,{css:Qi(m.key===n.key&&"desc"===m.order),icon:t.jsx($,{}),onClick:()=>S(n.key,"desc"),"aria-label":"Descending"})]}):null]})},n.key)))]})}),t.jsx(e.Table.Body,{css:na,children:o.map((e=>t.jsx(n.Fragment,{children:i(e)},e.id)))})]}),v?t.jsx("div",{css:ra,children:t.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,t.jsxs("div",{css:ea,children:[t.jsx("div",{children:j?t.jsx(_i,{pageSize:C,currentPage:w,totalItems:y,onPageSizeChange:f,showItemCountText:k}):null}),l?t.jsx("div",{css:ta,children:t.jsx(Ui,{totalItems:y,pageSize:C,currentPage:w,onPageChange:x})}):null]})]})},exports.TableCell=ia,exports.TableRow=oa,exports.Tag=Wt,exports.TextInput=Ct,exports.Textarea=({label:r,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[w,C]=n.useState(""),j=n.useId(),k=n.useId(),$=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),C(`Enter at least ${p-e} characters`)):p&&0===e&&C(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),C(`You have ${h-e} characters remaining`)):h&&0===e&&C(`Max ${h} characters`)}),[]);const S=!!a||v||b,E=[o?j:null,S?k:null,w?$:null].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{css:hn(c),children:[S?t.jsx("div",{css:fn}):null,t.jsxs(e.Field.Root,{required:s,invalid:S,gap:"0",style:{marginLeft:S?"19px":"0px"},children:[r?t.jsxs(e.Field.Label,{css:xn(c,l),"aria-label":r,children:[t.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),r,s?"":t.jsx("span",{children:" (Optional)"})]}):null,o?t.jsx(e.Field.HelperText,{id:j,css:gn(c,l),children:o}):null,a?t.jsx(e.Field.ErrorText,{id:k,css:mn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,t.jsx(e.Textarea,{placeholder:i,disabled:l,css:bn(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),C(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),C(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),C(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?t.jsxs(e.Field.ErrorText,{id:k,css:mn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?t.jsxs(e.Field.ErrorText,{id:k,css:mn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!w||b||v?null:t.jsx(e.Field.HelperText,{id:$,css:vn,"aria-live":"polite",children:w})]})]})},exports.Toast=()=>Object.keys(lx).map((n=>t.jsx(e.Portal,{children:t.jsx(e.Toaster,{toaster:lx[n],insetInline:{mdDown:"4"},children:r=>t.jsxs(e.Toast.Root,{css:nx,width:{md:"sm"},children:[t.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===r.type?r.meta?.icon?r.meta.icon:t.jsx(k,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===r.type?t.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===r.type?r.meta?.icon?r.meta.icon:t.jsx(P,{color:"var(--chakra-colors-success-500)"}):null,"warning"===r.type?r.meta?.icon?r.meta.icon:t.jsx(M,{color:"var(--chakra-colors-warning-500)"}):null,"error"===r.type?r.meta?.icon?r.meta.icon:t.jsx(_,{color:"var(--chakra-colors-error-500)"}):null,t.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[t.jsx(e.Toast.Title,{css:rx,"aria-label":`${r.title}`,children:r.title}),r.description?t.jsx(e.Toast.Title,{css:ox,"aria-label":`${r.description}`,children:r.description}):null]})]}),r.action||r.meta?.closable?t.jsxs(e.Stack,{flexDirection:"row",children:[r.action?t.jsx(b,{css:ix,label:r.action.label,size:"small",variant:"info"===r.type?"primary":"secondary",onClick:()=>{r?.action?.onClick&&r.action.onClick(),lx[n].dismiss()}}):null,r.meta?.closable?t.jsx(b,{css:ax,label:r.meta.closableLabel,"aria-label":r.meta?.closableLabel||"Dismiss",leftIcon:t.jsx(E,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>lx[n].dismiss()}):null]}):null]})})},n))),exports.Toolbar=fe,exports.Tooltip=pe,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=d,exports.getThemedColor=h,exports.showToast=e=>{lx[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
|
|
3624
|
+
`)}):t.jsx("div",{css:Si,children:e?.map(((e,r)=>t.jsx("div",{"data-test":`${e}-${n?.[r]}`,style:{backgroundColor:e,width:"100%",height:"100%"}},`${e}-${n?.[r]}`)))}),t.jsx("div",{css:Ei,children:n?.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Ri,children:e})},e)))}),o&&o.length?t.jsx("div",{css:Ei,children:o.map((e=>t.jsx("div",{style:{width:i?"auto":`calc(100% / ${n.length})`,display:"flex",justifyContent:"center"},children:t.jsx("p",{css:Li,style:{width:"100%"},children:e})},e)))}):null]});var a},exports.Search=({placeholder:r,disabled:o,size:i="default",options:a=[],resultsMaxHeight:s="200px",isLoading:l=!1,displayResults:c="text",onSelect:u,onQueryChange:d,onClear:p,renderResults:f})=>{const[x,g]=n.useState(""),{open:v,onOpen:m,onClose:b}=e.useDisclosure(),[y,w]=n.useState(a),[C,j]=n.useState(-1),k=n.useRef(null),$=`search-results-${n.useId()}`,S=e=>{const t=a.find((t=>t.id===e||t.label===e));t&&(u?.(t),g(""),b())};n.useEffect((()=>{if(d?.(x),!x)return void w(a);const e=a.filter((e=>e.id?.toLowerCase().includes(x.toLowerCase())||e.label.toLowerCase().includes(x.toLowerCase())||e.caption?.toLowerCase().includes(x.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>S(e.id||e.label)})));w(e),m()}),[x]),n.useEffect((()=>{function e(e){v&&k.current&&!k.current.contains(e.target)&&b()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[v]);const E=x.length?t.jsx(se,{style:{marginTop:"-12px"},onClick:()=>{g(""),p?.()}}):null,R="none"!==c&&!!x.length&&y.length>0&&v;return t.jsxs("div",{ref:k,style:{position:"relative",width:"100%"},children:[t.jsx(e.InputGroup,{startElement:t.jsx(ne,{fill:o?h("neutral",500):h("primary",700),style:{marginTop:"-12px"}}),endElement:E,children:t.jsx(Ct,{autoComplete:"off",placeholder:r||"Filter",onChange:e=>{const{value:t}=e.target;g(t)},value:x,label:"",style:{paddingLeft:"40px"},type:"search","aria-label":r||"Search filter","aria-expanded":R,"aria-controls":$,role:"combobox","aria-autocomplete":"list",disabled:o,size:i,onKeyDown:e=>{if(R){if("ArrowDown"===e.key&&(e.preventDefault(),j((e=>Math.min(e+1,y.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),j((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),C>=0)){const e=y[C];S(e.id||e.label)}"Escape"===e.key&&b()}}})}),(R||l&&!!x.length)&&"custom"===c&&f&&!l&&f({items:y,highlightedIndex:C,query:x,onSelect:S}),(R||l&&!!x.length)&&t.jsx(e.Portal,{container:k,children:t.jsxs(e.Box,{position:"absolute",marginTop:"-20px",width:"100%",backgroundColor:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"md",boxShadow:"md",zIndex:1e3,overflowY:"auto",maxHeight:s,children:[l&&t.jsx(e.Box,{padding:"1rem",children:t.jsx(e.Spinner,{})}),"text"===c&&!l&&t.jsx(Sf,{highlightedIndex:C,items:y,query:x,onSelect:S}),"list"===c&&!l&&t.jsx(Fi,{items:y})]})})]})},exports.Select=Ut,exports.Sheet=({header:e,content:r,footer:o,open:i=!1,onClose:a,minimizedHeight:s,midHeight:l=200,maxFullHeight:c,defaultSnap:u="minimized",className:d,blocking:p,zIndex:h=1e3})=>{const f=n.useRef(null),x=n.useRef([]),[g,v]=n.useState(null),m=window.innerWidth>768,b=x.current;let y="Expand sheet";if(null!=g){const e=Th(g,b);e>0&&e<b.length-1?y="Make full screen":e===b.length-1&&(y="Expanded sheet")}const w=!(null==g||!b.length||Th(g,b)!==b.length-1);return t.jsx(Rh,{ref:f,css:Oh(!!e,h),className:d,open:i,onDismiss:a,header:t.jsxs("div",{children:[t.jsx("button",{type:"button",disabled:w,"aria-label":y,css:Lh,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=b[b.length-1];if(m)return void f.current?.snapTo?.((()=>t));const n=g??b[0];let r=b.findIndex((e=>e>n));-1===r&&(r=b.length-1);const o=b[r];f.current?.snapTo?.((()=>o))},children:t.jsx("div",{})}),t.jsx("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:y}),e]}),footer:o,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:n})=>{const r=[20,s||e,l+(o?n:0),c||t-t/6];return x.current=r,r},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:n})=>{let r=20;return"minimized"===u?r=s||e:"mid"===u?r=l+(o?n:0):"full"===u&&(r=c||t-t/6),r},blocking:p,children:i?r:null})},exports.SimpleMapPin=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:i,variant:a="simple-pin"})=>o.jsx(Ln,{count:r,mode:i,onClick:e,ref:t,showFocusState:n,variant:a}),exports.Slider=tt,exports.SliderInput=({label:e,caption:r,size:o="default",sliderItem:i,required:a,onChange:s})=>{const[l,c]=n.useState(i.value||[]),u=(e,t)=>{const n=e.target.value,r=[...l];let o=n?parseInt(n,10):n;const a=i.min||0,s=i.max||100;o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>s?s:o,r[t]=o,c(r)},d=(e,t)=>{const n=e.target.value||"0",r=[...l];let o=parseInt(n,10);const a=i.min||0,u=i.max||100;if(o=Number.isNaN(o)?a:o,o=o<a?a:o,o=o>u?u:o,2===l?.length){o=Number.isNaN(o)?a:o;const e=l[0],n=l[1];0===t?(o=o<a?a:o,o=o>n?n:o):1===t&&(o=o<e?e:o,o=o>u?u:o)}r[t]=o,c(r),s&&s(r)};return t.jsxs("div",{children:[t.jsxs("p",{css:un(o),"aria-label":e,children:[a?t.jsx("span",{children:"*"}):null,e]}),r?t.jsx("p",{css:dn(o),"aria-label":r,children:r}):null,t.jsxs("div",{css:pn,children:[i.step&&i.marks?t.jsx(Ut,{items:i.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"90px"},value:[`${l?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));c(t),s&&s(t)}}):t.jsx(Ct,{"aria-label":e,min:i.min,max:i.max,value:l?.[0],type:"number",onChange:e=>u(e,0),onBlur:e=>d(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),t.jsx(tt,{css:{},...i,value:l,onValueChangeEnd:e=>{c(e.value),s&&s(e.value)}}),2===l?.length?t.jsx(Ct,{"aria-label":e,min:i.min,max:i.max,value:l?.[1],type:"number",onChange:e=>u(e,1),onBlur:e=>d(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},exports.StepProgressIndicator=({steps:e,currentStep:n})=>t.jsxs("div",{css:Yf,children:[e.map(((e,r)=>t.jsxs("div",{css:Kf,children:[t.jsx("button",{css:Jf(n>=r+1,n<r+1),type:"button",onClick:e.onClick,"aria-current":n===r+1,"aria-disabled":n<r+1,disabled:n<r+1,"aria-label":`Current Step ${r}${e.label?` ${e.label}`:""}`,"data-active":n>=r+1,children:n>r+1?t.jsx(C,{height:"16px",width:"16px"}):r+1}),e.label?t.jsx("p",{css:Qf(n===r+1),children:e.label}):null]},`${e.label}-${r}`))),t.jsx("div",{css:ex,children:t.jsx("div",{css:tx})})]}),exports.Switch=rt,exports.TabBar=({variant:r="panel",defaultValue:o,tabs:i,onTabClick:a,activationMode:s="manual"})=>{const[l,c]=n.useState(jf(i,o)||0),u="view"===r;return t.jsx("div",{css:mf(r),children:t.jsx(e.Tabs.Root,{width:"full",defaultValue:o||i?.[0]?.value,onValueChange:({value:e})=>{return c(jf(i,t=e)),void(a&&a(t));var t},activationMode:s,children:t.jsx(e.Tabs.List,{alignItems:"center",border:"none",children:i.map(((r,o)=>t.jsxs(n.Fragment,{children:[u&&1===o&&"left"===kf(l)?t.jsx("div",{css:wf}):null,t.jsx(e.Tabs.Trigger,{css:[bf,u?Cf:yf],"aria-label":r["aria-label"]||r.label,...r,children:t.jsxs(e.Box,{display:"flex",alignItems:"center",gap:"5px",children:[r.icon,r.label]})},r.label),u&&1===o&&"right"===kf(l)?t.jsx("div",{css:wf}):null]},r.label)))})})})},exports.Table=({columns:r,data:o=[],renderRow:i,striped:a,stickyHeader:s,pagination:l,selectable:c,selectedRows:u,variant:d="default",onSortColumn:p,onPageSizeChange:f,onPageChange:x,onAllItemsSelected:g,loading:v})=>{const[m,b]=n.useState({key:"",order:""}),{totalItems:y=o.length,currentPage:w=1,pageSize:C=10,showItemCount:j,showItemCountText:k}=l||{},S=(e,t)=>{b({key:e,order:t}),p&&p({key:e,order:t})},E=u?.length===o?.length,R=u&&u.length>0&&!E;return t.jsxs("div",{children:[t.jsxs(e.Table.Root,{css:Xi(d),striped:a,stickyHeader:s,interactive:!0,children:[t.jsx(e.Table.Header,{css:Yi(d),children:t.jsxs(e.Table.Row,{children:[c?t.jsx(e.Table.ColumnHeader,{children:t.jsx(Le,{name:"header-checkbox",checked:E,indeterminate:R,onCheckedChange:({checked:e})=>{g&&g(e)}})}):null,r.map((n=>t.jsx(e.Table.ColumnHeader,{role:n.sortable?"columnheader":void 0,"aria-sort":n.sortable&&"asc"===m.order?"ascending":n.sortable&&"desc"===m.order?"descending":void 0,children:t.jsxs("div",{css:Ki,children:[n.label,n.sortable?t.jsxs("div",{css:Ji,children:[t.jsx(ae,{css:Qi(m.key===n.key&&"asc"===m.order),icon:t.jsx($,{style:{transform:"rotate(180deg)"}}),onClick:()=>S(n.key,"asc"),"aria-label":"Ascending"}),t.jsx(ae,{css:Qi(m.key===n.key&&"desc"===m.order),icon:t.jsx($,{}),onClick:()=>S(n.key,"desc"),"aria-label":"Descending"})]}):null]})},n.key)))]})}),t.jsx(e.Table.Body,{css:na,children:o.map((e=>t.jsx(n.Fragment,{children:i(e)},e.id)))})]}),v?t.jsx("div",{css:ra,children:t.jsx(e.Spinner,{size:"lg",color:h("primary",500)})}):null,t.jsxs("div",{css:ea,children:[t.jsx("div",{children:j?t.jsx(_i,{pageSize:C,currentPage:w,totalItems:y,onPageSizeChange:f,showItemCountText:k}):null}),l?t.jsx("div",{css:ta,children:t.jsx(Ui,{totalItems:y,pageSize:C,currentPage:w,onPageChange:x})}):null]})]})},exports.TableCell=ia,exports.TableRow=oa,exports.Tag=Wt,exports.TextInput=Ct,exports.Textarea=({label:r,caption:o,placeholder:i,errorMessage:a,required:s,disabled:l,size:c="default",defaultValue:u="",onChange:d,minLength:p,maxLength:h,...f})=>{const[x,g]=n.useState(u),[v,m]=n.useState(!1),[b,y]=n.useState(!1),[w,C]=n.useState(""),j=n.useId(),k=n.useId(),$=n.useId();n.useEffect((()=>{const{length:e}=u;p&&e<p&&e>0?(m(e<p),y(!1),C(`Enter at least ${p-e} characters`)):p&&0===e&&C(`Min ${p} characters`),h&&e>0?(m(!1),y(e>h),C(`You have ${h-e} characters remaining`)):h&&0===e&&C(`Max ${h} characters`)}),[]);const S=!!a||v||b,E=[o?j:null,S?k:null,w?$:null].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{css:hn(c),children:[S?t.jsx("div",{css:fn}):null,t.jsxs(e.Field.Root,{required:s,invalid:S,gap:"0",style:{marginLeft:S?"19px":"0px"},children:[r?t.jsxs(e.Field.Label,{css:xn(c,l),"aria-label":r,children:[t.jsx(e.Field.RequiredIndicator,{"aria-label":"required"}),r,s?"":t.jsx("span",{children:" (Optional)"})]}):null,o?t.jsx(e.Field.HelperText,{id:j,css:gn(c,l),children:o}):null,a?t.jsx(e.Field.ErrorText,{id:k,css:mn,"aria-label":`Error: ${a}`,"aria-live":"polite",children:a}):null,t.jsx(e.Textarea,{placeholder:i,disabled:l,css:bn(c,x,u),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;p&&h?(m(t<p),y(t>h),C(`You have ${h-t} characters remaining`)):p?(m(t<p),y(!1),C(t<p?`Enter at least ${p-t} characters`:"")):h&&(y(t>h),m(!1),C(`You have ${h-t} characters remaining`)),d&&d(e)},value:x,"aria-describedby":E,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...f}),v&&p?t.jsxs(e.Field.ErrorText,{id:k,css:mn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You need ",p-x.length," more characters"]}):null,b&&h?t.jsxs(e.Field.ErrorText,{id:k,css:mn,style:{marginTop:"8px",fontSize:"12px",lineHeight:"16px"},"aria-live":"polite",children:["You have ",x.length-h," characters too many"]}):null,!w||b||v?null:t.jsx(e.Field.HelperText,{id:$,css:vn,"aria-live":"polite",children:w})]})]})},exports.Toast=()=>Object.keys(lx).map((n=>t.jsx(e.Portal,{children:t.jsx(e.Toaster,{toaster:lx[n],insetInline:{mdDown:"4"},children:r=>t.jsxs(e.Toast.Root,{css:nx,width:{md:"sm"},children:[t.jsxs(e.Stack,{flexDirection:"row",className:"ds-toast-icon-container",children:["info"===r.type?r.meta?.icon?r.meta.icon:t.jsx(k,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===r.type?t.jsx(e.Spinner,{size:"lg",borderWidth:"3px",color:"var(--chakra-colors-primary-500)"}):null,"success"===r.type?r.meta?.icon?r.meta.icon:t.jsx(P,{color:"var(--chakra-colors-success-500)"}):null,"warning"===r.type?r.meta?.icon?r.meta.icon:t.jsx(M,{color:"var(--chakra-colors-warning-500)"}):null,"error"===r.type?r.meta?.icon?r.meta.icon:t.jsx(_,{color:"var(--chakra-colors-error-500)"}):null,t.jsxs(e.Stack,{gap:"1",flex:"1",maxWidth:"100%",children:[t.jsx(e.Toast.Title,{css:rx,"aria-label":`${r.title}`,children:r.title}),r.description?t.jsx(e.Toast.Title,{css:ox,"aria-label":`${r.description}`,children:r.description}):null]})]}),r.action||r.meta?.closable?t.jsxs(e.Stack,{flexDirection:"row",children:[r.action?t.jsx(b,{css:ix,label:r.action.label,size:"small",variant:"info"===r.type?"primary":"secondary",onClick:()=>{r?.action?.onClick&&r.action.onClick(),lx[n].dismiss()}}):null,r.meta?.closable?t.jsx(b,{css:ax,label:r.meta.closableLabel,"aria-label":r.meta?.closableLabel||"Dismiss",leftIcon:t.jsx(E,{height:"10px!",width:"10px!"}),size:"small",variant:"secondary",onClick:()=>lx[n].dismiss()}):null]}):null]})})},n))),exports.Toolbar=fe,exports.Tooltip=pe,exports.designSystemStyles=p,exports.designSystemStylesForTailwind=d,exports.getThemedColor=h,exports.showToast=e=>{lx[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel},...e})};
|