// @bun
var{defineProperty:A,getOwnPropertyNames:D,getOwnPropertyDescriptor:E}=Object,F=Object.prototype.hasOwnProperty;function H(f){return this[f]}var M=(f)=>{var j=(C??=new WeakMap).get(f),q;if(j)return j;if(j=A({},"__esModule",{value:!0}),f&&typeof f==="object"||typeof f==="function"){for(var x of D(f))if(!F.call(j,x))A(j,x,{get:H.bind(f,x),enumerable:!(q=E(f,x))||q.enumerable})}return C.set(f,j),j},C;var I=(f)=>f;function J(f,j){this[f]=I.bind(null,j)}var N=(f,j)=>{for(var q in j)A(f,q,{get:j[q],enumerable:!0,configurable:!0,set:J.bind(j,q)})};var O=(f,j)=>()=>(f&&(j=f(f=0)),j);import{compareVersions as K}from"compare-versions";class L{prompts=new Map;register(f){let j=`${f.meta.key}-v${f.meta.version}`;if(this.prompts.has(j))throw Error(`Duplicate prompt ${j}`);return this.prompts.set(j,f),this}list(){return[...this.prompts.values()]}get(f,j){if(j!=null)return this.prompts.get(`${f}-v${j}`);let q;for(let[x,B]of this.prompts.entries()){if(!x.startsWith(`${f}.v`))continue;if(!q||K(B.meta.version,q.meta.version)>0)q=B}return q}}export{L as PromptRegistry};
