dev-process-kit 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/boards.js +1 -1
  2. package/dist/chunks/{shared-zDGLGSqj.js → shared-0HXwrPVn.js} +54 -54
  3. package/dist/chunks/{shared-C1y1ymFB.js → shared-B2F5LY6f.js} +13 -13
  4. package/dist/chunks/shared-B7MDu9J_.js +6912 -0
  5. package/dist/chunks/{shared-DFW6nDO8.js → shared-BSEt0fN6.js} +9 -2
  6. package/dist/chunks/{shared-CpI8ATFw.js → shared-BugVP_yn.js} +2 -2
  7. package/dist/chunks/shared-C1sWnXGY.js +1 -0
  8. package/dist/chunks/{shared-DPayIyBW.js → shared-C2_qMOyi.js} +1 -1
  9. package/dist/chunks/{shared-DVAXtJwE.js → shared-CeNV36-9.js} +134 -28
  10. package/dist/chunks/{shared-UIN_s3sw.js → shared-CjWMknuE.js} +1 -1
  11. package/dist/chunks/{shared-tkjGdHLh.js → shared-CxTKp5CX.js} +18 -18
  12. package/dist/chunks/{shared-DKxWTptq.js → shared-CyOyXHQO.js} +1 -1
  13. package/dist/chunks/{shared-DIEHJb_n.js → shared-D3Xm9wF8.js} +3 -3
  14. package/dist/chunks/shared-DCnxYUIB.js +3 -0
  15. package/dist/chunks/{shared-giADQT1w.js → shared-DE09J93T.js} +494 -226
  16. package/dist/chunks/{shared-Dp6JBc2T.js → shared-DJCdfkg-.js} +1 -1
  17. package/dist/chunks/{shared-BOQp0U9U.js → shared-Dxf3BUk6.js} +1055 -224
  18. package/dist/chunks/{shared-DOAi2-QH.js → shared-qLSu7C5m.js} +10 -10
  19. package/dist/chunks/{shared-CVBp1_S_.js → shared-tq8QsPTt.js} +2 -2
  20. package/dist/components.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/sync.js +1 -1
  23. package/dist/views/delegation-poker.js +1 -1
  24. package/dist/views/plain.js +1 -1
  25. package/dist/views/prototype.js +1 -1
  26. package/dist/views/slides.js +1 -1
  27. package/dist/views/task-board.js +1 -1
  28. package/dist/views/usm.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunks/shared-BTu8ZSVC.js +0 -1
  31. package/dist/chunks/shared-BjLRqdzA.js +0 -6724
  32. package/dist/chunks/shared-CJZKj_HI.js +0 -3
@@ -1,4 +1,4 @@
1
- import{a6 as o,a4 as d,x as p,ag as u}from"./shared-giADQT1w.js";import{v as h,L as k,Q as f,j as m}from"./shared-CJZKj_HI.js";const g={github:o`<path fill-rule="evenodd" d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path>`,gitlab:o`<path d="M8 15 1.2 9.9a.7.7 0 0 1-.25-.78L2.7 2.6a.35.35 0 0 1 .66 0L5.1 7.6h5.8l1.74-5a.35.35 0 0 1 .66 0l1.75 6.52a.7.7 0 0 1-.25.78z"></path>`,jira:o`<path d="M14.6 7.4 8.6 1.4 8 .8 3.5 5.3 1.4 7.4a.85.85 0 0 0 0 1.2l4.1 4.1L8 15.2l4.5-4.5.07-.07 2.03-2.03a.85.85 0 0 0 0-1.2zM8 9.9 5.9 8 8 5.9 10.1 8z"></path>`,linear:o`<path d="M1.2 9.4a6.9 6.9 0 0 0 5.4 5.4zM1 7.3l7.7 7.7a7 7 0 0 0 1.9-.5L1.5 5.4a7 7 0 0 0-.5 1.9zm1.2-3.1 9.6 9.6a7 7 0 0 0 1.2-1.1L3.3 3a7 7 0 0 0-1.1 1.2zM4.3 2.3a7 7 0 1 1 9.4 9.4z"></path>`,figma:o`<path d="M5.5 1h2.3v4.6H5.5a2.3 2.3 0 1 1 0-4.6zm2.3 0h2.3a2.3 2.3 0 1 1 0 4.6H7.8zm2.3 4.6a2.3 2.3 0 1 1 0 4.6 2.3 2.3 0 0 1 0-4.6zM5.5 5.6h2.3v4.6H5.5a2.3 2.3 0 1 1 0-4.6zm0 4.6h2.3v2.3a2.3 2.3 0 1 1-2.3-2.3z"></path>`,notion:o`<path fill-rule="evenodd" d="M2.5 1.6 11 1c1 0 1.3.1 2 .6l2.1 1.5c.4.3.5.4.5.7v9.6c0 .7-.3 1.1-1.1 1.2l-9.4.6c-.6 0-.9-.1-1.2-.5L1.9 12c-.3-.5-.5-.8-.5-1.3V2.8c0-.6.3-1.1 1.1-1.2zM5 4.4v8.9l8.6-.5V4zm1 1.2 2.9-.2 3 4.7V5.6l-.8-.1v-.5l2-.1v.6l-.6.1v6.1l-.9.1-3.5-5.4v4.9l.8.2v.5l-2.3.1v-.5l.6-.2V6.4l-.8-.1z"></path>`},x=i=>i==="web"?p():u`<svg class="link-mark" viewBox="0 0 16 16" aria-hidden="true">${g[i]}</svg>`,v=d`
1
+ import{a6 as o,a4 as d,x as p,ag as u}from"./shared-DE09J93T.js";import{v as h,M as k,R as f,j as m}from"./shared-DCnxYUIB.js";const g={github:o`<path fill-rule="evenodd" d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path>`,gitlab:o`<path d="M8 15 1.2 9.9a.7.7 0 0 1-.25-.78L2.7 2.6a.35.35 0 0 1 .66 0L5.1 7.6h5.8l1.74-5a.35.35 0 0 1 .66 0l1.75 6.52a.7.7 0 0 1-.25.78z"></path>`,jira:o`<path d="M14.6 7.4 8.6 1.4 8 .8 3.5 5.3 1.4 7.4a.85.85 0 0 0 0 1.2l4.1 4.1L8 15.2l4.5-4.5.07-.07 2.03-2.03a.85.85 0 0 0 0-1.2zM8 9.9 5.9 8 8 5.9 10.1 8z"></path>`,linear:o`<path d="M1.2 9.4a6.9 6.9 0 0 0 5.4 5.4zM1 7.3l7.7 7.7a7 7 0 0 0 1.9-.5L1.5 5.4a7 7 0 0 0-.5 1.9zm1.2-3.1 9.6 9.6a7 7 0 0 0 1.2-1.1L3.3 3a7 7 0 0 0-1.1 1.2zM4.3 2.3a7 7 0 1 1 9.4 9.4z"></path>`,figma:o`<path d="M5.5 1h2.3v4.6H5.5a2.3 2.3 0 1 1 0-4.6zm2.3 0h2.3a2.3 2.3 0 1 1 0 4.6H7.8zm2.3 4.6a2.3 2.3 0 1 1 0 4.6 2.3 2.3 0 0 1 0-4.6zM5.5 5.6h2.3v4.6H5.5a2.3 2.3 0 1 1 0-4.6zm0 4.6h2.3v2.3a2.3 2.3 0 1 1-2.3-2.3z"></path>`,notion:o`<path fill-rule="evenodd" d="M2.5 1.6 11 1c1 0 1.3.1 2 .6l2.1 1.5c.4.3.5.4.5.7v9.6c0 .7-.3 1.1-1.1 1.2l-9.4.6c-.6 0-.9-.1-1.2-.5L1.9 12c-.3-.5-.5-.8-.5-1.3V2.8c0-.6.3-1.1 1.1-1.2zM5 4.4v8.9l8.6-.5V4zm1 1.2 2.9-.2 3 4.7V5.6l-.8-.1v-.5l2-.1v.6l-.6.1v6.1l-.9.1-3.5-5.4v4.9l.8.2v.5l-2.3.1v-.5l.6-.2V6.4l-.8-.1z"></path>`},x=i=>i==="web"?p():u`<svg class="link-mark" viewBox="0 0 16 16" aria-hidden="true">${g[i]}</svg>`,v=d`
2
2
  .link-mark {
3
3
  fill: currentColor;
4
4
  }
@@ -14,7 +14,7 @@ import{a6 as o,a4 as d,x as p,ag as u}from"./shared-giADQT1w.js";import{v as h,L
14
14
  background: var(--dpk-paper-raised);
15
15
  color: var(--dpk-ink-soft);
16
16
  font-family: var(--dpk-mono);
17
- font-size: 10.5px;
17
+ font-size: var(--dpk-text-2xs);
18
18
  font-weight: 600;
19
19
  line-height: 18px;
20
20
  text-decoration: none;
@@ -40,4 +40,4 @@ import{a6 as o,a4 as d,x as p,ag as u}from"./shared-giADQT1w.js";import{v as h,L
40
40
  text-overflow: ellipsis;
41
41
  white-space: nowrap;
42
42
  }
43
- `,s=/^[A-Z][A-Z0-9]+-\d+$/,c=i=>{let e=i;try{e=decodeURIComponent(i)}catch{}return e.replace(/[-_+]+/g," ").trim()},b=(i,e)=>{if(i!=="github.com")return null;const[t,n,r,a]=e;if(t===void 0)return{kind:"github",text:"GitHub",title:"github.com"};if(n===void 0)return{kind:"github",text:t,title:t};const l=`${t}/${n}`;return(r==="issues"||r==="pull"||r==="discussions")&&a&&/^\d+$/.test(a)?{kind:"github",text:`#${a}`,title:`${l}#${a}`}:r==="commit"&&a?{kind:"github",text:a.slice(0,7),title:`${l}@${a}`}:{kind:"github",text:l,title:l}},w=(i,e)=>{if(i!=="gitlab.com")return null;const t=e.indexOf("-"),n=(t<0?e:e.slice(0,t)).join("/"),r=t<0?void 0:e[t+1],a=t<0?void 0:e[t+2];if(a&&/^\d+$/.test(a)){if(r==="issues")return{kind:"gitlab",text:`#${a}`,title:`${n}#${a}`};if(r==="merge_requests")return{kind:"gitlab",text:`!${a}`,title:`${n}!${a}`}}return{kind:"gitlab",text:n||"GitLab",title:n||i}},$=(i,e,t)=>{if(!e.endsWith(".atlassian.net")&&!e.startsWith("jira."))return null;const n=(t[0]==="browse"?t[1]:void 0)??i.searchParams.get("selectedIssue")??t.find(r=>s.test(r));return n&&s.test(n)?{kind:"jira",text:n,title:`${e} ${n}`}:{kind:"jira",text:"Jira",title:e}},z=(i,e)=>{if(i!=="linear.app")return null;const t=e[1]==="issue"?e[2]?.toUpperCase():void 0;return t&&s.test(t)?{kind:"linear",text:t,title:t}:{kind:"linear",text:"Linear",title:i}},L=(i,e)=>{if(i!=="figma.com")return null;const[t,,n]=e;if((t==="file"||t==="design"||t==="proto"||t==="board")&&n){const r=c(n);return{kind:"figma",text:r,title:r}}return{kind:"figma",text:"Figma",title:i}},M=(i,e)=>{if(i!=="notion.so"&&!i.endsWith(".notion.site"))return null;const n=(e.at(-1)??"").replace(/-?[0-9a-f]{32}$/i,""),r=n===""?"Notion":c(n);return{kind:"notion",text:r,title:r}},j=i=>{let e;try{e=new URL(i)}catch{return{kind:"web",text:i,title:i}}const t=e.hostname.replace(/^www\./,""),n=e.pathname.split("/").filter(r=>r!=="");return b(t,n)??w(t,n)??$(e,t,n)??z(t,n)??L(t,n)??M(t,n)??{kind:"web",text:t,title:i}},y=h(m(),f(),k(i=>/^https?:\/\//i.test(i),"a link must be an http(s) URL"));export{x as a,j as d,y as h,v as l};
43
+ `,s=/^[A-Z][A-Z0-9]+-\d+$/,c=i=>{let e=i;try{e=decodeURIComponent(i)}catch{}return e.replace(/[-_+]+/g," ").trim()},b=(i,e)=>{if(i!=="github.com")return null;const[t,n,r,a]=e;if(t===void 0)return{kind:"github",text:"GitHub",title:"github.com"};if(n===void 0)return{kind:"github",text:t,title:t};const l=`${t}/${n}`;return(r==="issues"||r==="pull"||r==="discussions")&&a&&/^\d+$/.test(a)?{kind:"github",text:`#${a}`,title:`${l}#${a}`}:r==="commit"&&a?{kind:"github",text:a.slice(0,7),title:`${l}@${a}`}:{kind:"github",text:l,title:l}},w=(i,e)=>{if(i!=="gitlab.com")return null;const t=e.indexOf("-"),n=(t<0?e:e.slice(0,t)).join("/"),r=t<0?void 0:e[t+1],a=t<0?void 0:e[t+2];if(a&&/^\d+$/.test(a)){if(r==="issues")return{kind:"gitlab",text:`#${a}`,title:`${n}#${a}`};if(r==="merge_requests")return{kind:"gitlab",text:`!${a}`,title:`${n}!${a}`}}return{kind:"gitlab",text:n||"GitLab",title:n||i}},$=(i,e,t)=>{if(!e.endsWith(".atlassian.net")&&!e.startsWith("jira."))return null;const n=(t[0]==="browse"?t[1]:void 0)??i.searchParams.get("selectedIssue")??t.find(r=>s.test(r));return n&&s.test(n)?{kind:"jira",text:n,title:`${e} ${n}`}:{kind:"jira",text:"Jira",title:e}},z=(i,e)=>{if(i!=="linear.app")return null;const t=e[1]==="issue"?e[2]?.toUpperCase():void 0;return t&&s.test(t)?{kind:"linear",text:t,title:t}:{kind:"linear",text:"Linear",title:i}},M=(i,e)=>{if(i!=="figma.com")return null;const[t,,n]=e;if((t==="file"||t==="design"||t==="proto"||t==="board")&&n){const r=c(n);return{kind:"figma",text:r,title:r}}return{kind:"figma",text:"Figma",title:i}},L=(i,e)=>{if(i!=="notion.so"&&!i.endsWith(".notion.site"))return null;const n=(e.at(-1)??"").replace(/-?[0-9a-f]{32}$/i,""),r=n===""?"Notion":c(n);return{kind:"notion",text:r,title:r}},j=i=>{let e;try{e=new URL(i)}catch{return{kind:"web",text:i,title:i}}const t=e.hostname.replace(/^www\./,""),n=e.pathname.split("/").filter(r=>r!=="");return b(t,n)??w(t,n)??$(e,t,n)??z(t,n)??M(t,n)??L(t,n)??{kind:"web",text:t,title:i}},y=h(m(),f(),k(i=>/^https?:\/\//i.test(i),"a link must be an http(s) URL"));export{x as a,j as d,y as h,v as l};
@@ -0,0 +1,3 @@
1
+ const me={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function A(n){return me}let de;function ke(n){return de?.get(n)}let be;function ge(n){return be?.get(n)}let xe;function Se(n,t){return xe?.get(n)?.get(t)}function x(n){const t=typeof n;return t==="string"?`"${n}"`:t==="number"||t==="bigint"||t==="boolean"?`${n}`:t==="object"||t==="function"?(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null":t}function c(n,t,e,r,i){const s=i&&"input"in i?i.input:e.value,u=i?.expected??n.expects??null,l=i?.received??x(s),o={kind:n.kind,type:n.type,input:s,expected:u,received:l,message:`Invalid ${t}: ${u?`Expected ${u} but r`:"R"}eceived ${l}`,requirement:n.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},a=n.kind==="schema",p=i?.message??n.message??Se(n.reference,o.lang)??(a?ge(o.lang):null)??r.message??ke(o.lang);p!==void 0&&(o.message=typeof p=="function"?p(o):p),a&&(e.typed=!1),e.issues?e.issues.push(o):e.issues=[o]}function Ee(n,t){return n===t||Number.isNaN(n)&&Number.isNaN(t)}function _e(n,t){return Object.prototype.hasOwnProperty.call(n,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function I(n,t){const e=[...new Set(n)];return e.length>1?`(${e.join(` ${t} `)})`:e[0]??"never"}function f(n){return n["~standard"]={version:1,vendor:"valibot",validate:t=>n["~run"]({value:t},A())},n}function Oe(n){if(n.path){let t="";for(const e of n.path)if(typeof e.key=="string"||typeof e.key=="number")t?t+=`.${e.key}`:t+=e.key;else return null;return t}return null}var je=class extends Error{constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};const De=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Ne=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u;function M(n,t){return{kind:"validation",type:"check",reference:M,async:!1,expects:null,requirement:n,message:t,"~run"(e,r){return e.typed&&!this.requirement(e.value)&&c(this,"input",e,r),e}}}function F(n){return{kind:"validation",type:"finite",reference:F,async:!1,expects:null,requirement:Number.isFinite,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&c(this,"finite",t,e),t}}}function U(n,t){const e=x(n);return{kind:"validation",type:"includes",reference:U,async:!1,expects:e,requirement:n,message:t,"~run"(r,i){return r.typed&&!r.value.includes(this.requirement)&&c(this,"content",r,i,{received:`!${e}`}),r}}}function C(n){return{kind:"validation",type:"integer",reference:C,async:!1,expects:null,requirement:Number.isInteger,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&c(this,"integer",t,e),t}}}function G(n){return{kind:"validation",type:"iso_date",reference:G,async:!1,expects:null,requirement:De,message:n,"~run"(t,e){return t.typed&&!this.requirement.test(t.value)&&c(this,"date",t,e),t}}}function J(n){return{kind:"validation",type:"iso_timestamp",reference:J,async:!1,expects:null,requirement:Ne,message:n,"~run"(t,e){return t.typed&&!this.requirement.test(t.value)&&c(this,"timestamp",t,e),t}}}function z(n,t){return{kind:"validation",type:"max_value",reference:z,async:!1,expects:`<=${n instanceof Date?n.toJSON():x(n)}`,requirement:n,message:t,"~run"(e,r){return e.typed&&!(e.value<=this.requirement)&&c(this,"value",e,r,{received:e.value instanceof Date?e.value.toJSON():x(e.value)}),e}}}function v(n,t){return{kind:"validation",type:"min_length",reference:v,async:!1,expects:`>=${n}`,requirement:n,message:t,"~run"(e,r){return e.typed&&e.value.length<this.requirement&&c(this,"length",e,r,{received:`${e.value.length}`}),e}}}function Y(n,t){return{kind:"validation",type:"min_value",reference:Y,async:!1,expects:`>=${n instanceof Date?n.toJSON():x(n)}`,requirement:n,message:t,"~run"(e,r){return e.typed&&!(e.value>=this.requirement)&&c(this,"value",e,r,{received:e.value instanceof Date?e.value.toJSON():x(e.value)}),e}}}function P(n,t){return{kind:"validation",type:"regex",reference:P,async:!1,expects:`${n}`,requirement:n,message:t,"~run"(e,r){return e.typed&&!this.requirement.test(e.value)&&c(this,"format",e,r),e}}}function Z(n){return{kind:"validation",type:"safe_integer",reference:Z,async:!1,expects:null,requirement:Number.isSafeInteger,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&c(this,"safe integer",t,e),t}}}function X(){return{kind:"transformation",type:"trim",reference:X,async:!1,"~run"(n){return n.value=n.value.trim(),n}}}function B(n){return{kind:"validation",type:"url",reference:B,async:!1,expects:null,requirement(t){try{return URL.canParse?URL.canParse(t):(new URL(t),!0)}catch{return!1}},message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&c(this,"URL",t,e),t}}}const Q={abortEarly:!0};function T(n,t,e){return typeof n.fallback=="function"?n.fallback(t,e):n.fallback}function H(n,t){return f({...n,fallback:t,"~run"(e,r){const i=n["~run"](e,r);return i.issues?{typed:!0,value:T(this,i,r)}:i}})}function N(n,t,e){return typeof n.default=="function"?n.default(t,e):n.default}function we(n,t){return!n["~run"]({value:t},Q).issues}function W(){return f({kind:"schema",type:"any",reference:W,expects:"any",async:!1,"~run"(n){return n.typed=!0,n}})}function w(n,t){return f({kind:"schema",type:"array",reference:w,expects:"Array",async:!1,item:n,message:t,"~run"(e,r){const i=e.value;if(Array.isArray(i)){e.typed=!0,e.value=[];for(let s=0;s<i.length;s++){const u=i[s],l=this.item["~run"]({value:u},r);if(l.issues){const o={type:"array",origin:"value",input:i,key:s,value:u};for(const a of l.issues)a.path?a.path.unshift(o):a.path=[o],e.issues?.push(a);if(e.issues||(e.issues=l.issues),r.abortEarly){e.typed=!1;break}}l.typed||(e.typed=!1),e.value.push(l.value)}}else c(this,"type",e,r);return e}})}function ee(n){return f({kind:"schema",type:"boolean",reference:ee,expects:"boolean",async:!1,message:n,"~run"(t,e){return typeof t.value=="boolean"?t.typed=!0:c(this,"type",t,e),t}})}function _(n,t){return f({kind:"schema",type:"exact_optional",reference:_,expects:n.expects,async:!1,wrapped:n,default:t,"~run"(e,r){return this.wrapped["~run"](e,r)}})}function ne(n){return f({kind:"schema",type:"function",reference:ne,expects:"Function",async:!1,message:n,"~run"(t,e){return typeof t.value=="function"?t.typed=!0:c(this,"type",t,e),t}})}function te(n){return f({kind:"schema",type:"lazy",reference:te,expects:"unknown",async:!1,getter:n,"~run"(t,e){return this.getter(t.value)["~run"](t,e)}})}function b(n,t){return f({kind:"schema",type:"literal",reference:b,expects:x(n),async:!1,literal:n,message:t,"~run"(e,r){return Ee(e.value,this.literal)?e.typed=!0:c(this,"type",e,r),e}})}function re(n){return f({kind:"schema",type:"null",reference:re,expects:"null",async:!1,message:n,"~run"(t,e){return t.value===null?t.typed=!0:c(this,"type",t,e),t}})}function se(n,t){return f({kind:"schema",type:"nullable",reference:se,expects:`(${n.expects} | null)`,async:!1,wrapped:n,default:t,"~run"(e,r){return e.value===null&&(this.default!==void 0&&(e.value=N(this,e,r)),e.value===null)?(e.typed=!0,e):this.wrapped["~run"](e,r)}})}function ie(n){return f({kind:"schema",type:"number",reference:ie,expects:"number",async:!1,message:n,"~run"(t,e){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:c(this,"type",t,e),t}})}function h(n,t){return f({kind:"schema",type:"object",reference:h,expects:"Object",async:!1,entries:n,message:t,"~run"(e,r){const i=e.value;if(i&&typeof i=="object"){e.typed=!0,e.value={};for(const s in this.entries){const u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=s in i?i[s]:N(u),o=u["~run"]({value:l},r);if(o.issues){const a={type:"object",origin:"value",input:i,key:s,value:l};for(const p of o.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=o.issues),r.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[s]=o.value}else if(u.fallback!==void 0)e.value[s]=T(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(c(this,"key",e,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}}else c(this,"type",e,r);return e}})}function q(n,t){return f({kind:"schema",type:"optional",reference:q,expects:`(${n.expects} | undefined)`,async:!1,wrapped:n,default:t,"~run"(e,r){return e.value===void 0&&(this.default!==void 0&&(e.value=N(this,e,r)),e.value===void 0)?(e.typed=!0,e):this.wrapped["~run"](e,r)}})}function ue(n,t){return f({kind:"schema",type:"picklist",reference:ue,expects:I(n.map(x),"|"),async:!1,options:n,message:t,"~run"(e,r){return this.options.includes(e.value)?e.typed=!0:c(this,"type",e,r),e}})}function oe(n,t,e){return f({kind:"schema",type:"record",reference:oe,expects:"Object",async:!1,key:n,value:t,message:e,"~run"(r,i){const s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(const u in s)if(_e(s,u)){const l=s[u],o=this.key["~run"]({value:u},i);if(o.issues){const p={type:"object",origin:"key",input:s,key:u,value:l};for(const k of o.issues)k.path=[p],r.issues?.push(k);if(r.issues||(r.issues=o.issues),i.abortEarly){r.typed=!1;break}}const a=this.value["~run"]({value:l},i);if(a.issues){const p={type:"object",origin:"value",input:s,key:u,value:l};for(const k of a.issues)k.path?k.path.unshift(p):k.path=[p],r.issues?.push(k);if(r.issues||(r.issues=a.issues),i.abortEarly){r.typed=!1;break}}(!o.typed||!a.typed)&&(r.typed=!1),o.typed&&(r.value[o.value]=a.value)}}else c(this,"type",r,i);return r}})}function le(n,t){return f({kind:"schema",type:"strict_object",reference:le,expects:"Object",async:!1,entries:n,message:t,"~run"(e,r){const i=e.value;if(i&&typeof i=="object"){e.typed=!0,e.value={};for(const s in this.entries){const u=this.entries[s];if(s in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=s in i?i[s]:N(u),o=u["~run"]({value:l},r);if(o.issues){const a={type:"object",origin:"value",input:i,key:s,value:l};for(const p of o.issues)p.path?p.path.unshift(a):p.path=[a],e.issues?.push(p);if(e.issues||(e.issues=o.issues),r.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[s]=o.value}else if(u.fallback!==void 0)e.value[s]=T(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(c(this,"key",e,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}if(!e.issues||!r.abortEarly){for(const s in i)if(!Object.prototype.hasOwnProperty.call(this.entries,s)){c(this,"key",e,r,{input:s,expected:"never",path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]});break}}}else c(this,"type",e,r);return e}})}function y(n){return f({kind:"schema",type:"string",reference:y,expects:"string",async:!1,message:n,"~run"(t,e){return typeof t.value=="string"?t.typed=!0:c(this,"type",t,e),t}})}function ce(n){let t;if(n)for(const e of n)if(t)for(const r of e.issues)t.push(r);else t=e.issues;return t}function ae(n,t){return f({kind:"schema",type:"union",reference:ae,expects:I(n.map(e=>e.expects),"|"),async:!1,options:n,message:t,"~run"(e,r){let i,s,u;for(const l of this.options){const o=l["~run"]({value:e.value},r);if(o.typed)if(o.issues)s?s.push(o):s=[o];else{i=o;break}else u?u.push(o):u=[o]}if(i)return i;if(s){if(s.length===1)return s[0];c(this,"type",e,r,{issues:ce(s)}),e.typed=!0}else{if(u?.length===1)return u[0];c(this,"type",e,r,{issues:ce(u)})}return e}})}function E(){return f({kind:"schema",type:"unknown",reference:E,expects:"unknown",async:!1,"~run"(n){return n.typed=!0,n}})}function O(n,t,e){return f({kind:"schema",type:"variant",reference:O,expects:"Object",async:!1,key:n,options:t,message:e,"~run"(r,i){const s=r.value;if(s&&typeof s=="object"){let u,l=0,o=this.key,a=[];const p=(k,L)=>{for(const S of k.options){if(S.type==="variant")p(S,new Set(L).add(S.key));else{let K=!0,j=0;for(const d of L){const D=S.entries[d];if(d in s?D["~run"]({typed:!1,value:s[d]},Q).issues:D.type!=="exact_optional"&&D.type!=="optional"&&D.type!=="nullish"){K=!1,o!==d&&(l<j||l===j&&d in s&&!(o in s))&&(l=j,o=d,a=[]),o===d&&a.push(S.entries[d].expects);break}j++}if(K){const d=S["~run"]({value:s},i);(!u||!u.typed&&d.typed)&&(u=d)}}if(u&&!u.issues)break}};if(p(this,new Set([this.key])),u)return u;c(this,"type",r,i,{input:s[o],expected:I(a,"|"),path:[{type:"object",origin:"value",input:s,key:o,value:s[o]}]})}else c(this,"type",r,i);return r}})}function Ae(n,t,e){const r=n["~run"]({value:t},A());if(r.issues)throw new je(r.issues);return r.value}function m(...n){return f({...n[0],pipe:n,"~run"(t,e){for(const r of n)if(r.kind!=="metadata"){if(t.issues&&(r.kind==="schema"||r.kind==="transformation")){t.typed=!1;break}(!t.issues||!e.abortEarly&&!e.abortPipeEarly)&&(t=r["~run"](t,e))}return t}})}function g(n,t,e){const r=n["~run"]({value:t},A());return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}function Ie(n){let t="";for(const e of n){t&&(t+=`
2
+ `),t+=`\xD7 ${e.message}`;const r=Oe(e);r&&(t+=`
3
+ \u2192 at ${r}`)}return t}const R=h({type:m(y(),v(1)),id:m(y(),v(1))}),Pe=m(y(),v(1),P(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Te=(n,t)=>{if(t===1)return n.includes(".")?null:[n];const e=n.split(".");return e.length===t&&e.every(r=>r.length>0)?e:null},V=h({id:m(y(),v(1)),type:m(y(),v(1)),target:R,payload:E(),note:_(y()),createdAt:m(y(),v(1))}),qe=(n,t,e,r={})=>{const i=h({id:m(y(),v(1)),type:b(n),target:R,payload:e,note:_(y()),createdAt:m(y(),v(1))}),s=u=>{const l=g(V,u);if(!l.success||l.output.type!==n)return null;const o=g(e,u.payload);return o.success?{id:l.output.id,type:n,target:l.output.target,payload:o.output,...l.output.note===void 0?{}:{note:l.output.note},createdAt:l.output.createdAt}:null};return{schema:i,mode:r.mode??"patch",targetType:t,actionType:n,payloadSchema:e,parse:s,...r.dedupeKey?{dedupeKey:r.dedupeKey}:{}}},Re=(n,t)=>{const e=pe(n,t.type);if(e===void 0)return null;const r=e.parse(t);return r===null?null:r},Ve=(n,t)=>{const e=g(n.payloadSchema,t.payload);if(!e.success)throw new Error(`invalid payload for action "${t.type}"`);return e.output},pe=(n,t)=>Object.hasOwn(n,t)?n[t]:void 0,$e=n=>{throw new Error(`unhandled action: ${JSON.stringify(n)}`)},Le=h({id:m(y(),v(1))}),Ke=n=>{const t=g(Le,n.payload);return`${n.type}|${t.success?t.output.id:JSON.stringify(n.payload)}`},Me="dpk-sync-request",Fe=1,Ue=(n,t)=>fe(n)===fe(t),fe=n=>{switch(n.kind){case"append":return`append:${n.action.id}`;case"remove":return`remove:${n.id}`;case"clear":return`clear:${n.upTo}`}},Ce=h({id:m(y(),v(1)),name:_(y())}),$=y(),Ge=m(y(),v(1)),Je=h({kind:b("snapshot"),cursor:$,actions:w(E())}),ze=h({kind:b("ops"),cursor:$,ops:w(E())}),Ye=O("kind",[Je,ze]),Ze=h({kind:b("append"),action:E()}),ye=h({kind:b("remove"),id:Ge}),he=h({kind:b("clear"),upTo:$}),Xe=O("kind",[Ze,ye,he]),Be=O("kind",[h({kind:b("append"),action:V}),ye,he]),Qe=h({author:H(q(Ce),void 0)}),He=(n,t)=>{const e=g(Ye,n);if(!e.success)return null;const r=e.output;return r.kind==="snapshot"?{kind:"snapshot",cursor:r.cursor,entries:r.actions.flatMap(i=>{const s=ve(i,t);return s===null?[]:[s]})}:{kind:"ops",cursor:r.cursor,ops:r.ops.flatMap(i=>{const s=g(Xe,i);if(!s.success)return[];if(s.output.kind!=="append")return[s.output];const u=ve(s.output.action,t);return u===null?[]:[{kind:"append",entry:u}]})}},ve=(n,t)=>{const e=t(n);if(e===null)return null;const r=g(Qe,n);return{action:e,author:r.success?r.output.author:void 0}},We=n=>Array.isArray(n)?n.flatMap(t=>{const e=g(Be,t);return e.success?[e.output]:[]}):[];export{ae as A,_ as B,Pe as C,se as D,Y as E,C as F,te as G,F as H,H as I,oe as J,P as K,z as L,M,J as N,Te as O,we as P,G as Q,B as R,Fe as S,re as T,Z as U,Ie as V,U as W,pe as X,Ue as Y,He as Z,W as _,Me as a,$e as b,V as c,qe as d,Ke as e,Ve as f,ee as g,w as h,ne as i,y as j,q as k,b as l,Ae as m,ie as n,h as o,Re as p,le as q,We as r,g as s,R as t,E as u,m as v,v as w,ue as x,X as y,O as z};