Files
anthropic-client/docs/public/chunk-KF4CENUX.min.js
T

4 lines
8.7 KiB
JavaScript
Raw Normal View History

2024-11-19 20:13:35 +00:00
import{a as mt}from"./chunk-CM5D5KZN.min.js";import{Ea as F,Ha as _,Ia as A,Ja as N,Ka as R,La as H,Ma as D,N as $,Na as O,Oa as j,Pa as z,Qa as U,Ra as k,Sa as G,Ta as J,Ua as X,Va as Y,Wa as q,Xa as Z,Ya as K,Za as Q,h as s,ia as L,j as f,m,p as E,s as b,w as I}from"./chunk-UOD6J27N.min.js";import{T as V,k as w}from"./chunk-CXRPJJJE.min.js";import{d as gt}from"./chunk-OSRY5VT3.min.js";var nt=gt(mt(),1);var vt="\u200B",yt={curveBasis:N,curveBasisClosed:R,curveBasisOpen:H,curveBumpX:_,curveBumpY:A,curveBundle:D,curveCardinalClosed:j,curveCardinalOpen:z,curveCardinal:O,curveCatmullRomClosed:k,curveCatmullRomOpen:G,curveCatmullRom:U,curveLinear:F,curveLinearClosed:J,curveMonotoneX:X,curveMonotoneY:Y,curveNatural:q,curveStep:Z,curveStepAfter:Q,curveStepBefore:K},xt=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,pt=s(function(e,t){let r=rt(e,/(?:init\b)|(?:initialize\b)/),n={};if(Array.isArray(r)){let a=r.map(l=>l.args);I(a),n=b(n,[...a])}else n=r.args;if(!n)return;let i=E(e,t),o="config";return n[o]!==void 0&&(i==="flowchart-v2"&&(i="flowchart"),n[i]=n[o],delete n[o]),n},"detectInit"),rt=s(function(e,t=null){try{let r=new RegExp(`[%]{2}(?![{]${xt.source})(?=[}][%]{2}).*
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),f.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let n,i=[];for(;(n=m.exec(e))!==null;)if(n.index===m.lastIndex&&m.lastIndex++,n&&!t||t&&n[1]?.match(t)||t&&n[2]?.match(t)){let o=n[1]?n[1]:n[2],a=n[3]?n[3].trim():n[4]?JSON.parse(n[4].trim()):null;i.push({type:o,args:a})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(r){return f.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),Ht=s(function(e){return e.replace(m,"")},"removeDirectives"),$t=s(function(e,t){for(let[r,n]of t.entries())if(n.match(e))return r;return-1},"isSubstringInArray");function it(e,t){if(!e)return t;let r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return yt[r]??t}s(it,"interpolateToCurve");function ot(e,t){let r=e.trim();if(r)return t.securityLevel!=="loose"?(0,nt.sanitizeUrl)(r):r}s(ot,"formatUrl");var wt=s((e,...t)=>{let r=e.split("."),n=r.length-1,i=r[n],o=window;for(let a=0;a<n;a++)if(o=o[r[a]],!o){f.error(`Function name: ${e} not found in window`);return}o[i](...t)},"runFunc");function B(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}s(B,"distance");function at(e){let t,r=0;e.forEach(i=>{r+=B(i,t),t=i});let n=r/2;return S(e,n)}s(at,"traverseEdge");function st(e){return e.length===1?e[0]:at(e)}s(st,"calcLabelPosition");var tt=s((e,t=2)=>{let r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),S=s((e,t)=>{let r,n=t;for(let i of e){if(r){let o=B(i,r);if(o<n)n-=o;else{let a=n/o;if(a<=0)return r;if(a>=1)return{x:i.x,y:i.y};if(a>0&&a<1)return{x:tt((1-a)*r.x+a*i.x,5),y:tt((1-a)*r.y+a*i.y,5)}}}r=i}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),Mt=s((e,t,r)=>{f.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());let i=S(t,25),o=e?10:5,a=Math.atan2(t[0].y-i.y,t[0].x-i.x),l={x:0,y:0};return l.x=Math.sin(a)*o+(t[0].x+i.x)/2,l.y=-Math.cos(a)*o+(t[0].y+i.y)/2,l},"calcCardinalityPosition");function ct(e,t,r){let n=structuredClone(r);f.info("our points",n),t!=="start_left"&&t!=="start_right"&&n.reverse();let i=25+e,o=S(n,i),a=10+e*.5,l=Math.atan2(n[0].y-o.y,n[0].x-o.x),c={x:0,y:0};return t==="start_left"?(c.x=Math.sin(l+Math.PI)*a+(n[0].x+o.x)/2,c.y=-Math.cos(l+Math.PI)*a+(n[0].y+o.y)/2):t==="end_right"?(c.x=Math.sin(l-Math.PI)*a+(n[0].x+o.x)/2-5,c.y=-Math.cos(l-Math.PI)*a+(n[0].y+o.y)/2-5):t==="end_left"?(c.x=Math.sin(l)*a+(n[0].x+o.x)/2-5,c.y=-Math.cos(l)*a+(n[0].y+o.y)/2-5):(c.x=Math.sin(l)*a+(n[0].x+o.x)/2,c.y=-Math.cos(l)*a+(n[0].y+o.y)/2),c}s(ct,"calcTerminalLabelPosition");function lt(e){let t="",r="";for(let n of e)n!==void 0&&(n.startsWith("color:")||n.startsWith("text-align:")?r=r+n+";":t=t+n+";");return{style:t,labelStyle:r}}s(lt,"getStylesFromArray");var et=0,bt=s(()=>(et++,"id-"+Math.random().toString(36).substr(2,12)+"-"+et),"generateId");function ut(e){let t="",r="0123456789abcdef",n=r.length;for(let i=0;i<e;i++)t+=r.charAt(Math.floor(Math.random()*n));return t}s(ut,"makeRandomHex");var Bt=s(e=>ut(e.length),"random"),St=s(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),Wt=s(function(e,t){let r=t.text.replace($.lineBreakRegex," "),[,n]=T(t.fontSize),i=e.append("text");i.attr("x",t.x),i.attr("y",t.y),i.style("text-anchor",t.anchor),i.style("font-family",t.fontFamily),i.style("font-size",n),i.style("font-weight",t.fontWeight),i.attr("fill",t.fill),t.class!==void 0&&i.attr("class",t.class);let o=i.append("tspan");return o.attr("x",t.x+t.textMargin*2),o.attr("fill",t.fill),o.text(r),i},"drawSimpleText"),Tt=w((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),$.lineBreakRegex.test(e)))return e;let n=e.split(" ").filter(Boolean),i=[],o="";return n.forEach((a,l)=>{let c=v(`${a} `,r),u=v(o,r);if(c>t){let{hyphenatedStrings:g,remainingWord:h}=Ct(a,t,"-",r);i.push(o,...g),o=h}else u+c>=t?(i.push(o),o=a):o=[o,a].filter(Boolean
//# sourceMappingURL=chunk-KF4CENUX.min.js.map