@canva/cli 0.0.1-beta.5 → 0.0.1-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli.js CHANGED
@@ -515,7 +515,7 @@ Run `+Ze.cyan("{updateCommand}")+" to update",s=t.message||i;t.boxenOptions??={p
515
515
 
516
516
  \u259D\u259C\u2584\u2584\u2584\u259E\u2598\u2580\u2599\u259E\u259C\u2599\u259E\u2588\u2598 \u259D\u2599\u259E \u259C\u2599\u2598 \u2580\u2599\u259E\u259C\u2599\u259E
517
517
  `));import Mi from"react";import{Box as HI,Text as Ya}from"ink";var YI=({name:e,currentVersion:t,latestVersion:r})=>{let{lite:n}=Mi.useContext(Ke);return!r||r===t?null:n?Mi.createElement(HI,{flexDirection:"column"},Mi.createElement(Ya,null,"Update available ",t," \u2192 ",r),Mi.createElement(Ya,null,"Run npm i -g ",e,"@latest to update")):Mi.createElement(HI,{borderStyle:"round",borderColor:"yellow",flexDirection:"column",alignSelf:"center",paddingLeft:2,width:52},Mi.createElement(Ya,{color:"yellow"},"Update available ",Mi.createElement(Ya,{color:"grey"},t," \u2192 "),Mi.createElement(Ya,{color:"yellow"},r)),Mi.createElement(Ya,null,"Run ",Mi.createElement(Ya,{bold:!0},"npm i -g ",e,"@latest")," to update"))};import io from"react";import{Box as VT,Text as z1,useApp as Wq}from"ink";import{Text as lde}from"ink";import fde from"react";var WG=Ft(ZI(),1);import Hpe,{createContext as UG,useContext as $G}from"react";import ji from"node:process";function S1(){return ji.platform!=="win32"?ji.env.TERM!=="linux":!!ji.env.WT_SESSION||!!ji.env.TERMINUS_SUBLIME||ji.env.ConEmuTask==="{cmd::Cmder}"||ji.env.TERM_PROGRAM==="Terminus-Sublime"||ji.env.TERM_PROGRAM==="vscode"||ji.env.TERM==="xterm-256color"||ji.env.TERM==="alacritty"||ji.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var QI={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"},eT={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"},CG={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"},EG={...QI,...eT},xG={...QI,...CG},SG=S1(),_G=SG?EG:xG,It=_G,Ope=Object.entries(eT);var tT={info:"blue",success:"green",error:"red",warning:"yellow"},bG={styles:{container:({variant:e})=>({flexGrow:1,borderStyle:"round",borderColor:tT[e],gap:1,paddingX:1}),iconContainer:()=>({flexShrink:0}),icon:({variant:e})=>({color:tT[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=It.info),e==="success"&&(t=It.tick),e==="error"&&(t=It.cross),e==="warning"&&(t=It.warning),{icon:t}}},rT=bG;var OG={styles:{container:({color:e})=>({backgroundColor:e}),label:()=>({color:"black"})}},nT=OG;var FG={styles:{input:({isFocused:e})=>({dimColor:!e})}},iT=FG;var AG={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})}},sT=AG;var IG={styles:{list:()=>({flexDirection:"column"}),listItem:()=>({gap:1}),marker:()=>({dimColor:!0}),content:()=>({flexDirection:"column"})}},oT=IG;var TG={styles:{container:()=>({flexGrow:1,minWidth:0}),completed:()=>({color:"magenta"}),remaining:()=>({dimColor:!0})},config:()=>({completedCharacter:It.square,remainingCharacter:It.squareLightShade})},aT=TG;var PG={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})}},uT=PG;var LG={styles:{container:()=>({gap:1}),frame:()=>({color:"blue"}),label:()=>({})}},lT=LG;var NG={success:"green",error:"red",warning:"yellow",info:"blue"},RG={success:It.tick,error:It.cross,warning:It.warning,info:It.info},BG={styles:{container:()=>({gap:1}),iconContainer:()=>({flexShrink:0}),icon:({variant:e})=>({color:NG[e]}),message:()=>({})},config:({variant:e})=>({icon:RG[e]})},cT=BG;var kG={styles:{list:()=>({flexDirection:"column"}),listItem:()=>({gap:1}),marker:()=>({dimColor:!0}),content:()=>({flexDirection:"column"})},config:()=>({marker:It.line})},fT=kG;var MG={styles:{value:()=>({})}},pT=MG;var jG={styles:{value:()=>({})}},dT=jG;var VG={styles:{value:()=>({})}},mT=VG;var GG={components:{Alert:rT,Badge:nT,ConfirmInput:iT,MultiSelect:sT,OrderedList:oT,ProgressBar:aT,Select:uT,Spinner:lT,StatusMessage:cT,UnorderedList:fT,TextInput:pT,EmailInput:dT,PasswordInput:mT}},qG=UG(GG);var nt=e=>$G(qG).components[e];import zG from"react";import{Text as HG,useInput as YG}from"ink";function hT({isDisabled:e=!1,defaultChoice:t="confirm",submitOnEnter:r=!0,onConfirm:n,onCancel:i}){YG((o,a)=>{o.toLowerCase()==="y"&&n(),o.toLowerCase()==="n"&&i(),a.return&&r&&(t==="confirm"?n():i())},{isActive:!e});let{styles:s}=nt("ConfirmInput");return zG.createElement(HG,{...s.input({isFocused:!e})},t==="confirm"?"Y/n":"y/N")}import{Box as QG}from"ink";import O1,{useMemo as DT,useContext as eq}from"react";import{Box as gT,Text as XG}from"ink";import _1,{useContext as JG}from"react";import{createContext as KG}from"react";var Wf=It.line;var mh=KG({marker:Wf});function yT({children:e}){let{marker:t}=JG(mh),{styles:r}=nt("UnorderedList");return _1.createElement(gT,{...r.listItem()},_1.createElement(XG,{...r.marker()},t),_1.createElement(gT,{...r.content()},e))}import{createContext as ZG}from"react";var b1=ZG({depth:0});function tq({children:e}){let{depth:t}=eq(b1),{styles:r,config:n}=nt("UnorderedList"),i=DT(()=>({depth:t+1}),[t]),s=DT(()=>{let{marker:o}=n();return typeof o=="string"?{marker:o}:Array.isArray(o)?{marker:o[t]??o.at(-1)??Wf}:{marker:Wf}},[n,t]);return O1.createElement(b1.Provider,{value:i},O1.createElement(mh.Provider,{value:s},O1.createElement(QG,{...r.list()},e)))}tq.Item=yT;import dme from"react";import{Box as hme,Text as gme}from"ink";import qde from"react";import{Box as Hde,Text as Yde}from"ink";import{useReducer as Qde,useCallback as eme,useMemo as tme,useState as rme,useEffect as nme}from"react";var Fl=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 ame}from"ink";import _me,{useState as bme}from"react";import{Box as Fme,Text as Ame,measureElement as Ime}from"ink";import Gf from"react";import{Box as cq,Text as fq}from"ink";import hh from"react";import{Box as rq,Text as F1}from"ink";function vT({isFocused:e,isSelected:t,children:r}){let{styles:n}=nt("Select");return hh.createElement(rq,{...n.option({isFocused:e})},e&&hh.createElement(F1,{...n.focusIndicator()},It.pointer),hh.createElement(F1,{...n.label({isFocused:e,isSelected:t})},r),t&&hh.createElement(F1,{...n.selectedIndicator()},It.tick))}import{isDeepStrictEqual as nq}from"node:util";import{useReducer as iq,useCallback as A1,useMemo as sq,useState as oq,useEffect as aq}from"react";var uq=(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}},wT=({visibleOptionCount:e,defaultValue:t,options:r})=>{let n=typeof e=="number"?Math.min(e,r.length):r.length,i=new Fl(r);return{optionMap:i,visibleOptionCount:n,focusedValue:i.first?.value,visibleFromIndex:0,visibleToIndex:n,previousValue:t,value:t}},CT=({visibleOptionCount:e=5,options:t,defaultValue:r,onChange:n})=>{let[i,s]=iq(uq,{visibleOptionCount:e,defaultValue:r,options:t},wT),[o,a]=oq(t);t!==o&&!nq(t,o)&&(s({type:"reset",state:wT({visibleOptionCount:e,defaultValue:r,options:t})}),a(t));let u=A1(()=>{s({type:"focus-next-option"})},[]),l=A1(()=>{s({type:"focus-previous-option"})},[]),c=A1(()=>{s({type:"select-focused-option"})},[]),f=sq(()=>t.map((p,d)=>({...p,index:d})).slice(i.visibleFromIndex,i.visibleToIndex),[t,i.visibleFromIndex,i.visibleToIndex]);return aq(()=>{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 lq}from"ink";var ET=({isDisabled:e=!1,state:t})=>{lq((r,n)=>{n.downArrow&&t.focusNextOption(),n.upArrow&&t.focusPreviousOption(),n.return&&t.selectFocusedOption()},{isActive:!e})};function Ds({isDisabled:e=!1,visibleOptionCount:t=5,highlightText:r,options:n,defaultValue:i,onChange:s}){let o=CT({visibleOptionCount:t,options:n,defaultValue:i,onChange:s});ET({isDisabled:e,state:o});let{styles:a}=nt("Select");return Gf.createElement(cq,{...a.container()},o.visibleOptions.map(u=>{let l=u.label;if(r&&u.label.includes(r)){let c=u.label.indexOf(r);l=Gf.createElement(Gf.Fragment,null,u.label.slice(0,c),Gf.createElement(fq,{...a.highlightedText()},r),u.label.slice(c+r.length))}return Gf.createElement(vT,{key:u.value,isFocused:!e&&o.focusedValue===u.value,isSelected:o.value===u.value},l)}))}import T1 from"react";import{Box as hq,Text as _T}from"ink";import{useEffect as dq,useState as mq}from"react";var I1={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 xT=I1,the=Object.keys(I1);function ST({type:e="dots"}){let[t,r]=mq(0),n=xT[e];return dq(()=>{let i=setInterval(()=>{r(s=>s===n.frames.length-1?0:s+1)},n.interval);return()=>{clearInterval(i)}},[n]),{frame:n.frames[t]??""}}function bT({label:e,type:t}){let{frame:r}=ST({type:t}),{styles:n}=nt("Spinner");return T1.createElement(hq,{...n.container()},T1.createElement(_T,{...n.frame()},r),e&&T1.createElement(_T,{...n.label()},e))}import Cq from"react";import{Text as Eq}from"ink";import{useReducer as gq,useCallback as qf,useEffect as yq,useMemo as Dq}from"react";var vq=(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}}}},OT=({defaultValue:e="",suggestions:t,onChange:r,onSubmit:n})=>{let[i,s]=gq(vq,{previousValue:e,value:e,cursorOffset:e.length}),o=Dq(()=>{if(i.value.length!==0)return t?.find(p=>p.startsWith(i.value))?.replace(i.value,"")},[i.value,t]),a=qf(()=>{s({type:"move-cursor-left"})},[]),u=qf(()=>{s({type:"move-cursor-right"})},[]),l=qf(p=>{s({type:"insert",text:p})},[]),c=qf(()=>{s({type:"delete"})},[]),f=qf(()=>{if(o){l(o),n?.(i.value+o);return}n?.(i.value)},[i.value,o,l,n]);return yq(()=>{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 FT}from"react";import{useInput as wq}from"ink";var P1=Ze.inverse(" "),AT=({isDisabled:e=!1,state:t,placeholder:r=""})=>{let n=FT(()=>e?r?Ze.dim(r):"":r&&r.length>0?Ze.inverse(r[0])+Ze.dim(r.slice(1)):P1,[e,r]),i=FT(()=>{if(e)return t.value;let s=0,o=t.value.length>0?"":P1;for(let a of t.value)o+=s===t.cursorOffset?Ze.inverse(a):a,s++;return t.suggestion?(t.cursorOffset===t.value.length?o+=Ze.inverse(t.suggestion[0])+Ze.dim(t.suggestion.slice(1)):o+=Ze.dim(t.suggestion),o):(t.value.length>0&&t.cursorOffset===t.value.length&&(o+=P1),o)},[e,t.value,t.cursorOffset,t.suggestion]);return wq((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 IT({isDisabled:e=!1,defaultValue:t,placeholder:r="",suggestions:n,onChange:i,onSubmit:s}){let o=OT({defaultValue:t,suggestions:n,onChange:i,onSubmit:s}),{inputValue:a}=AT({isDisabled:e,placeholder:r,state:o}),{styles:u}=nt("TextInput");return Cq.createElement(Eq,{...u.value()},a)}import{Box as Oq}from"ink";import zf,{useContext as Fq,isValidElement as PT}from"react";import{Box as TT,Text as Sq}from"ink";import L1,{useContext as _q}from"react";import{createContext as xq}from"react";var gh=xq({marker:It.line});function yh({children:e}){let{marker:t}=_q(gh),{styles:r}=nt("OrderedList");return L1.createElement(TT,{...r.listItem()},L1.createElement(Sq,{...r.marker()},t),L1.createElement(TT,{...r.content()},e))}import{createContext as bq}from"react";var N1=bq({marker:""});function Aq({children:e}){let{marker:t}=Fq(N1),{styles:r}=nt("OrderedList"),n=0;for(let s of zf.Children.toArray(e))!PT(s)||s.type!==yh||n++;let i=String(n).length;return zf.createElement(Oq,{...r.list()},zf.Children.map(e,(s,o)=>{if(!PT(s)||s.type!==yh)return s;let a=`${String(o+1).padStart(i)}.`,u=`${t}${a}`;return zf.createElement(N1.Provider,{value:{marker:u}},zf.createElement(gh.Provider,{value:{marker:u}},s))}))}Aq.Item=yh;import Nq from"react";import{Text as Rq}from"ink";import{useReducer as Iq,useCallback as Hf,useEffect 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}}}},LT=({onChange:e,onSubmit:t})=>{let[r,n]=Iq(Pq,{previousValue:"",value:"",cursorOffset:0}),i=Hf(()=>{n({type:"move-cursor-left"})},[]),s=Hf(()=>{n({type:"move-cursor-right"})},[]),o=Hf(l=>{n({type:"insert",text:l})},[]),a=Hf(()=>{n({type:"delete"})},[]),u=Hf(()=>{t?.(r.value)},[r.value,t]);return Tq(()=>{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 NT}from"react";import{useInput as Lq}from"ink";var R1=Ze.inverse(" "),RT=({isDisabled:e=!1,state:t,placeholder:r=""})=>{let n=NT(()=>e?r?Ze.dim(r):"":r&&r.length>0?Ze.inverse(r[0])+Ze.dim(r.slice(1)):R1,[e,r]),i=NT(()=>{let s="*".repeat(t.value.length);if(e)return s;let o=0,a=s.length>0?"":R1;for(let u of s)a+=o===t.cursorOffset?Ze.inverse(u):u,o++;return s.length>0&&t.cursorOffset===s.length&&(a+=R1),a},[e,t.value,t.cursorOffset]);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 BT({isDisabled:e=!1,placeholder:t="",onChange:r,onSubmit:n}){let i=LT({onChange:r,onSubmit:n}),{inputValue:s}=RT({isDisabled:e,placeholder:t,state:i}),{styles:o}=nt("PasswordInput");return Nq.createElement(Rq,{...o.value()},s)}import u0e from"react";import{Box as c0e,Text as f0e}from"ink";import y0e from"react";import{Box as v0e,Text as w0e}from"ink";import U0e from"react";import{Text as W0e}from"ink";import{useReducer as b0e,useCallback as O0e,useEffect as F0e,useMemo as A0e}from"react";import{useMemo as P0e}from"react";import{useInput as N0e}from"ink";var B0e=Ze.inverse(" ");import kT,{useContext as Bq}from"react";var no=e=>{let{lite:t}=Bq(Ke),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?kT.createElement(hT,{onConfirm:()=>s("yes"),onCancel:()=>s("no"),defaultChoice:e.default==="yes"?"confirm":"cancel"}):kT.createElement(Ds,{options:o,onChange:a=>s(a)})};import rr from"node:fs";import Cr from"node:path";import{promisify as Vq}from"util";import{exec as Uq}from"child_process";import kq from"node:path";function Yf(e){return e.replace(/\s+/g,"-").toLowerCase()}function Dh(e){return kq.join(process.cwd(),Yf(e))}var Mq=18;function Kf(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>Mq?{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 jq=["private","name","version","description","license","author","scripts","dependencies","devDependencies","keywords","engines","canvaCliMetadata"];function MT(e){let t={};return jq.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 $q}from"node:url";var jT=Vq(Uq),vh=$q(import.meta.url),B1={type:"preAppCreation",start:"Checking write permissions",failure:"We don\u2019t have write access to this folder, maybe try somewhere else?",action:async()=>{await rr.promises.access(process.cwd(),(rr.constants||rr).W_OK)},preventCleanupOnError:!0},k1={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 rr.promises.access(e.folderName,(rr.constants||rr).F_OK),t=!0}catch{t=!1}if(t)throw new Error(`A folder named ${e.folderName} already exists.`)},preventCleanupOnError:!0},M1={type:"preAppCreation",start:"Creating folder",failure:"We couldn\u2019t make a folder with that app name, maybe it already exists?",action:async e=>{await rr.promises.mkdir(e.folderName,{recursive:!0})},preventCleanupOnError:!0},j1={type:"preAppCreation",start:"Copying template files",failure:"Failed to copy template files",action:async e=>{let t=Cr.dirname(vh),r=Cr.join(t,"templates",e.template.path),n=e.folderName;return rr.promises.cp(r,n,{recursive:!0,dereference:!0})},preventCleanupOnError:!1},V1={type:"preAppCreation",start:"Copying common files",failure:"Failed to copy common files",action:async e=>{let t=Cr.dirname(vh),r=Cr.join(t,"templates","common"),n=e.folderName;e.debug&&console.log("running 'cp' command with following args: ",{src:r,destination:n}),await rr.promises.cp(r,n,{recursive:!0,dereference:!0});let i=Cr.join(e.folderName,".gitignore.template"),s=Cr.join(e.folderName,".gitignore");await rr.promises.rename(i,s)},preventCleanupOnError:!1},U1={type:"preAppCreation",start:"Generating README.md",failure:"Failed to generate README.md.",action:async e=>{let t=Cr.dirname(vh),r=Cr.join(t,"templates","common","README.md"),n=Cr.join(t,"templates",e.template.path,"README.md"),i=Cr.join(e.folderName,"README.md"),o=await rr.promises.readFile(r,{encoding:"utf8"});try{let a=await rr.promises.readFile(n,"utf8");o=o+`
518
- `+a}catch{}await rr.promises.writeFile(i,o)},preventCleanupOnError:!1},$1={type:"preAppCreation",start:"Generating an .env file",failure:"Failed to generate an .env file",action:async e=>{let t=Cr.join(e.folderName,".env.template"),r=Cr.join(e.folderName,".env");await rr.promises.copyFile(t,r)},preventCleanupOnError:!1},W1={type:"preAppCreation",start:"Updating package.json",failure:"Failed to update package.json",action:async e=>{let t=Cr.join(e.folderName,"package.json");e.debug&&console.log("Reading 'package.json': ",{packageJsonName:t});let r=await rr.promises.readFile(t,"utf8"),n=JSON.parse(r);n.name=Yf(e.name);let i=Cr.dirname(vh),s=Cr.join(i,"templates","base","package.json"),o=await rr.promises.readFile(s,"utf8"),a=JSON.parse(o),u=a.canvaCliMetadata;(u.inheritable||[]).forEach(d=>{n[d]=n[d]||a[d]||""});let l=Cr.join(i,"package.json"),c=await rr.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 rr.promises.writeFile(t,p)},preventCleanupOnError:!1},G1={type:"preAppCreation",start:"Initializing git repository",failure:"Failed to initialize git repository",action:async e=>{await jT(`git init ${e.folderName}`)},preventCleanupOnError:!1},q1={type:"preAppCreation",start:"Installing dependencies (This may take a few minutes)",failure:"Failed to install node packages",action:async e=>{await jT(`cd ${e.folderName} && npm install`)},preventCleanupOnError:!1};async function ci(e=500){await new Promise(t=>setTimeout(t,e))}var UT=({packageName:e,handlePromptDecision:t})=>{let{exit:r}=Wq(),[n,i]=io.useState(!1);return io.createElement(VT,{flexDirection:"column",paddingX:2,borderStyle:"round",borderColor:"yellow",width:80},io.createElement(z1,null,io.createElement(Rt,{color:"greenBright"},"? "),"You're using an older version of our CLI. Would you like to update?"),io.createElement(no,{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 ci(),r()),t(o)}}),n&&io.createElement(VT,{marginTop:1},io.createElement(z1,null,"Run ",io.createElement(z1,{bold:!0},"npm i -g ",e,"@latest")," to update.")))};import{Text as Gq}from"ink";import*as Xf from"react";var Vi=e=>{let{lite:t}=Xf.useContext(Ke);return t?Xf.createElement(Gq,null,e.label):Xf.createElement(bT,{type:"bouncingBall",...e})};var pn=({pkg:e,shouldPromptUpdate:t,children:r})=>{let{lite:n}=qq(Ke),[i,s]=wh(!0),[o,a]=wh(),[u,l]=wh(null),[c,f]=wh(!1);zq(()=>{(async()=>{try{let D=await t1({pkg:e}).fetchInfo();l(D.latest)}catch{f(!0)}finally{s(!1)}})()},[e]);let p=m=>{a(m?"agreed":"disagreed")};return i?so.createElement(Vi,{type:"bouncingBall",label:"Loading..."}):t&&u&&u!==e.version&&!o?so.createElement(UT,{packageName:e.name,handlePromptDecision:p}):so.createElement($T,{borderStyle:n?void 0:"round",margin:n?void 0:2,flexDirection:"column",borderColor:n?void 0:oh},so.createElement($T,{flexDirection:"row",paddingY:1},so.createElement(WT,null),so.createElement(zI,null),so.createElement(WT,null)),!c&&so.createElement(YI,{name:e.name,currentVersion:e.version,latestVersion:u}),r)};import wt from"react";import{Box as Zf,Text as Ui}from"ink";import Y1,{useContext as Yq}from"react";import{Text as KT,Transform as Kq}from"ink";var tt="\x1B[",Jf="\x1B]",Al="\x07",Ch=";",GT=process.env.TERM_PROGRAM==="Apple_Terminal",Ge={};Ge.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?tt+(e+1)+"G":tt+(t+1)+";"+(e+1)+"H"};Ge.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=tt+-e+"D":e>0&&(r+=tt+e+"C"),t<0?r+=tt+-t+"A":t>0&&(r+=tt+t+"B"),r};Ge.cursorUp=(e=1)=>tt+e+"A";Ge.cursorDown=(e=1)=>tt+e+"B";Ge.cursorForward=(e=1)=>tt+e+"C";Ge.cursorBackward=(e=1)=>tt+e+"D";Ge.cursorLeft=tt+"G";Ge.cursorSavePosition=GT?"\x1B7":tt+"s";Ge.cursorRestorePosition=GT?"\x1B8":tt+"u";Ge.cursorGetPosition=tt+"6n";Ge.cursorNextLine=tt+"E";Ge.cursorPrevLine=tt+"F";Ge.cursorHide=tt+"?25l";Ge.cursorShow=tt+"?25h";Ge.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=Ge.eraseLine+(r<e-1?Ge.cursorUp():"");return e&&(t+=Ge.cursorLeft),t};Ge.eraseEndLine=tt+"K";Ge.eraseStartLine=tt+"1K";Ge.eraseLine=tt+"2K";Ge.eraseDown=tt+"J";Ge.eraseUp=tt+"1J";Ge.eraseScreen=tt+"2J";Ge.scrollUp=tt+"S";Ge.scrollDown=tt+"T";Ge.clearScreen="\x1Bc";Ge.clearTerminal=process.platform==="win32"?`${Ge.eraseScreen}${tt}0f`:`${Ge.eraseScreen}${tt}3J${tt}H`;Ge.beep=Al;Ge.link=(e,t)=>[Jf,"8",Ch,Ch,t,Al,e,Jf,"8",Ch,Ch,Al].join("");Ge.image=(e,t={})=>{let r=`${Jf}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+Al};Ge.iTerm={setCwd:(e=process.cwd())=>`${Jf}50;CurrentDir=${e}${Al}`,annotation:(e,t={})=>{let r=`${Jf}1337;`,n=typeof t.x<"u",i=typeof t.y<"u";if((n||i)&&!(n&&i&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+Al}};var qT=Ge;var Eh=Ft(YT(),1);function Ka(e,t,{target:r="stdout",...n}={}){return Eh.default[r]?qT.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}Ka.isSupported=Eh.default.stdout;Ka.stderr=(e,t,r={})=>Ka(e,t,{target:"stderr",...r});Ka.stderr.isSupported=Eh.default.stderr;var Tt=({text:e,url:t,subtle:r})=>{let{lite:n}=Yq(Ke);return Y1.createElement(KT,{color:n||r?void 0:"blueBright",bold:!0},Y1.createElement(Kq,{transform:()=>Ka(e,t)},Y1.createElement(KT,null,e)))};function oo(e,t){if(e==null)throw new Error(t||"argument is null");return e}var Xa=class extends Error{constructor(t){super(`Unreachable case: ${t}`)}};var Ja=({env:e,appId:t})=>{let r;switch(e){case"dev":r="https://www.canva-dev.com/developers/app";break;case"staging":r="https://www.canva-staging.com/developers/app";break;case"prod":r="https://www.canva.com/developers/app";break;default:throw new Xa(e)}return t?`${r}/${t}`:`${r}s`},xh=e=>{let t,r=e.appId.toLowerCase();switch(e.env){case"dev":t=`https://app-${r}.canva-apps-dev.com`;break;case"staging":t=`https://app-${r}.canva-apps-staging.com`;break;case"prod":t=`https://app-${r}.canva-apps.com`;break;default:throw new Xa(e.env)}return t};import{useContext as Jq}from"react";import{Text as Zq}from"ink";import Qq from"react";var Bt=e=>{let{lite:t}=Jq(Ke);return Qq.createElement(Zq,{bold:e.bold??!0,color:t?void 0:"cyanBright",italic:e.italic},e.children)};var JT=()=>{let{lite:e}=wt.useContext(Ke);return wt.createElement(Zf,{flexDirection:"column",margin:.5},wt.createElement(Ui,null,wt.createElement(Rt,null,"\u{1F44B} "),wt.createElement(Ui,{bold:!0},"Welcome!")," Let\u2019s bring your Canva app to life."),wt.createElement(Zf,{marginTop:1,flexDirection:"column"},wt.createElement(Zf,{flexDirection:"column"},wt.createElement(Ui,null,"Run ",wt.createElement(Bt,null,"canva apps create")," to create a new app"),wt.createElement(Ui,{dimColor:!0},"By creating an app, you agree to the"," ",wt.createElement(Tt,{url:"https://www.canva.com/policies/canva-developer-terms/",text:"Canva Developer terms"}))),wt.createElement(Zf,{marginTop:1},wt.createElement(Ui,null,"Run ",wt.createElement(Bt,null,"canva apps list")," to view a list of your apps")),wt.createElement(Zf,{borderStyle:e?void 0:"double",borderColor:e?void 0:"cyanBright",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",width:"98%",marginTop:1,marginX:2,paddingX:1},wt.createElement(Ui,{bold:!0},wt.createElement(Rt,null,"\u{1F4A1} "),"Tips"),wt.createElement(Ui,null," ","\u2022 For a list of all commands, run"," ",wt.createElement(Bt,null,"canva --help")),wt.createElement(Ui,null," ","\u2022 View our Developer Documentation"," ",wt.createElement(Tt,{url:"https://canva.dev",text:"Developer Documentation"})," for more information"),wt.createElement(Ui,null," ","\u2022 Examples of all components from"," ",wt.createElement(Ui,{bold:!0},"@canva/app-ui-kit")," are available in the"," ",wt.createElement(Tt,{url:"https://www.canva.dev/docs/apps/app-ui-kit/storybook",text:"App UI Kit Storybook"})))))};var dn="@canva/cli",Rr="0.0.1-beta.5";var tz=e=>{ez(K1.createElement(Ke.Provider,{value:{lite:e.lite}},K1.createElement(pn,{pkg:{name:dn,version:Rr}},K1.createElement(JT,null))))},QT=e=>e.command(["welcome","$0"],"Welcome page",()=>{},t=>{tz(t)});import X1 from"react";import{render as sz}from"ink";import Qf from"react";import{Box as rz,Text as eP}from"ink";var Sh=e=>{let{lite:t}=Qf.useContext(Ke);return Qf.createElement(rz,{borderStyle:t?void 0:"double",borderColor:t?void 0:"cyanBright",display:"flex",justifyContent:"center",alignItems:"center",width:"98%",marginTop:1,marginX:2,paddingX:1},Qf.createElement(eP,{bold:!0},Qf.createElement(Rt,null,"\u{1F4A1}")," Tip:"," "),Qf.createElement(eP,null," "),e.children)};import{Text as jn}from"ink";import it from"react";function nz(e,t){if(e.length===0)throw new Error("Unable to select random element from an empty array.");if(t)return e[t];let r=Math.floor(Math.random()*e.length);return e[r]}var iz=[it.createElement(jn,{key:"ui-kit"},"Use the ",it.createElement(Tt,{text:"@canva/app-ui-kit",url:"https://www.npmjs.com/package/@canva/app-ui-kit"})," ","library to create apps that look and feel like the rest of Canva!"),it.createElement(jn,{key:"dam"},"Building a Digital Asset Management app? checkout the"," ",it.createElement(Bt,{italic:!0},"SearchableListView")," component from"," ",it.createElement(Tt,{text:"@canva/app-components",url:"https://www.npmjs.com/package/@canva/app-components"}),"."),it.createElement(jn,{key:"hmr"},"Enable"," ",it.createElement(Tt,{text:"Hot Module Replacement (HMR)",url:"https://www.canva.dev/docs/apps/previewing-apps/#automatic"})," ","to automatically reload your app inside the Canva editor whenever your source code changes!"),it.createElement(jn,{key:"storybook"},"Examples of all available components from"," ",it.createElement(Tt,{text:"@canva/app-ui-kit",url:"https://www.npmjs.com/package/@canva/app-ui-kit"})," are available in the"," ",it.createElement(Tt,{text:"App UI Kit Storybook",url:"https://www.canva.dev/docs/apps/app-ui-kit/storybook"}),"."),it.createElement(jn,{key:"discourse"},"Sign up to our ",it.createElement(Tt,{text:"Community forum",url:"https://community.canva.dev"})," to be involved in our community and network with fellow App Builders!"),it.createElement(jn,{key:"design-guidelines"},"Checkout our ",it.createElement(Tt,{text:"Design Guidelines",url:"https://www.canva.dev/docs/apps/design-guidelines/"})," ","to ensure your app complies, and help you speed through our app review process!"),it.createElement(jn,{key:"starter-kit"},"Explore the various example apps we have in our"," ",it.createElement(Tt,{text:"Apps SDK Starter Kit",url:"https://github.com/canva-sdks/canva-apps-sdk-starter-kit/tree/main"})," by running the command ",it.createElement(Bt,null,"npm start examples"),"."),it.createElement(jn,{key:"mobile"},"To test your app locally on a mobile device, you need to build your app and upload it as a Javascript bundle in the developer portal. The local development URL won't work when testing on mobile."),it.createElement(jn,{key:"submit"},"Once you're ready to submit your app, run the"," ",it.createElement(Bt,null,"npm run build")," command, to generate a Javascript bundle to upload via the"," ",it.createElement(Tt,{text:"Developer Portal",url:Ja({env:"prod"})}),"."),it.createElement(jn,{key:"getting-featured"},"Want to get featured on the apps marketplace? Checkout this article on"," ",it.createElement(Tt,{text:"how to get featured",url:"https://www.canva.dev/docs/apps/getting-featured/"}),"."),it.createElement(jn,{key:"deep-linking"},"Did you know you can create URLs that link users directly to the Canva editor with your app? To find our more, checkout this article on"," ",it.createElement(Tt,{text:"deep linking",url:"https://www.canva.dev/docs/apps/deep-linking/"}),"."),it.createElement(jn,{key:"docs"},"View our Developer Documentation"," ",it.createElement(Tt,{url:"https://canva.dev",text:"Developer Documentation"})," to learn more about our Canva Developers platform.")],_h=e=>nz(iz,e);var oz=async e=>{let t=await e.argv;sz(X1.createElement(Ke.Provider,{value:{lite:t.lite}},X1.createElement(pn,{pkg:{name:dn,version:Rr}},X1.createElement(Sh,null,_h()))))},tP=e=>e.command(["tip","tips"],"Get a random tip or trick",()=>{oz(e)});import ux from"react";import{render as rX}from"ink";var dr=Ft(pp(),1);import Yh from"node:process";import{Buffer as SH}from"node:buffer";import dL from"node:path";import{fileURLToPath as _H}from"node:url";import bH from"node:child_process";import Pw,{constants as mL}from"node:fs/promises";import aL from"node:process";import oH from"node:os";import aH from"node:fs";import iH from"node:fs";import sL from"node:fs";var Sw;function rH(){try{return sL.statSync("/.dockerenv"),!0}catch{return!1}}function nH(){try{return sL.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function _w(){return Sw===void 0&&(Sw=rH()||nH()),Sw}var bw,sH=()=>{try{return iH.statSync("/run/.containerenv"),!0}catch{return!1}};function $l(){return bw===void 0&&(bw=sH()||_w()),bw}var oL=()=>{if(aL.platform!=="linux")return!1;if(oH.release().toLowerCase().includes("microsoft"))return!$l();try{return aH.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!$l():!1}catch{return!1}},su=aL.env.__IS_WSL_TEST__?oL:oL();function ou(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 wH}from"node:util";import Iw from"node:process";import{execFile as CH}from"node:child_process";import{promisify as uH}from"node:util";import lH from"node:process";import{execFile as cH}from"node:child_process";var fH=uH(cH);async function Ow(){if(lH.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await fH("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 pH from"node:process";import{promisify as dH}from"node:util";import{execFile as mH,execFileSync as yDe}from"node:child_process";var hH=dH(mH);async function uL(e,{humanReadableOutput:t=!0}={}){if(pH.platform!=="darwin")throw new Error("macOS only");let r=t?[]:["-ss"],{stdout:n}=await hH("osascript",["-e",e,r]);return n.trim()}async function Fw(e){return uL(`tell application "Finder" to set app_path to application file id "${e}" as string
518
+ `+a}catch{}await rr.promises.writeFile(i,o)},preventCleanupOnError:!1},$1={type:"preAppCreation",start:"Generating an .env file",failure:"Failed to generate an .env file",action:async e=>{let t=Cr.join(e.folderName,".env.template"),r=Cr.join(e.folderName,".env");await rr.promises.copyFile(t,r)},preventCleanupOnError:!1},W1={type:"preAppCreation",start:"Updating package.json",failure:"Failed to update package.json",action:async e=>{let t=Cr.join(e.folderName,"package.json");e.debug&&console.log("Reading 'package.json': ",{packageJsonName:t});let r=await rr.promises.readFile(t,"utf8"),n=JSON.parse(r);n.name=Yf(e.name);let i=Cr.dirname(vh),s=Cr.join(i,"templates","base","package.json"),o=await rr.promises.readFile(s,"utf8"),a=JSON.parse(o),u=a.canvaCliMetadata;(u.inheritable||[]).forEach(d=>{n[d]=n[d]||a[d]||""});let l=Cr.join(i,"package.json"),c=await rr.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 rr.promises.writeFile(t,p)},preventCleanupOnError:!1},G1={type:"preAppCreation",start:"Initializing git repository",failure:"Failed to initialize git repository",action:async e=>{await jT(`git init ${e.folderName}`)},preventCleanupOnError:!1},q1={type:"preAppCreation",start:"Installing dependencies (This may take a few minutes)",failure:"Failed to install node packages",action:async e=>{await jT(`cd ${e.folderName} && npm install`)},preventCleanupOnError:!1};async function ci(e=500){await new Promise(t=>setTimeout(t,e))}var UT=({packageName:e,handlePromptDecision:t})=>{let{exit:r}=Wq(),[n,i]=io.useState(!1);return io.createElement(VT,{flexDirection:"column",paddingX:2,borderStyle:"round",borderColor:"yellow",width:80},io.createElement(z1,null,io.createElement(Rt,{color:"greenBright"},"? "),"You're using an older version of our CLI. Would you like to update?"),io.createElement(no,{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 ci(),r()),t(o)}}),n&&io.createElement(VT,{marginTop:1},io.createElement(z1,null,"Run ",io.createElement(z1,{bold:!0},"npm i -g ",e,"@latest")," to update.")))};import{Text as Gq}from"ink";import*as Xf from"react";var Vi=e=>{let{lite:t}=Xf.useContext(Ke);return t?Xf.createElement(Gq,null,e.label):Xf.createElement(bT,{type:"bouncingBall",...e})};var pn=({pkg:e,shouldPromptUpdate:t,children:r})=>{let{lite:n}=qq(Ke),[i,s]=wh(!0),[o,a]=wh(),[u,l]=wh(null),[c,f]=wh(!1);zq(()=>{(async()=>{try{let D=await t1({pkg:e}).fetchInfo();l(D.latest)}catch{f(!0)}finally{s(!1)}})()},[e]);let p=m=>{a(m?"agreed":"disagreed")};return i?so.createElement(Vi,{type:"bouncingBall",label:"Loading..."}):t&&u&&u!==e.version&&!o?so.createElement(UT,{packageName:e.name,handlePromptDecision:p}):so.createElement($T,{borderStyle:n?void 0:"round",margin:n?void 0:2,flexDirection:"column",borderColor:n?void 0:oh},so.createElement($T,{flexDirection:"row",paddingY:1},so.createElement(WT,null),so.createElement(zI,null),so.createElement(WT,null)),!c&&so.createElement(YI,{name:e.name,currentVersion:e.version,latestVersion:u}),r)};import wt from"react";import{Box as Zf,Text as Ui}from"ink";import Y1,{useContext as Yq}from"react";import{Text as KT,Transform as Kq}from"ink";var tt="\x1B[",Jf="\x1B]",Al="\x07",Ch=";",GT=process.env.TERM_PROGRAM==="Apple_Terminal",Ge={};Ge.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?tt+(e+1)+"G":tt+(t+1)+";"+(e+1)+"H"};Ge.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=tt+-e+"D":e>0&&(r+=tt+e+"C"),t<0?r+=tt+-t+"A":t>0&&(r+=tt+t+"B"),r};Ge.cursorUp=(e=1)=>tt+e+"A";Ge.cursorDown=(e=1)=>tt+e+"B";Ge.cursorForward=(e=1)=>tt+e+"C";Ge.cursorBackward=(e=1)=>tt+e+"D";Ge.cursorLeft=tt+"G";Ge.cursorSavePosition=GT?"\x1B7":tt+"s";Ge.cursorRestorePosition=GT?"\x1B8":tt+"u";Ge.cursorGetPosition=tt+"6n";Ge.cursorNextLine=tt+"E";Ge.cursorPrevLine=tt+"F";Ge.cursorHide=tt+"?25l";Ge.cursorShow=tt+"?25h";Ge.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=Ge.eraseLine+(r<e-1?Ge.cursorUp():"");return e&&(t+=Ge.cursorLeft),t};Ge.eraseEndLine=tt+"K";Ge.eraseStartLine=tt+"1K";Ge.eraseLine=tt+"2K";Ge.eraseDown=tt+"J";Ge.eraseUp=tt+"1J";Ge.eraseScreen=tt+"2J";Ge.scrollUp=tt+"S";Ge.scrollDown=tt+"T";Ge.clearScreen="\x1Bc";Ge.clearTerminal=process.platform==="win32"?`${Ge.eraseScreen}${tt}0f`:`${Ge.eraseScreen}${tt}3J${tt}H`;Ge.beep=Al;Ge.link=(e,t)=>[Jf,"8",Ch,Ch,t,Al,e,Jf,"8",Ch,Ch,Al].join("");Ge.image=(e,t={})=>{let r=`${Jf}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+Al};Ge.iTerm={setCwd:(e=process.cwd())=>`${Jf}50;CurrentDir=${e}${Al}`,annotation:(e,t={})=>{let r=`${Jf}1337;`,n=typeof t.x<"u",i=typeof t.y<"u";if((n||i)&&!(n&&i&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+Al}};var qT=Ge;var Eh=Ft(YT(),1);function Ka(e,t,{target:r="stdout",...n}={}){return Eh.default[r]?qT.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}Ka.isSupported=Eh.default.stdout;Ka.stderr=(e,t,r={})=>Ka(e,t,{target:"stderr",...r});Ka.stderr.isSupported=Eh.default.stderr;var Tt=({text:e,url:t,subtle:r})=>{let{lite:n}=Yq(Ke);return Y1.createElement(KT,{color:n||r?void 0:"blueBright",bold:!0},Y1.createElement(Kq,{transform:()=>Ka(e,t)},Y1.createElement(KT,null,e)))};function oo(e,t){if(e==null)throw new Error(t||"argument is null");return e}var Xa=class extends Error{constructor(t){super(`Unreachable case: ${t}`)}};var Ja=({env:e,appId:t})=>{let r;switch(e){case"dev":r="https://www.canva-dev.com/developers/app";break;case"staging":r="https://www.canva-staging.com/developers/app";break;case"prod":r="https://www.canva.com/developers/app";break;default:throw new Xa(e)}return t?`${r}/${t}`:`${r}s`},xh=e=>{let t,r=e.appId.toLowerCase();switch(e.env){case"dev":t=`https://app-${r}.canva-apps-dev.com`;break;case"staging":t=`https://app-${r}.canva-apps-staging.com`;break;case"prod":t=`https://app-${r}.canva-apps.com`;break;default:throw new Xa(e.env)}return t};import{useContext as Jq}from"react";import{Text as Zq}from"ink";import Qq from"react";var Bt=e=>{let{lite:t}=Jq(Ke);return Qq.createElement(Zq,{bold:e.bold??!0,color:t?void 0:"cyanBright",italic:e.italic},e.children)};var JT=()=>{let{lite:e}=wt.useContext(Ke);return wt.createElement(Zf,{flexDirection:"column",margin:.5},wt.createElement(Ui,null,wt.createElement(Rt,null,"\u{1F44B} "),wt.createElement(Ui,{bold:!0},"Welcome!")," Let\u2019s bring your Canva app to life."),wt.createElement(Zf,{marginTop:1,flexDirection:"column"},wt.createElement(Zf,{flexDirection:"column"},wt.createElement(Ui,null,"Run ",wt.createElement(Bt,null,"canva apps create")," to create a new app"),wt.createElement(Ui,{dimColor:!0},"By creating an app, you agree to the"," ",wt.createElement(Tt,{url:"https://www.canva.com/policies/canva-developer-terms/",text:"Canva Developer terms"}))),wt.createElement(Zf,{marginTop:1},wt.createElement(Ui,null,"Run ",wt.createElement(Bt,null,"canva apps list")," to view a list of your apps")),wt.createElement(Zf,{borderStyle:e?void 0:"double",borderColor:e?void 0:"cyanBright",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",width:"98%",marginTop:1,marginX:2,paddingX:1},wt.createElement(Ui,{bold:!0},wt.createElement(Rt,null,"\u{1F4A1} "),"Tips"),wt.createElement(Ui,null," ","\u2022 For a list of all commands, run"," ",wt.createElement(Bt,null,"canva --help")),wt.createElement(Ui,null," ","\u2022 View our Developer Documentation"," ",wt.createElement(Tt,{url:"https://canva.dev",text:"Developer Documentation"})," for more information"),wt.createElement(Ui,null," ","\u2022 Examples of all components from"," ",wt.createElement(Ui,{bold:!0},"@canva/app-ui-kit")," are available in the"," ",wt.createElement(Tt,{url:"https://www.canva.dev/docs/apps/app-ui-kit/storybook",text:"App UI Kit Storybook"})))))};var dn="@canva/cli",Rr="0.0.1-beta.6";var tz=e=>{ez(K1.createElement(Ke.Provider,{value:{lite:e.lite}},K1.createElement(pn,{pkg:{name:dn,version:Rr}},K1.createElement(JT,null))))},QT=e=>e.command(["welcome","$0"],"Welcome page",()=>{},t=>{tz(t)});import X1 from"react";import{render as sz}from"ink";import Qf from"react";import{Box as rz,Text as eP}from"ink";var Sh=e=>{let{lite:t}=Qf.useContext(Ke);return Qf.createElement(rz,{borderStyle:t?void 0:"double",borderColor:t?void 0:"cyanBright",display:"flex",justifyContent:"center",alignItems:"center",width:"98%",marginTop:1,marginX:2,paddingX:1},Qf.createElement(eP,{bold:!0},Qf.createElement(Rt,null,"\u{1F4A1}")," Tip:"," "),Qf.createElement(eP,null," "),e.children)};import{Text as jn}from"ink";import it from"react";function nz(e,t){if(e.length===0)throw new Error("Unable to select random element from an empty array.");if(t)return e[t];let r=Math.floor(Math.random()*e.length);return e[r]}var iz=[it.createElement(jn,{key:"ui-kit"},"Use the ",it.createElement(Tt,{text:"@canva/app-ui-kit",url:"https://www.npmjs.com/package/@canva/app-ui-kit"})," ","library to create apps that look and feel like the rest of Canva!"),it.createElement(jn,{key:"dam"},"Building a Digital Asset Management app? checkout the"," ",it.createElement(Bt,{italic:!0},"SearchableListView")," component from"," ",it.createElement(Tt,{text:"@canva/app-components",url:"https://www.npmjs.com/package/@canva/app-components"}),"."),it.createElement(jn,{key:"hmr"},"Enable"," ",it.createElement(Tt,{text:"Hot Module Replacement (HMR)",url:"https://www.canva.dev/docs/apps/previewing-apps/#automatic"})," ","to automatically reload your app inside the Canva editor whenever your source code changes!"),it.createElement(jn,{key:"storybook"},"Examples of all available components from"," ",it.createElement(Tt,{text:"@canva/app-ui-kit",url:"https://www.npmjs.com/package/@canva/app-ui-kit"})," are available in the"," ",it.createElement(Tt,{text:"App UI Kit Storybook",url:"https://www.canva.dev/docs/apps/app-ui-kit/storybook"}),"."),it.createElement(jn,{key:"discourse"},"Sign up to our ",it.createElement(Tt,{text:"Community forum",url:"https://community.canva.dev"})," to be involved in our community and network with fellow App Builders!"),it.createElement(jn,{key:"design-guidelines"},"Checkout our ",it.createElement(Tt,{text:"Design Guidelines",url:"https://www.canva.dev/docs/apps/design-guidelines/"})," ","to ensure your app complies, and help you speed through our app review process!"),it.createElement(jn,{key:"starter-kit"},"Explore the various example apps we have in our"," ",it.createElement(Tt,{text:"Apps SDK Starter Kit",url:"https://github.com/canva-sdks/canva-apps-sdk-starter-kit/tree/main"})," by running the command ",it.createElement(Bt,null,"npm start examples"),"."),it.createElement(jn,{key:"mobile"},"To test your app locally on a mobile device, you need to build your app and upload it as a Javascript bundle in the developer portal. The local development URL won't work when testing on mobile."),it.createElement(jn,{key:"submit"},"Once you're ready to submit your app, run the"," ",it.createElement(Bt,null,"npm run build")," command, to generate a Javascript bundle to upload via the"," ",it.createElement(Tt,{text:"Developer Portal",url:Ja({env:"prod"})}),"."),it.createElement(jn,{key:"getting-featured"},"Want to get featured on the apps marketplace? Checkout this article on"," ",it.createElement(Tt,{text:"how to get featured",url:"https://www.canva.dev/docs/apps/getting-featured/"}),"."),it.createElement(jn,{key:"deep-linking"},"Did you know you can create URLs that link users directly to the Canva editor with your app? To find our more, checkout this article on"," ",it.createElement(Tt,{text:"deep linking",url:"https://www.canva.dev/docs/apps/deep-linking/"}),"."),it.createElement(jn,{key:"docs"},"View our Developer Documentation"," ",it.createElement(Tt,{url:"https://canva.dev",text:"Developer Documentation"})," to learn more about our Canva Developers platform.")],_h=e=>nz(iz,e);var oz=async e=>{let t=await e.argv;sz(X1.createElement(Ke.Provider,{value:{lite:t.lite}},X1.createElement(pn,{pkg:{name:dn,version:Rr}},X1.createElement(Sh,null,_h()))))},tP=e=>e.command(["tip","tips"],"Get a random tip or trick",()=>{oz(e)});import ux from"react";import{render as rX}from"ink";var dr=Ft(pp(),1);import Yh from"node:process";import{Buffer as SH}from"node:buffer";import dL from"node:path";import{fileURLToPath as _H}from"node:url";import bH from"node:child_process";import Pw,{constants as mL}from"node:fs/promises";import aL from"node:process";import oH from"node:os";import aH from"node:fs";import iH from"node:fs";import sL from"node:fs";var Sw;function rH(){try{return sL.statSync("/.dockerenv"),!0}catch{return!1}}function nH(){try{return sL.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function _w(){return Sw===void 0&&(Sw=rH()||nH()),Sw}var bw,sH=()=>{try{return iH.statSync("/run/.containerenv"),!0}catch{return!1}};function $l(){return bw===void 0&&(bw=sH()||_w()),bw}var oL=()=>{if(aL.platform!=="linux")return!1;if(oH.release().toLowerCase().includes("microsoft"))return!$l();try{return aH.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!$l():!1}catch{return!1}},su=aL.env.__IS_WSL_TEST__?oL:oL();function ou(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 wH}from"node:util";import Iw from"node:process";import{execFile as CH}from"node:child_process";import{promisify as uH}from"node:util";import lH from"node:process";import{execFile as cH}from"node:child_process";var fH=uH(cH);async function Ow(){if(lH.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await fH("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 pH from"node:process";import{promisify as dH}from"node:util";import{execFile as mH,execFileSync as yDe}from"node:child_process";var hH=dH(mH);async function uL(e,{humanReadableOutput:t=!0}={}){if(pH.platform!=="darwin")throw new Error("macOS only");let r=t?[]:["-ss"],{stdout:n}=await hH("osascript",["-e",e,r]);return n.trim()}async function Fw(e){return uL(`tell application "Finder" to set app_path to application file id "${e}" as string
519
519
  tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as gH}from"node:util";import{execFile as yH}from"node:child_process";var DH=gH(yH),vH={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"}},Hh=class extends Error{};async function Aw(e=DH){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 Hh(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:n}=r.groups,i=vH[n];if(!i)throw new Hh(`Unknown browser ID: ${n}`);return i}var EH=wH(CH),xH=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function Tw(){if(Iw.platform==="darwin"){let e=await Ow();return{name:await Fw(e),id:e}}if(Iw.platform==="linux"){let{stdout:e}=await EH("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:xH(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(Iw.platform==="win32")return Aw();throw new Error("Only macOS, Linux, and Windows are supported")}var Lw=dL.dirname(_H(import.meta.url)),lL=dL.join(Lw,"xdg-open"),{platform:Wl,arch:cL}=Yh,OH=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let r="/etc/wsl.conf",n=!1;try{await Pw.access(r,mL.F_OK),n=!0}catch{}if(!n)return e;let i=await Pw.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}})(),fL=async(e,t)=>{let r;for(let n of e)try{return await t(n)}catch(i){r=i}throw r},Kh=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return fL(e.app,a=>Kh({...e,app:a}));let{name:t,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(t))return fL(t,a=>Kh({...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 Tw();if(l.id in a){let c=a[l.id];return t==="browserPrivate"&&r.push(u[c]),Kh({...e,app:{name:Gl[c],arguments:r}})}throw new Error(`${l.name} is not supported as a default browser`)}let n,i=[],s={};if(Wl==="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(Wl==="win32"||su&&!$l()&&!t){let a=await OH();n=su?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Yh.env.SYSTEMROOT||Yh.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),su||(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=SH.from(u.join(" "),"utf16le").toString("base64")}else{if(t)n=t;else{let a=!Lw||Lw==="/",u=!1;try{await Pw.access(lL,mL.X_OK),u=!0}catch{}n=Yh.versions.electron??(Wl==="android"||a||!u)?"xdg-open":lL}r.length>0&&i.push(...r),e.wait||(s.stdio="ignore",s.detached=!0)}Wl==="darwin"&&r.length>0&&i.push("--args",...r),e.target&&i.push(e.target);let o=bH.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)},FH=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return Kh({...t,target:e})};function pL(e){if(typeof e=="string"||Array.isArray(e))return e;let{[cL]:t}=e;if(!t)throw new Error(`${cL} is not supported`);return t}function Nw({[Wl]:e},{wsl:t}){if(t&&su)return pL(t);if(!e)throw new Error(`${Wl} is not supported`);return pL(e)}var Gl={};ou(Gl,"chrome",()=>Nw({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"]}}));ou(Gl,"firefox",()=>Nw({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));ou(Gl,"edge",()=>Nw({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));ou(Gl,"browser",()=>"browser");ou(Gl,"browserPrivate",()=>"browserPrivate");var ql=FH;var hL,gL,yL,DL,vL,wL,zt,Rw,Bw,kw,Mw,jw,Vw;wL=[dr.observable],vL=[dr.observable],DL=[dr.observable],yL=[dr.observable],gL=[dr.observable],hL=[dr.observable];var yi=class{constructor(){ai(this,Rw,lt(zt,8,this,"")),lt(zt,11,this);ai(this,Bw,lt(zt,12,this,null)),lt(zt,15,this);ai(this,kw,lt(zt,16,this,!1)),lt(zt,19,this);ai(this,Mw,lt(zt,20,this,null)),lt(zt,23,this);ai(this,jw,lt(zt,24,this,null)),lt(zt,27,this);ai(this,Vw,lt(zt,28,this,!0)),lt(zt,31,this)}};zt=el(null),Rw=new WeakMap,Bw=new WeakMap,kw=new WeakMap,Mw=new WeakMap,jw=new WeakMap,Vw=new WeakMap,ct(zt,4,"codeInput",wL,yi,Rw),ct(zt,4,"codeVerifier",vL,yi,Bw),ct(zt,4,"loginSuccessful",DL,yi,kw),ct(zt,4,"loginUrl",yL,yi,Mw),ct(zt,4,"error",gL,yi,jw),ct(zt,4,"loading",hL,yi,Vw),va(zt,yi);var CL,EL,xL,SL,_L,bL,OL,FL,AL,gi;AL=[dr.action],FL=[dr.action],OL=[dr.action],bL=[dr.action],_L=[dr.action],SL=[dr.action],xL=[dr.action],EL=[dr.action],CL=[dr.action];var Xr=class{constructor(t,r,n=ci){this.services=t;this.onLogin=r;this.delay=n;lt(gi,5,this)}async initLogin(t){if(this.setLoading(t,!0),await this.services.tokenService.isLoggedIn()){this.rerouteOnSuccess(t);return}this.setLoading(t,!1);let{url:n,codeVerifier:i}=this.services.authService.constructAuthUrl();this.setCodeVerifier(t,i),this.setLoginUrl(t,n),await this.delay(1500),ql(n)}setCodeInput(t,r){t.codeInput=r}async handleCodeInput(t){try{let r=t.codeInput.split("&")[0];if(!r){this.exitOnFailure(t,"Invalid input. Please paste the full code.");return}let[n,i]=r.split("=");if(!i||n!=="code"){this.exitOnFailure(t,"Invalid input. Please ensure the code includes the 'code=' prefix.");return}if(!t.codeVerifier){this.exitOnFailure(t,"Failed to generate code verifier.");return}let s=await this.services.tokenService.exchangeCodeForToken({authCode:i,codeVerifier:t.codeVerifier});s.success?this.rerouteOnSuccess(t):this.exitOnFailure(t,s.message)}catch(r){this.exitOnFailure(t,r.message)}}exitOnFailure(t,r){this.setError(t,r),this.delay().then(()=>process.exit(1))}setCodeVerifier(t,r){t.codeVerifier=r}setLoginSuccessful(t,r){t.loginSuccessful=r}setError(t,r){t.error=r}setLoginUrl(t,r){t.loginUrl=r}setLoading(t,r){t.loading=r}rerouteOnSuccess(t){this.setLoading(t,!1),this.setLoginSuccessful(t,!0),this.delay(1500).then(()=>this.onLogin())}};gi=el(null),ct(gi,1,"setCodeInput",AL,Xr),ct(gi,1,"handleCodeInput",FL,Xr),ct(gi,1,"exitOnFailure",OL,Xr),ct(gi,1,"setCodeVerifier",bL,Xr),ct(gi,1,"setLoginSuccessful",_L,Xr),ct(gi,1,"setError",SL,Xr),ct(gi,1,"setLoginUrl",xL,Xr),ct(gi,1,"setLoading",EL,Xr),ct(gi,1,"rerouteOnSuccess",CL,Xr),va(gi,Xr);var ax=Ft(ox(),1);import or from"react";import{Box as ad,Text as xc}from"ink";var L4=(0,ax.observer)(({store:e,presenter:t})=>(or.useEffect(()=>{t.initLogin(e)},[]),e.loading?or.createElement(ad,{marginX:2,marginY:1},or.createElement(Vi,{type:"bouncingBall",label:"Checking login status..."})):e.loginSuccessful?or.createElement(tX,null):or.createElement(eX,{store:e,presenter:t}))),eX=(0,ax.observer)(({store:e,presenter:t})=>or.createElement(ad,{flexDirection:"column",paddingX:2},or.createElement(xc,null,"Let's get you logged in to Canva CLI!"),!!e.loginUrl&&or.createElement(ad,null,or.createElement(xc,{color:"yellow"},"If a browser window didn't open, click"," ",or.createElement(Tt,{text:"here",url:e.loginUrl,subtle:!0}))),or.createElement(ad,{marginY:1},or.createElement(xc,{bold:!0},"Confirmation code: "),or.createElement(xc,null," "),or.createElement(BT,{onChange:r=>t.setCodeInput(e,r),placeholder:"Paste the confirmation code from the web browser then press enter.",onSubmit:()=>t.handleCodeInput(e)})),e.error&&or.createElement(xc,{color:"redBright"},e.error))),tX=()=>or.createElement(ad,{flexDirection:"column",paddingX:2},or.createElement(xc,null,or.createElement(Rt,null,"\u2705")," Successfully logged in!"));var Sc=async(e,t)=>{let r=await t.argv,n={lite:r.lite,dryRun:r.dryRun,debug:r.debug};return t.parse(e,n)};var nX=async({argv:e},t,r)=>{let n=await e,i=()=>{Sc("welcome",t)},s=new yi,o=new Xr(r,i);rX(ux.createElement(Ke.Provider,{value:{lite:n.lite}},ux.createElement(pn,{pkg:{name:dn,version:Rr}},ux.createElement(L4,{store:s,presenter:o}))))},N4=({cli:e,services:t})=>e.command("login","Log in to the Canva CLI",r=>{nX(r,e,t)});import zg from"react";import{render as gQ}from"ink";import Ue from"react";import{Box as Mu,Text as js,useApp as Zx,useInput as lQ}from"ink";import bB from"node:process";var lB=Ft(E6(),1);import{Buffer as qJ}from"node:buffer";import zJ from"node:path";import Ux from"node:child_process";import Lg from"node:process";function Dx(e){let t=typeof e=="string"?`
520
520
  `:10,r=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}import Cg from"node:process";import ud from"node:path";import{fileURLToPath as x6}from"node:url";function wg(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}var IX=({cwd:e=Cg.cwd(),path:t=Cg.env[wg()],preferLocal:r=!0,execPath:n=Cg.execPath,addExecPath:i=!0}={})=>{let s=e instanceof URL?x6(e):e,o=ud.resolve(s),a=[];return r&&TX(a,o),i&&PX(a,n,o),[...a,t].join(ud.delimiter)},TX=(e,t)=>{let r;for(;r!==t;)e.push(ud.join(t,"node_modules/.bin")),r=t,t=ud.resolve(t,"..")},PX=(e,t,r)=>{let n=t instanceof URL?x6(t):t;e.push(ud.resolve(r,n,".."))},S6=({env:e=Cg.env,...t}={})=>{e={...e};let r=wg({env:e});return t.path=e[r],e[r]=IX(t),e};var LX=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let i=Object.getOwnPropertyDescriptor(e,r),s=Object.getOwnPropertyDescriptor(t,r);!NX(i,s)&&n||Object.defineProperty(e,r,s)},NX=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},RX=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},BX=(e,t)=>`/* Wrapped ${e}*/
521
521
  ${t}`,kX=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),MX=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),jX=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,i=BX.bind(null,n,t.toString());Object.defineProperty(i,"name",MX),Object.defineProperty(e,"toString",{...kX,value:i})};function vx(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let i of Reflect.ownKeys(t))LX(e,t,i,r);return RX(e,t),jX(e,t,n),e}var Eg=new WeakMap,_6=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,i=e.displayName||e.name||"<anonymous>",s=function(...o){if(Eg.set(s,++n),n===1)r=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return vx(s,e),Eg.set(s,n),s};_6.callCount=e=>{if(!Eg.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Eg.get(e)};var b6=_6;import KX from"node:process";import{constants as WX}from"node:os";var O6=()=>{let e=A6-F6+1;return Array.from({length:e},VX)},VX=(e,t)=>({name:`SIGRT${t+1}`,number:F6+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),F6=34,A6=64;import{constants as UX}from"node:os";var I6=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var wx=()=>{let e=O6();return[...I6,...e].map($X)},$X=({name:e,number:t,description:r,action:n,forced:i=!1,standard:s})=>{let{signals:{[e]:o}}=UX,a=o!==void 0;return{name:e,number:a?o:t,description:r,supported:a,action:n,forced:i,standard:s}};var GX=()=>{let e=wx();return Object.fromEntries(e.map(qX))},qX=({name:e,number:t,description:r,supported:n,action:i,forced:s,standard:o})=>[e,{name:e,number:t,description:r,supported:n,action:i,forced:s,standard:o}],T6=GX(),zX=()=>{let e=wx(),t=65,r=Array.from({length:t},(n,i)=>HX(i,e));return Object.assign({},...r)},HX=(e,t)=>{let r=YX(e,t);if(r===void 0)return{};let{name:n,description:i,supported:s,action:o,forced:a,standard:u}=r;return{[e]:{name:n,number:e,description:i,supported:s,action:o,forced:a,standard:u}}},YX=(e,t)=>{let r=t.find(({name:n})=>WX.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},Jve=zX();var XX=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${i})`:s!==void 0?`failed with exit code ${s}`:"failed",ld=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:s,command:o,escapedCommand:a,timedOut:u,isCanceled:l,killed:c,parsed:{options:{timeout:f,cwd:p=KX.cwd()}}})=>{s=s===null?void 0:s,i=i===null?void 0:i;let d=i===void 0?void 0:T6[i].description,m=n&&n.code,D=`Command ${XX({timedOut:u,timeout:f,errorCode:m,signal:i,signalDescription:d,exitCode:s,isCanceled:l})}: ${o}`,h=Object.prototype.toString.call(n)==="[object Error]",g=h?`${D}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canva/cli",
3
- "version": "0.0.1-beta.5",
3
+ "version": "0.0.1-beta.6",
4
4
  "description": "The official Canva CLI.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Canva Pty Ltd.",
@@ -23,8 +23,8 @@ export default [
23
23
  },
24
24
  },
25
25
  ],
26
- "formatjs/enforce-description": "error",
27
- "formatjs/enforce-default-message": "error",
26
+ "formatjs/enforce-description": ["error", "literal"],
27
+ "formatjs/enforce-default-message": ["error", "literal"],
28
28
  "formatjs/enforce-placeholders": "error",
29
29
  "formatjs/no-id": "error",
30
30
  "formatjs/no-emoji": "error",
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import * as fs from "fs";
3
+ import * as path from "path";
4
+
5
+ const envPath = path.resolve(__dirname, "..", ".env");
6
+ const templatePath = path.resolve(__dirname, "..", ".env.template");
7
+
8
+ if (!fs.existsSync(envPath)) {
9
+ fs.copyFileSync(templatePath, envPath);
10
+ }
@@ -13,7 +13,8 @@
13
13
  "lint:types": "tsc",
14
14
  "start": "ts-node ./scripts/start/start.ts",
15
15
  "test": "jest --no-cache",
16
- "test:watch": "jest --watchAll"
16
+ "test:watch": "jest --watchAll",
17
+ "postinstall": "ts-node ./scripts/copy-env.ts"
17
18
  },
18
19
  "dependencies": {
19
20
  "@canva/app-components": "^1.0.0-beta.29",
@@ -13,7 +13,8 @@
13
13
  "lint:types": "tsc",
14
14
  "start": "ts-node ./scripts/start/start.ts",
15
15
  "test": "jest --no-cache",
16
- "test:watch": "jest --watchAll"
16
+ "test:watch": "jest --watchAll",
17
+ "postinstall": "ts-node ./scripts/copy-env.ts"
17
18
  },
18
19
  "dependencies": {
19
20
  "@canva/app-i18n-kit": "^1.0.0",
@@ -13,7 +13,8 @@
13
13
  "lint:types": "tsc",
14
14
  "start": "ts-node ./scripts/start/start.ts",
15
15
  "test": "jest --no-cache --passWithNoTests",
16
- "test:watch": "jest --watchAll"
16
+ "test:watch": "jest --watchAll",
17
+ "postinstall": "ts-node ./scripts/copy-env.ts"
17
18
  },
18
19
  "dependencies": {
19
20
  "@canva/app-ui-kit": "^4.2.0",