'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(window.CodeMirror)})(function(e){e.defineMode("powershell",function(){function e(a,b){b=b||{};var c=void 0!==b.prefix?b.prefix:"^";b=void 0!==b.suffix?b.suffix:"\\b";for(var d=0;d<a.length;d++)a[d]=a[d]instanceof RegExp?a[d].source:a[d].replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new RegExp(c+"("+a.join("|")+")"+
b,"i")}function f(a,b){var c=b.returnStack[b.returnStack.length-1];if(c&&c.shouldReturnFrom(b))return b.tokenize=c.tokenize,b.returnStack.pop(),b.tokenize(a,b);if(a.eatSpace())return null;if(a.eat("("))return b.bracketNesting+=1,"punctuation";if(a.eat(")"))return--b.bracketNesting,"punctuation";for(var d in n)if(a.match(n[d]))return d;c=a.next();if("'"===c){a:{for(;null!=(c=a.peek());)if(a.next(),"'"===c&&!a.eat("'")){b.tokenize=f;a="string";break a}a="error"}return a}if("$"===c)return h(a,b);if('"'===
c)return p(a,b);if("<"===c&&a.eat("#"))return b.tokenize=q,q(a,b);if("#"===c)return a.skipToEnd(),"comment";if("@"===c){if((c=a.eat(/["']/))&&a.eol())return b.tokenize=g,b.startQuote=c[0],g(a,b);if(!a.eol()){if(a.peek().match(/[({]/))return"punctuation";if(a.peek().match(k))return h(a,b)}}return"error"}function p(a,b){for(var c;null!=(c=a.peek());){if("$"===c)return b.tokenize=u,"string";a.next();if("`"===c)a.next();else if('"'===c&&!a.eat('"'))return b.tokenize=f,"string"}return"error"}function u(a,
b){return r(a,b,p)}function v(a,b){b.tokenize=g;b.startQuote='"';return g(a,b)}function w(a,b){return r(a,b,v)}function r(a,b,c){if(a.match("$(")){var d=b.bracketNesting;b.returnStack.push({shouldReturnFrom:function(a){return a.bracketNesting===d},tokenize:c});b.tokenize=f;b.bracketNesting+=1;return"punctuation"}a.next();b.returnStack.push({shouldReturnFrom:function(){return!0},tokenize:c});b.tokenize=h;return b.tokenize(a,b)}function q(a,b){for(var c=!1,d;null!=(d=a.next());){if(c&&">"==d){b.tokenize=
f;break}c="#"===d}return"comment"}function h(a,b){var c=a.peek();if(a.eat("{"))return b.tokenize=t,t(a,b);if(void 0!=c&&c.match(k))return a.eatWhile(k),b.tokenize=f,"variable-2";b.tokenize=f;return"error"}function t(a,b){for(var c;null!=(c=a.next());)if("}"===c){b.tokenize=f;break}return"variable-2"}function g(a,b){var c=b.startQuote;if(a.sol()&&a.match(new RegExp(c+"@")))b.tokenize=f;else if('"'===c)for(;!a.eol();){c=a.peek();if("$"===c){b.tokenize=w;break}a.next();"`"===c&&a.next()}else a.skipToEnd();
return"string"}var k=/[\w\-:]/,x=e([/begin|break|catch|continue|data|default|do|dynamicparam/,/else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/,/param|process|return|switch|throw|trap|try|until|where|while/],{suffix:"(?=[^A-Za-z\\d\\-_]|$)"}),l=e(["f",/b?not/,/[ic]?split/,"join",/is(not)?/,"as",/[ic]?(eq|ne|[gl][te])/,/[ic]?(not)?(like|match|contains)/,/[ic]?replace/,/b?(and|or|xor)/],{prefix:"-"});l=e([l,/[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/],{suffix:""});var m=
e([/Add-(Computer|Content|History|Member|PSSnapin|Type)/,/Checkpoint-Computer/,/Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,/Compare-Object/,/Complete-Transaction/,/Connect-PSSession/,/ConvertFrom-(Csv|Json|SecureString|StringData)/,/Convert-Path/,/ConvertTo-(Csv|Html|Json|SecureString|Xml)/,/Copy-Item(Property)?/,/Debug-Process/,/Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,/Disconnect-PSSession/,/Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,
/(Enter|Exit)-PSSession/,/Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,/ForEach-Object/,/Format-(Custom|List|Table|Wide)/,/Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)/,
/Group-Object/,/Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,/ImportSystemModules/,/Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,/Join-Path/,/Limit-EventLog/,/Measure-(Command|Object)/,/Move-Item(Property)?/,/New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)/,/Out-(Default|File|GridView|Host|Null|Printer|String)/,
/Pause/,/(Pop|Push)-Location/,/Read-Host/,/Receive-(Job|PSSession)/,/Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,/Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,/Rename-(Computer|Item(Property)?)/,/Reset-ComputerMachinePassword/,/Resolve-Path/,/Restart-(Computer|Service)/,/Restore-Computer/,/Resume-(Job|Service)/,/Save-Help/,/Select-(Object|String|Xml)/,/Send-MailMessage/,/Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)/,
/Show-(Command|ControlPanelItem|EventLog)/,/Sort-Object/,/Split-Path/,/Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,/Stop-(Computer|Job|Process|Service|Transcript)/,/Suspend-(Job|Service)/,/TabExpansion2/,/Tee-Object/,/Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,/Trace-Command/,/Unblock-File/,/Undo-Transaction/,/Unregister-(Event|PSSessionConfiguration)/,/Update-(FormatData|Help|List|TypeData)/,/Use-Transaction/,/Wait-(Event|Job|Process)/,/Where-Object/,
/Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,/cd|help|mkdir|more|oss|prompt/,/ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,/echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,/group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,/measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,
/rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,/sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/],{prefix:"",suffix:""}),y=e([/[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,/FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,/MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,
/PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,/PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,/WarningPreference|WhatIfPreference/,/Event|EventArgs|EventSubscriber|Sender/,/Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,/true|false|null/],{prefix:"\\$",suffix:""});m=e([/[A-Z]:|%|\?/i,m,y],{suffix:"(?=[^A-Za-z\\d\\-_]|$)"});var n={keyword:x,
number:/^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i,operator:l,builtin:m,punctuation:/[\[\]{},;`\.]|@[({]/,identifier:/^[A-Za-z_][A-Za-z\-_\d]*\b/};return{startState:function(){return{returnStack:[],bracketNesting:0,tokenize:f}},token:function(a,b){return b.tokenize(a,b)},blockCommentStart:"<#",blockCommentEnd:"#>",lineComment:"#",fold:"brace"}});e.defineMIME("application/x-powershell","powershell")});
