@canva/cli 0.0.1-beta.10 → 0.0.1-beta.11

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 (2) hide show
  1. package/cli.js +1 -1
  2. package/package.json +5 -5
package/cli.js CHANGED
@@ -508,7 +508,7 @@ ${Lb}
508
508
  to the local update config store via
509
509
  `+Je.cyan(y1(" sudo chown -R $USER:$(id -gn $USER) %s ",ml));eu.on("exit",()=>{console.error(dh(r,{textAlignment:"center"}))})}}check(){!this.config||this.config.get("optOut")||this.#r||(this.update=this.config.get("update"),this.update&&(this.update.current=this.#t,this.config.delete("update")),!(Date.now()-this.config.get("lastUpdateCheck")<this.#e)&&yG(eu.execPath,[D3.join(vG,"check.js"),JSON.stringify(this.#n)],{detached:!0,stdio:"ignore"}).unref())}async fetchInfo(){let{distTag:t}=this.#n,r=await Kv(this._packageName,{version:t});return{latest:r,current:this.#t,type:(0,v3.default)(this.#t,r)??t,name:this._packageName}}notify(t){let r=!this._shouldNotifyInNpmScript&&vI;if(!eu.stdout.isTTY||r||!this.update||!(0,w3.default)(this.update.latest,this.update.current))return this;t={isGlobal:II,...t};let n=t.isGlobal?`npm i -g ${this._packageName}`:`npm i ${this._packageName}`,i="Update available "+Je.dim("{currentVersion}")+Je.reset(" \u2192 ")+Je.green("{latestVersion}")+`
510
510
  Run `+Je.cyan("{updateCommand}")+" to update",s=t.message||i;t.boxenOptions??={padding:1,margin:1,textAlignment:"center",borderColor:"yellow",borderStyle:"round"};let o=dh(g1(s,{packageName:this._packageName,currentVersion:this.update.current,latestVersion:this.update.latest,updateCommand:n}),t.boxenOptions);return t.defer===!1?console.error(o):eu.on("exit",()=>{console.error(o)}),this}};function D1(e){let t=new jf(e);return t.check(),t}var C3="#8b3dff",mh="grey",v1="#7d2ae7",E3=[{color:"#00c4cc",pos:0},{pos:.5},{color:"#6420ff",pos:.9},{color:v1,pos:1}];import Ui from"react";import{Box as S3,Text as tu}from"ink";var x3=({name:e,currentVersion:t,latestVersion:r})=>{let{lite:n}=Ui.useContext(st);return!r||r===t?null:n?Ui.createElement(S3,{flexDirection:"column"},Ui.createElement(tu,null,"Update available ",t," \u2192 ",r),Ui.createElement(tu,null,"Run npm i -g ",e,"@latest to update")):Ui.createElement(S3,{borderStyle:"round",borderColor:"yellow",flexDirection:"column",alignSelf:"center",paddingLeft:2,width:52},Ui.createElement(tu,{color:"yellow"},"Update available ",Ui.createElement(tu,{color:"grey"},t," \u2192 "),Ui.createElement(tu,{color:"yellow"},r)),Ui.createElement(tu,null,"Run ",Ui.createElement(tu,{bold:!0},"npm i -g ",e,"@latest")," to update"))};import fo from"react";import{Box as gT,Text as $1,useApp as rz}from"ink";import{Text as Dme}from"ink";import wme from"react";var rq=St(F3(),1);import rme,{createContext as eq,useContext as tq}from"react";import $i from"node:process";function w1(){return $i.platform!=="win32"?$i.env.TERM!=="linux":!!$i.env.WT_SESSION||!!$i.env.TERMINUS_SUBLIME||$i.env.ConEmuTask==="{cmd::Cmder}"||$i.env.TERM_PROGRAM==="Terminus-Sublime"||$i.env.TERM_PROGRAM==="vscode"||$i.env.TERM==="xterm-256color"||$i.env.TERM==="alacritty"||$i.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var A3={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},I3={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},NG={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},RG={...A3,...I3},BG={...A3,...NG},kG=w1(),MG=kG?RG:BG,Tt=MG,Bde=Object.entries(I3);var T3={info:"blue",success:"green",error:"red",warning:"yellow"},jG={styles:{container:({variant:e})=>({flexGrow:1,borderStyle:"round",borderColor:T3[e],gap:1,paddingX:1}),iconContainer:()=>({flexShrink:0}),icon:({variant:e})=>({color:T3[e]}),content:()=>({flexShrink:1,flexGrow:1,minWidth:0,flexDirection:"column",gap:1}),title:()=>({bold:!0}),message:()=>({})},config({variant:e}){let t;return e==="info"&&(t=Tt.info),e==="success"&&(t=Tt.tick),e==="error"&&(t=Tt.cross),e==="warning"&&(t=Tt.warning),{icon:t}}},P3=jG;var VG={styles:{container:({color:e})=>({backgroundColor:e}),label:()=>({color:"black"})}},L3=VG;var UG={styles:{input:({isFocused:e})=>({dimColor:!e})}},N3=UG;var $G={styles:{container:()=>({flexDirection:"column"}),option:({isFocused:e})=>({gap:1,paddingLeft:e?0:2}),selectedIndicator:()=>({color:"green"}),focusIndicator:()=>({color:"blue"}),label({isFocused:e,isSelected:t}){let r;return t&&(r="green"),e&&(r="blue"),{color:r}},highlightedText:()=>({bold:!0})}},R3=$G;var WG={styles:{list:()=>({flexDirection:"column"}),listItem:()=>({gap:1}),marker:()=>({dimColor:!0}),content:()=>({flexDirection:"column"})}},B3=WG;var GG={styles:{container:()=>({flexGrow:1,minWidth:0}),completed:()=>({color:"magenta"}),remaining:()=>({dimColor:!0})},config:()=>({completedCharacter:Tt.square,remainingCharacter:Tt.squareLightShade})},k3=GG;var qG={styles:{container:()=>({flexDirection:"column"}),option:({isFocused:e})=>({gap:1,paddingLeft:e?0:2}),selectedIndicator:()=>({color:"green"}),focusIndicator:()=>({color:"blue"}),label({isFocused:e,isSelected:t}){let r;return t&&(r="green"),e&&(r="blue"),{color:r}},highlightedText:()=>({bold:!0})}},M3=qG;var zG={styles:{container:()=>({gap:1}),frame:()=>({color:"blue"}),label:()=>({})}},j3=zG;var HG={success:"green",error:"red",warning:"yellow",info:"blue"},YG={success:Tt.tick,error:Tt.cross,warning:Tt.warning,info:Tt.info},KG={styles:{container:()=>({gap:1}),iconContainer:()=>({flexShrink:0}),icon:({variant:e})=>({color:HG[e]}),message:()=>({})},config:({variant:e})=>({icon:YG[e]})},V3=KG;var XG={styles:{list:()=>({flexDirection:"column"}),listItem:()=>({gap:1}),marker:()=>({dimColor:!0}),content:()=>({flexDirection:"column"})},config:()=>({marker:Tt.line})},U3=XG;var JG={styles:{value:()=>({})}},$3=JG;var ZG={styles:{value:()=>({})}},W3=ZG;var QG={styles:{value:()=>({})}},G3=QG;var nq={components:{Alert:P3,Badge:L3,ConfirmInput:N3,MultiSelect:R3,OrderedList:B3,ProgressBar:k3,Select:M3,Spinner:j3,StatusMessage:V3,UnorderedList:U3,TextInput:$3,EmailInput:W3,PasswordInput:G3}},iq=eq(nq);var rt=e=>tq(iq).components[e];import sq from"react";import{Text as oq,useInput as aq}from"ink";function q3({isDisabled:e=!1,defaultChoice:t="confirm",submitOnEnter:r=!0,onConfirm:n,onCancel:i}){aq((o,a)=>{o.toLowerCase()==="y"&&n(),o.toLowerCase()==="n"&&i(),a.return&&r&&(t==="confirm"?n():i())},{isActive:!e});let{styles:s}=rt("ConfirmInput");return sq.createElement(oq,{...s.input({isFocused:!e})},t==="confirm"?"Y/n":"y/N")}import{Box as pq}from"ink";import S1,{useMemo as Y3,useContext as dq}from"react";import{Box as z3,Text as lq}from"ink";import C1,{useContext as cq}from"react";import{createContext as uq}from"react";var Uf=Tt.line;var hh=uq({marker:Uf});function H3({children:e}){let{marker:t}=cq(hh),{styles:r}=rt("UnorderedList");return C1.createElement(z3,{...r.listItem()},C1.createElement(lq,{...r.marker()},t),C1.createElement(z3,{...r.content()},e))}import{createContext as fq}from"react";var E1=fq({depth:0});function mq({children:e}){let{depth:t}=dq(E1),{styles:r,config:n}=rt("UnorderedList"),i=Y3(()=>({depth:t+1}),[t]),s=Y3(()=>{let{marker:o}=n();return typeof o=="string"?{marker:o}:Array.isArray(o)?{marker:o[t]??o.at(-1)??Uf}:{marker:Uf}},[n,t]);return S1.createElement(E1.Provider,{value:i},S1.createElement(hh.Provider,{value:s},S1.createElement(pq,{...r.list()},e)))}mq.Item=H3;import Ehe from"react";import{Box as xhe,Text as _he}from"ink";import ehe from"react";import{Box as rhe,Text as nhe}from"ink";import{useReducer as uhe,useCallback as lhe,useMemo as che,useState as fhe,useEffect as phe}from"react";var Tl=class extends Map{first;constructor(t){let r=[],n,i,s=0;for(let o of t){let a={...o,previous:i,next:void 0,index:s};i&&(i.next=a),n||=a,r.push([o.value,a]),s++,i=a}super(r),this.first=n}};import{useInput as ghe}from"ink";import Nhe,{useState as Rhe}from"react";import{Box as khe,Text as Mhe,measureElement as jhe}from"ink";import $f from"react";import{Box as Sq,Text as xq}from"ink";import gh from"react";import{Box as hq,Text as x1}from"ink";function K3({isFocused:e,isSelected:t,children:r}){let{styles:n}=rt("Select");return gh.createElement(hq,{...n.option({isFocused:e})},e&&gh.createElement(x1,{...n.focusIndicator()},Tt.pointer),gh.createElement(x1,{...n.label({isFocused:e,isSelected:t})},r),t&&gh.createElement(x1,{...n.selectedIndicator()},Tt.tick))}import{isDeepStrictEqual as gq}from"node:util";import{useReducer as yq,useCallback as _1,useMemo as Dq,useState as vq,useEffect as wq}from"react";var Cq=(e,t)=>{switch(t.type){case"focus-next-option":{if(!e.focusedValue)return e;let r=e.optionMap.get(e.focusedValue);if(!r)return e;let n=r.next;if(!n)return e;if(!(n.index>=e.visibleToIndex))return{...e,focusedValue:n.value};let s=Math.min(e.optionMap.size,e.visibleToIndex+1),o=s-e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:o,visibleToIndex:s}}case"focus-previous-option":{if(!e.focusedValue)return e;let r=e.optionMap.get(e.focusedValue);if(!r)return e;let n=r.previous;if(!n)return e;if(!(n.index<=e.visibleFromIndex))return{...e,focusedValue:n.value};let s=Math.max(0,e.visibleFromIndex-1),o=s+e.visibleOptionCount;return{...e,focusedValue:n.value,visibleFromIndex:s,visibleToIndex:o}}case"select-focused-option":return{...e,previousValue:e.value,value:e.focusedValue};case"reset":return t.state}},X3=({visibleOptionCount:e,defaultValue:t,options:r})=>{let n=typeof e=="number"?Math.min(e,r.length):r.length,i=new Tl(r);return{optionMap:i,visibleOptionCount:n,focusedValue:i.first?.value,visibleFromIndex:0,visibleToIndex:n,previousValue:t,value:t}},J3=({visibleOptionCount:e=5,options:t,defaultValue:r,onChange:n})=>{let[i,s]=yq(Cq,{visibleOptionCount:e,defaultValue:r,options:t},X3),[o,a]=vq(t);t!==o&&!gq(t,o)&&(s({type:"reset",state:X3({visibleOptionCount:e,defaultValue:r,options:t})}),a(t));let u=_1(()=>{s({type:"focus-next-option"})},[]),l=_1(()=>{s({type:"focus-previous-option"})},[]),c=_1(()=>{s({type:"select-focused-option"})},[]),f=Dq(()=>t.map((p,d)=>({...p,index:d})).slice(i.visibleFromIndex,i.visibleToIndex),[t,i.visibleFromIndex,i.visibleToIndex]);return wq(()=>{i.value&&i.previousValue!==i.value&&n?.(i.value)},[i.previousValue,i.value,t,n]),{focusedValue:i.focusedValue,visibleFromIndex:i.visibleFromIndex,visibleToIndex:i.visibleToIndex,value:i.value,visibleOptions:f,focusNextOption:u,focusPreviousOption:l,selectFocusedOption:c}};import{useInput as Eq}from"ink";var Z3=({isDisabled:e=!1,state:t})=>{Eq((r,n)=>{n.downArrow&&t.focusNextOption(),n.upArrow&&t.focusPreviousOption(),n.return&&t.selectFocusedOption()},{isActive:!e})};function ws({isDisabled:e=!1,visibleOptionCount:t=5,highlightText:r,options:n,defaultValue:i,onChange:s}){let o=J3({visibleOptionCount:t,options:n,defaultValue:i,onChange:s});Z3({isDisabled:e,state:o});let{styles:a}=rt("Select");return $f.createElement(Sq,{...a.container()},o.visibleOptions.map(u=>{let l=u.label;if(r&&u.label.includes(r)){let c=u.label.indexOf(r);l=$f.createElement($f.Fragment,null,u.label.slice(0,c),$f.createElement(xq,{...a.highlightedText()},r),u.label.slice(c+r.length))}return $f.createElement(K3,{key:u.value,isFocused:!e&&o.focusedValue===u.value,isSelected:o.value===u.value},l)}))}import O1 from"react";import{Box as Fq,Text as tT}from"ink";import{useEffect as bq,useState as Oq}from"react";var b1={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Q3=b1,c0e=Object.keys(b1);function eT({type:e="dots"}){let[t,r]=Oq(0),n=Q3[e];return bq(()=>{let i=setInterval(()=>{r(s=>s===n.frames.length-1?0:s+1)},n.interval);return()=>{clearInterval(i)}},[n]),{frame:n.frames[t]??""}}function rT({label:e,type:t}){let{frame:r}=eT({type:t}),{styles:n}=rt("Spinner");return O1.createElement(Fq,{...n.container()},O1.createElement(tT,{...n.frame()},r),e&&O1.createElement(tT,{...n.label()},e))}import Nq from"react";import{Text as Rq}from"ink";import{useReducer as Aq,useCallback as Wf,useEffect as Iq,useMemo as Tq}from"react";var Pq=(e,t)=>{switch(t.type){case"move-cursor-left":return{...e,cursorOffset:Math.max(0,e.cursorOffset-1)};case"move-cursor-right":return{...e,cursorOffset:Math.min(e.value.length,e.cursorOffset+1)};case"insert":return{...e,previousValue:e.value,value:e.value.slice(0,e.cursorOffset)+t.text+e.value.slice(e.cursorOffset),cursorOffset:e.cursorOffset+t.text.length};case"delete":{let r=Math.max(0,e.cursorOffset-1);return{...e,previousValue:e.value,value:e.value.slice(0,r)+e.value.slice(r+1),cursorOffset:r}}}},nT=({defaultValue:e="",suggestions:t,onChange:r,onSubmit:n})=>{let[i,s]=Aq(Pq,{previousValue:e,value:e,cursorOffset:e.length}),o=Tq(()=>{if(i.value.length!==0)return t?.find(p=>p.startsWith(i.value))?.replace(i.value,"")},[i.value,t]),a=Wf(()=>{s({type:"move-cursor-left"})},[]),u=Wf(()=>{s({type:"move-cursor-right"})},[]),l=Wf(p=>{s({type:"insert",text:p})},[]),c=Wf(()=>{s({type:"delete"})},[]),f=Wf(()=>{if(o){l(o),n?.(i.value+o);return}n?.(i.value)},[i.value,o,l,n]);return Iq(()=>{i.value!==i.previousValue&&r?.(i.value)},[i.previousValue,i.value,r]),{...i,suggestion:o,moveCursorLeft:a,moveCursorRight:u,insert:l,delete:c,submit:f}};import{useMemo as iT}from"react";import{useInput as Lq}from"ink";var F1=Je.inverse(" "),sT=({isDisabled:e=!1,state:t,placeholder:r=""})=>{let n=iT(()=>e?r?Je.dim(r):"":r&&r.length>0?Je.inverse(r[0])+Je.dim(r.slice(1)):F1,[e,r]),i=iT(()=>{if(e)return t.value;let s=0,o=t.value.length>0?"":F1;for(let a of t.value)o+=s===t.cursorOffset?Je.inverse(a):a,s++;return t.suggestion?(t.cursorOffset===t.value.length?o+=Je.inverse(t.suggestion[0])+Je.dim(t.suggestion.slice(1)):o+=Je.dim(t.suggestion),o):(t.value.length>0&&t.cursorOffset===t.value.length&&(o+=F1),o)},[e,t.value,t.cursorOffset,t.suggestion]);return Lq((s,o)=>{if(!(o.upArrow||o.downArrow||o.ctrl&&s==="c"||o.tab||o.shift&&o.tab)){if(o.return){t.submit();return}o.leftArrow?t.moveCursorLeft():o.rightArrow?t.moveCursorRight():o.backspace||o.delete?t.delete():t.insert(s)}},{isActive:!e}),{inputValue:t.value.length>0?i:n}};function oT({isDisabled:e=!1,defaultValue:t,placeholder:r="",suggestions:n,onChange:i,onSubmit:s}){let o=nT({defaultValue:t,suggestions:n,onChange:i,onSubmit:s}),{inputValue:a}=sT({isDisabled:e,placeholder:r,state:o}),{styles:u}=rt("TextInput");return Nq.createElement(Rq,{...u.value()},a)}import{Box as Vq}from"ink";import Gf,{useContext as Uq,isValidElement as uT}from"react";import{Box as aT,Text as kq}from"ink";import A1,{useContext as Mq}from"react";import{createContext as Bq}from"react";var yh=Bq({marker:Tt.line});function Dh({children:e}){let{marker:t}=Mq(yh),{styles:r}=rt("OrderedList");return A1.createElement(aT,{...r.listItem()},A1.createElement(kq,{...r.marker()},t),A1.createElement(aT,{...r.content()},e))}import{createContext as jq}from"react";var I1=jq({marker:""});function $q({children:e}){let{marker:t}=Uq(I1),{styles:r}=rt("OrderedList"),n=0;for(let s of Gf.Children.toArray(e))!uT(s)||s.type!==Dh||n++;let i=String(n).length;return Gf.createElement(Vq,{...r.list()},Gf.Children.map(e,(s,o)=>{if(!uT(s)||s.type!==Dh)return s;let a=`${String(o+1).padStart(i)}.`,u=`${t}${a}`;return Gf.createElement(I1.Provider,{value:{marker:u}},Gf.createElement(yh.Provider,{value:{marker:u}},s))}))}$q.Item=Dh;import Hq from"react";import{Text as Yq}from"ink";import{useReducer as Wq,useCallback as qf,useEffect as Gq}from"react";var qq=(e,t)=>{switch(t.type){case"move-cursor-left":return{...e,cursorOffset:Math.max(0,e.cursorOffset-1)};case"move-cursor-right":return{...e,cursorOffset:Math.min(e.value.length,e.cursorOffset+1)};case"insert":return{...e,previousValue:e.value,value:e.value.slice(0,e.cursorOffset)+t.text+e.value.slice(e.cursorOffset),cursorOffset:e.cursorOffset+t.text.length};case"delete":{let r=Math.max(0,e.cursorOffset-1);return{...e,previousValue:e.value,value:e.value.slice(0,r)+e.value.slice(r+1),cursorOffset:r}}}},lT=({onChange:e,onSubmit:t})=>{let[r,n]=Wq(qq,{previousValue:"",value:"",cursorOffset:0}),i=qf(()=>{n({type:"move-cursor-left"})},[]),s=qf(()=>{n({type:"move-cursor-right"})},[]),o=qf(l=>{n({type:"insert",text:l})},[]),a=qf(()=>{n({type:"delete"})},[]),u=qf(()=>{t?.(r.value)},[r.value,t]);return Gq(()=>{r.value!==r.previousValue&&e?.(r.value)},[r.previousValue,r.value,e]),{...r,moveCursorLeft:i,moveCursorRight:s,insert:o,delete:a,submit:u}};import{useMemo as cT}from"react";import{useInput as zq}from"ink";var T1=Je.inverse(" "),fT=({isDisabled:e=!1,state:t,placeholder:r=""})=>{let n=cT(()=>e?r?Je.dim(r):"":r&&r.length>0?Je.inverse(r[0])+Je.dim(r.slice(1)):T1,[e,r]),i=cT(()=>{let s="*".repeat(t.value.length);if(e)return s;let o=0,a=s.length>0?"":T1;for(let u of s)a+=o===t.cursorOffset?Je.inverse(u):u,o++;return s.length>0&&t.cursorOffset===s.length&&(a+=T1),a},[e,t.value,t.cursorOffset]);return zq((s,o)=>{if(!(o.upArrow||o.downArrow||o.ctrl&&s==="c"||o.tab||o.shift&&o.tab)){if(o.return){t.submit();return}o.leftArrow?t.moveCursorLeft():o.rightArrow?t.moveCursorRight():o.backspace||o.delete?t.delete():t.insert(s)}},{isActive:!e}),{inputValue:t.value.length>0?i:n}};function pT({isDisabled:e=!1,placeholder:t="",onChange:r,onSubmit:n}){let i=lT({onChange:r,onSubmit:n}),{inputValue:s}=fT({isDisabled:e,placeholder:t,state:i}),{styles:o}=rt("PasswordInput");return Hq.createElement(Yq,{...o.value()},s)}import yge from"react";import{Box as vge,Text as wge}from"ink";import bge from"react";import{Box as Fge,Text as Age}from"ink";import Xge from"react";import{Text as Zge}from"ink";import{useReducer as Rge,useCallback as Bge,useEffect as kge,useMemo as Mge}from"react";import{useMemo as Uge}from"react";import{useInput as Wge}from"ink";var qge=Je.inverse(" ");import dT,{useContext as Kq}from"react";var co=e=>{let{lite:t}=Kq(st),r=e.yesLabel||"Yes",n=e.noLabel||"No",i=[{label:r,value:"yes"},{label:n,value:"no"}],s=a=>{let u=a==="yes";e.onChange?.(u)},o=e.default==="no"?i.reverse():i;return t?dT.createElement(q3,{onConfirm:()=>s("yes"),onCancel:()=>s("no"),defaultChoice:e.default==="yes"?"confirm":"cancel"}):dT.createElement(ws,{options:o,onChange:a=>s(a)})};import nr from"node:fs";import Er from"node:path";import{promisify as Qq}from"util";import{exec as ez}from"child_process";import Xq from"node:path";function zf(e){return e.replace(/\s+/g,"-").toLowerCase()}function vh(e){return Xq.join(process.cwd(),zf(e))}var Jq=18;function Hf(e){return e.length?e.trim()===""?{valid:!1,message:"Name cannot be empty."}:e.trim()!==e?{valid:!1,message:"Name cannot contain leading or trailing whitespace."}:e.length>Jq?{valid:!1,message:"Name cannot be longer than 18 characters."}:/[|\r\n/\\:*?"<>.]+/g.test(e)?{valid:!1,message:'Name cannot contain any of these invalid characters (\\ / : * ? " < > | .).'}:/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\.\w+)?$/i.test(e)?{valid:!1,message:"Name cannot be the same as any reserved windows filenames."}:{valid:!0}:{valid:!1,message:"Name is required."}}var Zq=["private","name","version","description","license","author","scripts","dependencies","devDependencies","keywords","engines","canvaCliMetadata"];function mT(e){let t={};return Zq.forEach(r=>{e[r]&&(t[r]=e[r])}),Object.keys(e).forEach(r=>{t[r]||(t[r]=e[r])}),JSON.stringify(t,null,2)}import{fileURLToPath as tz}from"node:url";var hT=Qq(ez),wh=tz(import.meta.url),P1={type:"preAppCreation",start:"Checking write permissions",failure:"We don\u2019t have write access to this folder, maybe try somewhere else?",action:async()=>{await nr.promises.access(process.cwd(),(nr.constants||nr).W_OK)},preventCleanupOnError:!0},L1={type:"preAppCreation",start:"Checking folder name available",failure:"The folder already exists. We don\u2019t want to overwrite it automatically, so please remove it first.",action:async e=>{let t=!1;try{await nr.promises.access(e.folderName,(nr.constants||nr).F_OK),t=!0}catch{t=!1}if(t)throw new Error(`A folder named ${e.folderName} already exists.`)},preventCleanupOnError:!0},N1={type:"preAppCreation",start:"Creating folder",failure:"We couldn\u2019t make a folder with that app name, maybe it already exists?",action:async e=>{await nr.promises.mkdir(e.folderName,{recursive:!0})},preventCleanupOnError:!0},R1={type:"preAppCreation",start:"Copying template files",failure:"Failed to copy template files",action:async e=>{let t=Er.dirname(wh),r=Er.join(t,"templates",e.template.path),n=e.folderName;return nr.promises.cp(r,n,{recursive:!0,dereference:!0})},preventCleanupOnError:!1},B1={type:"preAppCreation",start:"Copying common files",failure:"Failed to copy common files",action:async e=>{let t=Er.dirname(wh),r=Er.join(t,"templates","common"),n=e.folderName;e.debug&&console.log("running 'cp' command with following args: ",{src:r,destination:n}),await nr.promises.cp(r,n,{recursive:!0,dereference:!0});let i=Er.join(e.folderName,".gitignore.template"),s=Er.join(e.folderName,".gitignore");await nr.promises.rename(i,s)},preventCleanupOnError:!1},k1={type:"preAppCreation",start:"Generating README.md",failure:"Failed to generate README.md.",action:async e=>{let t=Er.dirname(wh),r=Er.join(t,"templates","common","README.md"),n=Er.join(t,"templates",e.template.path,"README.md"),i=Er.join(e.folderName,"README.md"),o=await nr.promises.readFile(r,{encoding:"utf8"});try{let a=await nr.promises.readFile(n,"utf8");o=o+`
511
- `+a}catch{}await nr.promises.writeFile(i,o)},preventCleanupOnError:!1},M1={type:"preAppCreation",start:"Generating an .env file",failure:"Failed to generate an .env file",action:async e=>{let t=Er.join(e.folderName,".env.template"),r=Er.join(e.folderName,".env");await nr.promises.copyFile(t,r)},preventCleanupOnError:!1},j1={type:"preAppCreation",start:"Updating package.json",failure:"Failed to update package.json",action:async e=>{let t=Er.join(e.folderName,"package.json");e.debug&&console.log("Reading 'package.json': ",{packageJsonName:t});let r=await nr.promises.readFile(t,"utf8"),n=JSON.parse(r);n.name=zf(e.name);let i=Er.dirname(wh),s=Er.join(i,"templates","base","package.json"),o=await nr.promises.readFile(s,"utf8"),a=JSON.parse(o),u=a.canvaCliMetadata;(u.inheritable||[]).forEach(d=>{n[d]=n[d]||a[d]||""});let l=Er.join(i,"package.json"),c=await nr.promises.readFile(l,"utf8"),f=JSON.parse(c);n.canvaCliMetadata={},(u.metaFields||[]).forEach(d=>{n.canvaCliMetadata[d]=f[d]||void 0});let p=mT(n);await nr.promises.writeFile(t,p)},preventCleanupOnError:!1},V1={type:"preAppCreation",start:"Initializing git repository",failure:"Failed to initialize git repository",action:async e=>{await hT(`git init ${e.folderName}`)},preventCleanupOnError:!1},U1={type:"preAppCreation",start:"Installing dependencies (This may take a few minutes)",failure:"Failed to install node packages",action:async e=>{await hT(`cd ${e.folderName} && npm install`)},preventCleanupOnError:!1};async function pi(e=500){await new Promise(t=>setTimeout(t,e))}var yT=({packageName:e,handlePromptDecision:t})=>{let{exit:r}=rz(),[n,i]=fo.useState(!1);return fo.createElement(gT,{flexDirection:"column",paddingX:2,borderStyle:"round",borderColor:"yellow",width:80},fo.createElement($1,null,fo.createElement(Nt,{color:"greenBright"},"? "),"You're using an older version of our CLI. Would you like to update?"),fo.createElement(co,{default:"yes",yesLabel:"Yes (Recommended to access the latest templates)",noLabel:"No (Some features, such as app templates, may be outdated)",onChange:async o=>{o&&(i(!0),await pi(),r()),t(o)}}),n&&fo.createElement(gT,{marginTop:1},fo.createElement($1,null,"Run ",fo.createElement($1,{bold:!0},"npm i -g ",e,"@latest")," to update.")))};import{Text as nz}from"ink";import*as Yf from"react";var jn=e=>{let{lite:t}=Yf.useContext(st);return t?Yf.createElement(nz,null,e.label):Yf.createElement(rT,{type:"bouncingBall",...e})};import DT from"react";import{useContext as iz}from"react";import{Text as sz}from"ink";import oz from"react";var Vn=e=>{let{lite:t}=iz(st);return oz.createElement(sz,{color:t?void 0:"redBright"},e.children)};var Ch=class extends DT.Component{state={isCrashed:!1,message:void 0};static getDerivedStateFromError(t){return{isCrashed:!0,message:t.message}}render(){return this.state.isCrashed?DT.createElement(Vn,null,this.state.message??"Sorry, a problem occured"):this.props.children}componentDidCatch(t){this.setState({isCrashed:!0,message:t.message})}componentDidMount(){process.setUncaughtExceptionCaptureCallback(this.crashed)}componentWillUnmount(){process.setUncaughtExceptionCaptureCallback(null)}crashed=t=>{this.setState({isCrashed:!0,message:t.message}),process.exitCode=1}};var CT=({pkg:e,shouldPromptUpdate:t=!1,children:r,Logo:n})=>{let{lite:i}=az(st),[s,o]=Eh(!0),[a,u]=Eh(),[l,c]=Eh(null),[f,p]=Eh(!1);uz(()=>{(async()=>{try{let h=await D1({pkg:e}).fetchInfo();c(h.latest)}catch{p(!0)}finally{o(!1)}})()},[e]);let d=y=>{u(y?"agreed":"disagreed")};return s?Cs.createElement(jn,{type:"bouncingBall",label:"Loading..."}):t&&l&&l!==e.version&&!a?Cs.createElement(yT,{packageName:e.name,handlePromptDecision:d}):Cs.createElement(vT,{borderStyle:i?void 0:"round",margin:i?void 0:2,flexDirection:"column",borderColor:i?void 0:mh},Cs.createElement(vT,{flexDirection:"row",paddingY:1},Cs.createElement(wT,null),Cs.createElement(n,null),Cs.createElement(wT,null)),Cs.createElement(Ch,null,!f&&Cs.createElement(x3,{name:e.name,currentVersion:e.version,latestVersion:l}),r))};var ST="@canva/cli",Sh="0.0.1-beta.10";var q1={};xj(q1,{client:()=>ru,createApp:()=>Cz,exchangeAccessToken:()=>Sz,getApp:()=>Ez,introspectToken:()=>xz,listApps:()=>wz,revokeTokens:()=>_z});var lz=/\{[^{}]+\}/g,xh=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},cz=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},fz=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},pz=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},bT=({allowReserved:e,explode:t,name:r,style:n,value:i})=>{if(!t){let a=(e?i:i.map(u=>encodeURIComponent(u))).join(fz(n));switch(n){case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;case"simple":return a;default:return`${r}=${a}`}}let s=cz(n),o=i.map(a=>n==="label"||n==="simple"?e?a:encodeURIComponent(a):xh({allowReserved:e,name:r,value:a})).join(s);return n==="label"||n==="matrix"?s+o:o},OT=({allowReserved:e,explode:t,name:r,style:n,value:i})=>{if(i instanceof Date)return`${r}=${i.toISOString()}`;if(n!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([l,c])=>{a=[...a,l,e?c:encodeURIComponent(c)]});let u=a.join(",");switch(n){case"form":return`${r}=${u}`;case"label":return`.${u}`;case"matrix":return`;${r}=${u}`;default:return u}}let s=pz(n),o=Object.entries(i).map(([a,u])=>xh({allowReserved:e,name:n==="deepObject"?`${r}[${a}]`:a,value:u})).join(s);return n==="label"||n==="matrix"?s+o:o},dz=({path:e,url:t})=>{let r=t,n=t.match(lz);if(n)for(let i of n){let s=!1,o=i.substring(1,i.length-1),a="simple";o.endsWith("*")&&(s=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),a="label"):o.startsWith(";")&&(o=o.substring(1),a="matrix");let u=e[o];if(u==null)continue;if(Array.isArray(u)){r=r.replace(i,bT({explode:s,name:o,style:a,value:u}));continue}if(typeof u=="object"){r=r.replace(i,OT({explode:s,name:o,style:a,value:u}));continue}if(a==="matrix"){r=r.replace(i,`;${xh({name:o,value:u})}`);continue}let l=encodeURIComponent(a==="label"?`.${u}`:u);r=r.replace(i,l)}return r},FT=({allowReserved:e,array:t,object:r}={})=>n=>{let i=[];if(n&&typeof n=="object")for(let s in n){let o=n[s];if(o!=null){if(Array.isArray(o)){i=[...i,bT({allowReserved:e,explode:!0,name:s,style:"form",value:o,...t})];continue}if(typeof o=="object"){i=[...i,OT({allowReserved:e,explode:!0,name:s,style:"deepObject",value:o,...r})];continue}i=[...i,xh({allowReserved:e,name:s,value:o})]}}return i.join("&")},mz=e=>{if(!e)return;let t=e.split(";")[0].trim();if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"},hz=({baseUrl:e,path:t,query:r,querySerializer:n,url:i})=>{let s=i.startsWith("/")?i:`/${i}`,o=e+s;t&&(o=dz({path:t,url:o}));let a=r?n(r):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(o+=`?${a}`),o},xT=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=AT(e.headers,t.headers),r},AT=(...e)=>{let t=new Headers;for(let r of e){if(!r||typeof r!="object")continue;let n=r instanceof Headers?r.entries():Object.entries(r);for(let[i,s]of n)if(s===null)t.delete(i);else if(Array.isArray(s))for(let o of s)t.append(i,o);else s!==void 0&&t.set(i,typeof s=="object"?JSON.stringify(s):s)}return t},W1=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(e){return this._fns.indexOf(e)!==-1}eject(e){let t=this._fns.indexOf(e);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(e){this._fns=[...this._fns,e]}},gz=()=>({error:new W1,request:new W1,response:new W1});var yz={bodySerializer:e=>JSON.stringify(e)},_T=(e,t,r)=>{typeof r=="string"?e.append(t,r):e.append(t,JSON.stringify(r))},_h={bodySerializer:e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!=null&&(Array.isArray(n)?n.forEach(i=>_T(t,r,i)):_T(t,r,n))}),t}},Dz=FT({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),vz={"Content-Type":"application/json"},G1=(e={})=>({...yz,baseUrl:"",fetch:globalThis.fetch,headers:vz,parseAs:"auto",querySerializer:Dz,...e}),bh=(e={})=>{let t=xT(G1(),e),r=()=>({...t}),n=a=>(t=xT(t,a),r()),i=a=>hz({baseUrl:a.baseUrl??"",path:a.path,query:a.query,querySerializer:typeof a.querySerializer=="function"?a.querySerializer:FT(a.querySerializer),url:a.url}),s=gz(),o=async a=>{let u={...t,...a,headers:AT(t.headers,a.headers)};u.body&&u.bodySerializer&&(u.body=u.bodySerializer(u.body)),u.body||u.headers.delete("Content-Type");let l=i(u),c={redirect:"follow",...u},f=new Request(l,c);for(let h of s.request._fns)f=await h(f,u);let p=u.fetch,d=await p(f);for(let h of s.response._fns)d=await h(d,f,u);let m={request:f,response:d};if(d.ok){if(d.status===204||d.headers.get("Content-Length")==="0")return{data:{},...m};if(u.parseAs==="stream")return{data:d.body,...m};let h=(u.parseAs==="auto"?mz(d.headers.get("Content-Type")):u.parseAs)??"json",g=await d[h]();return h==="json"&&u.responseTransformer&&(g=await u.responseTransformer(g)),{data:g,...m}}let y=await d.text();try{y=JSON.parse(y)}catch{}let D=y;for(let h of s.error._fns)D=await h(y,d,f,u);if(D=D||{},u.throwOnError)throw D;return{error:D,...m}};return{buildUrl:i,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:r,head:a=>o({...a,method:"HEAD"}),interceptors:s,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:n,trace:a=>o({...a,method:"TRACE"})}};var ru=bh(G1()),wz=e=>(e?.client??ru).get({...e,url:"/v1/apps"}),Cz=e=>(e?.client??ru).post({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/v1/apps"}),Ez=e=>(e?.client??ru).get({...e,url:"/v1/apps/{appId}"}),Sz=e=>(e?.client??ru).post({...e,..._h,headers:{"Content-Type":"application/x-www-form-urlencoded",...e?.headers},url:"/v1/oauth/token"}),xz=e=>(e?.client??ru).post({...e,..._h,headers:{"Content-Type":"application/x-www-form-urlencoded",...e?.headers},url:"/v1/oauth/introspect"}),_z=e=>(e?.client??ru).post({...e,..._h,headers:{"Content-Type":"application/x-www-form-urlencoded",...e?.headers},url:"/v1/oauth/revoke"});var Oh=class{constructor(t,r,n=!1,i=q1){this.tokenService=t;this.env=r;this.debug=n;this.generatedAppService=i}getClient=async()=>{let t=await this.tokenService.getToken();if(!t.success)return{success:!1,code:"NO_TOKEN",message:"No token found. Please login first."};let r=bh({baseUrl:this.env.CONNECT_API_BASE_URL,fetch,headers:{Authorization:`Bearer ${t.data}`,"Content-Type":"application/json"}});return this.debug&&r.interceptors.response.use(n=>{let i=n.headers.get("x-request-id");return n.status>=400?console.warn(`Response status ${n.status} on ${n.url}: request id: ${i}}`):console.log(`Response status ${n.status} on ${n.url}: request id: ${i}`),n}),{success:!0,data:r}};listApps=async()=>{let t=await this.getClient();if(!t.success)return t;let{data:r}=t;try{let n=await this.generatedAppService.listApps({client:r});return n.error?{success:!1,code:"API_FAILURE",message:`Failed to fetch apps data: ${n.error.message}`}:{success:!0,data:n.data.items}}catch(n){return{success:!1,code:"API_FAILURE",message:`Failed to fetch apps data: ${n instanceof Error?n.message:String(n)}`}}};createApp=async({name:t,distribution:r})=>{let n=await this.getClient();if(!n.success)return n;let{data:i}=n;try{let s=await this.generatedAppService.createApp({client:i,body:{name:t,distribution:r}});if(s.error)return{success:!1,code:"API_FAILURE",message:`Failed to create app: ${s.error.message}`};let{app:o}=s.data;return{success:!0,data:o}}catch(s){return{success:!1,code:"API_FAILURE",message:`Failed to create app: ${s instanceof Error?s.message:String(s)}`}}}};import z1 from"crypto";var Fh=class{constructor(t){this.env=t}constructAuthUrl(){let t=`${this.env.CANVA_ENV_URL}/api/oauth/authorized/${this.env.CANVA_CLI_CLIENT_ID}`,r=z1.randomBytes(96).toString("base64url"),n=z1.randomBytes(96).toString("base64url"),i=z1.createHash("sha256").update(r).digest().toString("base64url");return{url:this.getAuthorizationUrl({redirectUri:t,state:n,codeChallenge:i}),codeVerifier:r}}getAuthorizationUrl({redirectUri:t,state:r,codeChallenge:n}){let i=["app:read","app:write","profile:read"].join(" "),s=new URL(`${this.env.CANVA_ENV_URL}/api/oauth/authorize`);return s.searchParams.append("code_challenge",n),s.searchParams.append("code_challenge_method","S256"),s.searchParams.append("scope",i),s.searchParams.append("response_type","code"),s.searchParams.append("client_id",this.env.CANVA_CLI_CLIENT_ID),s.searchParams.append("redirect_uri",t),s.searchParams.append("state",r),s.toString()}};var vL=St(DL(),1);import Ep from"crypto";var a0=class{KEY_DERIVATION_ITERATIONS=1e5;KEY_LENGTH=32;async c(){let t=await vL.default.uuid();return`${t.os}::${t.hardware}`}f(t,r){return Ep.pbkdf2Sync(t,r,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let r=await this.c(),n=Ep.randomBytes(16),i=this.f(r,n),s=Ep.randomBytes(12),o=Ep.createCipheriv("aes-256-gcm",i,s),a=o.update(t,"utf8","hex");a+=o.final("hex");let u={iv:s.toString("hex"),authTag:o.getAuthTag().toString("hex"),cipherText:a,salt:n.toString("hex")};return{success:!0,data:[u.iv,u.authTag,u.cipherText,u.salt].join(":")}}catch(r){return{success:!1,code:"ENCRYPTION_ERROR",message:`Encryption failed: ${r instanceof Error?r.message:String(r)}`}}}async decrypt(t){try{let r=await this.c(),n=t.split(":");if(n.length!==4)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Invalid encrypted data format."};let[i,s,o,a]=n;if(!i||!s||!o||!a)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Missing required components for decryption."};let u=Buffer.from(i,"hex"),l=Buffer.from(s,"hex"),c=Buffer.from(a,"hex"),f=this.f(r,c),p=Ep.createDecipheriv("aes-256-gcm",f,u);p.setAuthTag(l);let d=p.update(o,"hex","utf8");return d+=p.final("utf8"),{success:!0,data:d}}catch(r){return{success:!1,code:"DECRYPTION_ERROR",message:`Decryption failed: ${r instanceof Error?r.message:String(r)}`}}}};import l0 from"node:process";import{Buffer as pJ}from"node:buffer";import FL from"node:path";import{fileURLToPath as dJ}from"node:url";import mJ from"node:child_process";import Zw,{constants as AL}from"node:fs/promises";import EL from"node:process";import YX from"node:os";import KX from"node:fs";import zX from"node:fs";import wL from"node:fs";var Gw;function GX(){try{return wL.statSync("/.dockerenv"),!0}catch{return!1}}function qX(){try{return wL.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function qw(){return Gw===void 0&&(Gw=GX()||qX()),Gw}var zw,HX=()=>{try{return zX.statSync("/run/.containerenv"),!0}catch{return!1}};function Yl(){return zw===void 0&&(zw=HX()||qw()),zw}var CL=()=>{if(EL.platform!=="linux")return!1;if(YX.release().toLowerCase().includes("microsoft"))return!Yl();try{return KX.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Yl():!1}catch{return!1}},hu=EL.env.__IS_WSL_TEST__?CL:CL();function gu(e,t,r){let n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),e}import{promisify as uJ}from"node:util";import Xw from"node:process";import{execFile as lJ}from"node:child_process";import{promisify as XX}from"node:util";import JX from"node:process";import{execFile as ZX}from"node:child_process";var QX=XX(ZX);async function Hw(){if(JX.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await QX("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari"}import eJ from"node:process";import{promisify as tJ}from"node:util";import{execFile as rJ,execFileSync as gve}from"node:child_process";var nJ=tJ(rJ);async function SL(e,{humanReadableOutput:t=!0}={}){if(eJ.platform!=="darwin")throw new Error("macOS only");let r=t?[]:["-ss"],{stdout:n}=await nJ("osascript",["-e",e,r]);return n.trim()}async function Yw(e){return SL(`tell application "Finder" to set app_path to application file id "${e}" as string
511
+ `+a}catch{}await nr.promises.writeFile(i,o)},preventCleanupOnError:!1},M1={type:"preAppCreation",start:"Generating an .env file",failure:"Failed to generate an .env file",action:async e=>{let t=Er.join(e.folderName,".env.template"),r=Er.join(e.folderName,".env");await nr.promises.copyFile(t,r)},preventCleanupOnError:!1},j1={type:"preAppCreation",start:"Updating package.json",failure:"Failed to update package.json",action:async e=>{let t=Er.join(e.folderName,"package.json");e.debug&&console.log("Reading 'package.json': ",{packageJsonName:t});let r=await nr.promises.readFile(t,"utf8"),n=JSON.parse(r);n.name=zf(e.name);let i=Er.dirname(wh),s=Er.join(i,"templates","base","package.json"),o=await nr.promises.readFile(s,"utf8"),a=JSON.parse(o),u=a.canvaCliMetadata;(u.inheritable||[]).forEach(d=>{n[d]=n[d]||a[d]||""});let l=Er.join(i,"package.json"),c=await nr.promises.readFile(l,"utf8"),f=JSON.parse(c);n.canvaCliMetadata={},(u.metaFields||[]).forEach(d=>{n.canvaCliMetadata[d]=f[d]||void 0});let p=mT(n);await nr.promises.writeFile(t,p)},preventCleanupOnError:!1},V1={type:"preAppCreation",start:"Initializing git repository",failure:"Failed to initialize git repository",action:async e=>{await hT(`git init ${e.folderName}`)},preventCleanupOnError:!1},U1={type:"preAppCreation",start:"Installing dependencies (This may take a few minutes)",failure:"Failed to install node packages",action:async e=>{await hT(`cd ${e.folderName} && npm install`)},preventCleanupOnError:!1};async function pi(e=500){await new Promise(t=>setTimeout(t,e))}var yT=({packageName:e,handlePromptDecision:t})=>{let{exit:r}=rz(),[n,i]=fo.useState(!1);return fo.createElement(gT,{flexDirection:"column",paddingX:2,borderStyle:"round",borderColor:"yellow",width:80},fo.createElement($1,null,fo.createElement(Nt,{color:"greenBright"},"? "),"You're using an older version of our CLI. Would you like to update?"),fo.createElement(co,{default:"yes",yesLabel:"Yes (Recommended to access the latest templates)",noLabel:"No (Some features, such as app templates, may be outdated)",onChange:async o=>{o&&(i(!0),await pi(),r()),t(o)}}),n&&fo.createElement(gT,{marginTop:1},fo.createElement($1,null,"Run ",fo.createElement($1,{bold:!0},"npm i -g ",e,"@latest")," to update.")))};import{Text as nz}from"ink";import*as Yf from"react";var jn=e=>{let{lite:t}=Yf.useContext(st);return t?Yf.createElement(nz,null,e.label):Yf.createElement(rT,{type:"bouncingBall",...e})};import DT from"react";import{useContext as iz}from"react";import{Text as sz}from"ink";import oz from"react";var Vn=e=>{let{lite:t}=iz(st);return oz.createElement(sz,{color:t?void 0:"redBright"},e.children)};var Ch=class extends DT.Component{state={isCrashed:!1,message:void 0};static getDerivedStateFromError(t){return{isCrashed:!0,message:t.message}}render(){return this.state.isCrashed?DT.createElement(Vn,null,this.state.message??"Sorry, a problem occured"):this.props.children}componentDidCatch(t){this.setState({isCrashed:!0,message:t.message})}componentDidMount(){process.setUncaughtExceptionCaptureCallback(this.crashed)}componentWillUnmount(){process.setUncaughtExceptionCaptureCallback(null)}crashed=t=>{this.setState({isCrashed:!0,message:t.message}),process.exitCode=1}};var CT=({pkg:e,shouldPromptUpdate:t=!1,children:r,Logo:n})=>{let{lite:i}=az(st),[s,o]=Eh(!0),[a,u]=Eh(),[l,c]=Eh(null),[f,p]=Eh(!1);uz(()=>{(async()=>{try{let h=await D1({pkg:e}).fetchInfo();c(h.latest)}catch{p(!0)}finally{o(!1)}})()},[e]);let d=y=>{u(y?"agreed":"disagreed")};return s?Cs.createElement(jn,{type:"bouncingBall",label:"Loading..."}):t&&l&&l!==e.version&&!a?Cs.createElement(yT,{packageName:e.name,handlePromptDecision:d}):Cs.createElement(vT,{borderStyle:i?void 0:"round",margin:i?void 0:2,flexDirection:"column",borderColor:i?void 0:mh},Cs.createElement(vT,{flexDirection:"row",paddingY:1},Cs.createElement(wT,null),Cs.createElement(n,null),Cs.createElement(wT,null)),Cs.createElement(Ch,null,!f&&Cs.createElement(x3,{name:e.name,currentVersion:e.version,latestVersion:l}),r))};var ST="@canva/cli",Sh="0.0.1-beta.11";var q1={};xj(q1,{client:()=>ru,createApp:()=>Cz,exchangeAccessToken:()=>Sz,getApp:()=>Ez,introspectToken:()=>xz,listApps:()=>wz,revokeTokens:()=>_z});var lz=/\{[^{}]+\}/g,xh=({allowReserved:e,name:t,value:r})=>{if(r==null)return"";if(typeof r=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?r:encodeURIComponent(r)}`},cz=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},fz=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},pz=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},bT=({allowReserved:e,explode:t,name:r,style:n,value:i})=>{if(!t){let a=(e?i:i.map(u=>encodeURIComponent(u))).join(fz(n));switch(n){case"label":return`.${a}`;case"matrix":return`;${r}=${a}`;case"simple":return a;default:return`${r}=${a}`}}let s=cz(n),o=i.map(a=>n==="label"||n==="simple"?e?a:encodeURIComponent(a):xh({allowReserved:e,name:r,value:a})).join(s);return n==="label"||n==="matrix"?s+o:o},OT=({allowReserved:e,explode:t,name:r,style:n,value:i})=>{if(i instanceof Date)return`${r}=${i.toISOString()}`;if(n!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([l,c])=>{a=[...a,l,e?c:encodeURIComponent(c)]});let u=a.join(",");switch(n){case"form":return`${r}=${u}`;case"label":return`.${u}`;case"matrix":return`;${r}=${u}`;default:return u}}let s=pz(n),o=Object.entries(i).map(([a,u])=>xh({allowReserved:e,name:n==="deepObject"?`${r}[${a}]`:a,value:u})).join(s);return n==="label"||n==="matrix"?s+o:o},dz=({path:e,url:t})=>{let r=t,n=t.match(lz);if(n)for(let i of n){let s=!1,o=i.substring(1,i.length-1),a="simple";o.endsWith("*")&&(s=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(o=o.substring(1),a="label"):o.startsWith(";")&&(o=o.substring(1),a="matrix");let u=e[o];if(u==null)continue;if(Array.isArray(u)){r=r.replace(i,bT({explode:s,name:o,style:a,value:u}));continue}if(typeof u=="object"){r=r.replace(i,OT({explode:s,name:o,style:a,value:u}));continue}if(a==="matrix"){r=r.replace(i,`;${xh({name:o,value:u})}`);continue}let l=encodeURIComponent(a==="label"?`.${u}`:u);r=r.replace(i,l)}return r},FT=({allowReserved:e,array:t,object:r}={})=>n=>{let i=[];if(n&&typeof n=="object")for(let s in n){let o=n[s];if(o!=null){if(Array.isArray(o)){i=[...i,bT({allowReserved:e,explode:!0,name:s,style:"form",value:o,...t})];continue}if(typeof o=="object"){i=[...i,OT({allowReserved:e,explode:!0,name:s,style:"deepObject",value:o,...r})];continue}i=[...i,xh({allowReserved:e,name:s,value:o})]}}return i.join("&")},mz=e=>{if(!e)return;let t=e.split(";")[0].trim();if(t.startsWith("application/json")||t.endsWith("+json"))return"json";if(t==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>t.startsWith(r)))return"blob";if(t.startsWith("text/"))return"text"},hz=({baseUrl:e,path:t,query:r,querySerializer:n,url:i})=>{let s=i.startsWith("/")?i:`/${i}`,o=e+s;t&&(o=dz({path:t,url:o}));let a=r?n(r):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(o+=`?${a}`),o},xT=(e,t)=>{let r={...e,...t};return r.baseUrl?.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=AT(e.headers,t.headers),r},AT=(...e)=>{let t=new Headers;for(let r of e){if(!r||typeof r!="object")continue;let n=r instanceof Headers?r.entries():Object.entries(r);for(let[i,s]of n)if(s===null)t.delete(i);else if(Array.isArray(s))for(let o of s)t.append(i,o);else s!==void 0&&t.set(i,typeof s=="object"?JSON.stringify(s):s)}return t},W1=class{_fns;constructor(){this._fns=[]}clear(){this._fns=[]}exists(e){return this._fns.indexOf(e)!==-1}eject(e){let t=this._fns.indexOf(e);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(e){this._fns=[...this._fns,e]}},gz=()=>({error:new W1,request:new W1,response:new W1});var yz={bodySerializer:e=>JSON.stringify(e)},_T=(e,t,r)=>{typeof r=="string"?e.append(t,r):e.append(t,JSON.stringify(r))},_h={bodySerializer:e=>{let t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{n!=null&&(Array.isArray(n)?n.forEach(i=>_T(t,r,i)):_T(t,r,n))}),t}},Dz=FT({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),vz={"Content-Type":"application/json"},G1=(e={})=>({...yz,baseUrl:"",fetch:globalThis.fetch,headers:vz,parseAs:"auto",querySerializer:Dz,...e}),bh=(e={})=>{let t=xT(G1(),e),r=()=>({...t}),n=a=>(t=xT(t,a),r()),i=a=>hz({baseUrl:a.baseUrl??"",path:a.path,query:a.query,querySerializer:typeof a.querySerializer=="function"?a.querySerializer:FT(a.querySerializer),url:a.url}),s=gz(),o=async a=>{let u={...t,...a,headers:AT(t.headers,a.headers)};u.body&&u.bodySerializer&&(u.body=u.bodySerializer(u.body)),u.body||u.headers.delete("Content-Type");let l=i(u),c={redirect:"follow",...u},f=new Request(l,c);for(let h of s.request._fns)f=await h(f,u);let p=u.fetch,d=await p(f);for(let h of s.response._fns)d=await h(d,f,u);let m={request:f,response:d};if(d.ok){if(d.status===204||d.headers.get("Content-Length")==="0")return{data:{},...m};if(u.parseAs==="stream")return{data:d.body,...m};let h=(u.parseAs==="auto"?mz(d.headers.get("Content-Type")):u.parseAs)??"json",g=await d[h]();return h==="json"&&u.responseTransformer&&(g=await u.responseTransformer(g)),{data:g,...m}}let y=await d.text();try{y=JSON.parse(y)}catch{}let D=y;for(let h of s.error._fns)D=await h(y,d,f,u);if(D=D||{},u.throwOnError)throw D;return{error:D,...m}};return{buildUrl:i,connect:a=>o({...a,method:"CONNECT"}),delete:a=>o({...a,method:"DELETE"}),get:a=>o({...a,method:"GET"}),getConfig:r,head:a=>o({...a,method:"HEAD"}),interceptors:s,options:a=>o({...a,method:"OPTIONS"}),patch:a=>o({...a,method:"PATCH"}),post:a=>o({...a,method:"POST"}),put:a=>o({...a,method:"PUT"}),request:o,setConfig:n,trace:a=>o({...a,method:"TRACE"})}};var ru=bh(G1()),wz=e=>(e?.client??ru).get({...e,url:"/v1/apps"}),Cz=e=>(e?.client??ru).post({...e,headers:{"Content-Type":"application/json",...e?.headers},url:"/v1/apps"}),Ez=e=>(e?.client??ru).get({...e,url:"/v1/apps/{appId}"}),Sz=e=>(e?.client??ru).post({...e,..._h,headers:{"Content-Type":"application/x-www-form-urlencoded",...e?.headers},url:"/v1/oauth/token"}),xz=e=>(e?.client??ru).post({...e,..._h,headers:{"Content-Type":"application/x-www-form-urlencoded",...e?.headers},url:"/v1/oauth/introspect"}),_z=e=>(e?.client??ru).post({...e,..._h,headers:{"Content-Type":"application/x-www-form-urlencoded",...e?.headers},url:"/v1/oauth/revoke"});var Oh=class{constructor(t,r,n=!1,i=q1){this.tokenService=t;this.env=r;this.debug=n;this.generatedAppService=i}getClient=async()=>{let t=await this.tokenService.getToken();if(!t.success)return{success:!1,code:"NO_TOKEN",message:"No token found. Please login first."};let r=bh({baseUrl:this.env.CONNECT_API_BASE_URL,fetch,headers:{Authorization:`Bearer ${t.data}`,"Content-Type":"application/json"}});return this.debug&&r.interceptors.response.use(n=>{let i=n.headers.get("x-request-id");return n.status>=400?console.warn(`Response status ${n.status} on ${n.url}: request id: ${i}}`):console.log(`Response status ${n.status} on ${n.url}: request id: ${i}`),n}),{success:!0,data:r}};listApps=async()=>{let t=await this.getClient();if(!t.success)return t;let{data:r}=t;try{let n=await this.generatedAppService.listApps({client:r});return n.error?{success:!1,code:"API_FAILURE",message:`Failed to fetch apps data: ${n.error.message}`}:{success:!0,data:n.data.items}}catch(n){return{success:!1,code:"API_FAILURE",message:`Failed to fetch apps data: ${n instanceof Error?n.message:String(n)}`}}};createApp=async({name:t,distribution:r})=>{let n=await this.getClient();if(!n.success)return n;let{data:i}=n;try{let s=await this.generatedAppService.createApp({client:i,body:{name:t,distribution:r}});if(s.error)return{success:!1,code:"API_FAILURE",message:`Failed to create app: ${s.error.message}`};let{app:o}=s.data;return{success:!0,data:o}}catch(s){return{success:!1,code:"API_FAILURE",message:`Failed to create app: ${s instanceof Error?s.message:String(s)}`}}}};import z1 from"crypto";var Fh=class{constructor(t){this.env=t}constructAuthUrl(){let t=`${this.env.CANVA_ENV_URL}/api/oauth/authorized/${this.env.CANVA_CLI_CLIENT_ID}`,r=z1.randomBytes(96).toString("base64url"),n=z1.randomBytes(96).toString("base64url"),i=z1.createHash("sha256").update(r).digest().toString("base64url");return{url:this.getAuthorizationUrl({redirectUri:t,state:n,codeChallenge:i}),codeVerifier:r}}getAuthorizationUrl({redirectUri:t,state:r,codeChallenge:n}){let i=["app:read","app:write","profile:read"].join(" "),s=new URL(`${this.env.CANVA_ENV_URL}/api/oauth/authorize`);return s.searchParams.append("code_challenge",n),s.searchParams.append("code_challenge_method","S256"),s.searchParams.append("scope",i),s.searchParams.append("response_type","code"),s.searchParams.append("client_id",this.env.CANVA_CLI_CLIENT_ID),s.searchParams.append("redirect_uri",t),s.searchParams.append("state",r),s.toString()}};var vL=St(DL(),1);import Ep from"crypto";var a0=class{KEY_DERIVATION_ITERATIONS=1e5;KEY_LENGTH=32;async c(){let t=await vL.default.uuid();return`${t.os}::${t.hardware}`}f(t,r){return Ep.pbkdf2Sync(t,r,this.KEY_DERIVATION_ITERATIONS,this.KEY_LENGTH,"sha256")}async encrypt(t){try{let r=await this.c(),n=Ep.randomBytes(16),i=this.f(r,n),s=Ep.randomBytes(12),o=Ep.createCipheriv("aes-256-gcm",i,s),a=o.update(t,"utf8","hex");a+=o.final("hex");let u={iv:s.toString("hex"),authTag:o.getAuthTag().toString("hex"),cipherText:a,salt:n.toString("hex")};return{success:!0,data:[u.iv,u.authTag,u.cipherText,u.salt].join(":")}}catch(r){return{success:!1,code:"ENCRYPTION_ERROR",message:`Encryption failed: ${r instanceof Error?r.message:String(r)}`}}}async decrypt(t){try{let r=await this.c(),n=t.split(":");if(n.length!==4)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Invalid encrypted data format."};let[i,s,o,a]=n;if(!i||!s||!o||!a)return{success:!1,code:"INVALID_ENCRYPTED_DATA_FORMAT",message:"Missing required components for decryption."};let u=Buffer.from(i,"hex"),l=Buffer.from(s,"hex"),c=Buffer.from(a,"hex"),f=this.f(r,c),p=Ep.createDecipheriv("aes-256-gcm",f,u);p.setAuthTag(l);let d=p.update(o,"hex","utf8");return d+=p.final("utf8"),{success:!0,data:d}}catch(r){return{success:!1,code:"DECRYPTION_ERROR",message:`Decryption failed: ${r instanceof Error?r.message:String(r)}`}}}};import l0 from"node:process";import{Buffer as pJ}from"node:buffer";import FL from"node:path";import{fileURLToPath as dJ}from"node:url";import mJ from"node:child_process";import Zw,{constants as AL}from"node:fs/promises";import EL from"node:process";import YX from"node:os";import KX from"node:fs";import zX from"node:fs";import wL from"node:fs";var Gw;function GX(){try{return wL.statSync("/.dockerenv"),!0}catch{return!1}}function qX(){try{return wL.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function qw(){return Gw===void 0&&(Gw=GX()||qX()),Gw}var zw,HX=()=>{try{return zX.statSync("/run/.containerenv"),!0}catch{return!1}};function Yl(){return zw===void 0&&(zw=HX()||qw()),zw}var CL=()=>{if(EL.platform!=="linux")return!1;if(YX.release().toLowerCase().includes("microsoft"))return!Yl();try{return KX.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Yl():!1}catch{return!1}},hu=EL.env.__IS_WSL_TEST__?CL:CL();function gu(e,t,r){let n=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),e}import{promisify as uJ}from"node:util";import Xw from"node:process";import{execFile as lJ}from"node:child_process";import{promisify as XX}from"node:util";import JX from"node:process";import{execFile as ZX}from"node:child_process";var QX=XX(ZX);async function Hw(){if(JX.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await QX("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari"}import eJ from"node:process";import{promisify as tJ}from"node:util";import{execFile as rJ,execFileSync as gve}from"node:child_process";var nJ=tJ(rJ);async function SL(e,{humanReadableOutput:t=!0}={}){if(eJ.platform!=="darwin")throw new Error("macOS only");let r=t?[]:["-ss"],{stdout:n}=await nJ("osascript",["-e",e,r]);return n.trim()}async function Yw(e){return SL(`tell application "Finder" to set app_path to application file id "${e}" as string
512
512
  tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as iJ}from"node:util";import{execFile as sJ}from"node:child_process";var oJ=iJ(sJ),aJ={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},u0=class extends Error{};async function Kw(e=oJ){let{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!r)throw new u0(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:n}=r.groups,i=aJ[n];if(!i)throw new u0(`Unknown browser ID: ${n}`);return i}var cJ=uJ(lJ),fJ=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function Jw(){if(Xw.platform==="darwin"){let e=await Hw();return{name:await Yw(e),id:e}}if(Xw.platform==="linux"){let{stdout:e}=await cJ("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:fJ(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(Xw.platform==="win32")return Kw();throw new Error("Only macOS, Linux, and Windows are supported")}var Qw=FL.dirname(dJ(import.meta.url)),xL=FL.join(Qw,"xdg-open"),{platform:Kl,arch:_L}=l0,hJ=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let r="/etc/wsl.conf",n=!1;try{await Zw.access(r,AL.F_OK),n=!0}catch{}if(!n)return e;let i=await Zw.readFile(r,{encoding:"utf8"}),s=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return s?(t=s.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),bL=async(e,t)=>{let r;for(let n of e)try{return await t(n)}catch(i){r=i}throw r},c0=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return bL(e.app,a=>c0({...e,app:a}));let{name:t,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(t))return bL(t,a=>c0({...e,app:{name:a,arguments:r}}));if(t==="browser"||t==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},l=await Jw();if(l.id in a){let c=a[l.id];return t==="browserPrivate"&&r.push(u[c]),c0({...e,app:{name:Xl[c],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let n,i=[],s={};if(Kl==="darwin")n="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),t&&i.push("-a",t);else if(Kl==="win32"||hu&&!Yl()&&!t){let a=await hJ();n=hu?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${l0.env.SYSTEMROOT||l0.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),hu||(s.windowsVerbatimArguments=!0);let u=["Start"];e.wait&&u.push("-Wait"),t?(u.push(`"\`"${t}\`""`),e.target&&r.push(e.target)):e.target&&u.push(`"${e.target}"`),r.length>0&&(r=r.map(l=>`"\`"${l}\`""`),u.push("-ArgumentList",r.join(","))),e.target=pJ.from(u.join(" "),"utf16le").toString("base64")}else{if(t)n=t;else{let a=!Qw||Qw==="/",u=!1;try{await Zw.access(xL,AL.X_OK),u=!0}catch{}n=l0.versions.electron??(Kl==="android"||a||!u)?"xdg-open":xL}r.length>0&&i.push(...r),e.wait||(s.stdio="ignore",s.detached=!0)}Kl==="darwin"&&r.length>0&&i.push("--args",...r),e.target&&i.push(e.target);let o=mJ.spawn(n,i,s);return e.wait?new Promise((a,u)=>{o.once("error",u),o.once("close",l=>{if(!e.allowNonzeroExitCode&&l>0){u(new Error(`Exited with code ${l}`));return}a(o)})}):(o.unref(),o)},gJ=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return c0({...t,target:e})};function OL(e){if(typeof e=="string"||Array.isArray(e))return e;let{[_L]:t}=e;if(!t)throw new Error(`${_L} is not supported`);return t}function eC({[Kl]:e},{wsl:t}){if(t&&hu)return OL(t);if(!e)throw new Error(`${Kl} is not supported`);return OL(e)}var Xl={};gu(Xl,"chrome",()=>eC({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));gu(Xl,"firefox",()=>eC({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));gu(Xl,"edge",()=>eC({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));gu(Xl,"browser",()=>"browser");gu(Xl,"browserPrivate",()=>"browserPrivate");var f0=gJ;var p0=class{constructor(t){this.debug=t}openUrl=async t=>{try{return await f0(t),{success:!0,data:void 0}}catch(r){let n=r instanceof Error?r.message:`${r}`;return this.debug&&console.error(`Error opening URL: ${n}`),{success:!1,code:"NAVIGATION_ERROR",message:`Failed to open URL: ${n}`}}}};var d0=class{constructor(t,r,n=!1){this.storageService=t;this.env=r;this.debug=n}generatePreviewResult=async t=>{let r=t;if(!r){let i=await this.getAppId();if(!i.success)return i;r=i.data}return{success:!0,data:this.constructPreviewUrl(r)}};async getAppId(){try{let t=await this.storageService.getAppIdFromEnvFile();if(!t.success)return t;let r=t.data;if(r==="YOUR_APP_ID_HERE"){let n="CANVA_APP_ID is set to the default placeholder value. Please update it in the .env file.";return this.debug&&console.error(n),{success:!1,code:"MISSING_FIELD",message:n}}return{success:!0,data:r}}catch(t){let r=`Unknown Error reading CANVA_APP_ID from .env file: ${t instanceof Error?t.message:String(t)}`;return this.debug&&console.error(r),{success:!1,code:"ENV_READ_ERROR",message:r}}}constructPreviewUrl(t){let r=this.encodeUiState({appId:t}),n=this.env.CANVA_ENV_URL,i=new URL("/login/",n),s=new URL("/design",n);return s.searchParams.append("create",""),s.searchParams.append("width","800"),s.searchParams.append("height","600"),s.searchParams.append("units","px"),s.searchParams.append("ui",r),i.searchParams.append("redirect",s.pathname+s.search),i.toString()}encodeUiState(t){let r={E:{"A?":"N",S:t.appId,g:!0}},n=JSON.stringify(r);return btoa(n).replace(/[+]/g,"-").replace(/[/]/g,"_").replace(/[=]/g,"")}};var RL=St(NL(),1);import PJ from"fs/promises";import LJ from"os";import NJ from"path";var h0=class{constructor(t,r=PJ,n=NJ,i=LJ.homedir(),s=!1){this.encryptionService=t;this.fileSystem=r;this.pathModule=n;this.debug=s;this.filePath=this.pathModule.join(i,".canva-cli","credentials")}tokenKey="tokenData";flavorKey="flavor";filePath;isNodeError(t){return t instanceof Error&&typeof t.code=="string"}async ensureDirectoryExists(t){try{await this.fileSystem.mkdir(t,{recursive:!0})}catch(r){let n=r instanceof Error?r.message:String(r);throw new Error(`Failed to create directory ${t}: ${n}`)}}async readJsonFromFile(){try{let t=await this.fileSystem.readFile(this.filePath,"utf-8");return JSON.parse(t)}catch(t){let r=t instanceof Error?t.message:String(t);throw new Error(`Failed to read the file at ${this.filePath}: ${r}`)}}async writeJsonToFile(t){try{await this.fileSystem.writeFile(this.filePath,JSON.stringify(t,null,2),"utf-8")}catch(r){let n=r instanceof Error?r.message:String(r);throw new Error(`Failed to write the file at ${this.filePath}: ${n}`)}try{await this.fileSystem.chmod(this.filePath,384)}catch(r){let n=r instanceof Error?r.message:String(r);throw new Error(`Failed to set permissions on the file at ${this.filePath}: ${n}`)}}async saveTokenData({tokenData:t,flavor:r}){let n=await this.encryptionService.encrypt(JSON.stringify(t));if(!n.success)return{success:!1,code:"ENCRYPTION_ERROR",message:`Failed to encrypt token data: ${n.message}`};let i={tokenData:n.data,flavor:r};try{let s=this.pathModule.dirname(this.filePath);return await this.ensureDirectoryExists(s),await this.writeJsonToFile(i),{success:!0,data:void 0}}catch(s){let o=s instanceof Error?s.message:String(s);return{success:!1,code:"API_FAILURE",message:`Failed to save token data to file: ${o}`}}}async getTokenData(){try{let t=await this.readJsonFromFile();if(t[this.tokenKey]){let r=await this.encryptionService.decrypt(t[this.tokenKey]);return r.success?{success:!0,data:JSON.parse(r.data)}:r}else return{success:!1,code:"NO_TOKEN",message:"Token data not found in credentials file."}}catch(t){let r=t instanceof Error?t.message:String(t);return{success:!1,code:"NO_TOKEN",message:`Failed to read the token file: ${r}`}}}async getFlavor(){try{let r=(await this.readJsonFromFile())[this.flavorKey];if(r&&typeof r=="string"&&Object.values(ki).includes(r))return r}catch{return"prod"}return"prod"}async deleteToken(){try{if((await this.readJsonFromFile())[this.tokenKey])try{await this.fileSystem.access(this.filePath),await this.fileSystem.unlink(this.filePath)}catch(r){if(this.isNodeError(r)&&r.code==="ENOENT")return;let n=r instanceof Error?r.message:String(r);throw new Error(`Failed to delete the token data file: ${n}`)}else throw new Error("Token file does not exist or token data not found.")}catch(t){let r=t instanceof Error?t.message:String(t);throw new Error(`Failed to delete the token data file: ${r}`)}}async getAppIdFromEnvFile(){try{let t=this.pathModule.resolve(process.cwd(),".env");try{await this.fileSystem.access(t)}catch{let s="No .env file found, ensure you are in your intended app's directory.";return this.debug&&console.error(s),{success:!1,code:"FILE_NOT_FOUND",message:s}}let r=await this.fileSystem.readFile(t,"utf-8"),i=RL.parse(r).CANVA_APP_ID;if(!i){let s="CANVA_APP_ID not found in .env file";return this.debug&&console.error(s),{success:!1,code:"MISSING_FIELD",message:s}}return{success:!0,data:i}}catch(t){let r=`Unknown Error reading CANVA_APP_ID from .env file: ${t instanceof Error?t.message:String(t)}`;return this.debug&&console.error(r),{success:!1,code:"ENV_READ_ERROR",message:r}}}};import{Buffer as RJ}from"node:buffer";var e1e=new TextEncoder,g0=new TextDecoder,t1e=2**32;function BJ(e){let t=e;return t instanceof Uint8Array&&(t=g0.decode(t)),t}var BL=e=>new Uint8Array(RJ.from(BJ(e),"base64url"));var iC=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(t,r){super(t,r),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};var Ki=class extends iC{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};function jJ(e){return typeof e=="object"&&e!==null}function sC(e){if(!jJ(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var kL=BL;function oC(e){if(typeof e!="string")throw new Ki("JWTs must use Compact JWS serialization, JWT must be a string");let{1:t,length:r}=e.split(".");if(r===5)throw new Ki("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Ki("Invalid JWT");if(!t)throw new Ki("JWTs must contain a payload");let n;try{n=kL(t)}catch{throw new Ki("Failed to base64url decode the payload")}let i;try{i=JSON.parse(g0.decode(n))}catch{throw new Ki("Failed to parse the decoded payload as JSON")}if(!sC(i))throw new Ki("Invalid JWT Claims Set");return i}import{URLSearchParams as aC}from"url";var y0=class{constructor(t,r,n=fetch){this.storageService=t;this.env=r;this.fetchFn=n}get tokenEndpointUrl(){return`${this.env.CONNECT_API_BASE_URL}/v1/oauth/token`}async exchangeCodeForToken({authCode:t,codeVerifier:r}){let n=`${this.env.CANVA_ENV_URL}/api/oauth/authorized/${this.env.CANVA_CLI_CLIENT_ID}`;try{let i=await this.fetchFn(this.tokenEndpointUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new aC({grant_type:"authorization_code",code:t,code_verifier:r,client_id:this.env.CANVA_CLI_CLIENT_ID,redirect_uri:n})});if(!i.ok){let o=await i.text();return{success:!1,code:"API_FAILURE",message:`Failed to exchange code for token: ${o}`}}let s=await i.json();return await this.storageService.saveTokenData({tokenData:s,flavor:this.env.FLAVOR}),{success:!0,data:s.access_token}}catch(i){return{success:!1,code:"API_FAILURE",message:`Error exchanging authorization code for token: ${i}`}}}async getToken(){try{let t=await this.storageService.getTokenData();if(!t.success)return t;let r=t.data,n=oC(r.access_token),i=60*10;if(n.exp){let u=n.exp-i;if(Date.now()/1e3<u)return{success:!0,data:r.access_token}}let s=r.refresh_token,o=await this.fetchFn(this.tokenEndpointUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new aC({grant_type:"refresh_token",refresh_token:s,client_id:this.env.CANVA_CLI_CLIENT_ID})});if(!o.ok){let u=await o.text();throw new Error(`Failed to refresh token: ${u}`)}let a=await o.json();return await this.storageService.saveTokenData({tokenData:a,flavor:this.env.FLAVOR}),{success:!0,data:a.access_token}}catch(t){return{success:!1,code:"API_FAILURE",message:`An error occurred while getting the token: ${t}`}}}async revokeToken(){let t=await this.storageService.getTokenData();if(!t.success)return t;let r=t.data,n=`${this.env.CONNECT_API_BASE_URL}/v1/oauth/revoke`;try{let i=await this.fetchFn(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new aC({token:r.refresh_token,client_id:this.env.CANVA_CLI_CLIENT_ID})});if(!i.ok)throw new Error(`Failed to revoke token, status: ${i.status}`);return await this.storageService.deleteToken(),{success:!0,data:void 0}}catch(i){return{success:!1,code:"LOGOUT_ERROR",message:`An error occurred while revoking the token: ${i}`}}}isLoggedIn=async()=>(await this.getToken()).success};var D0=class{constructor(t){this.env=t}getDeveloperPortalUrl(t){return wm({flavor:this.env.FLAVOR,appId:t})}getAppOriginUrl(t){return Y_({flavor:this.env.FLAVOR,appId:t})}};var Ye;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(let o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Ye||(Ye={}));var lC;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lC||(lC={}));var ce=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Wo=e=>{switch(typeof e){case"undefined":return ce.undefined;case"string":return ce.string;case"number":return isNaN(e)?ce.nan:ce.number;case"boolean":return ce.boolean;case"function":return ce.function;case"bigint":return ce.bigint;case"symbol":return ce.symbol;case"object":return Array.isArray(e)?ce.array:e===null?ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ce.promise:typeof Map<"u"&&e instanceof Map?ce.map:typeof Set<"u"&&e instanceof Set?ce.set:typeof Date<"u"&&e instanceof Date?ce.date:ce.object;default:return ce.unknown}},Z=Ye.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$J=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),hn=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let l=o.path[u];u===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(o))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};hn.create=e=>new hn(e);var Ql=(e,t)=>{let r;switch(e.code){case Z.invalid_type:e.received===ce.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case Z.invalid_union:r="Invalid input";break;case Z.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case Z.invalid_enum_value:r=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:r="Invalid function arguments";break;case Z.invalid_return_type:r="Invalid function return type";break;case Z.invalid_date:r="Invalid date";break;case Z.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Z.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Z.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Z.custom:r="Invalid input";break;case Z.invalid_intersection_types:r="Intersection results could not be merged";break;case Z.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ye.assertNever(e)}return{message:r}},VL=Ql;function WJ(e){VL=e}function v0(){return VL}var w0=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}},GJ=[];function oe(e,t){let r=v0(),n=w0({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Ql?void 0:Ql].filter(i=>!!i)});e.common.issues.push(n)}var _r=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return Pe;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,o=await i.value;n.push({key:s,value:o})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Pe;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}},Pe=Object.freeze({status:"aborted"}),Zl=e=>({status:"dirty",value:e}),jr=e=>({status:"valid",value:e}),cC=e=>e.status==="aborted",fC=e=>e.status==="dirty",_p=e=>e.status==="valid",bp=e=>typeof Promise<"u"&&e instanceof Promise;function C0(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function UL(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}var Ee;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ee||(Ee={}));var Sp,xp,Xn=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ML=(e,t)=>{if(_p(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new hn(e.common.issues);return this._error=r,this._error}}};function je(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{var u,l;let{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}},description:i}}var Ve=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Wo(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Wo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _r,ctx:{common:t.parent.common,data:t.data,parsedType:Wo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(bp(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)},s=this._parseSync({data:t,path:i.path,parent:i});return ML(i,s)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Wo(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(bp(i)?i:Promise.resolve(i));return ML(n,s)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=t(i),a=()=>s.addIssue({code:Z.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new gn({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Kn.create(this,this._def)}nullable(){return Ji.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Is.create(this,this._def)}promise(){return zo.create(this,this._def)}or(t){return Su.create([this,t],this._def)}and(t){return xu.create(this,t,this._def)}transform(t){return new gn({...je(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Au({...je(this._def),innerType:this,defaultValue:r,typeName:Ie.ZodDefault})}brand(){return new Op({typeName:Ie.ZodBranded,type:this,...je(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Iu({...je(this._def),innerType:this,catchValue:r,typeName:Ie.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Fp.create(this,t)}readonly(){return Tu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},qJ=/^c[^\s-]{8,}$/i,zJ=/^[0-9a-z]+$/,HJ=/^[0-9A-HJKMNP-TV-Z]{26}$/,YJ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,KJ=/^[a-z0-9_-]{21}$/i,XJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,JJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZJ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uC,QJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eZ=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$L="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rZ=new RegExp(`^${$L}$`);function WL(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function nZ(e){return new RegExp(`^${WL(e)}$`)}function GL(e){let t=`${$L}T${WL(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function iZ(e,t){return!!((t==="v4"||!t)&&QJ.test(e)||(t==="v6"||!t)&&eZ.test(e))}var Go=class e extends Ve{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ce.string){let s=this._getOrReturnCtx(t);return oe(s,{code:Z.invalid_type,expected:ce.string,received:s.parsedType}),Pe}let n=new _r,i;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?oe(i,{code:Z.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&oe(i,{code:Z.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")JJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"email",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")uC||(uC=new RegExp(ZJ,"u")),uC.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"emoji",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")YJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"uuid",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")KJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"nanoid",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")qJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")zJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"cuid2",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")HJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ulid",code:Z.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),oe(i,{validation:"url",code:Z.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"regex",code:Z.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?GL(s).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?rZ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?nZ(s).test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?XJ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"duration",code:Z.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?iZ(t.data,s.version)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"ip",code:Z.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?tZ.test(t.data)||(i=this._getOrReturnCtx(t,i),oe(i,{validation:"base64",code:Z.invalid_string,message:s.message}),n.dirty()):Ye.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:Z.invalid_string,...Ee.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ee.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ee.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ee.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ee.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ee.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ee.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ee.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ee.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ee.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ee.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,...Ee.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ee.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ee.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ee.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Ee.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ee.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ee.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ee.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ee.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ee.errToObj(r)})}nonempty(t){return this.min(1,Ee.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Go.create=e=>{var t;return new Go({checks:[],typeName:Ie.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...je(e)})};function sZ(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var yu=class e extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ce.number){let s=this._getOrReturnCtx(t);return oe(s,{code:Z.invalid_type,expected:ce.number,received:s.parsedType}),Pe}let n,i=new _r;for(let s of this._def.checks)s.kind==="int"?Ye.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?sZ(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.not_finite,message:s.message}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ee.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ee.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ee.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ee.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ee.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ee.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ee.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ee.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ee.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ee.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ee.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ye.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};yu.create=e=>new yu({checks:[],typeName:Ie.ZodNumber,coerce:e?.coerce||!1,...je(e)});var Du=class e extends Ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==ce.bigint){let s=this._getOrReturnCtx(t);return oe(s,{code:Z.invalid_type,expected:ce.bigint,received:s.parsedType}),Pe}let n,i=new _r;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),oe(n,{code:Z.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ee.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ee.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ee.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ee.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ee.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ee.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Du.create=e=>{var t;return new Du({checks:[],typeName:Ie.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...je(e)})};var vu=class extends Ve{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ce.boolean){let n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:ce.boolean,received:n.parsedType}),Pe}return jr(t.data)}};vu.create=e=>new vu({typeName:Ie.ZodBoolean,coerce:e?.coerce||!1,...je(e)});var wu=class e extends Ve{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ce.date){let s=this._getOrReturnCtx(t);return oe(s,{code:Z.invalid_type,expected:ce.date,received:s.parsedType}),Pe}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return oe(s,{code:Z.invalid_date}),Pe}let n=new _r,i;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),oe(i,{code:Z.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ye.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ee.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ee.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};wu.create=e=>new wu({checks:[],coerce:e?.coerce||!1,typeName:Ie.ZodDate,...je(e)});var ec=class extends Ve{_parse(t){if(this._getType(t)!==ce.symbol){let n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:ce.symbol,received:n.parsedType}),Pe}return jr(t.data)}};ec.create=e=>new ec({typeName:Ie.ZodSymbol,...je(e)});var Cu=class extends Ve{_parse(t){if(this._getType(t)!==ce.undefined){let n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:ce.undefined,received:n.parsedType}),Pe}return jr(t.data)}};Cu.create=e=>new Cu({typeName:Ie.ZodUndefined,...je(e)});var Eu=class extends Ve{_parse(t){if(this._getType(t)!==ce.null){let n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:ce.null,received:n.parsedType}),Pe}return jr(t.data)}};Eu.create=e=>new Eu({typeName:Ie.ZodNull,...je(e)});var qo=class extends Ve{constructor(){super(...arguments),this._any=!0}_parse(t){return jr(t.data)}};qo.create=e=>new qo({typeName:Ie.ZodAny,...je(e)});var As=class extends Ve{constructor(){super(...arguments),this._unknown=!0}_parse(t){return jr(t.data)}};As.create=e=>new As({typeName:Ie.ZodUnknown,...je(e)});var yi=class extends Ve{_parse(t){let r=this._getOrReturnCtx(t);return oe(r,{code:Z.invalid_type,expected:ce.never,received:r.parsedType}),Pe}};yi.create=e=>new yi({typeName:Ie.ZodNever,...je(e)});var tc=class extends Ve{_parse(t){if(this._getType(t)!==ce.undefined){let n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:ce.void,received:n.parsedType}),Pe}return jr(t.data)}};tc.create=e=>new tc({typeName:Ie.ZodVoid,...je(e)});var Is=class e extends Ve{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==ce.array)return oe(r,{code:Z.invalid_type,expected:ce.array,received:r.parsedType}),Pe;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(oe(r,{code:o?Z.too_big:Z.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(oe(r,{code:Z.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(oe(r,{code:Z.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new Xn(r,o,r.path,a)))).then(o=>_r.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new Xn(r,o,r.path,a)));return _r.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Ee.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Ee.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Ee.toString(r)}})}nonempty(t){return this.min(1,t)}};Is.create=(e,t)=>new Is({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...je(t)});function Jl(e){if(e instanceof Kr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Kn.create(Jl(n))}return new Kr({...e._def,shape:()=>t})}else return e instanceof Is?new Is({...e._def,type:Jl(e.element)}):e instanceof Kn?Kn.create(Jl(e.unwrap())):e instanceof Ji?Ji.create(Jl(e.unwrap())):e instanceof Xi?Xi.create(e.items.map(t=>Jl(t))):e}var Kr=class e extends Ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=Ye.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==ce.object){let l=this._getOrReturnCtx(t);return oe(l,{code:Z.invalid_type,expected:ce.object,received:l.parsedType}),Pe}let{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof yi&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let u=[];for(let l of o){let c=s[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Xn(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof yi){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(oe(i,{code:Z.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Xn(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>_r.mergeObjectSync(n,l)):_r.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(t){return Ee.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ee.errToObj(t).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ie.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return Ye.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return Ye.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return Jl(this)}partial(t){let r={};return Ye.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return Ye.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Kn;)s=s._def.innerType;r[n]=s}}),new e({...this._def,shape:()=>r})}keyof(){return qL(Ye.objectKeys(this.shape))}};Kr.create=(e,t)=>new Kr({shape:()=>e,unknownKeys:"strip",catchall:yi.create(),typeName:Ie.ZodObject,...je(t)});Kr.strictCreate=(e,t)=>new Kr({shape:()=>e,unknownKeys:"strict",catchall:yi.create(),typeName:Ie.ZodObject,...je(t)});Kr.lazycreate=(e,t)=>new Kr({shape:e,unknownKeys:"strip",catchall:yi.create(),typeName:Ie.ZodObject,...je(t)});var Su=class extends Ve{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new hn(a.ctx.common.issues));return oe(r,{code:Z.invalid_union,unionErrors:o}),Pe}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new hn(u));return oe(r,{code:Z.invalid_union,unionErrors:a}),Pe}}get options(){return this._def.options}};Su.create=(e,t)=>new Su({options:e,typeName:Ie.ZodUnion,...je(t)});var Fs=e=>e instanceof _u?Fs(e.schema):e instanceof gn?Fs(e.innerType()):e instanceof bu?[e.value]:e instanceof Ou?e.options:e instanceof Fu?Ye.objectValues(e.enum):e instanceof Au?Fs(e._def.innerType):e instanceof Cu?[void 0]:e instanceof Eu?[null]:e instanceof Kn?[void 0,...Fs(e.unwrap())]:e instanceof Ji?[null,...Fs(e.unwrap())]:e instanceof Op||e instanceof Tu?Fs(e.unwrap()):e instanceof Iu?Fs(e._def.innerType):[],E0=class e extends Ve{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.object)return oe(r,{code:Z.invalid_type,expected:ce.object,received:r.parsedType}),Pe;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(oe(r,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let o=Fs(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new e({typeName:Ie.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...je(n)})}};function pC(e,t){let r=Wo(e),n=Wo(t);if(e===t)return{valid:!0,data:e};if(r===ce.object&&n===ce.object){let i=Ye.objectKeys(t),s=Ye.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(let a of s){let u=pC(e[a],t[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===ce.array&&n===ce.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let o=e[s],a=t[s],u=pC(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ce.date&&n===ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var xu=class extends Ve{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(s,o)=>{if(cC(s)||cC(o))return Pe;let a=pC(s.value,o.value);return a.valid?((fC(s)||fC(o))&&r.dirty(),{status:r.value,value:a.data}):(oe(n,{code:Z.invalid_intersection_types}),Pe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};xu.create=(e,t,r)=>new xu({left:e,right:t,typeName:Ie.ZodIntersection,...je(r)});var Xi=class e extends Ve{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.array)return oe(n,{code:Z.invalid_type,expected:ce.array,received:n.parsedType}),Pe;if(n.data.length<this._def.items.length)return oe(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pe;!this._def.rest&&n.data.length>this._def.items.length&&(oe(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Xn(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>_r.mergeArray(r,o)):_r.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Xi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xi({items:e,typeName:Ie.ZodTuple,rest:null,...je(t)})};var S0=class e extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.object)return oe(n,{code:Z.invalid_type,expected:ce.object,received:n.parsedType}),Pe;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new Xn(n,a,n.path,a)),value:o._parse(new Xn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?_r.mergeObjectAsync(r,i):_r.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ve?new e({keyType:t,valueType:r,typeName:Ie.ZodRecord,...je(n)}):new e({keyType:Go.create(),valueType:t,typeName:Ie.ZodRecord,...je(r)})}},rc=class extends Ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.map)return oe(n,{code:Z.invalid_type,expected:ce.map,received:n.parsedType}),Pe;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new Xn(n,a,n.path,[l,"key"])),value:s._parse(new Xn(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return Pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return Pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};rc.create=(e,t,r)=>new rc({valueType:t,keyType:e,typeName:Ie.ZodMap,...je(r)});var nc=class e extends Ve{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==ce.set)return oe(n,{code:Z.invalid_type,expected:ce.set,received:n.parsedType}),Pe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(oe(n,{code:Z.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(oe(n,{code:Z.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let l=new Set;for(let c of u){if(c.status==="aborted")return Pe;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>s._parse(new Xn(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:Ee.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Ee.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};nc.create=(e,t)=>new nc({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...je(t)});var x0=class e extends Ve{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.function)return oe(r,{code:Z.invalid_type,expected:ce.function,received:r.parsedType}),Pe;function n(a,u){return w0({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,v0(),Ql].filter(l=>!!l),issueData:{code:Z.invalid_arguments,argumentsError:u}})}function i(a,u){return w0({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,v0(),Ql].filter(l=>!!l),issueData:{code:Z.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof zo){let a=this;return jr(async function(...u){let l=new hn([]),c=await a._def.args.parseAsync(u,s).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(f,s).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return jr(function(...u){let l=a._def.args.safeParse(u,s);if(!l.success)throw new hn([n(u,l.error)]);let c=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(c,s);if(!f.success)throw new hn([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Xi.create(t).rest(As.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||Xi.create([]).rest(As.create()),returns:r||As.create(),typeName:Ie.ZodFunction,...je(n)})}},_u=class extends Ve{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};_u.create=(e,t)=>new _u({getter:e,typeName:Ie.ZodLazy,...je(t)});var bu=class extends Ve{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return oe(r,{received:r.data,code:Z.invalid_literal,expected:this._def.value}),Pe}return{status:"valid",value:t.data}}get value(){return this._def.value}};bu.create=(e,t)=>new bu({value:e,typeName:Ie.ZodLiteral,...je(t)});function qL(e,t){return new Ou({values:e,typeName:Ie.ZodEnum,...je(t)})}var Ou=class e extends Ve{constructor(){super(...arguments),Sp.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{expected:Ye.joinValues(n),received:r.parsedType,code:Z.invalid_type}),Pe}if(C0(this,Sp,"f")||UL(this,Sp,new Set(this._def.values),"f"),!C0(this,Sp,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return oe(r,{received:r.data,code:Z.invalid_enum_value,options:n}),Pe}return jr(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Sp=new WeakMap;Ou.create=qL;var Fu=class extends Ve{constructor(){super(...arguments),xp.set(this,void 0)}_parse(t){let r=Ye.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==ce.string&&n.parsedType!==ce.number){let i=Ye.objectValues(r);return oe(n,{expected:Ye.joinValues(i),received:n.parsedType,code:Z.invalid_type}),Pe}if(C0(this,xp,"f")||UL(this,xp,new Set(Ye.getValidEnumValues(this._def.values)),"f"),!C0(this,xp,"f").has(t.data)){let i=Ye.objectValues(r);return oe(n,{received:n.data,code:Z.invalid_enum_value,options:i}),Pe}return jr(t.data)}get enum(){return this._def.values}};xp=new WeakMap;Fu.create=(e,t)=>new Fu({values:e,typeName:Ie.ZodNativeEnum,...je(t)});var zo=class extends Ve{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==ce.promise&&r.common.async===!1)return oe(r,{code:Z.invalid_type,expected:ce.promise,received:r.parsedType}),Pe;let n=r.parsedType===ce.promise?r.data:Promise.resolve(r.data);return jr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};zo.create=(e,t)=>new zo({type:e,typeName:Ie.ZodPromise,...je(t)});var gn=class extends Ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{oe(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Pe;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?Pe:u.status==="dirty"||r.value==="dirty"?Zl(u.value):u});{if(r.value==="aborted")return Pe;let a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Pe:a.status==="dirty"||r.value==="dirty"?Zl(a.value):a}}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Pe:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Pe:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_p(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>_p(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Ye.assertNever(i)}};gn.create=(e,t,r)=>new gn({schema:e,typeName:Ie.ZodEffects,effect:t,...je(r)});gn.createWithPreprocess=(e,t,r)=>new gn({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...je(r)});var Kn=class extends Ve{_parse(t){return this._getType(t)===ce.undefined?jr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Kn.create=(e,t)=>new Kn({innerType:e,typeName:Ie.ZodOptional,...je(t)});var Ji=class extends Ve{_parse(t){return this._getType(t)===ce.null?jr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ji.create=(e,t)=>new Ji({innerType:e,typeName:Ie.ZodNullable,...je(t)});var Au=class extends Ve{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===ce.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Au.create=(e,t)=>new Au({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...je(t)});var Iu=class extends Ve{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return bp(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new hn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new hn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Iu.create=(e,t)=>new Iu({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...je(t)});var ic=class extends Ve{_parse(t){if(this._getType(t)!==ce.nan){let n=this._getOrReturnCtx(t);return oe(n,{code:Z.invalid_type,expected:ce.nan,received:n.parsedType}),Pe}return{status:"valid",value:t.data}}};ic.create=e=>new ic({typeName:Ie.ZodNaN,...je(e)});var oZ=Symbol("zod_brand"),Op=class extends Ve{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Fp=class e extends Ve{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Pe:s.status==="dirty"?(r.dirty(),Zl(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Pe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Ie.ZodPipeline})}},Tu=class extends Ve{_parse(t){let r=this._def.innerType._parse(t),n=i=>(_p(i)&&(i.value=Object.freeze(i.value)),i);return bp(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Tu.create=(e,t)=>new Tu({innerType:e,typeName:Ie.ZodReadonly,...je(t)});function zL(e,t={},r){return e?qo.create().superRefine((n,i)=>{var s,o;if(!e(n)){let a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:u})}}):qo.create()}var aZ={object:Kr.lazycreate},Ie;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ie||(Ie={}));var uZ=(e,t={message:`Input not instance of ${e.name}`})=>zL(r=>r instanceof e,t),HL=Go.create,YL=yu.create,lZ=ic.create,cZ=Du.create,KL=vu.create,fZ=wu.create,pZ=ec.create,dZ=Cu.create,mZ=Eu.create,hZ=qo.create,gZ=As.create,yZ=yi.create,DZ=tc.create,vZ=Is.create,Ap=Kr.create,wZ=Kr.strictCreate,CZ=Su.create,EZ=E0.create,SZ=xu.create,xZ=Xi.create,_Z=S0.create,bZ=rc.create,OZ=nc.create,FZ=x0.create,AZ=_u.create,IZ=bu.create,TZ=Ou.create,PZ=Fu.create,LZ=zo.create,jL=gn.create,NZ=Kn.create,RZ=Ji.create,BZ=gn.createWithPreprocess,kZ=Fp.create,MZ=()=>HL().optional(),jZ=()=>YL().optional(),VZ=()=>KL().optional(),UZ={string:e=>Go.create({...e,coerce:!0}),number:e=>yu.create({...e,coerce:!0}),boolean:e=>vu.create({...e,coerce:!0}),bigint:e=>Du.create({...e,coerce:!0}),date:e=>wu.create({...e,coerce:!0})},$Z=Pe,Ip=Object.freeze({__proto__:null,defaultErrorMap:Ql,setErrorMap:WJ,getErrorMap:v0,makeIssue:w0,EMPTY_PATH:GJ,addIssueToContext:oe,ParseStatus:_r,INVALID:Pe,DIRTY:Zl,OK:jr,isAborted:cC,isDirty:fC,isValid:_p,isAsync:bp,get util(){return Ye},get objectUtil(){return lC},ZodParsedType:ce,getParsedType:Wo,ZodType:Ve,datetimeRegex:GL,ZodString:Go,ZodNumber:yu,ZodBigInt:Du,ZodBoolean:vu,ZodDate:wu,ZodSymbol:ec,ZodUndefined:Cu,ZodNull:Eu,ZodAny:qo,ZodUnknown:As,ZodNever:yi,ZodVoid:tc,ZodArray:Is,ZodObject:Kr,ZodUnion:Su,ZodDiscriminatedUnion:E0,ZodIntersection:xu,ZodTuple:Xi,ZodRecord:S0,ZodMap:rc,ZodSet:nc,ZodFunction:x0,ZodLazy:_u,ZodLiteral:bu,ZodEnum:Ou,ZodNativeEnum:Fu,ZodPromise:zo,ZodEffects:gn,ZodTransformer:gn,ZodOptional:Kn,ZodNullable:Ji,ZodDefault:Au,ZodCatch:Iu,ZodNaN:ic,BRAND:oZ,ZodBranded:Op,ZodPipeline:Fp,ZodReadonly:Tu,custom:zL,Schema:Ve,ZodSchema:Ve,late:aZ,get ZodFirstPartyTypeKind(){return Ie},coerce:UZ,any:hZ,array:vZ,bigint:cZ,boolean:KL,date:fZ,discriminatedUnion:EZ,effect:jL,enum:TZ,function:FZ,instanceof:uZ,intersection:SZ,lazy:AZ,literal:IZ,map:bZ,nan:lZ,nativeEnum:PZ,never:yZ,null:mZ,nullable:RZ,number:YL,object:Ap,oboolean:VZ,onumber:jZ,optional:NZ,ostring:MZ,pipeline:kZ,preprocess:BZ,promise:LZ,record:_Z,set:OZ,strictObject:wZ,string:HL,symbol:pZ,transformer:jL,tuple:xZ,undefined:dZ,union:CZ,unknown:gZ,void:DZ,NEVER:$Z,ZodIssueCode:Z,quotelessJson:$J,ZodError:hn});function XL(e){let t=e.runtimeEnvStrict??e.runtimeEnv??process.env;if(e.emptyStringAsUndefined??!1)for(let[I,A]of Object.entries(t))A===""&&delete t[I];if(!!e.skipValidation)return t;let i=typeof e.client=="object"?e.client:{},s=typeof e.server=="object"?e.server:{},o=typeof e.shared=="object"?e.shared:{},a=Ap(i),u=Ap(s),l=Ap(o),c=e.isServer??(typeof window>"u"||"Deno"in window),f=a.merge(l),p=u.merge(l).merge(a),d=c?p.safeParse(t):f.safeParse(t),m=e.onValidationError??(I=>{throw console.error("\u274C Invalid environment variables:",I.flatten().fieldErrors),new Error("Invalid environment variables")}),y=e.onInvalidAccess??(I=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")});if(d.success===!1)return m(d.error);let D=I=>e.clientPrefix?!I.startsWith(e.clientPrefix)&&!(I in l.shape):!0,h=I=>c||!D(I),g=I=>I==="__esModule"||I==="$$typeof",v=(e.extends??[]).reduce((I,A)=>Object.assign(I,A),{}),w=Object.assign(d.data,v);return new Proxy(w,{get(I,A){if(typeof A=="string"&&!g(A))return h(A)?Reflect.get(I,A):y(A)}})}var WZ=e=>{switch(e){case"local":return{CONNECT_API_BASE_URL:"http://localhost:3000/rest",CANVA_ENV_URL:"http://localhost:3000",CANVA_CLI_CLIENT_ID:"FAKE_CLIENT_ID",FLAVOR:"local"};case"dev":return{CONNECT_API_BASE_URL:"https://api.canva-dev.com/rest",CANVA_ENV_URL:"https://www.canva-dev.com",CANVA_CLI_CLIENT_ID:"OC-AZFEJKOjQYw3",FLAVOR:"dev"};case"staging-cn":return{CONNECT_API_BASE_URL:"https://api.canva-staging.cn/rest",CANVA_ENV_URL:"https://www.canva-staging.cn",CANVA_CLI_CLIENT_ID:"OC-AZNlOhtxI_Zb",FLAVOR:"staging-cn"};case"staging":return{CONNECT_API_BASE_URL:"https://api.canva-staging.com/rest",CANVA_ENV_URL:"https://www.canva-staging.com",CANVA_CLI_CLIENT_ID:"OC-AZH-EOTpT8Ib",FLAVOR:"staging"};case"prod-cn":return{CONNECT_API_BASE_URL:"https://api.canva.cn/rest",CANVA_ENV_URL:"https://www.canva.cn",CANVA_CLI_CLIENT_ID:"OC-AZN2AS1hKtVM",FLAVOR:"prod-cn"};case"prod":default:return{CONNECT_API_BASE_URL:"https://api.canva.com/rest",CANVA_ENV_URL:"https://www.canva.com",CANVA_CLI_CLIENT_ID:"OC-AZICxlGo2biD",FLAVOR:"prod"}}},JL=({fallback:e="prod"})=>XL({server:{FLAVOR:Ip.enum(["prod","prod-cn","staging","staging-cn","dev","local"]).default(e),CONNECT_API_BASE_URL:Ip.string().url(),CANVA_ENV_URL:Ip.string().url(),CANVA_CLI_CLIENT_ID:Ip.enum(["OC-AZICxlGo2biD","OC-AZN2AS1hKtVM","OC-AZH-EOTpT8Ib","OC-AZNlOhtxI_Zb","OC-AZFEJKOjQYw3","FAKE_CLIENT_ID"]).default("OC-AZICxlGo2biD")},runtimeEnv:WZ(q_({fallback:e})),emptyStringAsUndefined:!0});var b0=({envLines:e,key:t,value:r,comment:n=""})=>e.map(i=>{if(i.startsWith(`${t}=`)){let s=`${t}=${r}`;return n?`${s} ${n}`:s}return i}),_0=class{constructor(t){this.env=t}get isChina(){return z_(this.env.FLAVOR)}};var ZL=async({debug:e,flavor:t})=>{let r=new a0,n=new h0(r),i=await n.getFlavor();if(e){let d;t?d=`Using flavor: ${t} due to flag passed to command`:i?d=`Using flavor: ${i} stored with token`:d="No flavor set by flags or found stored with token, using the default: Prod",console.log(d)}let s=JL({fallback:t??i??"prod"}),o=new Fh(s),a=new y0(n,s),u=new Oh(a,s,e),l=new D0(s),c=new _0(s),f=new p0(e),p=new d0(n,s,e);return{appService:u,navigationService:f,authService:o,tokenService:a,urlService:l,envService:c,previewService:p}};import Di from"react";import{Text as XN,Newline as wQ}from"ink";var Zi=St(oN(),1),IC=St(HN(),1);import DQ from"react";import{Transform as vQ}from"ink";function FC({onlyFirst:e=!1}={}){let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}var yQ=FC();function AC(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(yQ,"")}var YN=e=>{if(e.name&&e.colors)throw new Error("The `name` and `colors` props are mutually exclusive");let t;if(e.name)t=IC.default[e.name];else if(e.colors)t=(0,IC.default)(e.colors);else throw new Error("Either `name` or `colors` prop must be provided");let r=n=>t.multiline(AC(n));return DQ.createElement(vQ,{transform:r},e.children)};YN.propTypes={children:Zi.default.oneOfType([Zi.default.arrayOf(Zi.default.node),Zi.default.node]).isRequired,name:Zi.default.oneOf(["cristal","teen","mind","morning","vice","passion","fruit","instagram","atlas","retro","summer","pastel","rainbow"]),colors:Zi.default.arrayOf(Zi.default.oneOfType([Zi.default.string,Zi.default.object]))};var KN=YN;var N0=`
513
513
  \u2584\u259F\u2580\u2580\u2580\u2584
514
514
 
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@canva/cli",
3
- "version": "0.0.1-beta.10",
3
+ "version": "0.0.1-beta.11",
4
4
  "description": "The official Canva CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Canva Pty Ltd.",
7
7
  "type": "module",
8
- "main": "./dist/lib/cjs/index.cjs",
9
- "module": "./dist/lib/esm/index.mjs",
8
+ "main": "./lib/cjs/index.cjs",
9
+ "module": "./lib/esm/index.mjs",
10
10
  "exports": {
11
11
  ".": {
12
- "require": "./dist/lib/cjs/index.cjs",
13
- "import": "./dist/lib/esm/index.mjs"
12
+ "require": "./lib/cjs/index.cjs",
13
+ "import": "./lib/esm/index.mjs"
14
14
  }
15
15
  },
16
16
  "bin": {