1import{a as e,t}from"./chunk-BEqpzyXh.js";import{t as n}from"./react-BTpDkA_X.js";import{H as r,vt as i}from"./use-number-formatter-B9J6y0hQ.js";import{Si as a,Ti as o,wi as s}from"./lucide-react-I0s3kkbU.js";import{t as c}from"./jsx-runtime-CtcQ9akZ.js";import{t as l}from"./trans-s1xNl4Kf.js";import{r as u}from"./progress-circle-B4Qg5tKj.js";var d=t(((e,t)=>{function n(e,t){var n,r;if(typeof t==`function`)r=t(e),r!==void 0&&(e=r);else if(Array.isArray(t))for(n=0;n<t.length;n++)r=t[n](e),r!==void 0&&(e=r);return e}function r(e,t){return e[0]===`-`&&Array.isArray(t)&&/^-\d+$/.test(e)?t.length+parseInt(e,10):e}function i(e){return/^\d+$/.test(e)}function a(e){return Object.prototype.toString.call(e)===`[object Object]`}function o(e){return Object(e)===e}function s(e){return Object.keys(e).length===0}var c=[`__proto__`,`prototype`,`constructor`],l=function(e){return c.indexOf(e)===-1};function u(e,t){e.indexOf(`[`)>=0&&(e=e.replace(/\[/g,t).replace(/]/g,``));var n=e.split(t);if(n.filter(l).length!==n.length)throw Error(`Refusing to update blacklisted property `+e);return n}var d=Object.prototype.hasOwnProperty;function f(e,t,n,r){if(!(this instanceof f))return new f(e,t,n,r);t===void 0&&(t=!1),n===void 0&&(n=!0),r===void 0&&(r=!0),this.separator=e||`.`,this.override=t,this.useArray=n,this.useBrackets=r,this.keepArray=!1,this.cleanup=[]}var p=new f(`.`,!1,!0,!0);function m(e){return function(){return p[e].apply(p,arguments)}}f.prototype._fill=function(e,t,r,a){var c=e.shift();if(e.length>0){if(t[c]=t[c]||(this.useArray&&i(e[0])?[]:{}),!o(t[c]))if(this.override)t[c]={};else{if(!(o(r)&&s(r)))throw Error("Trying to redefine `"+c+"` which is a "+typeof t[c]);return}this._fill(e,t[c],r,a)}else{if(!this.override&&o(t[c])&&!s(t[c])){if(!(o(r)&&s(r)))throw Error(`Trying to redefine non-empty obj['`+c+`']`);return}t[c]=n(r,a)}},f.prototype.object=function(e,t){var r=this;return Object.keys(e).forEach(function(i){var a=t===void 0?null:t[i],o=u(i,r.separator).join(r.separator);o.indexOf(r.separator)===-1?e[i]=n(e[i],a):(r._fill(o.split(r.separator),e,e[i],a),delete e[i])}),e},f.prototype.str=function(e,t,r,i){var a=u(e,this.separator).join(this.separator);return e.indexOf(this.separator)===-1?r[e]=n(t,i):this._fill(a.split(this.separator),r,t,i),r},f.prototype.pick=function(e,t,n,i){var a,o=u(e,this.separator),s,c,l;for(a=0;a<o.length;a++)if(c=r(o[a],t),t&&typeof t==`object`&&c in t){if(a===o.length-1)return n?(s=t[c],i&&Array.isArray(t)?t.splice(c,1):delete t[c],Array.isArray(t)&&(l=o.slice(0,-1).join(`.`),this.cleanup.indexOf(l)===-1&&this.cleanup.push(l)),s):t[c];t=t[c]}else return;return n&&Array.isArray(t)&&(t=t.filter(function(e){return e!==void 0})),t},f.prototype.delete=function(e,t){return this.remove(e,t,!0)},f.prototype.remove=function(e,t,n){var r;if(this.cleanup=[],Array.isArray(e)){for(r=0;r<e.length;r++)this.pick(e[r],t,!0,n);return n||this._cleanup(t),t}else return this.pick(e,t,!0,n)},f.prototype._cleanup=function(e){var t,n,r,i;if(this.cleanup.length){for(n=0;n<this.cleanup.length;n++)r=this.cleanup[n].split(`.`),i=r.splice(0,-1).join(`.`),t=i?this.pick(i,e):e,t=t[r[0]].filter(function(e){return e!==void 0}),this.set(this.cleanup[n],t,e);this.cleanup=[]}},f.prototype.del=f.prototype.remove,f.prototype.move=function(e,t,r,i,a){return typeof i==`function`||Array.isArray(i)?this.set(t,n(this.pick(e,r,!0),i),r,a):(a=i,this.set(t,this.pick(e,r,!0),r,a)),r},f.prototype.transfer=function(e,t,r,i,a,o){return typeof a==`function`||Array.isArray(a)?this.set(t,n(this.pick(e,r,!0),a),i,o):(o=a,this.set(t,this.pick(e,r,!0),i,o)),i},f.prototype.copy=function(e,t,r,i,a,o){return typeof a==`function`||Array.isArray(a)?this.set(t,n(JSON.parse(JSON.stringify(this.pick(e,r,!1))),a),i,o):(o=a,this.set(t,this.pick(e,r,!1),i,o)),i},f.prototype.set=function(e,t,n,r){var i,o,s,c;if(t===void 0)return n;for(s=u(e,this.separator),i=0;i<s.length;i++){if(c=s[i],i===s.length-1)if(r&&a(t)&&a(n[c]))for(o in t)d.call(t,o)&&(n[c][o]=t[o]);else if(r&&Array.isArray(n[c])&&Array.isArray(t))for(var l=0;l<t.length;l++)n[s[i]].push(t[l]);else n[c]=t;else (!d.call(n,c)||!a(n[c])&&!Array.isArray(n[c]))&&(/^\d+$/.test(s[i+1]
1)?n[c]=[]:n[c]={});n=n[c]}return n},f.prototype.transform=function(e,t,n){return t||={},n||={},Object.keys(e).forEach(function(r){this.set(e[r],this.pick(r,t),n)}.bind(this)),n},f.prototype.dot=function(e,t,n){t||={},n||=[];var r=Array.isArray(e);return Object.keys(e).forEach(function(i){var c=r&&this.useBrackets?`[`+i+`]`:i;if(o(e[i])&&(a(e[i])&&!s(e[i])||Array.isArray(e[i])&&!this.keepArray&&e[i].length!==0))if(r&&this.useBrackets){var l=n[n.length-1]||``;return this.dot(e[i],t,n.slice(0,-1).concat(l+c))}else return this.dot(e[i],t,n.concat(c));else r&&this.useBrackets?t[n.join(this.separator).concat(`[`+i+`]`)]=e[i]:t[n.concat(c).join(this.separator)]=e[i]}.bind(this)),t},f.pick=m(`pick`),f.move=m(`move`),f.transfer=m(`transfer`),f.transform=m(`transform`),f.copy=m(`copy`),f.object=m(`object`),f.str=m(`str`),f.set=m(`set`),f.delete=m(`delete`),f.del=f.remove=m(`remove`),f.dot=m(`dot`),[`override`,`overwrite`].forEach(function(e){Object.defineProperty(f,e,{get:function(){return p.override},set:function(e){p.override=!!e}})}),[`useArray`,`keepArray`,`useBrackets`].forEach(function(e){Object.defineProperty(f,e,{get:function(){return p[e]},set:function(t){p[e]=t}})}),f._process=n,t.exports=f})),f=e(d()),p=e(n());function m(e){let t=u(),{user:n,hasPermission:i}=r();return(0,p.useMemo)(()=>{if(!e)return null;let r=typeof e==`string`?t.menus?.find(t=>t.positions?.includes(e)):e,a=[];if(r){for(let e of r.items){let r=(e.roles||[]).every(e=>n?.roles?.find(t=>t.id===e)),o=(e.permissions||[]).every(e=>i(e)),s=!e.settings||Object.entries(e.settings).every(([e,n])=>f.default.pick(e,t)==n);!e.action||!r||!o||!s||!h(e,n)||(n?.id&&(e.action=e.action.replace(/{currentUser}/g,`${n.id}`)),a.push(e))}r.items=a}return r},[i,e,t,n])}function h(e,t){if(!e.subscriptionStatus)return!0;let n=!!t?.subscriptions?.find(e=>e.active);return e.subscriptionStatus===`subscribed`?n:!n}var g=c();function _({className:e,iconClassName:t,itemClassName:n,gap:r=`gap-30`,menu:i,orientation:a=`horizontal`,children:s,matchDescendants:c,onlyShowIcons:l,iconSize:u,unstyled:d=!1,defaultIcons:f}){let p=m(i);return p?(0,g.jsx)(`div`,{className:o(`flex`,r,a===`vertical`?`flex-col items-start`:`items-center`,e),"data-menu-id":p.id,children:p.items.map(e=>{let r={item:e,unstyled:d,onlyShowIcon:l,matchDescendants:c,iconClassName:t,iconSize:u,defaultIcons:f,className:t=>typeof n==`function`?n({...t,item:e}):n};return s?s(e,r):(0,g.jsx)(v,{...r},e.id)})}):null}var v=(0,p.forwardRef)(({item:e,className:t,matchDescendants:n,unstyled:r,onlyShowIcon:c,iconClassName:u,iconSize:d=18,extraContent:f,position:m=`relative`,icon:h,defaultIcons:_,...v},b)=>{let x=(0,g.jsx)(l,{message:e.label}),S=null,C=_?.[e.action.split(`?`)[0]];if(h)S=h;else if(C&&(!e.icon||!s(e.icon)))S=(0,g.jsx)(C,{size:y(d),className:u});else if(e.icon){let t=a(e.icon);S=t?(0,g.jsx)(t,{size:d,className:u}):null}S&&=(0,g.jsx)(`div`,{className:`flex h-20 w-20 flex-shrink-0 items-center justify-center overflow-hidden rounded leading-none text-muted`,children:S});let w=(0,g.jsxs)(p.Fragment,{children:[S,(!S||!c)&&x]}),T=e=>typeof f==`function`?f({isActive:e}):f,E=!r&&`whitespace-nowrap flex items-center justify-start gap-10`,D=!r&&`outline-none focus-visible:ring-2`;return e.type===`link`?(0,g.jsxs)(`a`,{className:o(E,t?.({isActive:!1}),D,m),href:e.action,target:e.target,"data-menu-item-id":e.id,ref:b,...v,children:[T(!1),w]}):(0,g.jsx)(i,{end:typeof n==`function`?n(e.action):n,className:e=>o(E,t?.(e),D,m),to:e.action,target:e.target,"data-menu-item-id":e.id,ref:b,...v,children:e=>(0,g.jsxs)(p.Fragment,{children:[T(e.isActive),w]})})});function y(e){if(typeof e==`number`)return e;switch(e){case`2xs`:return 12;case`xs`:return 16;case`sm`:return 20;case`md`:return 24;case`lg`:return 35;case`xl`:return 43;default:return 18}}export{d as i,v as n,m as r,_ as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.