var e=`Tags must use lower-case letters, numbers, - or _, and must start and end with a letter or number.`,t=`Tags must be 32 characters or fewer.`,n=`A task may not have more than 20 tags.`,r=/^[a-z0-9](?:[a-z0-9_-]{0,30}[a-z0-9])?$/;function i(e){return[...e].sort((e,t)=>e.localeCompare(t))}function a(e){return e.trim().toLowerCase()}function o(e){let t=new Set;for(let n of e){let e=a(n??``);e&&t.add(e)}return i(t)}function s(e){return e.split(/[\n\r,]+/g)}function c(n){return n?n.length>32?t:r.test(n)?null:e:null}function l(e,t){let r=o(e),s=[];for(let e of t){let t=a(e??``);if(!t)continue;let n=c(t);if(n)return{ok:!1,error:n};s.push(t)}let l=new Set(r),u=new Set(r);for(let e of s)u.add(e);let d=i(u);return d.length>20?{ok:!1,error:n}:{ok:!0,tags:d,added:d.filter(e=>!l.has(e))}}export{c as a,s as i,l as n,o as r,n as t};