%PDF- %PDF-
Direktori : /var/www/projetos/vagas.ongrace.com/wp-includes/js/dist/ |
Current File : /var/www/projetos/vagas.ongrace.com/wp-includes/js/dist/commands.min.js |
/*! This file is auto-generated */ !function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},nc:void 0},t={};e.r(t),e.d(t,{CommandMenu:function(){return Bn},privateApis:function(){return Kn},store:function(){return jn},useCommand:function(){return qn},useCommandLoader:function(){return Hn}});var n={};e.r(n),e.d(n,{close:function(){return Rn},open:function(){return kn},registerCommand:function(){return yn},registerCommandLoader:function(){return Cn},unregisterCommand:function(){return wn},unregisterCommandLoader:function(){return Sn}});var r={};e.r(r),e.d(r,{getCommandLoaders:function(){return Nn},getCommands:function(){return Mn},getContext:function(){return _n},isOpen:function(){return Dn}});var o={};e.r(o),e.d(o,{setContext:function(){return Pn}});var a=window.wp.element,u=1,c=.9,l=.8,i=.17,s=.1,d=.999,f=.9999,m=.99,v=/[\\\/_+.#"@\[\(\{&]/,p=/[\\\/_+.#"@\[\(\{&]/g,h=/[\s-]/,g=/[\s-]/g;function E(e,t,n,r,o,a,b){if(a===t.length)return o===e.length?u:m;var y=`${o},${a}`;if(void 0!==b[y])return b[y];for(var w,C,S,k,R=r.charAt(a),O=n.indexOf(R,o),x=0;O>=0;)(w=E(e,t,n,r,O+1,a+1,b))>x&&(O===o?w*=u:v.test(e.charAt(O-1))?(w*=l,(S=e.slice(o,O-1).match(p))&&o>0&&(w*=Math.pow(d,S.length))):h.test(e.charAt(O-1))?(w*=c,(k=e.slice(o,O-1).match(g))&&o>0&&(w*=Math.pow(d,k.length))):(w*=i,o>0&&(w*=Math.pow(d,O-o))),e.charAt(O)!==t.charAt(a)&&(w*=f)),(w<s&&n.charAt(O-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(O-1)!==r.charAt(a))&&((C=E(e,t,n,r,O+1,a+2,b))*s>w&&(w=C*s)),w>x&&(x=w),O=n.indexOf(R,O+1);return b[y]=x,x}function b(e){return e.toLowerCase().replace(g," ")}function y(e,t){return E(e,t,b(e),b(t),0,0,{})}function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(null,arguments)}var C=window.React;function S(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function k(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function R(...e){return(0,C.useCallback)(k(...e),e)}function O(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return(0,C.useMemo)((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}const x=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?C.useLayoutEffect:()=>{},A=C["useId".toString()]||(()=>{});let L=0;function M(e){const[t,n]=C.useState(A());return x((()=>{e||n((e=>null!=e?e:String(L++)))}),[e]),e||(t?`radix-${t}`:"")}function N(e){const t=(0,C.useRef)(e);return(0,C.useEffect)((()=>{t.current=e})),(0,C.useMemo)((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function D({prop:e,defaultProp:t,onChange:n=(()=>{})}){const[r,o]=function({defaultProp:e,onChange:t}){const n=(0,C.useState)(e),[r]=n,o=(0,C.useRef)(r),a=N(t);return(0,C.useEffect)((()=>{o.current!==r&&(a(r),o.current=r)}),[r,o,a]),n}({defaultProp:t,onChange:n}),a=void 0!==e,u=a?e:r,c=N(n);return[u,(0,C.useCallback)((t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&c(n)}else o(t)}),[a,e,o,c])]}var _=window.ReactDOM,P=e.n(_);const I=(0,C.forwardRef)(((e,t)=>{const{children:n,...r}=e,o=C.Children.toArray(n),a=o.find(j);if(a){const e=a.props.children,n=o.map((t=>t===a?C.Children.count(e)>1?C.Children.only(null):(0,C.isValidElement)(e)?e.props.children:null:t));return(0,C.createElement)(T,w({},r,{ref:t}),(0,C.isValidElement)(e)?(0,C.cloneElement)(e,void 0,n):null)}return(0,C.createElement)(T,w({},r,{ref:t}),n)}));I.displayName="Slot";const T=(0,C.forwardRef)(((e,t)=>{const{children:n,...r}=e;return(0,C.isValidElement)(n)?(0,C.cloneElement)(n,{...W(r,n.props),ref:k(t,n.ref)}):C.Children.count(n)>1?C.Children.only(null):null}));T.displayName="SlotClone";const F=({children:e})=>(0,C.createElement)(C.Fragment,null,e);function j(e){return(0,C.isValidElement)(e)&&e.type===F}function W(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?n[r]=(...e)=>{null==a||a(...e),null==o||o(...e)}:"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}const U=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=(0,C.forwardRef)(((e,n)=>{const{asChild:r,...o}=e,a=r?I:t;return(0,C.useEffect)((()=>{window[Symbol.for("radix-ui")]=!0}),[]),(0,C.createElement)(a,w({},o,{ref:n}))}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});const $="dismissableLayer.update",B="dismissableLayer.pointerDownOutside",K="dismissableLayer.focusOutside";let q;const H=(0,C.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z=(0,C.forwardRef)(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:u,onDismiss:c,...l}=e,i=(0,C.useContext)(H),[s,d]=(0,C.useState)(null),[,f]=(0,C.useState)({}),m=R(t,(e=>d(e))),v=Array.from(i.layers),[p]=[...i.layersWithOutsidePointerEventsDisabled].slice(-1),h=v.indexOf(p),g=s?v.indexOf(s):-1,E=i.layersWithOutsidePointerEventsDisabled.size>0,b=g>=h,y=function(e){const t=N(e),n=(0,C.useRef)(!1),r=(0,C.useRef)((()=>{}));return(0,C.useEffect)((()=>{const e=e=>{if(e.target&&!n.current){const o={originalEvent:e};function a(){V(B,t,o,{discrete:!0})}"touch"===e.pointerType?(document.removeEventListener("click",r.current),r.current=a,document.addEventListener("click",r.current,{once:!0})):a()}n.current=!1},o=window.setTimeout((()=>{document.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),document.removeEventListener("pointerdown",e),document.removeEventListener("click",r.current)}}),[t]),{onPointerDownCapture:()=>n.current=!0}}((e=>{const t=e.target,n=[...i.branches].some((e=>e.contains(t)));b&&!n&&(null==o||o(e),null==u||u(e),e.defaultPrevented||null==c||c())})),k=function(e){const t=N(e),n=(0,C.useRef)(!1);return(0,C.useEffect)((()=>{const e=e=>{if(e.target&&!n.current){V(K,t,{originalEvent:e},{discrete:!1})}};return document.addEventListener("focusin",e),()=>document.removeEventListener("focusin",e)}),[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}((e=>{const t=e.target;[...i.branches].some((e=>e.contains(t)))||(null==a||a(e),null==u||u(e),e.defaultPrevented||null==c||c())}));return function(e){const t=N(e);(0,C.useEffect)((()=>{const e=e=>{"Escape"===e.key&&t(e)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[t])}((e=>{g===i.layers.size-1&&(null==r||r(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))})),(0,C.useEffect)((()=>{if(s)return n&&(0===i.layersWithOutsidePointerEventsDisabled.size&&(q=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),i.layersWithOutsidePointerEventsDisabled.add(s)),i.layers.add(s),G(),()=>{n&&1===i.layersWithOutsidePointerEventsDisabled.size&&(document.body.style.pointerEvents=q)}}),[s,n,i]),(0,C.useEffect)((()=>()=>{s&&(i.layers.delete(s),i.layersWithOutsidePointerEventsDisabled.delete(s),G())}),[s,i]),(0,C.useEffect)((()=>{const e=()=>f({});return document.addEventListener($,e),()=>document.removeEventListener($,e)}),[]),(0,C.createElement)(U.div,w({},l,{ref:m,style:{pointerEvents:E?b?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,k.onFocusCapture),onBlurCapture:S(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,y.onPointerDownCapture)}))}));function G(){const e=new CustomEvent($);document.dispatchEvent(e)}function V(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&(0,_.flushSync)((()=>e.dispatchEvent(t)))}(o,a):o.dispatchEvent(a)}const X="focusScope.autoFocusOnMount",Y="focusScope.autoFocusOnUnmount",Z={bubbles:!1,cancelable:!0},J=(0,C.forwardRef)(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...u}=e,[c,l]=(0,C.useState)(null),i=N(o),s=N(a),d=(0,C.useRef)(null),f=R(t,(e=>l(e))),m=(0,C.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,C.useEffect)((()=>{if(r){function e(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?d.current=t:ne(d.current,{select:!0})}function t(e){!m.paused&&c&&(c.contains(e.relatedTarget)||ne(d.current,{select:!0}))}return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[r,c,m.paused]),(0,C.useEffect)((()=>{if(c){re.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(X,Z);c.addEventListener(X,i),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ne(r,{select:t}),document.activeElement!==n)return}((e=Q(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&ne(c))}return()=>{c.removeEventListener(X,i),setTimeout((()=>{const e=new CustomEvent(Y,Z);c.addEventListener(Y,s),c.dispatchEvent(e),e.defaultPrevented||ne(null!=t?t:document.body,{select:!0}),c.removeEventListener(Y,s),re.remove(m)}),0)}}var e}),[c,i,s,m]);const v=(0,C.useCallback)((e=>{if(!n&&!r)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){const t=e.currentTarget,[r,a]=function(e){const t=Q(e),n=ee(t,e),r=ee(t.reverse(),e);return[n,r]}(t);r&&a?e.shiftKey||o!==a?e.shiftKey&&o===r&&(e.preventDefault(),n&&ne(a,{select:!0})):(e.preventDefault(),n&&ne(r,{select:!0})):o===t&&e.preventDefault()}}),[n,r,m.paused]);return(0,C.createElement)(U.div,w({tabIndex:-1},u,{ref:f,onKeyDown:v}))}));function Q(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ee(e,t){for(const n of e)if(!te(n,{upTo:t}))return n}function te(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ne(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const re=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=oe(e,t),e.unshift(t)},remove(t){var n;e=oe(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function oe(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const ae=(0,C.forwardRef)(((e,t)=>{var n;const{container:r=(null===globalThis||void 0===globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...o}=e;return r?P().createPortal((0,C.createElement)(U.div,w({},o,{ref:t})),r):null}));const ue=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=(0,C.useState)(),r=(0,C.useRef)({}),o=(0,C.useRef)(e),a=(0,C.useRef)("none"),u=e?"mounted":"unmounted",[c,l]=function(e,t){return(0,C.useReducer)(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,C.useEffect)((()=>{const e=ce(r.current);a.current="mounted"===c?e:"none"}),[c]),x((()=>{const t=r.current,n=o.current;if(n!==e){const r=a.current,u=ce(t);if(e)l("MOUNT");else if("none"===u||"none"===(null==t?void 0:t.display))l("UNMOUNT");else{l(n&&r!==u?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,l]),x((()=>{if(t){const e=e=>{const n=ce(r.current).includes(e.animationName);e.target===t&&n&&(0,_.flushSync)((()=>l("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=ce(r.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}l("ANIMATION_END")}),[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:(0,C.useCallback)((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):C.Children.only(n),a=R(r.ref,o.ref);return"function"==typeof n||r.isPresent?(0,C.cloneElement)(o,{ref:a}):null};function ce(e){return(null==e?void 0:e.animationName)||"none"}ue.displayName="Presence";let le=0;function ie(){(0,C.useEffect)((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:se()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:se()),le++,()=>{1===le&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),le--}}),[])}function se(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},de.apply(this,arguments)};function fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}Object.create;function me(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create;"function"==typeof SuppressedError&&SuppressedError;var ve="right-scroll-bar-position",pe="width-before-scroll-bar";function he(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ge="undefined"!=typeof window?C.useLayoutEffect:C.useEffect,Ee=new WeakMap;function be(e,t){var n,r,o,a=(n=t||null,r=function(t){return e.forEach((function(e){return he(e,t)}))},(o=(0,C.useState)((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0]).callback=r,o.facade);return ge((function(){var t=Ee.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach((function(e){r.has(e)||he(e,null)})),r.forEach((function(e){n.has(e)||he(e,o)}))}Ee.set(a,e)}),[e]),a}function ye(e){return e}function we(e,t){void 0===t&&(t=ye);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},u=function(){return Promise.resolve().then(a)};u(),n={push:function(e){t.push(e),u()},filter:function(e){return t=t.filter(e),n}}}}}var Ce=function(e){void 0===e&&(e={});var t=we(null);return t.options=de({async:!0,ssr:!1},e),t}(),Se=function(){},ke=C.forwardRef((function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Se,onWheelCapture:Se,onTouchMoveCapture:Se}),o=r[0],a=r[1],u=e.forwardProps,c=e.children,l=e.className,i=e.removeScrollBar,s=e.enabled,d=e.shards,f=e.sideCar,m=e.noIsolation,v=e.inert,p=e.allowPinchZoom,h=e.as,g=void 0===h?"div":h,E=fe(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=f,y=be([n,t]),w=de(de({},E),o);return C.createElement(C.Fragment,null,s&&C.createElement(b,{sideCar:Ce,removeScrollBar:i,shards:d,noIsolation:m,inert:v,setCallbacks:a,allowPinchZoom:!!p,lockRef:n}),u?C.cloneElement(C.Children.only(c),de(de({},w),{ref:y})):C.createElement(g,de({},w,{className:l,ref:y}),c))}));ke.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ke.classNames={fullWidth:pe,zeroRight:ve};var Re,Oe=function(e){var t=e.sideCar,n=fe(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,de({},n))};Oe.isSideCarExport=!0;function xe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var n=Re||e.nc;return n&&t.setAttribute("nonce",n),t}var Ae=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=xe())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Le=function(){var e,t=(e=Ae(),function(t,n){C.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},Me={left:0,top:0,right:0,gap:0},Ne=function(e){return parseInt(e||"",10)||0},De=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Me;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ne(n),Ne(r),Ne(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},_e=Le(),Pe="data-scroll-locked",Ie=function(e,t,n,r){var o=e.left,a=e.top,u=e.right,c=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(c,"px ").concat(r,";\n }\n body[").concat(Pe,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(u,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(c,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(ve," {\n right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(pe," {\n margin-right: ").concat(c,"px ").concat(r,";\n }\n \n .").concat(ve," .").concat(ve," {\n right: 0 ").concat(r,";\n }\n \n .").concat(pe," .").concat(pe," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Pe,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(c,"px;\n }\n")},Te=function(){var e=parseInt(document.body.getAttribute(Pe)||"0",10);return isFinite(e)?e:0},Fe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;C.useEffect((function(){return document.body.setAttribute(Pe,(Te()+1).toString()),function(){var e=Te()-1;e<=0?document.body.removeAttribute(Pe):document.body.setAttribute(Pe,e.toString())}}),[]);var a=C.useMemo((function(){return De(o)}),[o]);return C.createElement(_e,{styles:Ie(a,!t,o,n?"":"!important")})},je=!1;if("undefined"!=typeof window)try{var We=Object.defineProperty({},"passive",{get:function(){return je=!0,!0}});window.addEventListener("test",We,We),window.removeEventListener("test",We,We)}catch(e){je=!1}var Ue=!!je&&{passive:!1},$e=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Be(e,n)){var r=Ke(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Be=function(e,t){return"v"===e?function(e){var t=window.getComputedStyle(e);return"hidden"!==t.overflowY&&!(t.overflowY===t.overflowX&&"visible"===t.overflowY)}(t):function(e){var t=window.getComputedStyle(e);return"hidden"!==t.overflowX&&!(t.overflowY===t.overflowX&&"visible"===t.overflowX)}(t)},Ke=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},qe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},He=function(e){return[e.deltaX,e.deltaY]},ze=function(e){return e&&"current"in e?e.current:e},Ge=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ve=0,Xe=[];var Ye,Ze=(Ye=function(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),o=C.useState(Ve++)[0],a=C.useState((function(){return Le()}))[0],u=C.useRef(e);C.useEffect((function(){u.current=e}),[e]),C.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=me([e.lockRef.current],(e.shards||[]).map(ze),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var c=C.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!u.current.allowPinchZoom;var o,a=qe(e),c=n.current,l="deltaX"in e?e.deltaX:c[0]-a[0],i="deltaY"in e?e.deltaY:c[1]-a[1],s=e.target,d=Math.abs(l)>Math.abs(i)?"h":"v";if("touches"in e&&"h"===d&&"range"===s.type)return!1;var f=$e(d,s);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=$e(d,s)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||i)&&(r.current=o),!o)return!0;var m=r.current||o;return function(e,t,n,r,o){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),u=a*r,c=n.target,l=t.contains(c),i=!1,s=u>0,d=0,f=0;do{var m=Ke(e,c),v=m[0],p=m[1]-m[2]-a*v;(v||p)&&Be(e,c)&&(d+=p,f+=v),c=c.parentNode}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(s&&(o&&0===d||!o&&u>d)||!s&&(o&&0===f||!o&&-u>f))&&(i=!0),i}(m,t,e,"h"===m?l:i,!0)}),[]),l=C.useCallback((function(e){var n=e;if(Xe.length&&Xe[Xe.length-1]===a){var r="deltaY"in n?He(n):qe(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&(t=e.delta,o=r,t[0]===o[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.preventDefault();else if(!o){var l=(u.current.shards||[]).map(ze).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?c(n,l[0]):!u.current.noIsolation)&&n.preventDefault()}}}),[]),i=C.useCallback((function(e,n,r,o){var a={name:e,delta:n,target:r,should:o};t.current.push(a),setTimeout((function(){t.current=t.current.filter((function(e){return e!==a}))}),1)}),[]),s=C.useCallback((function(e){n.current=qe(e),r.current=void 0}),[]),d=C.useCallback((function(t){i(t.type,He(t),t.target,c(t,e.lockRef.current))}),[]),f=C.useCallback((function(t){i(t.type,qe(t),t.target,c(t,e.lockRef.current))}),[]);C.useEffect((function(){return Xe.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Ue),document.addEventListener("touchmove",l,Ue),document.addEventListener("touchstart",s,Ue),function(){Xe=Xe.filter((function(e){return e!==a})),document.removeEventListener("wheel",l,Ue),document.removeEventListener("touchmove",l,Ue),document.removeEventListener("touchstart",s,Ue)}}),[]);var m=e.removeScrollBar,v=e.inert;return C.createElement(C.Fragment,null,v?C.createElement(a,{styles:Ge(o)}):null,m?C.createElement(Fe,{gapMode:"margin"}):null)},Ce.useMedium(Ye),Oe),Je=C.forwardRef((function(e,t){return C.createElement(ke,de({},e,{ref:t,sideCar:Ze}))}));Je.classNames=ke.classNames;var Qe=Je,et=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},tt=new WeakMap,nt=new WeakMap,rt={},ot=0,at=function(e){return e&&(e.host||at(e.parentNode))},ut=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=at(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);rt[n]||(rt[n]=new WeakMap);var a=rt[n],u=[],c=new Set,l=new Set(o),i=function(e){e&&!c.has(e)&&(c.add(e),i(e.parentNode))};o.forEach(i);var s=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(c.has(e))s(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(tt.get(e)||0)+1,i=(a.get(e)||0)+1;tt.set(e,l),a.set(e,i),u.push(e),1===l&&o&&nt.set(e,!0),1===i&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return s(t),c.clear(),ot++,function(){u.forEach((function(e){var t=tt.get(e)-1,o=a.get(e)-1;tt.set(e,t),a.set(e,o),t||(nt.has(e)||e.removeAttribute(r),nt.delete(e)),o||e.removeAttribute(n)})),--ot||(tt=new WeakMap,tt=new WeakMap,nt=new WeakMap,rt={})}},ct=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||et(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),ut(r,o,n,"aria-hidden")):function(){return null}};const lt="Dialog",[it,st]=function(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>(0,C.createContext)(e)));return function(n){const r=(null==n?void 0:n[e])||t;return(0,C.useMemo)((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const o=(0,C.createContext)(r),a=n.length;function u(t){const{scope:n,children:r,...u}=t,c=(null==n?void 0:n[e][a])||o,l=(0,C.useMemo)((()=>u),Object.values(u));return(0,C.createElement)(c.Provider,{value:l},r)}return n=[...n,r],u.displayName=t+"Provider",[u,function(n,u){const c=(null==u?void 0:u[e][a])||o,l=(0,C.useContext)(c);if(l)return l;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},O(r,...t)]}(lt),[dt,ft]=it(lt),mt=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:u=!0}=e,c=(0,C.useRef)(null),l=(0,C.useRef)(null),[i=!1,s]=D({prop:r,defaultProp:o,onChange:a});return(0,C.createElement)(dt,{scope:t,triggerRef:c,contentRef:l,contentId:M(),titleId:M(),descriptionId:M(),open:i,onOpenChange:s,onOpenToggle:(0,C.useCallback)((()=>s((e=>!e))),[s]),modal:u},n)},vt="DialogPortal",[pt,ht]=it(vt,{forceMount:void 0}),gt=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=ft(vt,t);return(0,C.createElement)(pt,{scope:t,forceMount:n},C.Children.map(r,(e=>(0,C.createElement)(ue,{present:n||a.open},(0,C.createElement)(ae,{asChild:!0,container:o},e)))))},Et="DialogOverlay",bt=(0,C.forwardRef)(((e,t)=>{const n=ht(Et,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ft(Et,e.__scopeDialog);return a.modal?(0,C.createElement)(ue,{present:r||a.open},(0,C.createElement)(yt,w({},o,{ref:t}))):null})),yt=(0,C.forwardRef)(((e,t)=>{const{__scopeDialog:n,...r}=e,o=ft(Et,n);return(0,C.createElement)(Qe,{as:I,allowPinchZoom:!0,shards:[o.contentRef]},(0,C.createElement)(U.div,w({"data-state":xt(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))})),wt="DialogContent",Ct=(0,C.forwardRef)(((e,t)=>{const n=ht(wt,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=ft(wt,e.__scopeDialog);return(0,C.createElement)(ue,{present:r||a.open},a.modal?(0,C.createElement)(St,w({},o,{ref:t})):(0,C.createElement)(kt,w({},o,{ref:t})))})),St=(0,C.forwardRef)(((e,t)=>{const n=ft(wt,e.__scopeDialog),r=(0,C.useRef)(null),o=R(t,n.contentRef,r);return(0,C.useEffect)((()=>{const e=r.current;if(e)return ct(e)}),[]),(0,C.createElement)(Rt,w({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:S(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()})),onFocusOutside:S(e.onFocusOutside,(e=>e.preventDefault()))}))})),kt=(0,C.forwardRef)(((e,t)=>{const n=ft(wt,e.__scopeDialog),r=(0,C.useRef)(!1);return(0,C.createElement)(Rt,w({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var o,a;(null===(o=e.onCloseAutoFocus)||void 0===o||o.call(e,t),t.defaultPrevented)||(r.current||null===(a=n.triggerRef.current)||void 0===a||a.focus(),t.preventDefault());r.current=!1},onInteractOutside:t=>{var o,a;null===(o=e.onInteractOutside)||void 0===o||o.call(e,t),t.defaultPrevented||(r.current=!0);const u=t.target;(null===(a=n.triggerRef.current)||void 0===a?void 0:a.contains(u))&&t.preventDefault()}}))})),Rt=(0,C.forwardRef)(((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...u}=e,c=ft(wt,n),l=R(t,(0,C.useRef)(null));return ie(),(0,C.createElement)(C.Fragment,null,(0,C.createElement)(J,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a},(0,C.createElement)(z,w({role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":xt(c.open)},u,{ref:l,onDismiss:()=>c.onOpenChange(!1)}))),!1)})),Ot="DialogTitle";function xt(e){return e?"open":"closed"}const At="DialogTitleWarning",[Lt,Mt]=function(e,t){const n=(0,C.createContext)(t);function r(e){const{children:t,...r}=e,o=(0,C.useMemo)((()=>r),Object.values(r));return(0,C.createElement)(n.Provider,{value:o},t)}return r.displayName=e+"Provider",[r,function(r){const o=(0,C.useContext)(n);if(o)return o;if(void 0!==t)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}]}(At,{contentName:wt,titleName:Ot,docsSlug:"dialog"}),Nt=mt,Dt=gt,_t=bt,Pt=Ct;var It='[cmdk-group=""]',Tt='[cmdk-group-items=""]',Ft='[cmdk-item=""]',jt=`${Ft}:not([aria-disabled="true"])`,Wt="cmdk-item-select",Ut="data-value",$t=(e,t)=>y(e,t),Bt=C.createContext(void 0),Kt=()=>C.useContext(Bt),qt=C.createContext(void 0),Ht=()=>C.useContext(qt),zt=C.createContext(void 0),Gt=C.forwardRef(((e,t)=>{let n=C.useRef(null),r=cn((()=>{var t,n,r;return{search:"",value:null!=(r=null!=(n=e.value)?n:null==(t=e.defaultValue)?void 0:t.toLowerCase())?r:"",filtered:{count:0,items:new Map,groups:new Set}}})),o=cn((()=>new Set)),a=cn((()=>new Map)),u=cn((()=>new Map)),c=cn((()=>new Set)),l=an(e),{label:i,children:s,value:d,onValueChange:f,filter:m,shouldFilter:v,vimBindings:p=!0,...h}=e,g=C.useId(),E=C.useId(),b=C.useId(),y=fn();un((()=>{if(void 0!==d){let e=d.trim().toLowerCase();r.current.value=e,y(6,A),w.emit()}}),[d]);let w=C.useMemo((()=>({subscribe:e=>(c.current.add(e),()=>c.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,u;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)x(),R(),y(1,O);else if("value"===e){if(void 0!==(null==(o=l.current)?void 0:o.value)){let e=null!=t?t:"";return void(null==(u=(a=l.current).onValueChange)||u.call(a,e))}n||y(5,A)}w.emit()}},emit:()=>{c.current.forEach((e=>e()))}})),[]),S=C.useMemo((()=>({value:(e,t)=>{t!==u.current.get(e)&&(u.current.set(e,t),r.current.filtered.items.set(e,k(t)),y(2,(()=>{R(),w.emit()})))},item:(e,t)=>(o.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),y(3,(()=>{x(),R(),r.current.value||O(),w.emit()})),()=>{u.current.delete(e),o.current.delete(e),r.current.filtered.items.delete(e);let t=L();y(4,(()=>{x(),(null==t?void 0:t.getAttribute("id"))===e&&O(),w.emit()}))}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{u.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:i||e["aria-label"],commandRef:n,listId:g,inputId:b,labelId:E})),[]);function k(e){var t,n;let o=null!=(n=null==(t=l.current)?void 0:t.filter)?n:$t;return e?o(e,r.current.search):0}function R(){if(!n.current||!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach((n=>{let r=a.current.get(n),o=0;r.forEach((t=>{let n=e.get(t);o=Math.max(n,o)})),t.push([n,o])}));let o=n.current.querySelector('[cmdk-list-sizer=""]');M().sort(((t,n)=>{var r,o;let a=t.getAttribute(Ut),u=n.getAttribute(Ut);return(null!=(r=e.get(u))?r:0)-(null!=(o=e.get(a))?o:0)})).forEach((e=>{let t=e.closest(Tt);t?t.appendChild(e.parentElement===t?e:e.closest(`${Tt} > *`)):o.appendChild(e.parentElement===o?e:e.closest(`${Tt} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=n.current.querySelector(`${It}[${Ut}="${e[0]}"]`);null==t||t.parentElement.appendChild(t)}))}function O(){let e=M().find((e=>!e.ariaDisabled)),t=null==e?void 0:e.getAttribute(Ut);w.setState("value",t||void 0)}function x(){if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=o.current.size);r.current.filtered.groups=new Set;let e=0;for(let t of o.current){let n=k(u.current.get(t));r.current.filtered.items.set(t,n),n>0&&e++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=e}function A(){var e,t,n;let r=L();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(It))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function L(){var e;return null==(e=n.current)?void 0:e.querySelector(`${Ft}[aria-selected="true"]`)}function M(){return Array.from(n.current.querySelectorAll(jt))}function N(e){let t=M()[e];t&&w.setState("value",t.getAttribute(Ut))}function D(e){var t;let n=L(),r=M(),o=r.findIndex((e=>e===n)),a=r[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),a&&w.setState("value",a.getAttribute(Ut))}function _(e){let t,n=L(),r=null==n?void 0:n.closest(It);for(;r&&!t;)r=e>0?rn(r,It):on(r,It),t=null==r?void 0:r.querySelector(jt);t?w.setState("value",t.getAttribute(Ut)):D(e)}let P=()=>N(M().length-1),I=e=>{e.preventDefault(),e.metaKey?P():e.altKey?_(1):D(1)},T=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?_(-1):D(-1)};return C.createElement("div",{ref:ln([n,t]),...h,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=h.onKeyDown)||t.call(h,e),!e.defaultPrevented)switch(e.key){case"n":case"j":p&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":p&&e.ctrlKey&&T(e);break;case"ArrowUp":T(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),P();break;case"Enter":if(!e.nativeEvent.isComposing){e.preventDefault();let t=L();if(t){let e=new Event(Wt);t.dispatchEvent(e)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:mn},i),C.createElement(qt.Provider,{value:w},C.createElement(Bt.Provider,{value:S},s)))})),Vt=C.forwardRef(((e,t)=>{var n,r;let o=C.useId(),a=C.useRef(null),u=C.useContext(zt),c=Kt(),l=an(e),i=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==u?void 0:u.forceMount;un((()=>c.item(o,null==u?void 0:u.id)),[]);let s=dn(o,a,[e.value,e.children,a]),d=Ht(),f=sn((e=>e.value&&e.value===s.current)),m=sn((e=>!(!i&&!1!==c.filter())||(!e.search||e.filtered.items.get(o)>0)));function v(){var e,t;p(),null==(t=(e=l.current).onSelect)||t.call(e,s.current)}function p(){d.setState("value",s.current,!0)}if(C.useEffect((()=>{let t=a.current;if(t&&!e.disabled)return t.addEventListener(Wt,v),()=>t.removeEventListener(Wt,v)}),[m,e.onSelect,e.disabled]),!m)return null;let{disabled:h,value:g,onSelect:E,forceMount:b,...y}=e;return C.createElement("div",{ref:ln([a,t]),...y,id:o,"cmdk-item":"",role:"option","aria-disabled":h||void 0,"aria-selected":f||void 0,"data-disabled":h||void 0,"data-selected":f||void 0,onPointerMove:h?void 0:p,onClick:h?void 0:v},e.children)})),Xt=C.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...a}=e,u=C.useId(),c=C.useRef(null),l=C.useRef(null),i=C.useId(),s=Kt(),d=sn((e=>!(!o&&!1!==s.filter())||(!e.search||e.filtered.groups.has(u))));un((()=>s.group(u)),[]),dn(u,c,[e.value,e.heading,l]);let f=C.useMemo((()=>({id:u,forceMount:o})),[o]),m=C.createElement(zt.Provider,{value:f},r);return C.createElement("div",{ref:ln([c,t]),...a,"cmdk-group":"",role:"presentation",hidden:!d||void 0},n&&C.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:i},n),C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?i:void 0},m))})),Yt=C.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=C.useRef(null),a=sn((e=>!e.search));return n||a?C.createElement("div",{ref:ln([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),Zt=C.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,a=Ht(),u=sn((e=>e.search)),c=sn((e=>e.value)),l=Kt(),i=C.useMemo((()=>{var e;let t=null==(e=l.commandRef.current)?void 0:e.querySelector(`${Ft}[${Ut}="${c}"]`);return null==t?void 0:t.getAttribute("id")}),[c,l.commandRef]);return C.useEffect((()=>{null!=e.value&&a.setState("search",e.value)}),[e.value]),C.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":i,id:l.inputId,type:"text",value:o?e.value:u,onChange:e=>{o||a.setState("search",e.target.value),null==n||n(e.target.value)}})})),Jt=C.forwardRef(((e,t)=>{let{children:n,...r}=e,o=C.useRef(null),a=C.useRef(null),u=Kt();return C.useEffect((()=>{if(a.current&&o.current){let e,t=a.current,n=o.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),C.createElement("div",{ref:ln([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:u.listId,"aria-labelledby":u.inputId},C.createElement("div",{ref:a,"cmdk-list-sizer":""},n))})),Qt=C.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:a,container:u,...c}=e;return C.createElement(Nt,{open:n,onOpenChange:r},C.createElement(Dt,{container:u},C.createElement(_t,{"cmdk-overlay":"",className:o}),C.createElement(Pt,{"aria-label":e.label,"cmdk-dialog":"",className:a},C.createElement(Gt,{ref:t,...c}))))})),en=C.forwardRef(((e,t)=>{let n=C.useRef(!0),r=sn((e=>0===e.filtered.count));return C.useEffect((()=>{n.current=!1}),[]),n.current||!r?null:C.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})})),tn=C.forwardRef(((e,t)=>{let{progress:n,children:r,...o}=e;return C.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},C.createElement("div",{"aria-hidden":!0},r))})),nn=Object.assign(Gt,{List:Jt,Item:Vt,Input:Zt,Group:Xt,Separator:Yt,Dialog:Qt,Empty:en,Loading:tn});function rn(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function on(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function an(e){let t=C.useRef(e);return un((()=>{t.current=e})),t}var un="undefined"==typeof window?C.useEffect:C.useLayoutEffect;function cn(e){let t=C.useRef();return void 0===t.current&&(t.current=e()),t}function ln(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function sn(e){let t=Ht(),n=()=>e(t.snapshot());return C.useSyncExternalStore(t.subscribe,n,n)}function dn(e,t,n){let r=C.useRef(),o=Kt();return un((()=>{var a;let u=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim().toLowerCase();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim().toLowerCase():r.current}})();o.value(e,u),null==(a=t.current)||a.setAttribute(Ut,u),r.current=u})),r}var fn=()=>{let[e,t]=C.useState(),n=cn((()=>new Map));return un((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}},mn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},vn=window.wp.data,pn=window.wp.i18n,hn=window.wp.components,gn=window.wp.keyboardShortcuts;var En=function({icon:e,size:t=24,...n}){return(0,a.cloneElement)(e,{width:t,height:t,...n})};var bn=(0,vn.combineReducers)({commands:function(e={},t){switch(t.type){case"REGISTER_COMMAND":return{...e,[t.name]:{name:t.name,label:t.label,searchLabel:t.searchLabel,context:t.context,callback:t.callback,icon:t.icon}};case"UNREGISTER_COMMAND":{const{[t.name]:n,...r}=e;return r}}return e},commandLoaders:function(e={},t){switch(t.type){case"REGISTER_COMMAND_LOADER":return{...e,[t.name]:{name:t.name,context:t.context,hook:t.hook}};case"UNREGISTER_COMMAND_LOADER":{const{[t.name]:n,...r}=e;return r}}return e},isOpen:function(e=!1,t){switch(t.type){case"OPEN":return!0;case"CLOSE":return!1}return e},context:function(e="root",t){return"SET_CONTEXT"===t.type?t.context:e}});function yn(e){return{type:"REGISTER_COMMAND",...e}}function wn(e){return{type:"UNREGISTER_COMMAND",name:e}}function Cn(e){return{type:"REGISTER_COMMAND_LOADER",...e}}function Sn(e){return{type:"UNREGISTER_COMMAND_LOADER",name:e}}function kn(){return{type:"OPEN"}}function Rn(){return{type:"CLOSE"}}var On={};function xn(e){return[e]}function An(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Ln(e,t){var n,r=t||xn;function o(){n=new WeakMap}function a(){var t,o,a,u,c,l=arguments.length;for(u=new Array(l),a=0;a<l;a++)u[a]=arguments[a];for(t=function(e){var t,r,o,a,u,c=n,l=!0;for(t=0;t<e.length;t++){if(!(u=r=e[t])||"object"!=typeof u){l=!1;break}c.has(r)?c=c.get(r):(o=new WeakMap,c.set(r,o),c=o)}return c.has(On)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=l,c.set(On,a)),c.get(On)}(c=r.apply(null,u)),t.isUniqueByDependants||(t.lastDependants&&!An(c,t.lastDependants,0)&&t.clear(),t.lastDependants=c),o=t.head;o;){if(An(o.args,u,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,u)},u[0]=null,o.args=u,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return a.getDependants=r,a.clear=o,o(),a}const Mn=Ln(((e,t=!1)=>Object.values(e.commands).filter((n=>{const r=n.context&&n.context===e.context;return t?r:!r}))),(e=>[e.commands,e.context])),Nn=Ln(((e,t=!1)=>Object.values(e.commandLoaders).filter((n=>{const r=n.context&&n.context===e.context;return t?r:!r}))),(e=>[e.commandLoaders,e.context]));function Dn(e){return e.isOpen}function _n(e){return e.context}function Pn(e){return{type:"SET_CONTEXT",context:e}}var In=window.wp.privateApis;const{lock:Tn,unlock:Fn}=(0,In.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/commands"),jn=(0,vn.createReduxStore)("core/commands",{reducer:bn,actions:n,selectors:r});function Wn({name:e,search:t,hook:n,setLoader:r,close:o}){var u;const{isLoading:c,commands:l=[]}=null!==(u=n({search:t}))&&void 0!==u?u:{};return(0,a.useEffect)((()=>{r(e,c)}),[r,e,c]),l.length?(0,a.createElement)(a.Fragment,null,(0,a.createElement)(nn.List,null,l.map((e=>{var n;return(0,a.createElement)(nn.Item,{key:e.name,value:null!==(n=e.searchLabel)&&void 0!==n?n:e.label,onSelect:()=>e.callback({close:o})},(0,a.createElement)(hn.__experimentalHStack,{alignment:"left",className:"commands-command-menu__item"},(0,a.createElement)(En,{icon:e.icon}),(0,a.createElement)("span",null,(0,a.createElement)(hn.TextHighlight,{text:e.label,highlight:t}))))})))):null}function Un({hook:e,search:t,setLoader:n,close:r}){const o=(0,a.useRef)(e),[u,c]=(0,a.useState)(0);return(0,a.useEffect)((()=>{o.current!==e&&(o.current=e,c((e=>e+1)))}),[e]),(0,a.createElement)(Wn,{key:u,hook:o.current,search:t,setLoader:n,close:r})}function $n({isContextual:e,search:t,setLoader:n,close:r}){const{commands:o,loaders:u}=(0,vn.useSelect)((t=>{const{getCommands:n,getCommandLoaders:r}=t(jn);return{commands:n(e),loaders:r(e)}}),[e]);return o.length||u.length?(0,a.createElement)(nn.Group,null,o.map((e=>{var n;return(0,a.createElement)(nn.Item,{key:e.name,value:null!==(n=e.searchLabel)&&void 0!==n?n:e.label,onSelect:()=>e.callback({close:r})},(0,a.createElement)(hn.__experimentalHStack,{alignment:"left",className:"commands-command-menu__item"},(0,a.createElement)(En,{icon:e.icon}),(0,a.createElement)("span",null,(0,a.createElement)(hn.TextHighlight,{text:e.label,highlight:t}))))})),u.map((e=>(0,a.createElement)(Un,{key:e.name,hook:e.hook,search:t,setLoader:n,close:r})))):null}function Bn(){const{registerShortcut:e}=(0,vn.useDispatch)(gn.store),[t,n]=(0,a.useState)(""),r=(0,vn.useSelect)((e=>e(jn).isOpen()),[]),{open:o,close:u}=(0,vn.useDispatch)(jn),[c,l]=(0,a.useState)({}),i=(0,a.useRef)();(0,a.useEffect)((()=>{e({name:"core/commands",category:"global",description:(0,pn.__)("Open the command palette"),keyCombination:{modifier:"primary",character:"k"}})}),[e]),(0,gn.useShortcut)("core/commands",(e=>{e.defaultPrevented||(e.preventDefault(),r?u():o())}),{bindGlobal:!0});const s=(0,a.useCallback)(((e,t)=>l((n=>({...n,[e]:t})))),[]),d=()=>{n(""),u()};if((0,a.useEffect)((()=>{r&&i.current.focus()}),[r]),!r)return!1;const f=Object.values(c).some(Boolean);return(0,a.createElement)(hn.Modal,{className:"commands-command-menu",overlayClassName:"commands-command-menu__overlay",onRequestClose:d,__experimentalHideHeader:!0},(0,a.createElement)("div",{className:"commands-command-menu__container"},(0,a.createElement)(nn,{label:(0,pn.__)("Command palette"),onKeyDown:e=>{(e.nativeEvent.isComposing||229===e.keyCode)&&e.preventDefault()}},(0,a.createElement)("div",{className:"commands-command-menu__header"},(0,a.createElement)(nn.Input,{ref:i,value:t,onValueChange:n,placeholder:(0,pn.__)("Type a command or search")})),(0,a.createElement)(nn.List,null,t&&!f&&(0,a.createElement)(nn.Empty,null,(0,pn.__)("No results found.")),(0,a.createElement)($n,{search:t,setLoader:s,close:d,isContextual:!0}),t&&(0,a.createElement)($n,{search:t,setLoader:s,close:d})))))}(0,vn.register)(jn),Fn(jn).registerPrivateActions(o);const Kn={};function qn(e){const{registerCommand:t,unregisterCommand:n}=(0,vn.useDispatch)(jn),r=(0,a.useRef)(e.callback);(0,a.useEffect)((()=>{r.current=e.callback}),[e.callback]),(0,a.useEffect)((()=>(t({name:e.name,context:e.context,label:e.label,searchLabel:e.searchLabel,icon:e.icon,callback:(...e)=>r.current(...e)}),()=>{n(e.name)})),[e.name,e.label,e.searchLabel,e.icon,e.context,t,n])}function Hn(e){const{registerCommandLoader:t,unregisterCommandLoader:n}=(0,vn.useDispatch)(jn);(0,a.useEffect)((()=>(t({name:e.name,hook:e.hook,context:e.context}),()=>{n(e.name)})),[e.name,e.hook,e.context,t,n])}Tn(Kn,{useCommandContext:function(e){const{getContext:t}=(0,vn.useSelect)(jn),n=(0,a.useRef)(t()),{setContext:r}=Fn((0,vn.useDispatch)(jn));(0,a.useEffect)((()=>{r(e)}),[e,r]),(0,a.useEffect)((()=>{const e=n.current;return()=>r(e)}),[r])}}),(window.wp=window.wp||{}).commands=t}();