// @bun
import{a as T}from"../chunk-gv6hk8pm.js";import{b as U}from"../chunk-5tjqtvn9.js";import{c as F,d as G,e as L}from"../chunk-9k34mjvb.js";import{f as K}from"../chunk-9w10a3wa.js";import{g as M,h as O}from"../chunk-284557ex.js";import{i as a,j as i,k as t,l as o,m as A}from"../chunk-7nmzea24.js";import{n as Q,o as W,p as X,q as Y,r as Z,s as _,t as $,u as k}from"../chunk-2tsqgztt.js";import"../chunk-6xnzhztm.js";import"../chunk-ks3qn9ry.js";import"../chunk-b3tacpjq.js";import"../chunk-hggcmr0j.js";class H{token;projectId;constructor(j,q){this.token=j;this.projectId=q}async createBranch(j,q){console.log(`Would create branch ${j} from ${q}`)}async commitChanges(j,q,x){console.log(`Would commit ${x.length} files to ${j} with message: ${q}`)}async createPullRequest(j){return console.log(`Would create MR: ${j.title}`),{number:1,title:j.title,body:j.body,head:j.head,base:j.base,state:"open",url:`https://gitlab.com/project/${this.projectId}/-/merge_requests/1`,createdAt:new Date,updatedAt:new Date,author:"buddy",reviewers:j.reviewers||[],assignees:j.assignees||[],labels:j.labels||[],draft:j.draft||!1}}async getPullRequests(j="open"){return console.log(`Would get ${j} MRs`),[]}async updatePullRequest(j,q){throw console.log(`Would update MR #${j}`),new Error("Not implemented")}async closePullRequest(j){console.log(`Would close MR #${j}`)}async mergePullRequest(j,q="merge"){console.log(`Would merge MR #${j} using ${q}`)}async createIssue(j){return console.log(`Would create issue: ${j.title}`),{number:1,title:j.title,body:j.body,state:"open",url:`https://gitlab.com/project/${this.projectId}/-/issues/1`,createdAt:new Date,updatedAt:new Date,author:"buddy",assignees:j.assignees||[],labels:j.labels||[],pinned:!1}}async getIssues(j="open"){return console.log(`Would get ${j} issues`),[]}async updateIssue(j,q){throw console.log(`Would update issue #${j}`),new Error("Not implemented")}async closeIssue(j){console.log(`Would close issue #${j}`)}async unpinIssue(j){console.log("\u2139\uFE0F GitLab does not support issue pinning")}}class I{projectPath;constructor(j){this.projectPath=j}async applyUpdates(j){console.log(`Would apply ${j.length} updates`)}async applyScanResult(j){await this.applyUpdates(j.updates)}}var{semver:D}=globalThis.Bun;class J{static compareVersions(j,q){return D.order(j,q)}static satisfiesRange(j,q){return D.satisfies(j,q)}static getLatestInRange(j,q){let x=j.filter((z)=>D.satisfies(z,q));if(x.length===0)return null;return x.sort((z,C)=>D.order(C,z))[0]}static createRange(j){return{raw:j,range:j.replace(/^[\^~>=<]+/,""),isExact:!/^[\^~>=<]/.test(j),satisfies:(q)=>this.satisfiesRange(q,j),getLatest:(q)=>this.getLatestInRange(q,j)}}static getUpdateType(j,q){let x=j.replace(/^[\^~>=<]+/,""),z=q.replace(/^[\^~>=<]+/,""),C=x.split(".").map(Number),E=z.split(".").map(Number);if(E[0]>C[0])return"major";if(E[0]===C[0]&&E[1]>C[1])return"minor";return"patch"}static isSafeUpdate(j,q){return D.satisfies(q,j)}}export{k as sortUpdatesByPriority,Q as parsePackageFile,$ as groupUpdates,_ as generateBranchName,Y as formatPRTitle,Z as formatPRBody,X as formatCommitMessage,W as detectPackageManager,J as VersionResolver,I as UpdateProcessor,T as Scheduler,M as ReleaseNotesFetcher,A as RegistryClient,O as PullRequestGenerator,F as PackageScanner,i as PackageRegistryError,G as Logger,t as GitProviderError,H as GitLabProvider,K as GitHubProvider,U as GitHubActionsTemplate,o as ConfigurationError,a as BuddyError,L as Buddy};
