dev-process-kit 0.3.3 → 0.4.0
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.
- package/dist/boards.js +1 -1
- package/dist/chunks/{shared-DvpWdbzP.js → shared-B2S6Vsb5.js} +1 -1
- package/dist/chunks/{shared-DstEY0ER.js → shared-BBKduY__.js} +1 -1
- package/dist/chunks/{shared-CLrs15X7.js → shared-BDAaq_FM.js} +1 -1
- package/dist/chunks/{shared-D7lvvzdN.js → shared-BWIla41c.js} +243 -239
- package/dist/chunks/{shared-DpOLnWXG.js → shared-Bj6Oqtla.js} +1 -1
- package/dist/chunks/shared-CBzul9Ae.js +1 -0
- package/dist/chunks/shared-CJZKj_HI.js +3 -0
- package/dist/chunks/{shared-CkaifYF3.js → shared-CKIn5p8J.js} +5 -5
- package/dist/chunks/{shared-B3gYWxeF.js → shared-CTxoriaS.js} +1 -1
- package/dist/chunks/shared-Cd0_rxlc.js +1883 -0
- package/dist/chunks/{shared-C9Mo56gs.js → shared-CkOyWfwZ.js} +1 -1
- package/dist/chunks/{shared-BAlmAjut.js → shared-DF9b2Hdv.js} +1 -1
- package/dist/chunks/{shared-CMe6_Sdn.js → shared-DRCtnrZO.js} +1 -1
- package/dist/chunks/{shared-DTIEx3lM.js → shared-DZNeJT2R.js} +1 -1
- package/dist/chunks/{shared-D-lFQPYy.js → shared-DnSwEx91.js} +1 -1
- package/dist/chunks/{shared-8-7i0SJv.js → shared-O0o2ls6e.js} +1 -1
- package/dist/chunks/{shared-ComyWGLL.js → shared-lPeFJij5.js} +1 -1
- package/dist/chunks/{shared-ZjHQZcxc.js → shared-zNs0yAfd.js} +5 -1
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/sync.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-CVEzSR4J.js +0 -3
- package/dist/chunks/shared-DIYD6Tuj.js +0 -1
- package/dist/chunks/shared-MI4Xe0aq.js +0 -1868
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ai as bt,a5 as h,ag as r,L as js,ar as G,_ as D,a7 as z,O as M,i as K,a4 as A,a8 as R,aB as Is,A as Ps,aC as Jt,aD as Os,aE as Us,al as F,aF as Xt,a6 as P,a3 as kt,af as Yt,aw as Fs,av as vt,aG as Hs,aH as dt,u as Bs,aI as Zt,ak as _s,ax as Ns,t as Ws,aJ as Gs,R as Ks,S as Vs}from"./shared-D7lvvzdN.js";import{o as _,r as Js}from"./shared-D4PPk0Dk.js";import{e as Xs}from"./shared-CLrs15X7.js";import{a as Qt,c as Ys}from"./shared-DstEY0ER.js";import{c as Zs}from"./shared-CMe6_Sdn.js";import{m as N,o as xt,k as u,I as te,D as ee,x as st,h as w,u as yt,s as se,A as ae,j as b,B as Qs,n as ct,q as y,v as $,H as wt,w as E,C as W,g as at,z as ne,l as V,y as ie,G as re,J as ta,K as oe}from"./shared-CVEzSR4J.js";import{p as ea,i as sa,r as aa,c as na,a as le,b as de,d as ia,e as ra,f as oa,h as ce,g as la,j as $t,s as da,k as ca,l as pa,m as ha,n as ua,t as ma}from"./shared-CkaifYF3.js";import{B as ga,t as fa,v as ba,i as ka,k as va,j as xa}from"./shared-8-7i0SJv.js";import{d as ya}from"./shared-BAlmAjut.js";class pt{#n;#t;#e=null;#s=null;#a=null;#i=null;#r=new Map;#o=null;constructor(t){this.#n=t,this.#t=new bt(t),t.addController(this)}get isOpen(){return this.#e!==null}open(t,e,s){this.#e=t,this.#a=e,this.#i=s??null,this.#o=null,this.#n.requestUpdate()}close(){this.#e=null,this.#a=null,this.#i=null,this.#n.requestUpdate()}hostDisconnected(){this.close()}sync(t){const e=this.#s!==this.#e;this.#s=this.#e,!(t===null||this.#a===null||this.#e===null)&&(this.#t.open(t,this.#a,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}render(t){const e=this.#e;if(e===null)return h;const s=ea(this.#r.get(e)??"",[],{...this.#i===null?{}:{label:this.#i},key:e,...this.#o===e&&t.errorMessage!==void 0?{error:t.errorMessage}:{}});return r`${sa(e,aa(na(t.locale),s,n=>this.#l(e,t.submit,n)))}`}#l(t,e,s){if(s.kind==="input"){this.#r=new Map(this.#r).set(t,s.body),this.#o=null,this.#n.requestUpdate();return}if(s.kind==="comment"){if(!e(t,s.body)){this.#o=t,this.#n.requestUpdate();return}const i=new Map(this.#r);i.delete(t),this.#r=i}this.#o=null,this.close()}}const Ct=(a,t,e,s)=>{if(a===null)return null;const n=js(a),i=t.find(d=>d.value===n);return i===void 0?null:{id:"review-comment",entries:[{kind:"item",id:"review-comment",label:e.reviewComment,run:()=>s(n,i.label)}]}},ht=.08,pe=1.8,he=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const t=Math.min(...a.map(i=>i.x)),e=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-t,n=Math.max(...a.map(i=>i.y+i.height))-e;return{x:t-s*.1,y:e-n*.1,width:s*1.2,height:n*1.2}},ue=(a,t)=>a+t/12,wa=(a,t)=>{if(a.length===0)return null;const e=Math.min(...a.map(n=>n.y)),s=a.filter(n=>n.y<e+t);return{x:Math.min(...s.map(n=>n.x)),y:e}},St=16,$a=.8,ut=(a,t,e,s,n)=>a==="start"?St-ue(t,e)*s:(n-e*s)/2-t*s,me=(a,t,e,s,n="center")=>{if(t.width===0||t.height===0)return{...a,x:0,y:0};const i=(d,l,o,m)=>{const p=o*a.scale,f=m*$a;if(p<=m){const S=ut(n,l,o,a.scale,m);return G(d,S-f,S+f)}return G(d,m-(l+o)*a.scale-f,-l*a.scale+f)};return{...a,x:i(a.x,t.x,t.width,e),y:i(a.y,t.y,t.height,s)}},Ca=(a,t,e,s,n,i,d="center")=>{const l=Math.abs(i)>Math.abs(n);if(l&&t.height*a.scale<=s)return null;const o=me({...a,x:a.x-n,y:a.y-i},t,e,s,d);return l&&o.y===a.y?null:o},Sa=a=>Math.exp(-a*.01),ge='button,[role="button"],a,input,textarea,select',Et=(a,t,e)=>{for(const s of a.composedPath()){if(s===t)return null;if(s instanceof Element&&s.matches(e))return s}return null},Ea=a=>{const{canvas:t,world:e,onClearSelection:s,onView:n,align:i="center",sizeWorld:d=!0}=a;let l={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const m=()=>({width:t.clientWidth||1e3,height:t.clientHeight||560}),p=()=>{const{width:c,height:g}=m();o=me(o,l,c,g,i),e.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,e.style.setProperty("--dpk-zoom-inverse",String(1/o.scale)),e.style.setProperty("--dpk-zoom-scale",String(o.scale)),n?.(o)},f=()=>{const{width:c,height:g}=m(),k=l.width/1.2||1,x=l.height/1.2||1,C=G(Math.min((c-24)/k,(g-40)/x),ht,1);o={scale:C,x:ut(i,l.x,l.width,C,c),y:ut(i,l.y,l.height,C,g)},p()},S=c=>{const{width:g,height:k}=m(),x=he([c]),C=x.width/1.2||1,L=x.height/1.2||1;o={...o,scale:G(Math.min((g-24)/C,(k-40)/L),ht,pe)},o={...o,x:(g-x.width*o.scale)/2-x.x*o.scale,y:(k-x.height*o.scale)/2-x.y*o.scale},p()},O=()=>{const{width:c}=m(),g=l.width/1.2||1,k=G((c-24)/g,ht,1);o={scale:k,x:(c-l.width*k)/2-l.x*k,y:16},p()},lt=c=>{const{width:g,height:k}=m(),x=(C,L,Kt,Vt)=>Vt!==void 0?St-Vt:L<=Kt?ut(i,C,L,1,Kt):St-ue(C,L);o={scale:1,x:x(l.x,l.width,g,c?.x),y:x(l.y,l.height,k,c?.y)},p()},B=(c,g=m().width/2,k=m().height/2)=>{const x=o.scale,C=G(x*c,ht,pe);C!==x&&(o={scale:C,x:g-(g-o.x)*C/x,y:k-(k-o.y)*C/x},p())},Q=c=>{if(Et(c,t,".diagram-zoom")!==null)return;const g=c.deltaMode===1?16:c.deltaMode===2?m().height:1;if(c.ctrlKey||c.metaKey){c.preventDefault();const L=t.getBoundingClientRect();B(Sa(c.deltaY),c.clientX-L.left,c.clientY-L.top);return}const{width:k,height:x}=m(),C=Ca(o,l,k,x,c.deltaX*g,c.deltaY*g,i);C!==null&&(c.preventDefault(),o=C,p())},j=new Map;let T=null,I=!1;const U=()=>{const c=[...j.values()],g=c[0];if(!g)return null;const k=c[1];return k?{x:(g.x+k.x)/2,y:(g.y+k.y)/2,distance:Math.hypot(k.x-g.x,k.y-g.y)}:{...g,distance:0}},tt=c=>{j.size===0&&(I=!1);const g=Et(c,t,ge);c.button!==0||c.pointerType!=="touch"&&g!==null||(j.set(c.pointerId,{x:c.clientX,y:c.clientY}),T=U(),g===null&&t.setPointerCapture(c.pointerId),c.pointerType!=="touch"&&g===null&&(c.preventDefault(),t.focus({preventScroll:!0})))},Ht=c=>{if(!j.has(c.pointerId)||T===null)return;j.set(c.pointerId,{x:c.clientX,y:c.clientY});const g=U();if(g===null)return;const k=g.x-T.x,x=g.y-T.y;if((Math.abs(k)+Math.abs(x)>1||Math.abs(g.distance-T.distance)>1)&&(I=!0),g.distance>0&&T.distance>0){const C=t.getBoundingClientRect();B(Math.pow(g.distance/T.distance,.45),T.x-C.left,T.y-C.top)}o={...o,x:o.x+k,y:o.y+x},p(),T=g,t.classList.toggle("is-panning",I)},et=c=>{j.delete(c.pointerId),T=U(),!(j.size>0)&&(t.classList.remove("is-panning"),c.type==="pointercancel"&&(I=!1))},Bt=c=>{I&&(c.preventDefault(),c.stopPropagation()),et(c)},_t=c=>{if(I){c.preventDefault(),c.stopPropagation(),I=!1;return}!(c.target instanceof Element)||Et(c,t,ge)!==null||s()},Nt=c=>{if(c.target!==t)return;const g=30;if(c.key==="+"||c.key==="=")B(1.1);else if(c.key==="-")B(1/1.1);else if(c.key==="0")f();else if(c.key==="Escape"){if(s()===!1)return}else if(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")o={...o,x:o.x+(c.key==="ArrowLeft"?g:c.key==="ArrowRight"?-g:0),y:o.y+(c.key==="ArrowUp"?g:c.key==="ArrowDown"?-g:0)},p();else return;c.preventDefault()},Wt=c=>{const g=c.target instanceof HTMLElement?c.target:null;if(g===null||!c.composedPath().includes(e))return;const k=g.getBoundingClientRect(),x=t.getBoundingClientRect();let C=0,L=0;k.left<x.left+12?C=x.left+12-k.left:k.right>x.right-12&&(C=x.right-12-k.right),k.top<x.top+12?L=x.top+12-k.top:k.bottom>x.bottom-40&&(L=x.bottom-40-k.bottom),!(C===0&&L===0)&&(o={...o,x:o.x+C,y:o.y+L},p())};t.addEventListener("wheel",Q,{passive:!1}),t.addEventListener("pointerdown",tt),t.addEventListener("pointermove",Ht),t.addEventListener("pointerup",Bt),t.addEventListener("pointercancel",et),t.addEventListener("lostpointercapture",et),t.addEventListener("click",_t,!0),t.addEventListener("keydown",Nt),t.addEventListener("focusin",Wt);const Gt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>p());return Gt?.observe(t),{setContent(c){l=he(c.width===0&&c.height===0?[]:[c]),d&&(e.style.width=`${c.width}px`,e.style.height=`${c.height}px`),p()},apply:p,fit:f,fitTo:S,fitWidth:O,reset:lt,zoom:B,view:()=>({...o}),destroy(){Gt?.disconnect(),t.removeEventListener("wheel",Q),t.removeEventListener("pointerdown",tt),t.removeEventListener("pointermove",Ht),t.removeEventListener("pointerup",Bt),t.removeEventListener("pointercancel",et),t.removeEventListener("lostpointercapture",et),t.removeEventListener("click",_t,!0),t.removeEventListener("keydown",Nt),t.removeEventListener("focusin",Wt)}}},za=["fit","fit-width","actual","none"];class Aa{#n;#t=null;#e=null;#s=!1;constructor(t,e){this.#n=e,t.addController(this)}hostDisconnected(){this.detach()}get attached(){return this.#t!==null}get view(){return this.#t?.view()??{x:0,y:0,scale:1}}attach(){this.detach();const t=this.#n.elements();if(t===null)return;const{canvas:e,world:s}=t;this.#t=Ea({canvas:e,world:s,align:this.#n.align(),sizeWorld:!1,onClearSelection:()=>this.#n.onDismiss(),onView:n=>this.#n.onView(n)}),this.#e=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.sync()),this.#e?.observe(s),this.sync()}detach(){this.#t?.destroy(),this.#t=null,this.#e?.disconnect(),this.#e=null}sync(){const t=this.#t,e=this.#n.elements()?.world;if(t===null||e===void 0)return;const s=this.#n.contentSize();e.style.width=s?`${s.width}px`:"",e.style.height=s?`${s.height}px`:"";const n=s?.width??e.offsetWidth,i=s?.height??e.offsetHeight;t.setContent({x:0,y:0,width:n,height:i}),!this.#s&&n>0&&i>0&&this.open()}open(){const t=this.#t;if(t===null)return;this.#s=!0;const e=this.#n.initial(),s=za.includes(e)?e:"fit";s==="fit"?t.fit():s==="fit-width"?t.fitWidth():s==="actual"&&t.reset()}fit(){this.#t?.fit()}fitWidth(){this.#t?.fitWidth()}fitTo(t){this.#t?.fitTo(t)}reset(t){this.#t?.reset(t)}zoom(t){this.#t?.zoom(t)}apply(){this.#t?.apply()}}const Ta=(a,t,e)=>a.some(s=>Math.abs(t)>Math.abs(e)?s.overflowX!=="auto"&&s.overflowX!=="scroll"||s.scrollWidth<=s.clientWidth?!1:t>0?s.scrollLeft+s.clientWidth<s.scrollWidth-1:t<0&&s.scrollLeft>0:s.overflowY!=="auto"&&s.overflowY!=="scroll"||s.scrollHeight<=s.clientHeight?!1:e>0?s.scrollTop+s.clientHeight<s.scrollHeight-1:e<0&&s.scrollTop>0),fe=160,zt=(a,t,e=fe)=>Math.max(e,Math.round(a+t)),Ma=(a,t,e,s=fe)=>{const n=e?96:24;return t==="ArrowDown"?zt(a,n,s):t==="ArrowUp"?zt(a,-n,s):null},be={kind:"idle"};class La{constructor(t,e){this.#e=null,this.#s=be,this.handlers={pointerdown:s=>{if(s.button!==0)return;s.preventDefault();const n=s.currentTarget;n instanceof Element&&n.setPointerCapture(s.pointerId),this.#s={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.#t()},this.#n.requestUpdate()},pointermove:s=>{const n=this.#s;n.kind!=="dragging"||n.pointerId!==s.pointerId||this.#a(zt(n.startHeight,s.clientY-n.startY))},pointerup:s=>this.#i(s),pointercancel:s=>this.#i(s),keydown:s=>{const n=Ma(this.#e??this.#t(),s.key,s.shiftKey);n!==null&&(s.preventDefault(),this.#a(n))},dblclick:()=>this.#a(null)},this.#n=t,this.#t=e,t.addController(this)}#n;#t;#e;#s;hostConnected(){}get height(){return this.#e}get dragging(){return this.#s.kind==="dragging"}#a(t){t!==this.#e&&(this.#e=t,this.#n.requestUpdate())}#i(t){const e=this.#s;e.kind!=="dragging"||e.pointerId!==t.pointerId||(this.#s=be,this.#n.requestUpdate())}}const Da=D({en:{maximize:"Maximize",restore:"Restore size",controls:"View controls",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",canvas:"Canvas. Arrow keys pan, plus and minus zoom, 0 fits the view.",resize:"Resize the panel",resizeHint:"Drag or use the up and down arrows to resize. Double-click restores the height."},ja:{maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",controls:"\u8868\u793A\u306E\u64CD\u4F5C",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",canvas:"\u30AD\u30E3\u30F3\u30D0\u30B9\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",resize:"\u30D1\u30CD\u30EB\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306E\u9AD8\u3055\u306B\u623B\u3059\u3002"}});class ke extends z{static{this.styles=[M,K,A`
|
|
1
|
+
import{ai as bt,a5 as h,ag as r,L as js,ar as G,_ as D,a7 as z,O as M,i as K,a4 as A,a8 as R,aB as Is,A as Ps,aC as Jt,aD as Os,aE as Us,al as F,aF as Xt,a6 as P,a3 as kt,af as Yt,aw as Fs,av as vt,aG as Hs,aH as dt,u as Bs,aI as Zt,ak as _s,ax as Ns,t as Ws,aJ as Gs,R as Ks,S as Vs}from"./shared-BWIla41c.js";import{o as _,r as Js}from"./shared-D4PPk0Dk.js";import{e as Xs}from"./shared-BDAaq_FM.js";import{a as Qt,c as Ys}from"./shared-BBKduY__.js";import{c as Zs}from"./shared-DRCtnrZO.js";import{m as N,o as xt,k as u,I as te,D as ee,x as st,h as w,u as yt,s as se,A as ae,j as b,B as Qs,n as ct,q as y,v as $,H as wt,w as E,C as W,g as at,z as ne,l as V,y as ie,G as re,J as ta,K as oe}from"./shared-CJZKj_HI.js";import{p as ea,i as sa,r as aa,c as na,a as le,b as de,d as ia,e as ra,f as oa,h as ce,g as la,j as $t,s as da,k as ca,l as pa,m as ha,n as ua,t as ma}from"./shared-CKIn5p8J.js";import{B as ga,t as fa,v as ba,i as ka,k as va,j as xa}from"./shared-O0o2ls6e.js";import{d as ya}from"./shared-DF9b2Hdv.js";class pt{#n;#t;#e=null;#s=null;#a=null;#i=null;#r=new Map;#o=null;constructor(t){this.#n=t,this.#t=new bt(t),t.addController(this)}get isOpen(){return this.#e!==null}open(t,e,s){this.#e=t,this.#a=e,this.#i=s??null,this.#o=null,this.#n.requestUpdate()}close(){this.#e=null,this.#a=null,this.#i=null,this.#n.requestUpdate()}hostDisconnected(){this.close()}sync(t){const e=this.#s!==this.#e;this.#s=this.#e,!(t===null||this.#a===null||this.#e===null)&&(this.#t.open(t,this.#a,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}render(t){const e=this.#e;if(e===null)return h;const s=ea(this.#r.get(e)??"",[],{...this.#i===null?{}:{label:this.#i},key:e,...this.#o===e&&t.errorMessage!==void 0?{error:t.errorMessage}:{}});return r`${sa(e,aa(na(t.locale),s,n=>this.#l(e,t.submit,n)))}`}#l(t,e,s){if(s.kind==="input"){this.#r=new Map(this.#r).set(t,s.body),this.#o=null,this.#n.requestUpdate();return}if(s.kind==="comment"){if(!e(t,s.body)){this.#o=t,this.#n.requestUpdate();return}const i=new Map(this.#r);i.delete(t),this.#r=i}this.#o=null,this.close()}}const Ct=(a,t,e,s)=>{if(a===null)return null;const n=js(a),i=t.find(d=>d.value===n);return i===void 0?null:{id:"review-comment",entries:[{kind:"item",id:"review-comment",label:e.reviewComment,run:()=>s(n,i.label)}]}},ht=.08,pe=1.8,he=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const t=Math.min(...a.map(i=>i.x)),e=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-t,n=Math.max(...a.map(i=>i.y+i.height))-e;return{x:t-s*.1,y:e-n*.1,width:s*1.2,height:n*1.2}},ue=(a,t)=>a+t/12,wa=(a,t)=>{if(a.length===0)return null;const e=Math.min(...a.map(n=>n.y)),s=a.filter(n=>n.y<e+t);return{x:Math.min(...s.map(n=>n.x)),y:e}},St=16,$a=.8,ut=(a,t,e,s,n)=>a==="start"?St-ue(t,e)*s:(n-e*s)/2-t*s,me=(a,t,e,s,n="center")=>{if(t.width===0||t.height===0)return{...a,x:0,y:0};const i=(d,l,o,m)=>{const p=o*a.scale,f=m*$a;if(p<=m){const S=ut(n,l,o,a.scale,m);return G(d,S-f,S+f)}return G(d,m-(l+o)*a.scale-f,-l*a.scale+f)};return{...a,x:i(a.x,t.x,t.width,e),y:i(a.y,t.y,t.height,s)}},Ca=(a,t,e,s,n,i,d="center")=>{const l=Math.abs(i)>Math.abs(n);if(l&&t.height*a.scale<=s)return null;const o=me({...a,x:a.x-n,y:a.y-i},t,e,s,d);return l&&o.y===a.y?null:o},Sa=a=>Math.exp(-a*.01),ge='button,[role="button"],a,input,textarea,select',Et=(a,t,e)=>{for(const s of a.composedPath()){if(s===t)return null;if(s instanceof Element&&s.matches(e))return s}return null},Ea=a=>{const{canvas:t,world:e,onClearSelection:s,onView:n,align:i="center",sizeWorld:d=!0}=a;let l={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const m=()=>({width:t.clientWidth||1e3,height:t.clientHeight||560}),p=()=>{const{width:c,height:g}=m();o=me(o,l,c,g,i),e.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,e.style.setProperty("--dpk-zoom-inverse",String(1/o.scale)),e.style.setProperty("--dpk-zoom-scale",String(o.scale)),n?.(o)},f=()=>{const{width:c,height:g}=m(),k=l.width/1.2||1,x=l.height/1.2||1,C=G(Math.min((c-24)/k,(g-40)/x),ht,1);o={scale:C,x:ut(i,l.x,l.width,C,c),y:ut(i,l.y,l.height,C,g)},p()},S=c=>{const{width:g,height:k}=m(),x=he([c]),C=x.width/1.2||1,L=x.height/1.2||1;o={...o,scale:G(Math.min((g-24)/C,(k-40)/L),ht,pe)},o={...o,x:(g-x.width*o.scale)/2-x.x*o.scale,y:(k-x.height*o.scale)/2-x.y*o.scale},p()},O=()=>{const{width:c}=m(),g=l.width/1.2||1,k=G((c-24)/g,ht,1);o={scale:k,x:(c-l.width*k)/2-l.x*k,y:16},p()},lt=c=>{const{width:g,height:k}=m(),x=(C,L,Kt,Vt)=>Vt!==void 0?St-Vt:L<=Kt?ut(i,C,L,1,Kt):St-ue(C,L);o={scale:1,x:x(l.x,l.width,g,c?.x),y:x(l.y,l.height,k,c?.y)},p()},B=(c,g=m().width/2,k=m().height/2)=>{const x=o.scale,C=G(x*c,ht,pe);C!==x&&(o={scale:C,x:g-(g-o.x)*C/x,y:k-(k-o.y)*C/x},p())},Q=c=>{if(Et(c,t,".diagram-zoom")!==null)return;const g=c.deltaMode===1?16:c.deltaMode===2?m().height:1;if(c.ctrlKey||c.metaKey){c.preventDefault();const L=t.getBoundingClientRect();B(Sa(c.deltaY),c.clientX-L.left,c.clientY-L.top);return}const{width:k,height:x}=m(),C=Ca(o,l,k,x,c.deltaX*g,c.deltaY*g,i);C!==null&&(c.preventDefault(),o=C,p())},j=new Map;let T=null,I=!1;const U=()=>{const c=[...j.values()],g=c[0];if(!g)return null;const k=c[1];return k?{x:(g.x+k.x)/2,y:(g.y+k.y)/2,distance:Math.hypot(k.x-g.x,k.y-g.y)}:{...g,distance:0}},tt=c=>{j.size===0&&(I=!1);const g=Et(c,t,ge);c.button!==0||c.pointerType!=="touch"&&g!==null||(j.set(c.pointerId,{x:c.clientX,y:c.clientY}),T=U(),g===null&&t.setPointerCapture(c.pointerId),c.pointerType!=="touch"&&g===null&&(c.preventDefault(),t.focus({preventScroll:!0})))},Ht=c=>{if(!j.has(c.pointerId)||T===null)return;j.set(c.pointerId,{x:c.clientX,y:c.clientY});const g=U();if(g===null)return;const k=g.x-T.x,x=g.y-T.y;if((Math.abs(k)+Math.abs(x)>1||Math.abs(g.distance-T.distance)>1)&&(I=!0),g.distance>0&&T.distance>0){const C=t.getBoundingClientRect();B(Math.pow(g.distance/T.distance,.45),T.x-C.left,T.y-C.top)}o={...o,x:o.x+k,y:o.y+x},p(),T=g,t.classList.toggle("is-panning",I)},et=c=>{j.delete(c.pointerId),T=U(),!(j.size>0)&&(t.classList.remove("is-panning"),c.type==="pointercancel"&&(I=!1))},Bt=c=>{I&&(c.preventDefault(),c.stopPropagation()),et(c)},_t=c=>{if(I){c.preventDefault(),c.stopPropagation(),I=!1;return}!(c.target instanceof Element)||Et(c,t,ge)!==null||s()},Nt=c=>{if(c.target!==t)return;const g=30;if(c.key==="+"||c.key==="=")B(1.1);else if(c.key==="-")B(1/1.1);else if(c.key==="0")f();else if(c.key==="Escape"){if(s()===!1)return}else if(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")o={...o,x:o.x+(c.key==="ArrowLeft"?g:c.key==="ArrowRight"?-g:0),y:o.y+(c.key==="ArrowUp"?g:c.key==="ArrowDown"?-g:0)},p();else return;c.preventDefault()},Wt=c=>{const g=c.target instanceof HTMLElement?c.target:null;if(g===null||!c.composedPath().includes(e))return;const k=g.getBoundingClientRect(),x=t.getBoundingClientRect();let C=0,L=0;k.left<x.left+12?C=x.left+12-k.left:k.right>x.right-12&&(C=x.right-12-k.right),k.top<x.top+12?L=x.top+12-k.top:k.bottom>x.bottom-40&&(L=x.bottom-40-k.bottom),!(C===0&&L===0)&&(o={...o,x:o.x+C,y:o.y+L},p())};t.addEventListener("wheel",Q,{passive:!1}),t.addEventListener("pointerdown",tt),t.addEventListener("pointermove",Ht),t.addEventListener("pointerup",Bt),t.addEventListener("pointercancel",et),t.addEventListener("lostpointercapture",et),t.addEventListener("click",_t,!0),t.addEventListener("keydown",Nt),t.addEventListener("focusin",Wt);const Gt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>p());return Gt?.observe(t),{setContent(c){l=he(c.width===0&&c.height===0?[]:[c]),d&&(e.style.width=`${c.width}px`,e.style.height=`${c.height}px`),p()},apply:p,fit:f,fitTo:S,fitWidth:O,reset:lt,zoom:B,view:()=>({...o}),destroy(){Gt?.disconnect(),t.removeEventListener("wheel",Q),t.removeEventListener("pointerdown",tt),t.removeEventListener("pointermove",Ht),t.removeEventListener("pointerup",Bt),t.removeEventListener("pointercancel",et),t.removeEventListener("lostpointercapture",et),t.removeEventListener("click",_t,!0),t.removeEventListener("keydown",Nt),t.removeEventListener("focusin",Wt)}}},za=["fit","fit-width","actual","none"];class Aa{#n;#t=null;#e=null;#s=!1;constructor(t,e){this.#n=e,t.addController(this)}hostDisconnected(){this.detach()}get attached(){return this.#t!==null}get view(){return this.#t?.view()??{x:0,y:0,scale:1}}attach(){this.detach();const t=this.#n.elements();if(t===null)return;const{canvas:e,world:s}=t;this.#t=Ea({canvas:e,world:s,align:this.#n.align(),sizeWorld:!1,onClearSelection:()=>this.#n.onDismiss(),onView:n=>this.#n.onView(n)}),this.#e=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.sync()),this.#e?.observe(s),this.sync()}detach(){this.#t?.destroy(),this.#t=null,this.#e?.disconnect(),this.#e=null}sync(){const t=this.#t,e=this.#n.elements()?.world;if(t===null||e===void 0)return;const s=this.#n.contentSize();e.style.width=s?`${s.width}px`:"",e.style.height=s?`${s.height}px`:"";const n=s?.width??e.offsetWidth,i=s?.height??e.offsetHeight;t.setContent({x:0,y:0,width:n,height:i}),!this.#s&&n>0&&i>0&&this.open()}open(){const t=this.#t;if(t===null)return;this.#s=!0;const e=this.#n.initial(),s=za.includes(e)?e:"fit";s==="fit"?t.fit():s==="fit-width"?t.fitWidth():s==="actual"&&t.reset()}fit(){this.#t?.fit()}fitWidth(){this.#t?.fitWidth()}fitTo(t){this.#t?.fitTo(t)}reset(t){this.#t?.reset(t)}zoom(t){this.#t?.zoom(t)}apply(){this.#t?.apply()}}const Ta=(a,t,e)=>a.some(s=>Math.abs(t)>Math.abs(e)?s.overflowX!=="auto"&&s.overflowX!=="scroll"||s.scrollWidth<=s.clientWidth?!1:t>0?s.scrollLeft+s.clientWidth<s.scrollWidth-1:t<0&&s.scrollLeft>0:s.overflowY!=="auto"&&s.overflowY!=="scroll"||s.scrollHeight<=s.clientHeight?!1:e>0?s.scrollTop+s.clientHeight<s.scrollHeight-1:e<0&&s.scrollTop>0),fe=160,zt=(a,t,e=fe)=>Math.max(e,Math.round(a+t)),Ma=(a,t,e,s=fe)=>{const n=e?96:24;return t==="ArrowDown"?zt(a,n,s):t==="ArrowUp"?zt(a,-n,s):null},be={kind:"idle"};class La{constructor(t,e){this.#e=null,this.#s=be,this.handlers={pointerdown:s=>{if(s.button!==0)return;s.preventDefault();const n=s.currentTarget;n instanceof Element&&n.setPointerCapture(s.pointerId),this.#s={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.#t()},this.#n.requestUpdate()},pointermove:s=>{const n=this.#s;n.kind!=="dragging"||n.pointerId!==s.pointerId||this.#a(zt(n.startHeight,s.clientY-n.startY))},pointerup:s=>this.#i(s),pointercancel:s=>this.#i(s),keydown:s=>{const n=Ma(this.#e??this.#t(),s.key,s.shiftKey);n!==null&&(s.preventDefault(),this.#a(n))},dblclick:()=>this.#a(null)},this.#n=t,this.#t=e,t.addController(this)}#n;#t;#e;#s;hostConnected(){}get height(){return this.#e}get dragging(){return this.#s.kind==="dragging"}#a(t){t!==this.#e&&(this.#e=t,this.#n.requestUpdate())}#i(t){const e=this.#s;e.kind!=="dragging"||e.pointerId!==t.pointerId||(this.#s=be,this.#n.requestUpdate())}}const Da=D({en:{maximize:"Maximize",restore:"Restore size",controls:"View controls",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",canvas:"Canvas. Arrow keys pan, plus and minus zoom, 0 fits the view.",resize:"Resize the panel",resizeHint:"Drag or use the up and down arrows to resize. Double-click restores the height."},ja:{maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",controls:"\u8868\u793A\u306E\u64CD\u4F5C",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",canvas:"\u30AD\u30E3\u30F3\u30D0\u30B9\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",resize:"\u30D1\u30CD\u30EB\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306E\u9AD8\u3055\u306B\u623B\u3059\u3002"}});class ke extends z{static{this.styles=[M,K,A`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
color: var(--dpk-ink);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a5 as r}from"./shared-BWIla41c.js";const t=o=>o??r;export{t as o};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const ve={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function A(n){return ve}let me;function de(n){return me?.get(n)}let ke;function be(n){return ke?.get(n)}let ge;function xe(n,t){return ge?.get(n)?.get(t)}function S(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 l(n,t,e,r,i){const s=i&&"input"in i?i.input:e.value,u=i?.expected??n.expects??null,c=i?.received??S(s),o={kind:n.kind,type:n.type,input:s,expected:u,received:c,message:`Invalid ${t}: ${u?`Expected ${u} but r`:"R"}eceived ${c}`,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??xe(n.reference,o.lang)??(a?be(o.lang):null)??r.message??de(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 Se(n,t){return n===t||Number.isNaN(n)&&Number.isNaN(t)}function Ee(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 _e(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 Oe=class extends Error{constructor(n){super(n[0].message),this.name="ValiError",this.issues=n}};const je=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,De=/^\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)&&l(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)&&l(this,"finite",t,e),t}}}function U(n,t){const e=S(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)&&l(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)&&l(this,"integer",t,e),t}}}function G(n){return{kind:"validation",type:"iso_date",reference:G,async:!1,expects:null,requirement:je,message:n,"~run"(t,e){return t.typed&&!this.requirement.test(t.value)&&l(this,"date",t,e),t}}}function z(n){return{kind:"validation",type:"iso_timestamp",reference:z,async:!1,expects:null,requirement:De,message:n,"~run"(t,e){return t.typed&&!this.requirement.test(t.value)&&l(this,"timestamp",t,e),t}}}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&&l(this,"length",e,r,{received:`${e.value.length}`}),e}}}function J(n,t){return{kind:"validation",type:"min_value",reference:J,async:!1,expects:`>=${n instanceof Date?n.toJSON():S(n)}`,requirement:n,message:t,"~run"(e,r){return e.typed&&!(e.value>=this.requirement)&&l(this,"value",e,r,{received:e.value instanceof Date?e.value.toJSON():S(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)&&l(this,"format",e,r),e}}}function Y(n){return{kind:"validation",type:"safe_integer",reference:Y,async:!1,expects:null,requirement:Number.isSafeInteger,message:n,"~run"(t,e){return t.typed&&!this.requirement(t.value)&&l(this,"safe integer",t,e),t}}}function Z(){return{kind:"transformation",type:"trim",reference:Z,async:!1,"~run"(n){return n.value=n.value.trim(),n}}}function X(n){return{kind:"validation",type:"url",reference:X,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)&&l(this,"URL",t,e),t}}}const B={abortEarly:!0};function q(n,t,e){return typeof n.fallback=="function"?n.fallback(t,e):n.fallback}function Q(n,t){return f({...n,fallback:t,"~run"(e,r){const i=n["~run"](e,r);return i.issues?{typed:!0,value:q(this,i,r)}:i}})}function N(n,t,e){return typeof n.default=="function"?n.default(t,e):n.default}function Ne(n,t){return!n["~run"]({value:t},B).issues}function H(){return f({kind:"schema",type:"any",reference:H,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],c=this.item["~run"]({value:u},r);if(c.issues){const o={type:"array",origin:"value",input:i,key:s,value:u};for(const a of c.issues)a.path?a.path.unshift(o):a.path=[o],e.issues?.push(a);if(e.issues||(e.issues=c.issues),r.abortEarly){e.typed=!1;break}}c.typed||(e.typed=!1),e.value.push(c.value)}}else l(this,"type",e,r);return e}})}function W(n){return f({kind:"schema",type:"boolean",reference:W,expects:"boolean",async:!1,message:n,"~run"(t,e){return typeof t.value=="boolean"?t.typed=!0:l(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 ee(n){return f({kind:"schema",type:"function",reference:ee,expects:"Function",async:!1,message:n,"~run"(t,e){return typeof t.value=="function"?t.typed=!0:l(this,"type",t,e),t}})}function ne(n){return f({kind:"schema",type:"lazy",reference:ne,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:S(n),async:!1,literal:n,message:t,"~run"(e,r){return Se(e.value,this.literal)?e.typed=!0:l(this,"type",e,r),e}})}function te(n){return f({kind:"schema",type:"null",reference:te,expects:"null",async:!1,message:n,"~run"(t,e){return t.value===null?t.typed=!0:l(this,"type",t,e),t}})}function re(n,t){return f({kind:"schema",type:"nullable",reference:re,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 se(n){return f({kind:"schema",type:"number",reference:se,expects:"number",async:!1,message:n,"~run"(t,e){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:l(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 c=s in i?i[s]:N(u),o=u["~run"]({value:c},r);if(o.issues){const a={type:"object",origin:"value",input:i,key:s,value:c};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]=q(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(l(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 l(this,"type",e,r);return e}})}function T(n,t){return f({kind:"schema",type:"optional",reference:T,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 ie(n,t){return f({kind:"schema",type:"picklist",reference:ie,expects:I(n.map(S),"|"),async:!1,options:n,message:t,"~run"(e,r){return this.options.includes(e.value)?e.typed=!0:l(this,"type",e,r),e}})}function ue(n,t,e){return f({kind:"schema",type:"record",reference:ue,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(Ee(s,u)){const c=s[u],o=this.key["~run"]({value:u},i);if(o.issues){const p={type:"object",origin:"key",input:s,key:u,value:c};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:c},i);if(a.issues){const p={type:"object",origin:"value",input:s,key:u,value:c};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 l(this,"type",r,i);return r}})}function oe(n,t){return f({kind:"schema",type:"strict_object",reference:oe,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 c=s in i?i[s]:N(u),o=u["~run"]({value:c},r);if(o.issues){const a={type:"object",origin:"value",input:i,key:s,value:c};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]=q(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(l(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)){l(this,"key",e,r,{input:s,expected:"never",path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]});break}}}else l(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:l(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 le(n,t){return f({kind:"schema",type:"union",reference:le,expects:I(n.map(e=>e.expects),"|"),async:!1,options:n,message:t,"~run"(e,r){let i,s,u;for(const c of this.options){const o=c["~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];l(this,"type",e,r,{issues:ce(s)}),e.typed=!0}else{if(u?.length===1)return u[0];l(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,c=0,o=this.key,a=[];const p=(k,$)=>{for(const x of k.options){if(x.type==="variant")p(x,new Set($).add(x.key));else{let K=!0,j=0;for(const d of $){const D=x.entries[d];if(d in s?D["~run"]({typed:!1,value:s[d]},B).issues:D.type!=="exact_optional"&&D.type!=="optional"&&D.type!=="nullish"){K=!1,o!==d&&(c<j||c===j&&d in s&&!(o in s))&&(c=j,o=d,a=[]),o===d&&a.push(x.entries[d].expects);break}j++}if(K){const d=x["~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;l(this,"type",r,i,{input:s[o],expected:I(a,"|"),path:[{type:"object",origin:"value",input:s,key:o,value:s[o]}]})}else l(this,"type",r,i);return r}})}function we(n,t,e){const r=n["~run"]({value:t},A());if(r.issues)throw new Oe(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 Ae(n){let t="";for(const e of n){t&&(t+=`
|
|
2
|
+
`),t+=`\xD7 ${e.message}`;const r=_e(e);r&&(t+=`
|
|
3
|
+
\u2192 at ${r}`)}return t}const R=h({type:m(y(),v(1)),id:m(y(),v(1))}),Ie=m(y(),v(1),P(/^[A-Za-z0-9_-]+$/,'ids may only contain letters, digits, "_" and "-" (a "." builds a path)')),Pe=(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},L=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 c=g(L,u);if(!c.success||c.output.type!==n)return null;const o=g(e,u.payload);return o.success?{id:c.output.id,type:n,target:c.output.target,payload:o.output,...c.output.note===void 0?{}:{note:c.output.note},createdAt:c.output.createdAt}:null};return{schema:i,mode:r.mode??"patch",targetType:t,actionType:n,payloadSchema:e,parse:s,...r.dedupeKey?{dedupeKey:r.dedupeKey}:{}}},Te=(n,t)=>{const e=ae(n,t.type);if(e===void 0)return null;const r=e.parse(t);return r===null?null:r},Re=(n,t)=>{const e=g(n.payloadSchema,t.payload);if(!e.success)throw new Error(`invalid payload for action "${t.type}"`);return e.output},ae=(n,t)=>Object.hasOwn(n,t)?n[t]:void 0,Le=n=>{throw new Error(`unhandled action: ${JSON.stringify(n)}`)},Ve=h({id:m(y(),v(1))}),$e=n=>{const t=g(Ve,n.payload);return`${n.type}|${t.success?t.output.id:JSON.stringify(n.payload)}`},Ke="dpk-sync-request",Me=1,Fe=(n,t)=>pe(n)===pe(t),pe=n=>{switch(n.kind){case"append":return`append:${n.action.id}`;case"remove":return`remove:${n.id}`;case"clear":return`clear:${n.upTo}`}},Ue=h({id:m(y(),v(1)),name:_(y())}),V=y(),Ce=m(y(),v(1)),Ge=h({kind:b("snapshot"),cursor:V,actions:w(E())}),ze=h({kind:b("ops"),cursor:V,ops:w(E())}),Je=O("kind",[Ge,ze]),Ye=h({kind:b("append"),action:E()}),fe=h({kind:b("remove"),id:Ce}),ye=h({kind:b("clear"),upTo:V}),Ze=O("kind",[Ye,fe,ye]),Xe=O("kind",[h({kind:b("append"),action:L}),fe,ye]),Be=h({author:Q(T(Ue),void 0)}),Qe=(n,t)=>{const e=g(Je,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=he(i,t);return s===null?[]:[s]})}:{kind:"ops",cursor:r.cursor,ops:r.ops.flatMap(i=>{const s=g(Ze,i);if(!s.success)return[];if(s.output.kind!=="append")return[s.output];const u=he(s.output.action,t);return u===null?[]:[{kind:"append",entry:u}]})}},he=(n,t)=>{const e=t(n);if(e===null)return null;const r=g(Be,n);return{action:e,author:r.success?r.output.author:void 0}},He=n=>Array.isArray(n)?n.flatMap(t=>{const e=g(Xe,t);return e.success?[e.output]:[]}):[];export{le as A,_ as B,Ie as C,re as D,J as E,C as F,ne as G,F as H,Q as I,ue as J,P as K,M as L,z as M,Pe as N,Ne as O,G as P,X as Q,te as R,Me as S,Y as T,Ae as U,U as V,ae as W,Fe as X,Qe as Y,H as Z,Ke as a,Le as b,L as c,qe as d,$e as e,Re as f,W as g,w as h,ee as i,y as j,T as k,b as l,we as m,se as n,h as o,Te as p,oe as q,He as r,g as s,R as t,E as u,m as v,v as w,ie as x,Z as y,O as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A as v,aY as O,t as j,a4 as R}from"./shared-
|
|
1
|
+
import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A as v,aY as O,t as j,a4 as R}from"./shared-BWIla41c.js";import{L as D}from"./shared-CjW1DhGL.js";const N=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]],K=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]],P=z(class extends C{constructor(){super(...arguments),this.key=d}render(e,r){return this.key=e,r}update(e,[r,t]){return r!==this.key&&(L(e),this.key=r),t}}),U=B({en:{comment:"Comment",commentOn:e=>`Comment on ${e}`,submit:"Add",cancel:"Cancel"},ja:{comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:e=>`${e}\u3078\u306E\u30B3\u30E1\u30F3\u30C8`,submit:"\u8FFD\u52A0",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB"}}),F=(e,r,t={})=>({body:e,notes:r,submission:e.trim()||null,label:t.label??null,error:t.error??null,key:t.key??null,choice:t.choice??null,submitLabel:t.submitLabel??null}),G=(e,r,t)=>{const a=()=>{r.submission!==null&&t({kind:"comment",body:r.submission})};return n`<div
|
|
2
2
|
class="comment-pop"
|
|
3
3
|
popover="manual"
|
|
4
4
|
role="dialog"
|
|
@@ -8,7 +8,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
|
|
|
8
8
|
>
|
|
9
9
|
${r.label?n`<strong class="comment-target">${r.label}</strong>`:d}
|
|
10
10
|
${r.error?n`<p class="comment-error" role="alert">${r.error}</p>`:d}
|
|
11
|
-
${r.choice?
|
|
11
|
+
${r.choice?H(r.choice,t):d}
|
|
12
12
|
${r.notes.length?n`<ul class="comment-list">
|
|
13
13
|
${r.notes.map(o=>n`<li>${o}</li>`)}
|
|
14
14
|
</ul>`:d}
|
|
@@ -33,7 +33,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
|
|
|
33
33
|
${e.cancel}
|
|
34
34
|
</button>
|
|
35
35
|
</div>
|
|
36
|
-
</div>`},
|
|
36
|
+
</div>`},H=(e,r)=>{const t=e.options.find(a=>a.value===e.value)?.hint;return n`<fieldset class="comment-kinds">
|
|
37
37
|
<legend>${e.label}</legend>
|
|
38
38
|
${e.options.map(a=>n`<label class="comment-kind">
|
|
39
39
|
<input
|
|
@@ -46,7 +46,7 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
|
|
|
46
46
|
<span>${a.label}</span>
|
|
47
47
|
</label>`)}
|
|
48
48
|
</fieldset>
|
|
49
|
-
${t===void 0?d:n`<p class="comment-kind-hint">${t}</p>`}`},$=(e,r)=>{const t=e.trim();if(t==="")return null;try{return t.startsWith("/")?new URL(t,r):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`)}catch{return null}},
|
|
49
|
+
${t===void 0?d:n`<p class="comment-kind-hint">${t}</p>`}`},$=(e,r)=>{const t=e.trim();if(t==="")return null;try{return t.startsWith("/")?new URL(t,r):new URL(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`)}catch{return null}},S=e=>`${e.origin}${e.pathname.replace(/\/+$/,"")}`,W=(e,r)=>{const t=e.trim();return t.startsWith("/")?$(t,r)?.href??t:/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:`https://${t}`},X=e=>{try{return new URL(e).host||e}catch{return e}},_=p(E),V=p(M),J=p(K),Y=p(D),g=p(N),q=(e,r,t)=>{const a=r.length-1;if(e==="ArrowRight")return r[t===a?0:t+1];if(e==="ArrowLeft")return r[t===0?a:t-1];if(e==="Home")return r[0];if(e==="End")return r[a]},Q=e=>{const{view:r,send:t,labels:a}=e,o=s=>i=>{const l=r.tabs[s],k=i.key==="Enter"||i.key===" "?l:q(i.key,r.tabs,s);k!==void 0&&(i.preventDefault(),t({kind:"activate",id:k.id,focus:!0}))};return n`<div class="browser-tabs">
|
|
50
50
|
<div class="browser-tab-list" role="tablist" aria-label=${a.tabs}>
|
|
51
51
|
${r.tabs.map((s,i)=>n`<div
|
|
52
52
|
class="browser-tab"
|
|
@@ -683,4 +683,4 @@ import{aT as z,aU as C,a5 as d,aV as L,_ as B,ag as n,ay as p,aW as E,aX as M,A
|
|
|
683
683
|
top: 8px;
|
|
684
684
|
right: 8px;
|
|
685
685
|
}
|
|
686
|
-
`;export{$ as a,
|
|
686
|
+
`;export{$ as a,S as b,U as c,u as d,ce as e,le as f,xe as g,X as h,P as i,x as j,re as k,ne as l,te as m,we as n,F as p,G as r,ie as s,W as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as S,L as T,V as _}from"./shared-
|
|
1
|
+
import{_ as S,L as T,V as _}from"./shared-BWIla41c.js";import{m as j,q as a,k as o,h as k,j as l,C as B,v as E,w as $}from"./shared-CJZKj_HI.js";const r=S({en:{wholePage:"Whole page",sectionGroup:"Section"},ja:{wholePage:"\u30DA\u30FC\u30B8\u5168\u4F53",sectionGroup:"\u30BB\u30AF\u30B7\u30E7\u30F3"}}),x=a({id:B,title:E(l(),$(1))}),c=a({title:o(l(),""),sections:o(k(x),[])}),p=t=>{const e=j(c,t),i=new Set;for(const n of e.sections){if(i.has(n.id))throw new Error(`duplicate section id: ${n.id}`);i.add(n.id)}return{title:e.title,sections:e.sections}},d=()=>({title:"",sections:[]}),s=(t,e)=>t.sections.find(i=>i.id===e),m=t=>t.title===""?"Plain":t.title,u=(t,e,i)=>{switch(i.type){case"section":return s(e,i.id)?.title??i.id;case"page":return t.wholePage;default:return i.id}},g=(t,e,i)=>({title:e.type,targetLabel:u(t,i,e.target),tone:"meta"}),f=t=>`${t.type} ${T(t.target)} ${JSON.stringify(t.payload)}`,h=(t,e)=>e.sections.map(i=>({value:`section:${i.id}`,label:i.title,group:t.sectionGroup})),w=(t,e)=>e,y=(t,e)=>{switch(e.type){case"section":return s(t,e.id)!==void 0;case"page":return!0;default:return!1}},P=t=>{const e=r(t);return{kind:"view",name:"plain",label:"Plain",addable:!1,parseBase:p,emptyBase:d,actions:{},apply:()=>null,hasTarget:y,describe:(i,n)=>g(e,i,n),serialize:f,resolveNavigation:w,commentTargets:i=>h(e,i),title:m}};class b extends _{definitionFor(e){return P(e)}renderRegions(e){return{}}}const v=()=>{customElements.get("dpk-view-plain")||customElements.define("dpk-view-plain",b)},L=Object.freeze(Object.defineProperty({__proto__:null,DpkViewPlain:b,definePlainElement:v,describePlainAction:g,emptyPlainBase:d,findSection:s,parsePlainBase:p,plainBaseSchema:c,plainCommentTargets:h,plainDefinitionFor:P,plainHasTarget:y,plainMessages:r,plainTargetLabel:u,plainTitle:m,resolvePlainNavigation:w,serializePlainAction:f},Symbol.toStringTag,{value:"Module"}));export{v as d,L as i};
|