@salla.sa/cli
Version:
The Official Salla Command Line Interface
2 lines • 1.79 MB
JavaScript
/*! For license information please see index.js.LICENSE.txt */
(()=>{var e={38206:(e,t,n)=>{const r=new(n(27461).Command);e.exports=function(){const e=r.command("app").description(global.content.commands.app.description);return e.command("create").description(global.content.commands.app.create.description).action(n(98300)),e.command("serve").alias("s").description(global.content.commands.app.serve.description).option("-p, --port <name>",global.content.commands.app.serve.options.port).option("-l, --local",global.content.commands.app.serve.options.local).action(n(22842)),e.command("create-webhook").option("-w,--webhook-name <webhook_name>",global.content.commands.app.createWebhook.options.webhook).description(global.content.commands.app.createWebhook.description).action(n(7377)),e.command("delete").alias("d").description(global.content.commands.app.delete.description).action(n(17570)),e.command("list").alias("l").description(global.content.commands.app.list.description).action(n(69669)),e.showSuggestionAfterError(),e.command("info").alias("i").description(global.content.commands.app.info.description).action(n(4058)),e.command("link").alias("k").description(global.content.commands.app.link.description).action(n(48992)),e.command("publish").alias("p").description(global.content.commands.app.publish.description).action(n(1982)),e.showHelpAfterError(!0),e}},21873:(e,t,n)=>{const r=new(n(27461).Command);r.name("salla").usage("[command]").version(global.version).addCommand(n(38206)()).addCommand(n(5168)()).addCommand(n(52126)()).addCommand(n(8872)()).addCommand(n(74034)()).addCommand(n(86223)()),r.configureHelp({sortSubcommands:!0,subcommandTerm:e=>e.name()}),r.exitOverride();try{r.parse(process.argv)}catch(e){if("commander.help"!==e.code)throw 0===e.exitCode&&process.exit(0),e;process.exit(2)}},74034:(e,t,n)=>{const r=new(n(27461).Command);e.exports=function(){const e=r.command("info").description(global.content.commands.info.description).action(n(46466));return e.showHelpAfterError(!0),e}},5168:(e,t,n)=>{const r=new(n(27461).Command);e.exports=function(){return r.command("login").description(global.content.commands.login.description).action(n(26384))}},52126:(e,t,n)=>{const r=new(n(27461).Command);e.exports=function(){return r.command("logout").description(global.content.commands.logout.description).action(n(82808))}},8872:(e,t,n)=>{const{execSync:r}=n(32081),i=new(n(27461).Command);e.exports=function(){const e=i.command("store").description(global.content.commands.store.description);return e.command("create").alias("c").description(global.content.commands.store.create.description).action(n(73963)),e.command("list").alias("l").description(global.content.commands.store.list.description).action(n(37966)),e.showHelpAfterError(!0),e}},86223:(e,t,n)=>{const{execSync:r}=n(32081),i=new(n(27461).Command);e.exports=function(){const e=i.command("theme").description(global.content.commands.theme.description);return e.command("create").alias("c").alias("import").description(global.content.commands.theme.create.description).action(n(75943)),e.command("preview").alias("p").alias("watch").option("-s, --store <store>",global.content.commands.theme.preview.options.store).option("-e,--with-editor",global.content.commands.theme.preview.options.withEditor).option("-eo,--without-editor",global.content.commands.theme.preview.options.withoutEditor).option("-ol,--only-link",global.content.commands.theme.preview.options.onlyLink).option("-b,--browser <browser>",global.content.commands.theme.preview.options.browser,"chrome").description(global.content.commands.theme.preview.description).action(n(16070)),e.command("list").alias("l").description(global.content.commands.theme.list.description).action(n(49460)),e.command("sync",{hidden:!0}).alias("s").description(global.content.commands.theme.sync.description).option("-id,--theme_id <theme_id>",global.content.commands.theme.sync.options.themeId).option("-f,--file <file_path>",global.content.commands.theme.sync.options.themeFilePath).option("-store_id,--store_id <store_id>",global.content.commands.theme.sync.options.storeId).option("-draft_id,--draft_id <draft_id>",global.content.commands.theme.sync.options.draftId).option("-upload_url,--upload_url <upload_url>",global.content.commands.theme.sync.options.uploadUrl).action(n(24925)),e.command("serve",{hidden:!0}).description(global.content.commands.theme.serve.description).option("-p,--port <port>",global.content.commands.theme.serve.options.assetsPort).option("-wsp,--ws_port <ws_port>",global.content.commands.theme.serve.options.wsPort).action(n(39274)),e.command("delete").alias("d").description(global.content.commands.theme.delete.description).action(n(49723)),e.command("publish").alias("s").description(global.content.commands.theme.publish.description).action(n(22215)),e.showHelpAfterError(!0),e}},16381:(e,t,n)=>{n(95687).globalAgent.options.rejectUnauthorized=!1,global.content=n(86403);const r=n(55674),i=n(59738),s=n(71017),o=n(22037);global.DEV_MODE=r.existsSync(__dirname+"/.env"),global.ASSETS_DIR=s.join(__dirname,"assets"),global.UUID="";let a={};r.existsSync(__dirname+"/.env")&&(a=i.parse(r.readFileSync(__dirname+"/.env"))),global.BASE_URL_PARTENRS=a.BASE_URL_PARTENRS||"https://portal.salla.partners",global.BASE_URL=a.BASE_URL||"https://api.salla.dev/partners/v1",global.BASE_URL_API=global.BASE_URL+"/api/",global.WS_ENDPOINT=a.WS_ENDPOINT||"wss://ws.salla.cloud",global.GITHUB_TOKEN=a.GITHUB_TOKEN,global.NGROK_TOKEN=a.NGROK_TOKEN,global.SALLA_SEGMENT_KEY=a.SALLA_SEGMENT_KEY||"LRG60gm2fbheVZT9D6nbnjprkmBXTyOY",global.SALLA_SENTRY_DSN=a.SALLA_SENTRY_DSN||"https://fa8f9d2963f44dd59a726ae9dd296b37@s.salla.dev/26",global.CF_ClIENT_ID=a.CF_ClIENT_ID||"",global.CF_CLIENT_SECRET=a.CF_CLIENT_SECRET||"",global.DEV_LOG=a.LOG&&"false"!==a.LOG,global.NEW_ORG_URL=a.NEW_ORG_URL||"https://github.com/apps/twilightci/installations/new",global.TWILIGHT_GIHTUB_INSTALL=a.TWILIGHT_GIHTUB_INSTALL||"https://github.com/apps/twilightci/installations/new",global.VSCODE_EXTENSION_URL="https://marketplace.visualstudio.com/items?itemName=salla.twilight-vscode-extension",global.CLI_CONFIG_DIR=o.homedir()+"/.salla",global.CLI_CONFIG_FILE=s.join(CLI_CONFIG_DIR,"config.json"),global.ASSETS_PORT=8e3,global.WS_ASSETS_PORT=8001,global.BASE_THEME={url:"https://github.com/SallaApp/theme-raed",org:"SallaApp",repo:"theme-raed"},global.FORBIDDEN_PROJECT_NAMES=["node_modules","src","public"],global.DATABASE_ORM=["Sequelize","Mongoose","TypeORM"],global.DEFAULT_APP_PORT=8081,global.WITH_HEAD=!0,global.PREFFERED_NODE_PACKAGE="npm",r.existsSync(`${__dirname}/package.json`)?global.version=JSON.parse(r.readFileSync(`${__dirname}/package.json`)).version:global.version=JSON.parse(r.readFileSync(`${__dirname}/../package.json`)).version;const c=n(450),l=new(n(54669)),u=new(n(73257)),p=n(46515);global.libs={Logger:c,AuthManager:l,CommandsWrapper:u,InputsManager:p};const h=new(n(35042)),d=new(n(54849)),f=new(n(38265)),m=new(n(7265));global.APIs={SallaAuthApi:h,ThemeAPI:d,AppAPI:f,StoreAPI:m},global.WebSocket=n(8777),global.XMLHttpRequest=n(84844).h,global.beforeExitTasks=[]},86403:e=>{e.exports={global:{version:"Version: {version}",welcome:"Welcome 🤗 to The Official Salla Command Line Interface ..\nmake sure you login to your Salla Account by running: ",bugs:"Support and bugs: https://github.com/SallaApp/Salla-CLI/issues ",docs:"Read the docs: https://github.com/SallaApp/Salla-CLI/ ",offical:"The Official Salla Command Line Interface",happyCodingMessage:"💻 As always, Happy Coding! 💻 ",visitTroubleshootingPage:"Please visit the troubleshooting page https://dev.salla.dev/",submitGithubIssue:"If this error persists, please visit https://github.com/SallaApp/salla-cli/issues and submit an issue.",tryAgain:"Do you want to try again?",loading:"Please Wait ☕️",error:"Oops! There is an error that occured! Please check it.",devMode:"DEV MODE: You are in development mode"},commands:{app:{description:"Start building your New Salla Partners App",create:{description:"Wizard to help you create a new Salla Partners App."},serve:{description:"Serve, test, and view your Salla Partners App.",options:{port:"port to listen to",local:"run it locally without ngrok"}},createWebhook:{description:"Creates a new webhook events file.",options:{webhook:"webhook name"}},delete:{description:"Delete your Salla Partners App locally and remotly ."},list:{description:"List your Salla Partners Apps ."},info:{description:"Show detailed App information."},link:{description:"Link your local project to Salla Partners App ."},publish:{description:"Publish your App to Salla ."}},info:{description:"Display info about your App to track issues."},login:{description:"Login to your Salla Partners account"},logout:{description:"Logout from your Salla Partners account"},store:{description:"Create Demo Stores for testing.",create:{description:"Create a new store ."},list:{description:"List the stores that are linked to your Salla Partners account."}},theme:{description:"Your gateway to creating elegant Salla Themes.",create:{description:"Create a new theme. You can also import a theme."},preview:{description:"Preview the theme being created using a Demo Store as a live environment.",options:{store:"store name/id",withEditor:"Open the theme with salla editor",withoutEditor:"Open the theme without salla editor",onlyLink:"Only get the preview link",browser:"Open the theme with a specific browser"}},list:{description:"List of the themes that are linked to your Salla Partners account."},sync:{description:"Sync theme files",options:{themeId:"Theme Id",themeFilePath:"Theme File Path",storeId:"Store Id",draftId:"Draft Id",uploadUrl:"Upload Url"}},serve:{description:"Serve, test, and view your Salla Theme.",options:{assetsPort:"Assets port",wsPort:"Websocket port"}},delete:{description:"Delete a theme from the themes connected your Salla Partners Account."},publish:{description:"Publish a theme to make it available in the Salla Themes Marketplace."},format:{description:"Format your theme code."}}},apis:{errors:{endpointNotFound:"Oops! The system failed to find endpoint for: {endpoint}",AuthorizationError:"Authorization Error: ",AuthorizationTokenError:"Oops! An invalid authorization token was found. Ensure to run the following command to login properly to Salla: `salla login`"}},app:{appTypes:{public:"Available for all Salla Merchants to download and use.",private:"Privately built apps for integration to larger scaled and individual merchants.",shipping:"Best suitable for shipping companies and delivery services."},global:{errors:{noEnvFile:"Please make sure you type the command in a Salla app project ."}},webhook:{createError:"Please enter a valid webhook name. Example: 'app.installed'",appTypeError:"Oops! couldn't recognize your app type. Ensure that you are inside Salla App Project ."},create:{errors:{appName:"Your app name should be between 10 and 50 characters long for better visibility!",appNameNotAllowed:"Oops! Seems like the App Name, {app_name}, is not allowed to use.\nPlease try creating your Salla App with another name.",appPathExists:"Hmmm! Looks like you already have a project in {app_path}. Please, either delete it and try again or use a different folder name.",appDesc:"Make your description at least 100 characters lengthy and no more than 200 characters long to attract merchants.",appUrl:"Oops! Your App Home Page URL is not in a standard format, HTTP, which could result in merchants not visiting your app's home page website.",appSubmit:"Oops! Something went wrong while submitting your app. Try again later.",appNotSupported:"Hmmm! The Framework selected is not supported ... From the provided list, please choose a valid framework.",appCreate:"Oops! There is an error while creating your App ."},info:{appName:"The app name will be used to create a folder in your project root as well as in your Salla Partners Dashboard,\nso make sure it's unique, easy to understand, and straight-forward.",appDesc:"This description will be used in the Salla Dashboard to help you attract new merchants.\nEnsure that your short description is easy-to-understand by the merchants and non-technical personnel\nas it is the first thing they will see when they visit your app on Salla App Store.",email:"This email will be assoicated with your Salla Partners account.\nIt will also be used to contact you in case of any issues or questions by the Salla Team.",appType:"Salla Partners gives you the option to create your app in three types. Choose the one that suits your needs.",appUrl:"Add your app's home page URL where Salla merchants can learn more about your app's services and more.",appUrlExample:"https://www.example.com",appEasyMode:"Salla in-house authorization where you listen automatically to webhook events.",appCustomMode:"Your custom web page to handle the callback URLs.",appAuthMode:"Choose your app's authorization mode that is supported by Salla. You can either use the easy mode or custom mode.",appExpress:"Express is Fast, unopinionated, minimalist web framework for Node.js",appLaravel:"Laravel is a web application framework with expressive, elegant syntax.",appFramework:"Select your preferred framework to develope your Salla App",appDatabaseORM:"Object-Relational Mapping (ORM) is a technique that lets you query and manipulate data from a database using an object-oriented paradigm. Select your prefred ORM to help you create and manage your database for your Salla App.",initApp:"Initializing your app in Salla.",appCreated:"Your app has been created successfully.",appCreatedDesc:"Hooray! You have successfully created a new Salla app! Please, run the following command to start your app:"},inputs:{selectApp:"Select Your App",addApp:"I Want to Create New Salla Partner App",appName:"App Name",appDesc:"Short Description",email:"Email Address",appType:"App Type",appUrl:"App Homepage URL",appAuthMode:"App Authorization Mode",appEasyMode:"Easy Mode",appCustomMode:"Custom Mode",appFramework:"Select Framework",appExpress:"Express",appLaravel:"Laravel",appDatabaseORM:"App Database ORM"}},delete:{errors:{delete:"Oops! There is an error while deleting your App ."},info:{noAppYet:"👋 You don't have any apps yet, please create one by running the following command: salla app create",confirmDelete:"You won't be able to retrive the App once removed as it will disappear from your view as well!",cancel:"Canceling the deletion!",success:"Your app has been deleted successfully."},inputs:{selectApp:"Select App to Delete :",cancelDelete:"Cancel deletion",confirmDelete:"Are you sure ?"}},info:{errors:{envFile:"SALLA_APP_ID not found in .env file"},info:{loading:"Getting app info ...",appInfo:"App info",appData:"App data",name:"Name",status:"Status",desc:"Description",redirectUrl:"Easy Redirect URL",type:"Type",url:"App URL",appOwner:"App Owner",ownerName:"Owner Name",ownerEmail:"Owner Email"}},link:{info:{success:"App Linked Successfully! You are now able to view your {app_name} info using the `salla app info` command "},inputs:{selectApp:"Select App to Link",cancelSelect:"Cancel Linking App"}},list:{errors:{noApps:"Oops! Something went wrong while fetching your apps from Salla. Please try again later."},info:{loading:"Getting your Salla apps...",noApps:"👋 You don't have any apps yet, please create one by running the following command: salla app create"},inputs:{selectApp:"Select App to Link",cancelSelect:"Cancel Linking App"}},publish:{info:{redirect:"Redirecting you to Salla Publish Page..."}},serve:{errors:{serve:"Oops! There is an error while serving your Salla App .",invalidProject:"Hmmm! This is neither a Laravel nor an Expressjs project! Please try again.",updatewebhookURL:"Oops! Something went wrong while updating webhook URL! Please try again later.",updateURL:"Oops! Something went wrong while updating Redirect URL! Please try again later."},info:{startProject:"Starting your project on PORT:{port} ... ",localURLDesc:"Local URL : http://localhost:{port}",localURL:"http://localhost:{port}",OAuthCallbackURL:"OAuth Callback URL : http://localhost:{port}/oauth/callback/ ",loading:"Starting ngrok. Please hold on ...",remoteURL:"Remote URL : {url} ",webhookRemoteURL:"Webhook Remote URL : {url}/webhook/ ",updateURL:"Hooray! OAuth Callback and Webhook URLs have been updated successfully."}}},login:{errors:{login:"Oops! There is an error logging to Salla. Please try loggin again by running the following command: salla login",connection:"Error getting connection token, Please check your internet connection and try again later .",wsInit:"There's an error initializing the websocket library. Please make sure you have the @salla.sa/websocket package installed.",timeout:"⌛ Timeout reached, please try again."},info:{redirect:"To complete the login process, you will be redirected to your browser to signin with your Salla Partners account.",loadingAuth:"Waiting for authentication ...",welcome:"👋 Hello {name} ! You have landed successfully at Salla CLI 🤓",config:"You can find your configuration file at: {config}"}},logout:{info:{success:"You have been logged out successfully."}},store:{create:{errors:{nameInputError:"Theme name must be between 10 and 50 characters long!",passwordInputError:"Demo Store password must be at least 6 characters long!",createStore:"Oops! An error occured while creating the store."},info:{loading:"Creating your demo store in Salla ...",success:"Your demo store has been created successfully!",demoStoreName:"Demo Store Name: {store_name}",demoStorePassword:"Demo Store Password: {store_password}"},inputs:{name:"Demo Store Name:",password:"Demo Store Password:"}},delete:{errors:{deleteError:"Hmmm! There was an error with deleting your Salla store."},inputs:{selectStore:"Select the store you want to delete:"},info:{loading:"Deleting store {store_name} is in progress..",success:"Theme, {store_name}, is successfully deleted!"}},list:{errors:{listError:"Oops! Something went wrong while retrieving your Salla stores. Please try again."},info:{loading:"Getting stores is in progress ...",noStores:"You don't have any stores yet. Create one by executing the following command: `salla store create`"}}},info:{info:{head:"Salla info"}},helpers:{createWebhook:{info:{usage:"Usage : salla create-webhook {event.name}",success:"Hooray! Your Webhook is created successfully {path}"},errors:{sameName:"Oops! An error occured. you already have the webhook action file for this event. Please enter a different webhook name. Example: 'app.installed'",createError:"Oops! An error occured. Please enter the Webhook name you want to create. Example: 'app.installed'. Look up https://docs.salla.dev for detailed list of supported webhook events.",notFound:"Oops! Something went wrong while creating the webhook. Please try again later.",vaildName:"Oops! An error occured. Please enter a valid webhook name. Example: 'app.installed'",getLastCommitId:"Oops! Something went wrong while getting the last commit id. Please try again later."}},app:{createProject:"Creating the Project's Folder ...",clone:"Initializing the Project ...",createEnv:"Creating .env file ...",execNpm:"Installing Project dependencies with {package} ...",composerInstall:"Installing composer packages ....",generateApp:"Generating the App Key ...."},theme:{redirected:"You have been redirected...",noAccess:"Salla doesn't have enough access.\nTo continue,please change the access to all repositories in the Salla GitHub app.",linkWarn:"Please link your GitHub account before using theme commands.",inputs:{linkAccDesc:"Listed below are the GitHub accounts linked with your Salla Partners account ",addNewOrg:"Add New Organization",selectLinkedAcc:"Choose from linked accounts",changeAccess:"Do you want to change it now ?",linkGithubAccount:"Your account is not linked to GitHub. Want to link it right away?"},loadingInstallations:"Getting gitHub installations",wsServerError:"Websocket client connection error: ",assetsServerStarted:"Hooray! WebSocket & Assets servers are currently running.",assetsServerClose:"[Server Closed]",errorAssetsServer:"Oops! The following message says: ",waitingForChanges:"[😌 Waiting For Changes]",portInUse:"Oops! The Port {port} is already in use. Please close the process or change the port number.",checks:{info:{linked:"The theme folder is linked to GitHub repository.",remoteURL:"Remote repo URL: {url}",localURL:"Local repo URL: {url}",loadingGithubRepo:"Checking if the theme folder is linked to the GitHub repository ...",themeExists:"Theme ID exists.",loadingThemeId:"Checking Theme ID ...",githubLinked:"Github account is linked.",info:"run checks: ",loadingTwilightJson:"Checking twilight.json ...",succTwilight:"twilight.json was found.",loadingGithubLinked:"Checking if a GitHub account is linked..."},errors:{abort:"Aborting! You have to re-import the theme again using `salla theme create` command.",themeURLdiff:"Theme folder repository URL is not the same as remote github repository.",themeNotLinked:"The theme folder is not linked to GitHub repository.",noThemeInfo:"Error getting theme info",noThemeIdThrow:"Oops! Theme ID doesn't exist in your developer account,or we don't have access to your theme in github.\nYou have to re-import the theme again using `salla theme create` command.",noThemeId:"Theme ID's not exists.",notLinked:"Github account is not linked.",noTwilight:"Oops! twilight.json doesn't exist. make sure you are inside the theme folder.",noGithubLinked:"Github account is not linked."},inputs:{tryLinkAgain:"Please link your GitHub account and try again.",accoountLinked:"Your account is not linked with GitHub profile. Do you want to link it?"}}},funcs:{inputs:{commitDefault:"New Changes",commit:"Commit message:",changedFiles:"Please, commit the changes before requesting Theme Preview. Shall the CLI commit those changes?"},info:{successfulCommit:"Changes committed successfully",changedFiles:"The CLI detected certain changes in some files",folderCreated:"The folder ({folderName}) has been created successfully.",cloneLoading:"Cloning Repo in progress...",installVscodeExtension:"Do you want to install twilight-vscode-extension to vscode \nand improve your productivity ?",changedFilesWarning:"Your last changes in *.twig/*.json files will not be reflected in the preview."},errors:{errorCommit:"Oops! The CLI failed to commit the changes Try again later.",diffSummary:"Oops! The CLI failed to read diff summary. Please try again later.",folderCreated:"Oops! The folder, ({folderName}), does already exist in this directory! Please try another name.",initWS:"There's an error initializing the websocket library. Please make sure you have the @salla.sa/websocket package installed."}}},libs:{errors:{notVaild:"Hmmm! {name} is not valid! Please try again.",runningError:"Hmmm! An error occured while running : {msg}!",notInstalled:"Oops! The following Command {name} has not been found.",sameVersion:"Hmmm! The {name} version must be {command_version} or newer. Your version is {version}, please either please update or install it manually.",assetsServer:"The local server assets is closed: ",fetchingCategories:"Oops! Something went wrong while fetching categories. Please try again later.",fetchingStores:"Oops! Something went wrong while fetching your demo stores from Salla. Please try again later.",fetchingThemes:"Oops! Something went wrong while fetching your themes from Salla. Please try again later.",invalidToken:"Oops! Authentication failed. Now trying to get you to log in ..",configError:"Oops! Something went wrong while writing config file: "},info:{atleastOne:"You must select at least one option",checkingNodeVersion:"🔍 Looking up Node's Version.",installed:"Hooray! The following Command {name} has been found.",selectCategories:"Below are the categories ..\nYou need to select at least one category.",listCategoriesLoading:"Getting categories is in progress ...",listCategories:"Getting theme categories from Salla ...",selectStores:"Listed below are the stores assoicated with your Salla Partners account ..\nYou can either select an existing store or create a new store in simple steps",listStoresLoading:"Getting stores is in progress ...",listStores:"Getting your demo stores from your account...",selectThemes:"Listed below are the themes assoicated with your Salla Partners account ..\nYou can either select an existing theme or create a new theme in simple steps",noThemes:"You don't have any themes yet. Create one by executing the following command: `salla theme create`",listThemesLoading:"Getting themes ...",listThemes:"Getting your Salla themes...",selectApps:"Listed below are the apps assoicated with your Salla Partners account ..\nYou can either select an existing app or create a new app in simple steps",checkingAccess:"Checking access token ..."},inputs:{select:" (use space key to select)",enterLine:"Enter line (type e to end)",useArrows:" "}},theme:{create:{info:{changeRepo:"Change directories to the theme folder using the command `cd {theme_name}` and run `salla theme preview` which requests theme preview.",requestPreview:"Requesting theme preview ...",installPackages:"Running {pkg} install...",createSuccess:"Theme, {theme_name}, is created successfully.",selectRepo:"Listed below are the GitHub repos assoicated with your Salla Partners account ",themeAuthorEmail:"Your Salla Partners account will be linked to this email address. It will be used to contact you as well.",themeURL:"Add the URL to your theme's home page so Salla merchants may learn more about your theme's features.",themeDesc:"Write detailed description about the Theme",startThemeDesc:"Welcome to Salla's Theme Engine Manager"},errors:{create:"Oops! An error occured while creating/importing the Theme.",installPackages:"Oops! Something went wrong while installing packages.",checkRepo:"Please check if you have git installed on your machine and make sure you are logged in to your github account",createTheme:"Oops! An error occured while making the request to create the Theme.",themeURL:"Oops! Your App Home Page URL is not in HTTP format, which may cause merchant issues.",themeDesc:"Theme description must be at least 50 characters and less than 200 characters long!",themeName:"Theme name must be between 10 and 50 characters long!"},inputs:{selectRepo:"Select from the following repositories:",themeAuthorEmail:"Author's Email Address:",themeURL:"Enter the theme's URL",startTheme:"Start a new theme",createTheme:"Create a new theme",importTheme:"Import a theme",themeName:"Theme Name:",themeDesc:"Theme Description (optional) :",selectThemeType:"Select a theme type",storeTheme:"Store Theme",landingPageTheme:"Landing Page Theme"}},delete:{info:{success:"Theme, {theme_name}, is successfully deleted!",loading:"Deleting theme {theme_name} is in progress.."},errors:{delete:"Hmmm! There was an error with deleting your Salla theme. Please try again."},inputs:{select:"Select the theme you want to delete:"}},list:{info:{noThemes:"You don't yet have any themes. Please create one by executing the following command:",listLoading:"Getting themes is in progress ...",list:"Getting your Salla themes..."},errors:{list:"Oops! Something went wrong while retrieving your Salla themes. Please try again."}},preview:{inputs:{openEditor:"Do you want to open the theme in the editor?",selectStore:"Select the store you want to install the theme on:"},info:{watching:"Watching files is in progress ...",wsURL:"Live reload URL : ws://localhost:{port}",assetsURL:"Assets URL : http://localhost:{port}",assets:"Creating a local server to serve assets ...",preview:"Preview URL: {url}",withEditor:"You can skip this question by adding --with-editor",withoutEditor:"You can skip this question by adding --without-editor"},errors:{storeNotFound:"Oops! The store with name/id : `{store_name}` not found.",failPreview:"The CLI failed to request preview for the Theme. Try again later.",failServer:"Failed to start the local server. Please try again later.",noStores:"You don't have any stores yet. we will create one for you",nodeModulesNotFound:"Oops! The node_modules folder is not found. Please run `npm install`"}},publish:{info:{pending:"Pending ...",published:"Hooray! Your Theme is under review.",descPublish:"Your publication request is currently under review by Salla Team. You will be notified via email when your request is confirmed. \nPlease note that your theme is now in ready-only mode. To edit your theme, withdraw your request.",publish:"Publishing your theme to Themes Marketplace ...",build:"The build is in progress.",changeLogArDesc:"Describe in Arabic the new features or updates to the Theme.",changeLogEnDesc:"Describe in English the new features or updates to the Theme.",discountPriceDesc:"The Price before discount must be less than them price.",priceDesc:"The theme price is in SAR, which will be displayed in the marketplace.",checkLoading:"Checking requirements...",checking:"Twilight CI Checking URL : "},errors:{failPublish:"Oops! Failed to publish your theme. Please check the github repository.",request:"Can't process the request at the moment.",publishGithub:"for more detail you can go to following link {url} to review the issues",publish:"Failed to publish your theme: ",changeLogAr:"The Theme change log in Arabic field must be at least 25 characters",changeLogEn:"The theme change log in the English field must be at least 25 characters.",discountPrice:"The Price before discount field must be between Price and 99,999.",inputPrice:"The price of the theme must range from 150 SAR to 99,999 SAR.",price:"Please provide a price for your theme.",chooseScreenshots:"Please choose at least one category for your theme.",screenshots:"Please add screenshots to your theme from {path}"},inputs:{build:"Would you like to build your theme first before publishing it on the Themes Marketplace?",changeLogAr:"Change Log (AR)",changeLogEn:"Change Log (EN)",discountPrice:"Enter the price before the discount (SAR)",discount:"Do you offer a discount of your Theme?",price:"Theme Price (SAR)",categories:"Select the Theme's Categories"}},sync:{info:{success:"Hooray! The file ({path}) is synced successfully ...",syncing:"Syncing files in progress ..."},errors:{syncing:"Oops! The system failed to sync: ({file}) to the theme: {theme_id} Please try again.",fileSize:"Oops! The file ({path}) is larger than 500 KB. Please try again with a smaller size.",fileNotFound:"Oops! Unfortunately, {file} doesn't exist. Please try again.",file:"Oops! Unfortunately, the file was not received. Please try again.",draftId:"Opos! You need to specify a valid draft ID, as the theme_id didn't pass! Please try again."}}}}},90594:(e,t,n)=>{n(16381),n(92348),n(55674),(async()=>{if(process.argv.includes("--nohead")?(global.WITH_HEAD=!1,process.argv.splice(process.argv.indexOf("--nohead"),1)):process.argv.includes("sync")||process.argv.includes("info")?global.WITH_HEAD=!1:await global.libs.Logger.printHead(null,global.version),global.libs.AuthManager.isConfigValid()){let e=await global.libs.AuthManager.getConfigFile();global.UUID=e.uuid||""}else global.libs.Logger.showHeadWithWelcomeMessage();n(51575),n(21873)})()},21513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(53593))},53593:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(57147),s=r(n(67993)).default("@kwsites/file-exists");t.exists=function(e,n=t.READABLE){return function(e,t,n){s("checking %s",e);try{const r=i.statSync(e);return r.isFile()&&t?(s("[OK] path represents a file"),!0):r.isDirectory()&&n?(s("[OK] path represents a directory"),!0):(s("[FAIL] path represents something other than a file or directory"),!1)}catch(e){if("ENOENT"===e.code)return s("[FAIL] path is not accessible: %o",e),!1;throw s("[FATAL] %o",e),e}}(e,(n&t.FILE)>0,(n&t.FOLDER)>0)},t.FILE=1,t.FOLDER=2,t.READABLE=t.FILE+t.FOLDER},33079:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(47302)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},47302:(e,t,n)=>{e.exports=function(e){function t(e){let n,i,s,o=null;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),s=i-(n||i);r.diff=s,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";o++;const s=t.formatters[i];if("function"==typeof s){const t=e[o];n=s.call(r,t),e.splice(o,1),o--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=n(86823),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},67993:(e,t,n)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(33079):e.exports=n(42156)},42156:(e,t,n)=>{const r=n(76224),i=n(73837);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(i.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),s=` ${i};1m${r} [0m`;n[0]=s+n[0].split("\n").join("\n"+s),n.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=i.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(92130);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(47302)(t);const{formatters:s}=e.exports;s.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},s.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}},86823:e=>{var t=1e3,n=60*t,r=60*n,i=24*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,o){o=o||{};var a,c,l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var o=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*i;case"hours":case"hour":case"hrs":case"hr":case"h":return o*r;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(e);if("number"===l&&isFinite(e))return o.long?(a=e,(c=Math.abs(a))>=i?s(a,c,i,"day"):c>=r?s(a,c,r,"hour"):c>=n?s(a,c,n,"minute"):c>=t?s(a,c,t,"second"):a+" ms"):function(e){var s=Math.abs(e);return s>=i?Math.round(e/i)+"d":s>=r?Math.round(e/r)+"h":s>=n?Math.round(e/n)+"m":s>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},12443:(e,t)=>{"use strict";function n(){let e,t,n="pending";return{promise:new Promise(((n,r)=>{e=n,t=r})),done(t){"pending"===n&&(n="resolved",e(t))},fail(e){"pending"===n&&(n="rejected",t(e))},get fulfilled(){return"pending"!==n},get status(){return n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferred=t.deferred=void 0,t.deferred=n,t.createDeferred=n,t.default=n},51636:()=>{var e,t={exports:{}};e=t,function(t){var n=Object.hasOwnProperty,r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i="object"==typeof process&&"function"==typeof process.nextTick,s="function"==typeof Symbol,o="object"==typeof Reflect,a="function"==typeof setImmediate?setImmediate:setTimeout,c=s?o&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function l(){this._events={},this._conf&&u.call(this,this._conf)}function u(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==t&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(e,t){var n="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var r=new Error(n);r.name="MaxListenersExceededWarning",r.emitter=this,r.count=e,process.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var h=function(e,t,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,n];default:for(var i=new Array(r);r--;)i[r]=arguments[r];return i}};function d(e,n){for(var r={},i=e.length,s=n?n.length:0,o=0;o<i;o++)r[e[o]]=o<s?n[o]:t;return r}function f(e,t,n){var r,i;if(this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(r=n.on,i=n.off),t.addEventListener?(r=t.addEventListener,i=t.removeEventListener):t.addListener?(r=t.addListener,i=t.removeListener):t.on&&(r=t.on,i=t.off),!r&&!i)throw Error("target does not implement any known event API");if("function"!=typeof r)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=r,this._off=i;var s=e._observers;s?s.push(this):e._observers=[this]}function m(e,r,i,s){var o=Object.assign({},r);if(!e)return o;if("object"!=typeof e)throw TypeError("options must be an object");var a,c,l,u=Object.keys(e),p=u.length;function h(e){throw Error('Invalid "'+a+'" option value'+(e?". Reason: "+e:""))}for(var d=0;d<p;d++){if(a=u[d],!s&&!n.call(r,a))throw Error('Unknown "'+a+'" option');(c=e[a])!==t&&(l=i[a],o[a]=l?l(c,h):c)}return o}function g(e,t){return"function"==typeof e&&e.hasOwnProperty("prototype")||t("value must be a constructor"),e}function b(e){var t="value must be type of "+e.join("|"),n=e.length,r=e[0],i=e[1];return 1===n?function(e,n){if(typeof e===r)return e;n(t)}:2===n?function(e,n){var s=typeof e;if(s===r||s===i)return e;n(t)}:function(r,i){for(var s=typeof r,o=n;o-- >0;)if(s===e[o])return r;i(t)}}Object.assign(f.prototype,{subscribe:function(e,t,n){var r=this,i=this._target,s=this._emitter,o=this._listeners,a=function(){var r=h.apply(null,arguments),o={data:r,name:t,original:e};if(n){var a=n.call(i,o);!1!==a&&s.emit.apply(s,[o.name].concat(r))}else s.emit.apply(s,[t].concat(r))};if(o[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,s._newListener&&s._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===t&&null===o[e]&&(o[e]=a,r._on.call(i,e,a))},s.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===t&&!s.hasListeners(n)&&o[e]&&(o[e]=null,r._off.call(i,e,a))},o[e]=null,s.on("removeListener",this._onRemoveListener)):(o[e]=a,r._on.call(i,e,a))},unsubscribe:function(e){var t,n,r,i=this,s=this._listeners,o=this._emitter,a=this._off,l=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function u(){i._onNewListener&&(o.off("newListener",i._onNewListener),o.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=x.call(o,i);o._observers.splice(e,1)}if(e){if(!(t=s[e]))return;a.call(l,e,t),delete s[e],--this._listenersCount||u()}else{for(r=(n=c(s)).length;r-- >0;)e=n[r],a.call(l,e,s[e]);this._listeners={},this._listenersCount=0,u()}}});var v=b(["function"]),y=b(["object","function"]);function _(e,t,n){var r,i,s,o=0,a=new e((function(c,l,u){function p(){i&&(i=null),o&&(clearTimeout(o),o=0)}n=m(n,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),r=!n.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof u;var h=function(e){p(),c(e)},d=function(e){p(),l(e)};r?t(h,d,u):(i=[function(e){d(e||Error("canceled"))}],t(h,d,(function(e){if(s)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),s=!0),n.timeout>0&&(o=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",o=0,a.cancel(e),l(e)}),n.timeout))}));return r||(a.cancel=function(e){if(i){for(var t=i.length,n=1;n<t;n++)i[n](e);i[0](e),i=null}}),a}function x(e){var t=this._observers;if(!t)return-1;for(var n=t.length,r=0;r<n;r++)if(t[r]._target===e)return r;return-1}function w(e,t,n,r,i){if(!n)return null;if(0===r){var s=typeof t;if("string"===s){var o,a,l=0,u=0,p=this.delimiter,h=p.length;if(-1!==(a=t.indexOf(p))){o=new Array(5);do{o[l++]=t.slice(u,a),u=a+h}while(-1!==(a=t.indexOf(p,u)));o[l++]=t.slice(u),t=o,i=l}else t=[t],i=1}else"object"===s?i=t.length:(t=[t],i=1)}var d,f,m,g,b,v,y,_=null,x=t[r],E=t[r+1];if(r===i)n._listeners&&("function"==typeof n._listeners?(e&&e.push(n._listeners),_=[n]):(e&&e.push.apply(e,n._listeners),_=[n]));else{if("*"===x){for(a=(v=c(n)).length;a-- >0;)"_listeners"!==(d=v[a])&&(y=w(e,t,n[d],r+1,i))&&(_?_.push.apply(_,y):_=y);return _}if("**"===x){for((b=r+1===i||r+2===i&&"*"===E)&&n._listeners&&(_=w(e,t,n,i,i)),a=(v=c(n)).length;a-- >0;)"_listeners"!==(d=v[a])&&("*"===d||"**"===d?(n[d]._listeners&&!b&&(y=w(e,t,n[d],i,i))&&(_?_.push.apply(_,y):_=y),y=w(e,t,n[d],r,i)):y=w(e,t,n[d],d===E?r+2:r,i),y&&(_?_.push.apply(_,y):_=y));return _}n[x]&&(_=w(e,t,n[x],r+1,i))}if((f=n["*"])&&w(e,t,f,r+1,i),m=n["**"])if(r<i)for(m._listeners&&w(e,t,m,i,i),a=(v=c(m)).length;a-- >0;)"_listeners"!==(d=v[a])&&(d===E?w(e,t,m[d],r+2,i):d===x?w(e,t,m[d],r+1,i):((g={})[d]=m[d],w(e,t,{"**":g},r+1,i)));else m._listeners?w(e,t,m,i,i):m["*"]&&m["*"]._listeners&&w(e,t,m["*"],i,i);return _}function E(e,t,n){var r,i,s=0,o=0,a=this.delimiter,c=a.length;if("string"==typeof e)if(-1!==(r=e.indexOf(a))){i=new Array(5);do{i[s++]=e.slice(o,r),o=r+c}while(-1!==(r=e.indexOf(a,o)));i[s++]=e.slice(o)}else i=[e],s=1;else i=e,s=e.length;if(s>1)for(r=0;r+1<s;r++)if("**"===i[r]&&"**"===i[r+1])return;var l,u=this.listenerTree;for(r=0;r<s;r++)if(u=u[l=i[r]]||(u[l]={}),r===s-1)return u._listeners?("function"==typeof u._listeners&&(u._listeners=[u._listeners]),n?u._listeners.unshift(t):u._listeners.push(t),!u._listeners.warned&&this._maxListeners>0&&u._listeners.length>this._maxListeners&&(u._listeners.warned=!0,p.call(this,u._listeners.length,l))):u._listeners=t,!0;return!0}function S(e,t,n,r){for(var i,s,o,a,l=c(e),u=l.length,p=e._listeners;u-- >0;)i=e[s=l[u]],o="_listeners"===s?n:n?n.concat(s):[s],a=r||"symbol"==typeof s,p&&t.push(a?o:o.join(this.delimiter)),"object"==typeof i&&S.call(this,i,t,o,a);return t}function O(e){for(var t,n,r,i=c(e),s=i.length;s-- >0;)(t=e[n=i[s]])&&(r=!0,"_listeners"===n||O(t)||delete e[n]);return r}function k(e,t,n){this.emitter=e,this.event=t,this.listener=n}function C(e,n,r){if(!0===r)o=!0;else if(!1===r)s=!0;else{if(!r||"object"!=typeof r)throw TypeError("options should be an object or true");var s=r.async,o=r.promisify,c=r.nextTick,l=r.objectify}if(s||c||o){var u=n,p=n._origin||n;if(c&&!i)throw Error("process.nextTick is not supported");o===t&&(o="AsyncFunction"===n.constructor.name),n=function(){var e=arguments,t=this,n=this.event;return o?c?Promise.resolve():new Promise((function(e){a(e)})).then((function(){return t.event=n,u.apply(t,e)})):(c?process.nextTick:a)((function(){t.event=n,u.apply(t,e)}))},n._async=!0,n._origin=p}return[n,l?new k(this,e,n):this]}function D(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,u.call(this,e)}k.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},D.EventEmitter2=D,D.prototype.listenTo=function(e,n,i){if("object"!=typeof e)throw TypeError("target musts be an object");var s=this;function o(t){if("object"!=typeof t)throw TypeError("events must be an object");var n,r=i.reducers,o=x.call(s,e);n=-1===o?new f(s,e,i):s._observers[o];for(var a,l=c(t),u=l.length,p="function"==typeof r,h=0;h<u;h++)a=l[h],n.subscribe(a,t[a]||a,p?r:r&&r[a])}return i=m(i,{on:t,off:t,reducers:t},{on:v,off:v,reducers:y}),r(n)?o(d(n)):o("string"==typeof n?d(n.split(/\s+/)):n),this},D.prototype.stopListeningTo=function(e,t){var n=this._observers;if(!n)return!1;var r,i=n.length,s=!1;if(e&&"object"!=typeof e)throw TypeError("target should be an object");for(;i-- >0;)r=n[i],e&&r._target!==e||(r.unsubscribe(t),s=!0);return s},D.prototype.delimiter=".",D.prototype.setMaxListeners=function(e){e!==t&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},D.prototype.getMaxListeners=function(){return this._maxListeners},D.prototype.event="",D.prototype.once=functi