code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
$elm$core$Result$Err = function (a) { return {$: 'Err', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Result$Err
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Result$Ok = function (a) { return {$: 'Ok', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Result$Ok
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$json$Json$Decode$OneOf = function (a) { return {$: 'OneOf', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$json$Json$Decode$OneOf
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Maybe$Just = function (a) { return {$: 'Just', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Maybe$Just
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$json$Json$Decode$indent = function (str) { return A2( $elm$core$String$join, '\n ', A2($elm$core$String$split, '\n', str)); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$json$Json$Decode$indent
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$List$length = function (xs) { return A3( $elm$core$List$foldl, F2( function (_v0, i) { return i + 1; }), 0, xs); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$List$length
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Char$isLower = function (_char) { var code = $elm$core$Char$toCode(_char); return (97 <= code) && (code <= 122); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Char$isLower
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Char$isUpper = function (_char) { var code = $elm$core$Char$toCode(_char); return (code <= 90) && (65 <= code); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Char$isUpper
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Char$isAlpha = function (_char) { return $elm$core$Char$isLower(_char) || $elm$core$Char$isUpper(_char); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Char$isAlpha
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Char$isDigit = function (_char) { var code = $elm$core$Char$toCode(_char); return (code <= 57) && (48 <= code); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Char$isDigit
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Char$isAlphaNum = function (_char) { return $elm$core$Char$isLower(_char) || ($elm$core$Char$isUpper(_char) || $elm$core$Char$isDigit(_char)); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Char$isAlphaNum
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$List$reverse = function (list) { return A3($elm$core$List$foldl, $elm$core$List$cons, _List_Nil, list); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$List$reverse
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$json$Json$Decode$errorToString = function (error) { return A2($elm$json$Json$Decode$errorToStringHelp, error, _List_Nil); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$json$Json$Decode$errorToString
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Array$Leaf = function (a) { return {$: 'Leaf', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Array$Leaf
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Array$SubTree = function (a) { return {$: 'SubTree', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Array$SubTree
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Tuple$first = function (_v0) { var x = _v0.a; return x; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Tuple$first
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Result$isOk = function (result) { if (result.$ === 'Ok') { return true; } else { return false; } }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Result$isOk
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { switch (handler.$) { case 'Normal': return 0; case 'MayStopPropagation': return 1; case 'MayPreventDefault': return 2; default: return 3; } }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$virtual_dom$VirtualDom$toHandlerInt
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$browser$Browser$External = function (a) { return {$: 'External', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$browser$Browser$External
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$browser$Browser$Internal = function (a) { return {$: 'Internal', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$browser$Browser$Internal
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Basics$identity = function (x) { return x; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Basics$identity
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$browser$Browser$Dom$NotFound = function (a) { return {$: 'NotFound', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$browser$Browser$Dom$NotFound
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$String$isEmpty = function (string) { return string === ''; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$String$isEmpty
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$url$Url$fromString = function (str) { return A2($elm$core$String$startsWith, 'http://', str) ? A2( $elm$url$Url$chompAfterProtocol, $elm$url$Url$Http, A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( $elm$url$Url$chompAfterProtocol, $elm$url$Url$Https, A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$url$Url$fromString
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Basics$never = function (_v0) { never: while (true) { var nvr = _v0.a; var $temp$_v0 = nvr; _v0 = $temp$_v0; continue never; } }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Basics$never
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Task$Perform = function (a) { return {$: 'Perform', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Task$Perform
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Task$sequence = function (tasks) { return A3( $elm$core$List$foldr, $elm$core$Task$map2($elm$core$List$cons), $elm$core$Task$succeed(_List_Nil), tasks); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Task$sequence
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$json$Json$Encode$object = function (pairs) { return _Json_wrap( A3( $elm$core$List$foldl, F2( function (_v0, obj) { var k = _v0.a; var v = _v0.b; return A3(_Json_addField, k, v, obj); }), _Json_emptyObject(_Utils_Tuple0), pairs)); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$json$Json$Encode$object
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$encodeRustCommand = function (command) { switch (command.$) { case 'Init': return $elm$json$Json$Encode$object( _List_fromArray( [ _Utils_Tuple2( 'cmd', $elm$json$Json$Encode$string('Init')) ])); case 'Log': var text = command.a.text; return $elm$json$Json$Encode$object( _List_fromArray( [ _Utils_Tuple2( 'cmd', $elm$json$Json$Encode$string('Log')), _Utils_Tuple2( 'text', $elm$json$Json$Encode$string(text)) ])); case 'AddTask': var name = command.a.name; return $elm$json$Json$Encode$object( _List_fromArray( [ _Utils_Tuple2( 'cmd', $elm$json$Json$Encode$string('AddTask')), _Utils_Tuple2( 'name', $elm$json$Json$Encode$string(name)) ])); case 'MarkTask': var index = command.a.index; var done = command.a.done; return $elm$json$Json$Encode$object( _List_fromArray( [ _Utils_Tuple2( 'cmd', $elm$json$Json$Encode$string('MarkTask')), _Utils_Tuple2( 'index', $elm$json$Json$Encode$int(index)), _Utils_Tuple2( 'done', $elm$json$Json$Encode$bool(done)) ])); default: return $elm$json$Json$Encode$object( _List_fromArray( [ _Utils_Tuple2( 'cmd', $elm$json$Json$Encode$string('ClearDoneTasks')) ])); } }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$encodeRustCommand
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$init = function (_v0) { return _Utils_Tuple2( {field: '', str: '', tasks: _List_Nil}, $author$project$Main$toRust( $author$project$Main$encodeRustCommand($author$project$Main$Init))); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$init
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$Log = function (a) { return {$: 'Log', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$Log
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$SendToRust = function (a) { return {$: 'SendToRust', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$SendToRust
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$UpdateTasks = function (a) { return {$: 'UpdateTasks', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$UpdateTasks
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$decodeValue = function (x) { var result = A2($elm$json$Json$Decode$decodeValue, $author$project$Main$taskListDecoder, x); if (result.$ === 'Ok') { var tasks = result.a; return $author$project$Main$UpdateTasks(tasks); } else { var err = result.a; return $author$project$Main$SendToRust( $author$project$Main$Log( { text: $elm$json$Json$Decode$errorToString(err) })); } }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$decodeValue
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$subscriptions = function (model) { return $author$project$Main$fromRust($author$project$Main$decodeValue); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$subscriptions
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$AddTask = function (a) { return {$: 'AddTask', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$AddTask
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$UpdateField = function (a) { return {$: 'UpdateField', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$UpdateField
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$virtual_dom$VirtualDom$Normal = function (a) { return {$: 'Normal', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$virtual_dom$VirtualDom$Normal
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$html$Html$Events$onClick = function (msg) { return A2( $elm$html$Html$Events$on, 'click', $elm$json$Json$Decode$succeed(msg)); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$html$Html$Events$onClick
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$html$Html$Events$alwaysStop = function (x) { return _Utils_Tuple2(x, true); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$html$Html$Events$alwaysStop
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { return {$: 'MayStopPropagation', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$virtual_dom$VirtualDom$MayStopPropagation
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$html$Html$Events$onInput = function (tagger) { return A2( $elm$html$Html$Events$stopPropagationOn, 'input', A2( $elm$json$Json$Decode$map, $elm$html$Html$Events$alwaysStop, A2($elm$json$Json$Decode$map, tagger, $elm$html$Html$Events$targetValue))); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$html$Html$Events$onInput
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$html$Html$Events$alwaysPreventDefault = function (msg) { return _Utils_Tuple2(msg, true); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$html$Html$Events$alwaysPreventDefault
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$virtual_dom$VirtualDom$MayPreventDefault = function (a) { return {$: 'MayPreventDefault', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$virtual_dom$VirtualDom$MayPreventDefault
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$html$Html$Events$onSubmit = function (msg) { return A2( $elm$html$Html$Events$preventDefaultOn, 'submit', A2( $elm$json$Json$Decode$map, $elm$html$Html$Events$alwaysPreventDefault, $elm$json$Json$Decode$succeed(msg))); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$html$Html$Events$onSubmit
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$MarkTask = function (a) { return {$: 'MarkTask', a: a}; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$MarkTask
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$core$Tuple$second = function (_v0) { var y = _v0.b; return y; }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$core$Tuple$second
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$elm$html$Html$Attributes$classList = function (classes) { return $elm$html$Html$Attributes$class( A2( $elm$core$String$join, ' ', A2( $elm$core$List$map, $elm$core$Tuple$first, A2($elm$core$List$filter, $elm$core$Tuple$second, classes)))); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$elm$html$Html$Attributes$classList
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
$author$project$Main$view = function (model) { return A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class('container') ]), _List_fromArray( [ $elm$html$Html$text(model.str), A2( $elm$html$Html$form, _List_fromArray( [ $elm$html$Html$Attributes$class('text-input-wrapper'), $elm$html$Html$Events$onSubmit( $author$project$Main$SendToRust( $author$project$Main$AddTask( {name: model.field}))) ]), _List_fromArray( [ A2( $elm$html$Html$input, _List_fromArray( [ $elm$html$Html$Attributes$id('task-name-input'), $elm$html$Html$Attributes$class('text-input'), $elm$html$Html$Attributes$type_('text'), $elm$html$Html$Attributes$autofocus(true), $elm$html$Html$Attributes$value(model.field), $elm$html$Html$Events$onInput($author$project$Main$UpdateField) ]), _List_Nil) ])), A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class('task-list') ]), A2($elm$core$List$indexedMap, $author$project$Main$viewTask, model.tasks)), A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class('footer') ]), _List_fromArray( [ A2( $elm$html$Html$div, _List_fromArray( [ $elm$html$Html$Attributes$class('btn-clear-tasks'), $elm$html$Html$Events$onClick( $author$project$Main$SendToRust($author$project$Main$ClearDoneTasks)) ]), _List_fromArray( [ $elm$html$Html$text('Delete completed') ])) ])) ])); }
/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //
$author$project$Main$view
javascript
Boscop/web-view
webview-examples/examples/todo-elm/elm.js
https://github.com/Boscop/web-view/blob/master/webview-examples/examples/todo-elm/elm.js
MIT
exit = (code) => { if (process.env.NODE_ENV === 'test') { throw new Error(`Exit called with code: ${code}`); } else { process.exit(code); } }
Custom exit function that handles both production and test environments @param {number} code - Exit code to return @throws {Error} In test environment instead of exiting
exit
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
exit = (code) => { if (process.env.NODE_ENV === 'test') { throw new Error(`Exit called with code: ${code}`); } else { process.exit(code); } }
Custom exit function that handles both production and test environments @param {number} code - Exit code to return @throws {Error} In test environment instead of exiting
exit
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
function normalizeGitHubUrl(url) { try { // Remove trailing slashes url = url.replace(/\/+$/, ''); // Handle git@ URLs if (url.startsWith('[email protected]:')) { return url; } // Handle full HTTPS URLs if (url.startsWith('https://github.com/')) { return url; } // Handle short format (user/repo) if (url.match(/^[\w-]+\/[\w-]+$/)) { return `https://github.com/${url}`; } throw new Error('Invalid GitHub repository URL format'); } catch (error) { throw new Error(`Invalid GitHub URL: ${url}`); } }
Normalizes various GitHub URL formats to a consistent format @param {string} url - The GitHub repository URL to normalize @returns {string} Normalized GitHub URL @throws {Error} If URL format is invalid
normalizeGitHubUrl
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function validateInput(input) { if (!input || input.length === 0) { throw new Error('Repository URL is required'); } const url = input[0]; if (!url.includes('github.com') && !url.match(/^[\w-]+\/[\w-]+$/)) { throw new Error('Only GitHub repositories are supported'); } return url; }
Validates the command line input @param {string[]} input - Command line arguments @returns {Promise<string>} Validated repository URL @throws {Error} If input is missing or invalid
validateInput
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function downloadRepository(url) { const spinner = process.env.NODE_ENV !== 'test' ? ora('Downloading repository...').start() : null; const tempDir = path.join(os.tmpdir(), `git2txt-${Date.now()}`); try { // Normalize the GitHub URL const normalizedUrl = normalizeGitHubUrl(url); const repoName = url.split('/').pop().replace('.git', ''); if (cli.flags.debug) { console.log(chalk.blue('Debug: Normalized URL:'), normalizedUrl); console.log(chalk.blue('Debug: Temp directory:'), tempDir); } // Create temp directory await fs.mkdir(tempDir, { recursive: true }); // Clone the repository const cloneCommand = `git clone --depth 1 ${normalizedUrl} ${tempDir}`; if (cli.flags.debug) { console.log(chalk.blue('Debug: Executing command:'), cloneCommand); } await execAsync(cloneCommand, { maxBuffer: 1024 * 1024 * 100 // 100MB buffer }); // Verify the download const files = await fs.readdir(tempDir); if (files.length === 0) { throw new Error('Repository appears to be empty'); } if (spinner) spinner.succeed('Repository downloaded successfully'); return { tempDir, repoName }; } catch (error) { if (spinner) spinner.fail('Failed to download repository'); if (cli.flags.debug) { console.log(chalk.blue('Debug: Full error:'), error); } if (process.env.NODE_ENV !== 'test') { console.error(chalk.red('Error: Could not access the repository. Please check:')); console.error(chalk.yellow(' 1. The repository exists and is public')); console.error(chalk.yellow(' 2. You have the correct repository URL')); console.error(chalk.yellow(' 3. GitHub is accessible from your network')); console.error(chalk.yellow(' 4. Git is installed and accessible from command line')); } await cleanup(tempDir); throw error; } }
Downloads a GitHub repository to a temporary directory @param {string} url - GitHub repository URL @returns {Promise<Object>} Object containing temporary directory path and repository name @throws {Error} If download fails
downloadRepository
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function processFiles(directory, options) { let spinner = process.env.NODE_ENV !== 'test' ? ora('Processing files...').start() : null; const thresholdBytes = options.threshold * 1024 * 1024; let output = ''; let processedFiles = 0; let skippedFiles = 0; /** * Recursively processes files in a directory * @param {string} dir - Directory to process */ async function processDirectory(dir) { const entries = await fs.readdir(dir, { withFileTypes: true }); for (const entry of entries) { const fullPath = path.join(dir, entry.name); if (entry.isDirectory() && entry.name !== 'node_modules' && entry.name !== '.git') { // Recursively process subdirectories await processDirectory(fullPath); continue; } if (!entry.isFile()) continue; try { const stats = await fs.stat(fullPath); // Skip if file is too large and we're not including all files if (!options.includeAll && stats.size > thresholdBytes) { if (process.env.DEBUG) console.log(`Skipping large file: ${entry.name}`); skippedFiles++; continue; } // Skip binary files unless includeAll is true if (!options.includeAll) { if (await isBinaryFile(fullPath)) { if (process.env.DEBUG) console.log(`Skipping binary file: ${entry.name}`); skippedFiles++; continue; } } const content = await fs.readFile(fullPath, 'utf8'); const relativePath = path.relative(directory, fullPath); output += `\n${'='.repeat(80)}\n`; output += `File: ${relativePath}\n`; output += `Size: ${formatFileSize(stats.size)}\n`; output += `${'='.repeat(80)}\n\n`; output += `${content}\n`; processedFiles++; if (process.env.DEBUG) { console.log(`Processed file: ${relativePath}`); } } catch (error) { if (process.env.DEBUG) { console.error(`Error processing ${entry.name}:`, error); } skippedFiles++; } } } try { // Process the entire directory tree await processDirectory(directory); if (spinner) { spinner.succeed(`Processed ${processedFiles} files successfully (${skippedFiles} skipped)`); } if (processedFiles === 0 && process.env.DEBUG) { console.warn('Warning: No files were processed'); } return output; } catch (error) { if (spinner) { spinner.fail('Failed to process files'); } throw error; } }
Processes files in the repository directory and combines them into a single text output @param {string} directory - Path to the repository directory @param {Object} options - Processing options @param {number} options.threshold - File size threshold in MB @param {boolean} options.includeAll - Whether to include all files regardless of size/type @returns {Promise<string>} Combined content of all processed files @throws {Error} If file processing fails
processFiles
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function processDirectory(dir) { const entries = await fs.readdir(dir, { withFileTypes: true }); for (const entry of entries) { const fullPath = path.join(dir, entry.name); if (entry.isDirectory() && entry.name !== 'node_modules' && entry.name !== '.git') { // Recursively process subdirectories await processDirectory(fullPath); continue; } if (!entry.isFile()) continue; try { const stats = await fs.stat(fullPath); // Skip if file is too large and we're not including all files if (!options.includeAll && stats.size > thresholdBytes) { if (process.env.DEBUG) console.log(`Skipping large file: ${entry.name}`); skippedFiles++; continue; } // Skip binary files unless includeAll is true if (!options.includeAll) { if (await isBinaryFile(fullPath)) { if (process.env.DEBUG) console.log(`Skipping binary file: ${entry.name}`); skippedFiles++; continue; } } const content = await fs.readFile(fullPath, 'utf8'); const relativePath = path.relative(directory, fullPath); output += `\n${'='.repeat(80)}\n`; output += `File: ${relativePath}\n`; output += `Size: ${formatFileSize(stats.size)}\n`; output += `${'='.repeat(80)}\n\n`; output += `${content}\n`; processedFiles++; if (process.env.DEBUG) { console.log(`Processed file: ${relativePath}`); } } catch (error) { if (process.env.DEBUG) { console.error(`Error processing ${entry.name}:`, error); } skippedFiles++; } } }
Recursively processes files in a directory @param {string} dir - Directory to process
processDirectory
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function writeOutput(content, outputPath) { let spinner = process.env.NODE_ENV !== 'test' ? ora('Writing output file...').start() : null; try { await fs.writeFile(outputPath, content); if (spinner) spinner.succeed(`Output saved to ${chalk.green(outputPath)}`); } catch (error) { if (spinner) spinner.fail('Failed to write output file'); if (process.env.NODE_ENV !== 'test') { console.error(chalk.red('Write error:'), error); } throw error; } }
Writes the processed content to an output file @param {string} content - Content to write @param {string} outputPath - Path to the output file @returns {Promise<void>} @throws {Error} If writing fails
writeOutput
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function cleanup(directory) { try { await fs.rm(directory, { recursive: true, force: true }); } catch (error) { if (process.env.NODE_ENV !== 'test') { console.error(chalk.yellow('Warning: Failed to clean up temporary files')); } } }
Cleans up temporary files and directories @param {string} directory - Directory to clean up @returns {Promise<void>}
cleanup
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
async function main() { let tempDir; try { const url = await validateInput(cli.input); if (process.env.NODE_ENV !== 'test') { const result = await downloadRepository(url); tempDir = result.tempDir; const outputPath = cli.flags.output || `${result.repoName}.txt`; const content = await processFiles(tempDir, { threshold: cli.flags.threshold, includeAll: cli.flags.includeAll }); if (!content) { throw new Error('No content was generated from the repository'); } await writeOutput(content, outputPath); } } catch (error) { if (process.env.NODE_ENV === 'test') { throw error; } else { console.error(chalk.red('\nAn unexpected error occurred:')); console.error(error.message || error); exit(1); } } finally { if (tempDir) { await cleanup(tempDir); } } }
Main application function that orchestrates the entire process @returns {Promise<void>}
main
javascript
addyosmani/git2txt
index.js
https://github.com/addyosmani/git2txt/blob/master/index.js
MIT
renderLoop = function(){ requestAnimationFrame(renderLoop); game._board.render(); }
Update the sizes of the renderer (this makes the game responsive)
renderLoop
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
function Shape(game, orientations, symmetrical, blockType) { $.extend(this, { x: 0, y: 0, symmetrical: symmetrical, init: function() { $.extend(this, { orientation: 0, x: Math.floor(game._BLOCK_WIDTH / 2) - 1, y: -1 }); return this; }, blockType: blockType, blockVariation: null, blocksLen: orientations[0].length, orientations: orientations, orientation: 0, // 4 possible rotate: function(direction) { var orientation = (this.orientation + (direction === "left" ? 1 : -1) + 4) % 4; if (!game._checkCollisions( this.x, this.y, this.getBlocks(orientation) )) { this.orientation = orientation; game._board.renderChanged = true; } else { var ogOrientation = this.orientation; var ogX = this.x; var ogY = this.y; this.orientation = orientation; while (this.x >= game._BLOCK_WIDTH - 2) { this.x--; } while (this.x < 0) { this.x++; } if (this.blockType === "line" && this.x === 0) this.x++; if ( game._checkCollisions( this.x, this.y, this.getBlocks(orientation) ) ) { this.y--; if ( game._checkCollisions( this.x, this.y, this.getBlocks(orientation) ) ) { this.x = ogX; this.y = ogY; this.orientation = ogOrientation; } } game._board.renderChanged = true; } }, moveRight: function() { if (!game._checkCollisions(this.x + 1, this.y, this.getBlocks())) { this.x++; game._board.renderChanged = true; } }, moveLeft: function() { if (!game._checkCollisions(this.x - 1, this.y, this.getBlocks())) { this.x--; game._board.renderChanged = true; } }, drop: function() { if (!game._checkCollisions(this.x, this.y + 1, this.getBlocks())) { this.y++; // Reset the drop count, as we dropped the block sooner game._board.dropCount = -1; game._board.animate(); game._board.renderChanged = true; } }, getBlocks: function(orientation) { // optional param return this.orientations[orientation !== undefined ? orientation : this.orientation]; }, draw: function(_x, _y, _orientation) { var blocks = this.getBlocks(_orientation), x = _x === undefined ? this.x : _x, y = _y === undefined ? this.y : _y, i = 0, index = 0; for (; i<this.blocksLen; i += 2) { game._board.drawBlock(x + blocks[i], y + blocks[i+1], this.blockType, this.blockVariation, index, this.orientation, true); index++; } }, getBounds: function(_blocks) { // _blocks can be an array of blocks, an orientation index, or undefined var blocks = $.isArray(_blocks) ? _blocks : this.getBlocks(_blocks), i=0, len=blocks.length, minx=999, maxx=-999, miny=999, maxy=-999; for (; i<len; i+=2) { if (blocks[i] < minx) { minx = blocks[i]; } if (blocks[i] > maxx) { maxx = blocks[i]; } if (blocks[i+1] < miny) { miny = blocks[i+1]; } if (blocks[i+1] > maxy) { maxy = blocks[i+1]; } } return { left: minx, right: maxx, top: miny, bottom: maxy, width: maxx - minx, height: maxy - miny }; } }); return this.init(); }
The shapes have a reference point (the dot) and always rotate left. Keep in mind that the blocks should keep in the same relative position when rotating, to allow for custom per-block themes.
Shape
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
getCustomBlockImageCoordinates = function(image, blockType, blockIndex) { // The image is based on the first ("upright") orientation var positions = game._shapes[blockType][0]; // Find the number of tiles it should have var minX = Math.min(positions[0], positions[2], positions[4], positions[6]); var maxX = Math.max(positions[0], positions[2], positions[4], positions[6]); var minY = Math.min(positions[1], positions[3], positions[5], positions[7]); var maxY = Math.max(positions[1], positions[3], positions[5], positions[7]); var rangeX = maxX - minX + 1; var rangeY = maxY - minY + 1; // X and Y sizes should match. Should. var tileSizeX = image.width / rangeX; var tileSizeY = image.height / rangeY; return { x: tileSizeX * (positions[blockIndex*2]-minX), y: tileSizeY * Math.abs(minY-positions[blockIndex*2+1]), w: tileSizeX, h: tileSizeY }; }
Draws one block (Each piece is made of 4 blocks) The blockType is used to draw any block. The falling attribute is needed to apply different styles for falling and placed blocks.
getCustomBlockImageCoordinates
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
getBlockVariation = function(blockTheme, blockVariation) { if( $.isArray(blockTheme) ) { if( blockVariation !== null && typeof blockTheme[blockVariation] !== 'undefined' ) { return blockTheme[blockVariation]; } else if(blockTheme.length > 0) { return blockTheme[0]; } else { return null; } } else { return blockTheme; } }
The theme allows us to do many things: - Use a specific color for the falling block (primary), regardless of the proper color. - Use another color for the placed blocks (secondary). - Default to the "original" block color in any of those cases by setting primary and/or secondary to null. - With primary and secondary as null, all blocks keep their original colors.
getBlockVariation
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
handleAssetLoad = function() { // Rerender the board as soon as an asset loads if( game._board ) { game._board.render(true); } }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
handleAssetLoad
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
loadAsset = function(src) { var plainSrc = src; if( ! hexColorcheck.test( plainSrc ) ) { // It's an image src = new Image(); src.src = plainSrc; src.onload = handleAssetLoad; } else { // It's a color src = plainSrc; } return src; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
loadAsset
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
startAssetLoad = function(block) { // Assets can be an array of variation so they can change color/design randomly if( $.isArray(block) && block.length > 0 ) { for( var i=0; i<block.length; i++ ) { block[i] = loadAsset(block[i]); } } else if( typeof block === 'string' ) { block = loadAsset(block); } return block; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
startAssetLoad
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
function scoreBlocks(possibles, blocks, x, y, filled, width, height) { var i, len=blocks.length, score=0, bottoms = {}, tx, ty, overlaps; // base score for (i=0; i<len; i+=2) { score += possibles[game._filled.asIndex(x + blocks[i], y + blocks[i+1])] || 0; } // overlap score -- //TODO - don't count overlaps if cleared? for (i=0; i<len; i+=2) { tx = blocks[i]; ty = blocks[i+1]; if (bottoms[tx] === undefined || bottoms[tx] < ty) { bottoms[tx] = ty; } } overlaps = 0; for (tx in bottoms) { tx = parseInt(tx); for (ty=bottoms[tx]+1, i=0; y+ty<height; ty++, i++) { if (!game._filled.check(x + tx, y + ty)) { overlaps += i == 0 ? 2 : 1; //TODO-score better //if (i == 0) overlaps += 1; break; } } } score = score - overlaps; return score; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
scoreBlocks
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
function resetShapes() { for (var attr in shapes) { shapes[attr].x = 0; shapes[attr].y = -1; } }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
resetShapes
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
func = function(filled, checkCollisions, width, height, mode, _one_shape) { if (!_one_shape) resetShapes(); var possibles = new Array(width * height), evil = mode == 'evil', x, y, py, attr, shape, i, blocks, bounds, score, best_shape, best_score = (evil ? 1 : -1) * 999, best_orientation, best_x, best_score_for_shape, best_orientation_for_shape, best_x_for_shape; for (x=0; x<width; x++) { for (y=0; y<=height; y++) { if (y == height || filled.check(x, y)) { for (py=y-4; py<y; py++) { possibles[filled.asIndex(x, py)] = py; //TODO - figure out better scoring? } break; } } } // for each shape... var opts = _one_shape === undefined ? shapes : {cur: _one_shape}; //BOO for (attr in opts) { //TODO - check in random order to prevent later shapes from winning shape = opts[attr]; best_score_for_shape = -999; // for each orientation... for (i=0; i<(shape.symmetrical ? 2 : 4); i++) { //TODO - only look at unique orientations blocks = shape.getBlocks(i); bounds = shape.getBounds(blocks); // try each possible position... for (x=-bounds.left; x<width - bounds.width; x++) { for (y=-1; y<height - bounds.bottom; y++) { if( game._checkCollisions(x, y + 1, blocks, true) ) { // collision score = scoreBlocks(possibles, blocks, x, y, filled, width, height); if (score > best_score_for_shape) { best_score_for_shape = score; best_orientation_for_shape = i; best_x_for_shape = x; } break; } } } } if ((evil && best_score_for_shape < best_score) || (!evil && best_score_for_shape > best_score)) { best_shape = shape; best_score = best_score_for_shape; best_orientation = best_orientation_for_shape; best_x = best_x_for_shape; } } best_shape.best_orientation = best_orientation; best_shape.best_x = best_x; return best_shape; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
func
javascript
Aerolab/blockrain.js
dist/blockrain.jquery.js
https://github.com/Aerolab/blockrain.js/blob/master/dist/blockrain.jquery.js
MIT
renderLoop = function(){ requestAnimationFrame(renderLoop); game._board.render(); }
Update the sizes of the renderer (this makes the game responsive)
renderLoop
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
function Shape(game, orientations, symmetrical, blockType) { $.extend(this, { x: 0, y: 0, symmetrical: symmetrical, init: function() { $.extend(this, { orientation: 0, x: Math.floor(game._BLOCK_WIDTH / 2) - 1, y: -1 }); return this; }, blockType: blockType, blockVariation: null, blocksLen: orientations[0].length, orientations: orientations, orientation: 0, // 4 possible rotate: function(direction) { var orientation = (this.orientation + (direction === "left" ? 1 : -1) + 4) % 4; if (!game._checkCollisions( this.x, this.y, this.getBlocks(orientation) )) { this.orientation = orientation; game._board.renderChanged = true; } else { var ogOrientation = this.orientation; var ogX = this.x; var ogY = this.y; this.orientation = orientation; while (this.x >= game._BLOCK_WIDTH - 2) { this.x--; } while (this.x < 0) { this.x++; } if (this.blockType === "line" && this.x === 0) this.x++; if ( game._checkCollisions( this.x, this.y, this.getBlocks(orientation) ) ) { this.y--; if ( game._checkCollisions( this.x, this.y, this.getBlocks(orientation) ) ) { this.x = ogX; this.y = ogY; this.orientation = ogOrientation; } } game._board.renderChanged = true; } }, moveRight: function() { if (!game._checkCollisions(this.x + 1, this.y, this.getBlocks())) { this.x++; game._board.renderChanged = true; } }, moveLeft: function() { if (!game._checkCollisions(this.x - 1, this.y, this.getBlocks())) { this.x--; game._board.renderChanged = true; } }, drop: function() { if (!game._checkCollisions(this.x, this.y + 1, this.getBlocks())) { this.y++; // Reset the drop count, as we dropped the block sooner game._board.dropCount = -1; game._board.animate(); game._board.renderChanged = true; } }, getBlocks: function(orientation) { // optional param return this.orientations[orientation !== undefined ? orientation : this.orientation]; }, draw: function(_x, _y, _orientation) { var blocks = this.getBlocks(_orientation), x = _x === undefined ? this.x : _x, y = _y === undefined ? this.y : _y, i = 0, index = 0; for (; i<this.blocksLen; i += 2) { game._board.drawBlock(x + blocks[i], y + blocks[i+1], this.blockType, this.blockVariation, index, this.orientation, true); index++; } }, getBounds: function(_blocks) { // _blocks can be an array of blocks, an orientation index, or undefined var blocks = $.isArray(_blocks) ? _blocks : this.getBlocks(_blocks), i=0, len=blocks.length, minx=999, maxx=-999, miny=999, maxy=-999; for (; i<len; i+=2) { if (blocks[i] < minx) { minx = blocks[i]; } if (blocks[i] > maxx) { maxx = blocks[i]; } if (blocks[i+1] < miny) { miny = blocks[i+1]; } if (blocks[i+1] > maxy) { maxy = blocks[i+1]; } } return { left: minx, right: maxx, top: miny, bottom: maxy, width: maxx - minx, height: maxy - miny }; } }); return this.init(); }
The shapes have a reference point (the dot) and always rotate left. Keep in mind that the blocks should keep in the same relative position when rotating, to allow for custom per-block themes.
Shape
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
getCustomBlockImageCoordinates = function(image, blockType, blockIndex) { // The image is based on the first ("upright") orientation var positions = game._shapes[blockType][0]; // Find the number of tiles it should have var minX = Math.min(positions[0], positions[2], positions[4], positions[6]); var maxX = Math.max(positions[0], positions[2], positions[4], positions[6]); var minY = Math.min(positions[1], positions[3], positions[5], positions[7]); var maxY = Math.max(positions[1], positions[3], positions[5], positions[7]); var rangeX = maxX - minX + 1; var rangeY = maxY - minY + 1; // X and Y sizes should match. Should. var tileSizeX = image.width / rangeX; var tileSizeY = image.height / rangeY; return { x: tileSizeX * (positions[blockIndex*2]-minX), y: tileSizeY * Math.abs(minY-positions[blockIndex*2+1]), w: tileSizeX, h: tileSizeY }; }
Draws one block (Each piece is made of 4 blocks) The blockType is used to draw any block. The falling attribute is needed to apply different styles for falling and placed blocks.
getCustomBlockImageCoordinates
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
getBlockVariation = function(blockTheme, blockVariation) { if( $.isArray(blockTheme) ) { if( blockVariation !== null && typeof blockTheme[blockVariation] !== 'undefined' ) { return blockTheme[blockVariation]; } else if(blockTheme.length > 0) { return blockTheme[0]; } else { return null; } } else { return blockTheme; } }
The theme allows us to do many things: - Use a specific color for the falling block (primary), regardless of the proper color. - Use another color for the placed blocks (secondary). - Default to the "original" block color in any of those cases by setting primary and/or secondary to null. - With primary and secondary as null, all blocks keep their original colors.
getBlockVariation
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
handleAssetLoad = function() { // Rerender the board as soon as an asset loads if( game._board ) { game._board.render(true); } }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
handleAssetLoad
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
loadAsset = function(src) { var plainSrc = src; if( ! hexColorcheck.test( plainSrc ) ) { // It's an image src = new Image(); src.src = plainSrc; src.onload = handleAssetLoad; } else { // It's a color src = plainSrc; } return src; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
loadAsset
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
startAssetLoad = function(block) { // Assets can be an array of variation so they can change color/design randomly if( $.isArray(block) && block.length > 0 ) { for( var i=0; i<block.length; i++ ) { block[i] = loadAsset(block[i]); } } else if( typeof block === 'string' ) { block = loadAsset(block); } return block; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
startAssetLoad
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
function scoreBlocks(possibles, blocks, x, y, filled, width, height) { var i, len=blocks.length, score=0, bottoms = {}, tx, ty, overlaps; // base score for (i=0; i<len; i+=2) { score += possibles[game._filled.asIndex(x + blocks[i], y + blocks[i+1])] || 0; } // overlap score -- //TODO - don't count overlaps if cleared? for (i=0; i<len; i+=2) { tx = blocks[i]; ty = blocks[i+1]; if (bottoms[tx] === undefined || bottoms[tx] < ty) { bottoms[tx] = ty; } } overlaps = 0; for (tx in bottoms) { tx = parseInt(tx); for (ty=bottoms[tx]+1, i=0; y+ty<height; ty++, i++) { if (!game._filled.check(x + tx, y + ty)) { overlaps += i == 0 ? 2 : 1; //TODO-score better //if (i == 0) overlaps += 1; break; } } } score = score - overlaps; return score; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
scoreBlocks
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
function resetShapes() { for (var attr in shapes) { shapes[attr].x = 0; shapes[attr].y = -1; } }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
resetShapes
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
func = function(filled, checkCollisions, width, height, mode, _one_shape) { if (!_one_shape) resetShapes(); var possibles = new Array(width * height), evil = mode == 'evil', x, y, py, attr, shape, i, blocks, bounds, score, best_shape, best_score = (evil ? 1 : -1) * 999, best_orientation, best_x, best_score_for_shape, best_orientation_for_shape, best_x_for_shape; for (x=0; x<width; x++) { for (y=0; y<=height; y++) { if (y == height || filled.check(x, y)) { for (py=y-4; py<y; py++) { possibles[filled.asIndex(x, py)] = py; //TODO - figure out better scoring? } break; } } } // for each shape... var opts = _one_shape === undefined ? shapes : {cur: _one_shape}; //BOO for (attr in opts) { //TODO - check in random order to prevent later shapes from winning shape = opts[attr]; best_score_for_shape = -999; // for each orientation... for (i=0; i<(shape.symmetrical ? 2 : 4); i++) { //TODO - only look at unique orientations blocks = shape.getBlocks(i); bounds = shape.getBounds(blocks); // try each possible position... for (x=-bounds.left; x<width - bounds.width; x++) { for (y=-1; y<height - bounds.bottom; y++) { if( game._checkCollisions(x, y + 1, blocks, true) ) { // collision score = scoreBlocks(possibles, blocks, x, y, filled, width, height); if (score > best_score_for_shape) { best_score_for_shape = score; best_orientation_for_shape = i; best_x_for_shape = x; } break; } } } } if ((evil && best_score_for_shape < best_score) || (!evil && best_score_for_shape > best_score)) { best_shape = shape; best_score = best_score_for_shape; best_orientation = best_orientation_for_shape; best_x = best_x_for_shape; } } best_shape.best_orientation = best_orientation; best_shape.best_x = best_x; return best_shape; }
Find base64 encoded images and load them as image objects, which can be used by the canvas renderer
func
javascript
Aerolab/blockrain.js
src/blockrain.jquery.src.js
https://github.com/Aerolab/blockrain.js/blob/master/src/blockrain.jquery.src.js
MIT
create = object => ({ ...suffixProperties(object, "Object"), ...StyleSheet.create(object) })
Very frequently you may want to use a style with some tweaks. This class generates properties with the Object suffix, that can be used to create a customized entry in a `StyleSheet`, e.g.: const styles = StyleSheet.create({ wrapper: { ...material.title1Object, color: 'palevioletred', }, }); Pattern taken from React Native's StyleSheet @see https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/StyleSheet.js
create
javascript
hectahertz/react-native-typography
src/internal/CombinedStyleSheet.js
https://github.com/hectahertz/react-native-typography/blob/master/src/internal/CombinedStyleSheet.js
MIT
create = object => ({ ...suffixProperties(object, "Object"), ...StyleSheet.create(object) })
Very frequently you may want to use a style with some tweaks. This class generates properties with the Object suffix, that can be used to create a customized entry in a `StyleSheet`, e.g.: const styles = StyleSheet.create({ wrapper: { ...material.title1Object, color: 'palevioletred', }, }); Pattern taken from React Native's StyleSheet @see https://github.com/facebook/react-native/blob/master/Libraries/StyleSheet/StyleSheet.js
create
javascript
hectahertz/react-native-typography
src/internal/CombinedStyleSheet.js
https://github.com/hectahertz/react-native-typography/blob/master/src/internal/CombinedStyleSheet.js
MIT
function O2(r,e,t,i){Li.has(e)||Li.set(e,new Lg.default({maxSize:25e3}));for(let n of r.split(` `))if(n=n.trim(),!i.has(n))if(i.add(n),Li.get(e).has(n))for(let s of Li.get(e).get(n))t.add(s);else{let s=e(n).filter(o=>o!=="!*"),a=new Set(s);for(let o of a)t.add(o);Li.get(e).set(n,a)}}
":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:PE.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?jE:Hm}}});var qi=x(Re=>{u();"use strict";var UE=(et(),Ur),VE=m.platform==="win32",{REGEX_BACKSLASH:HE,REGEX_REMOVE_BACKSLASH:WE,REGEX_SPECIAL_CHARS:GE,REGEX_SPECIAL_CHARS_GLOBAL:QE}=Di();Re.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Re.hasRegexChars=r=>GE.test(r);Re.isRegexChar=r=>r.length===1&&Re.hasRegexChars(r);Re.escapeRegex=r=>r.replace(QE,"\\$1");Re.toPosixSlashes=r=>r.replace(HE,"/");Re.removeBackslashes=r=>r.replace(WE,e=>e==="\\"?"":e);Re.supportsLookbehinds=()=>{let r=m.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Re.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:VE===!0||UE.sep==="\\";Re.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?Re.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};Re.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Re.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var eg=x((u6,Jm)=>{u();"use strict";var Gm=qi(),{CHAR_ASTERISK:gl,CHAR_AT:YE,CHAR_BACKWARD_SLASH:$i,CHAR_COMMA:KE,CHAR_DOT:yl,CHAR_EXCLAMATION_MARK:bl,CHAR_FORWARD_SLASH:Qm,CHAR_LEFT_CURLY_BRACE:wl,CHAR_LEFT_PARENTHESES:vl,CHAR_LEFT_SQUARE_BRACKET:XE,CHAR_PLUS:ZE,CHAR_QUESTION_MARK:Ym,CHAR_RIGHT_CURLY_BRACE:JE,CHAR_RIGHT_PARENTHESES:Km,CHAR_RIGHT_SQUARE_BRACKET:e2}=Di(),Xm=r=>r===Qm||r===$i,Zm=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},t2=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],a=[],o=[],l=r,c=-1,f=0,d=0,p=!1,h=!1,b=!1,v=!1,y=!1,w=!1,k=!1,S=!1,E=!1,T=!1,B=0,N,R,F={value:"",depth:0,isGlob:!1},Y=()=>c>=i,_=()=>l.charCodeAt(c+1),Q=()=>(N=R,l.charCodeAt(++c));for(;c<i;){R=Q();let he;if(R===$i){k=F.backslashes=!0,R=Q(),R===wl&&(w=!0);continue}if(w===!0||R===wl){for(B++;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,Q();continue}if(R===wl){B++;continue}if(w!==!0&&R===yl&&(R=Q())===yl){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(w!==!0&&R===KE){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===JE&&(B--,B===0)){w=!1,p=F.isBrace=!0,T=!0;break}}if(n===!0)continue;break}if(R===Qm){if(s.push(c),a.push(F),F={value:"",depth:0,isGlob:!1},T===!0)continue;if(N===yl&&c===f+1){f+=2;continue}d=c+1;continue}if(t.noext!==!0&&(R===ZE||R===YE||R===gl||R===Ym||R===bl)===!0&&_()===vl){if(b=F.isGlob=!0,v=F.isExtglob=!0,T=!0,R===bl&&c===f&&(E=!0),n===!0){for(;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,R=Q();continue}if(R===Km){b=F.isGlob=!0,T=!0;break}}continue}break}if(R===gl){if(N===gl&&(y=F.isGlobstar=!0),b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===Ym){if(b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===XE){for(;Y()!==!0&&(he=Q());){if(he===$i){k=F.backslashes=!0,Q();continue}if(he===e2){h=F.isBracket=!0,b=F.isGlob=!0,T=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&R===bl&&c===f){S=F.negated=!0,f++;continue}if(t.noparen!==!0&&R===vl){if(b=F.isGlob=!0,n===!0){for(;Y()!==!0&&(R=Q());){if(R===vl){k=F.backslashes=!0,R=Q();continue}if(R===Km){T=!0;break}}continue}break}if(b===!0){if(T=!0,n===!0)continue;break}}t.noext===!0&&(v=!1,b=!1);let U=l,le="",A="";f>0&&(le=l.slice(0,f),l=l.slice(f),d-=f),U&&b===!0&&d>0?(U=l.slice(0,d),A=l.slice(d)):b===!0?(U="",A=l):U=l,U&&U!==""&&U!=="/"&&U!==l&&Xm(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),t.unescape===!0&&(A&&(A=Gm.removeBackslashes(A)),U&&k===!0&&(U=Gm.removeBackslashes(U)));let C={prefix:le,input:r,start:f,base:U,glob:A,isBrace:p,isBracket:h,isGlob:b,isExtglob:v,isGlobstar:y,negated:S,negatedExtglob:E};if(t.tokens===!0&&(C.maxDepth=0,Xm(R)||a.push(F),C.tokens=a),t.parts===!0||t.tokens===!0){let he;for(let V=0;V<s.length;V++){let Ee=he?he+1:f,Ie=s[V],De=r.slice(Ee,Ie);t.tokens&&(V===0&&f!==0?(a[V].isPrefix=!0,a[V].value=le):a[V].value=De,Zm(a[V]),C.maxDepth+=a[V].depth),(V!==0||De!=="")&&o.push(De),he=Ie}if(he&&he+1<r.length){let V=r.slice(he+1);o.push(V),t.tokens&&(a[a.length-1].value=V,Zm(a[a.length-1]),C.maxDepth+=a[a.length-1].depth)}C.slashes=s,C.parts=o}return C};Jm.exports=t2});var ig=x((f6,rg)=>{u();"use strict";var bs=Di(),Me=qi(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:r2,REGEX_NON_SPECIAL_CHARS:i2,REGEX_SPECIAL_CHARS_BACKREF:n2,REPLACEMENTS:tg}=bs,s2=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>Me.escapeRegex(n)).join("..")}return t},gr=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,xl=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=tg[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},a=[s],o=t.capture?"":"?:",l=Me.isWindows(e),c=bs.globChars(l),f=bs.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:k,QMARK:S,QMARK_NO_DOT:E,STAR:T,START_ANCHOR:B}=c,N=$=>`(${o}(?:(?!${B}${$.dot?v:d}).)*?)`,R=t.dot?"":y,F=t.dot?S:E,Y=t.bash===!0?N(t):T;t.capture&&(Y=`(${Y})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};r=Me.removePrefix(r,_),n=r.length;let Q=[],U=[],le=[],A=s,C,he=()=>_.index===n-1,V=_.peek=($=1)=>r[_.index+$],Ee=_.advance=()=>r[++_.index]||"",Ie=()=>r.slice(_.index+1),De=($="",ae=0)=>{_.consumed+=$,_.index+=ae},ji=$=>{_.output+=$.output!=null?$.output:$.value,De($.value)},Iv=()=>{let $=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)Ee(),_.start++,$++;return $%2==0?!1:(_.negated=!0,_.start++,!0)},zi=$=>{_[$]++,le.push($)},Ft=$=>{_[$]--,le.pop()},W=$=>{if(A.type==="globstar"){let ae=_.braces>0&&($.type==="comma"||$.type==="brace"),I=$.extglob===!0||Q.length&&($.type==="pipe"||$.type==="paren");$.type!=="slash"&&$.type!=="paren"&&!ae&&!I&&(_.output=_.output.slice(0,-A.output.length),A.type="star",A.value="*",A.output=Y,_.output+=A.output)}if(Q.length&&$.type!=="paren"&&(Q[Q.length-1].inner+=$.value),($.value||$.output)&&ji($),A&&A.type==="text"&&$.type==="text"){A.value+=$.value,A.output=(A.output||"")+$.value;return}$.prev=A,a.push($),A=$},Ui=($,ae)=>{let I={...f[ae],conditions:1,inner:""};I.prev=A,I.parens=_.parens,I.output=_.output;let H=(t.capture?"(":"")+I.open;zi("parens"),W({type:$,value:ae,output:_.output?"":b}),W({type:"paren",extglob:!0,value:Ee(),output:H}),Q.push(I)},Dv=$=>{let ae=$.close+(t.capture?")":""),I;if($.type==="negate"){let H=Y;if($.inner&&$.inner.length>1&&$.inner.includes("/")&&(H=N(t)),(H!==Y||he()||/^\)+$/.test(Ie()))&&(ae=$.close=`)$))${H}`),$.inner.includes("*")&&(I=Ie())&&/^\.[^\\/.]+$/.test(I)){let ce=xl(I,{...e,fastpaths:!1}).output;ae=$.close=`)${ce})${H})`}$.prev.type==="bos"&&(_.negatedExtglob=!0)}W({type:"paren",extglob:!0,value:C,output:ae}),Ft("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let $=!1,ae=r.replace(n2,(I,H,ce,Ce,ye,Bs)=>Ce==="\\"?($=!0,I):Ce==="?"?H?H+Ce+(ye?S.repeat(ye.length):""):Bs===0?F+(ye?S.repeat(ye.length):""):S.repeat(ce.length):Ce==="."?d.repeat(ce.length):Ce==="*"?H?H+Ce+(ye?Y:""):Y:H?I:`\\${I}`);return $===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,I=>I.length%2==0?"\\\\":I?"\\":"")),ae===r&&t.contains===!0?(_.output=r,_):(_.output=Me.wrapOutput(ae,_,e),_)}for(;!he();){if(C=Ee(),C==="\0")continue;if(C==="\\"){let I=V();if(I==="/"&&t.bash!==!0||I==="."||I===";")continue;if(!I){C+="\\",W({type:"text",value:C});continue}let H=/^\\+/.exec(Ie()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,_.index+=ce,ce%2!=0&&(C+="\\")),t.unescape===!0?C=Ee():C+=Ee(),_.brackets===0){W({type:"text",value:C});continue}}if(_.brackets>0&&(C!=="]"||A.value==="["||A.value==="[^")){if(t.posix!==!1&&C===":"){let I=A.value.slice(1);if(I.includes("[")&&(A.posix=!0,I.includes(":"))){let H=A.value.lastIndexOf("["),ce=A.value.slice(0,H),Ce=A.value.slice(H+2),ye=r2[Ce];if(ye){A.value=ce+ye,_.backtrack=!0,Ee(),!s.output&&a.indexOf(A)===1&&(s.output=b);continue}}}(C==="["&&V()!==":"||C==="-"&&V()==="]")&&(C=`\\${C}`),C==="]"&&(A.value==="["||A.value==="[^")&&(C=`\\${C}`),t.posix===!0&&C==="!"&&A.value==="["&&(C="^"),A.value+=C,ji({value:C});continue}if(_.quotes===1&&C!=='"'){C=Me.escapeRegex(C),A.value+=C,ji({value:C});continue}if(C==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&W({type:"text",value:C});continue}if(C==="("){zi("parens"),W({type:"paren",value:C});continue}if(C===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(gr("opening","("));let I=Q[Q.length-1];if(I&&_.parens===I.parens+1){Dv(Q.pop());continue}W({type:"paren",value:C,output:_.parens?")":"\\)"}),Ft("parens");continue}if(C==="["){if(t.nobracket===!0||!Ie().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));C=`\\${C}`}else zi("brackets");W({type:"bracket",value:C});continue}if(C==="]"){if(t.nobracket===!0||A&&A.type==="bracket"&&A.value.length===1){W({type:"text",value:C,output:`\\${C}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(gr("opening","["));W({type:"text",value:C,output:`\\${C}`});continue}Ft("brackets");let I=A.value.slice(1);if(A.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(C=`/${C}`),A.value+=C,ji({value:C}),t.literalBrackets===!1||Me.hasRegexChars(I))continue;let H=Me.escapeRegex(A.value);if(_.output=_.output.slice(0,-A.value.length),t.literalBrackets===!0){_.output+=H,A.value=H;continue}A.value=`(${o}${H}|${A.value})`,_.output+=A.value;continue}if(C==="{"&&t.nobrace!==!0){zi("braces");let I={type:"brace",value:C,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};U.push(I),W(I);continue}if(C==="}"){let I=U[U.length-1];if(t.nobrace===!0||!I){W({type:"text",value:C,output:C});continue}let H=")";if(I.dots===!0){let ce=a.slice(),Ce=[];for(let ye=ce.length-1;ye>=0&&(a.pop(),ce[ye].type!=="brace");ye--)ce[ye].type!=="dots"&&Ce.unshift(ce[ye].value);H=s2(Ce,t),_.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let ce=_.output.slice(0,I.outputIndex),Ce=_.tokens.slice(I.tokensIndex);I.value=I.output="\\{",C=H="\\}",_.output=ce;for(let ye of Ce)_.output+=ye.output||ye.value}W({type:"brace",value:C,output:H}),Ft("braces"),U.pop();continue}if(C==="|"){Q.length>0&&Q[Q.length-1].conditions++,W({type:"text",value:C});continue}if(C===","){let I=C,H=U[U.length-1];H&&le[le.length-1]==="braces"&&(H.comma=!0,I="|"),W({type:"comma",value:C,output:I});continue}if(C==="/"){if(A.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",a.pop(),A=s;continue}W({type:"slash",value:C,output:h});continue}if(C==="."){if(_.braces>0&&A.type==="dot"){A.value==="."&&(A.output=d);let I=U[U.length-1];A.type="dots",A.output+=C,A.value+=C,I.dots=!0;continue}if(_.braces+_.parens===0&&A.type!=="bos"&&A.type!=="slash"){W({type:"text",value:C,output:d});continue}W({type:"dot",value:C,output:d});continue}if(C==="?"){if(!(A&&A.value==="(")&&t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("qmark",C);continue}if(A&&A.type==="paren"){let H=V(),ce=C;if(H==="<"&&!Me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ce=`\\${C}`),W({type:"text",value:C,output:ce});continue}if(t.dot!==!0&&(A.type==="slash"||A.type==="bos")){W({type:"qmark",value:C,output:E});continue}W({type:"qmark",value:C,output:S});continue}if(C==="!"){if(t.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Ui("negate",C);continue}if(t.nonegate!==!0&&_.index===0){Iv();continue}}if(C==="+"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("plus",C);continue}if(A&&A.value==="("||t.regex===!1){W({type:"plus",value:C,output:p});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||_.parens>0){W({type:"plus",value:C});continue}W({type:"plus",value:p});continue}if(C==="@"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){W({type:"at",extglob:!0,value:C,output:""});continue}W({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let I=i2.exec(Ie());I&&(C+=I[0],_.index+=I[0].length),W({type:"text",value:C});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=C,A.output=Y,_.backtrack=!0,_.globstar=!0,De(C);continue}let $=Ie();if(t.noextglob!==!0&&/^\([^?]/.test($)){Ui("star",C);continue}if(A.type==="star"){if(t.noglobstar===!0){De(C);continue}let I=A.prev,H=I.prev,ce=I.type==="slash"||I.type==="bos",Ce=H&&(H.type==="star"||H.type==="globstar");if(t.bash===!0&&(!ce||$[0]&&$[0]!=="/")){W({type:"star",value:C,output:""});continue}let ye=_.braces>0&&(I.type==="comma"||I.type==="brace"),Bs=Q.length&&(I.type==="pipe"||I.type==="paren");if(!ce&&I.type!=="paren"&&!ye&&!Bs){W({type:"star",value:C,output:""});continue}for(;$.slice(0,3)==="/**";){let Vi=r[_.index+4];if(Vi&&Vi!=="/")break;$=$.slice(3),De("/**",3)}if(I.type==="bos"&&he()){A.type="globstar",A.value+=C,A.output=N(t),_.output=A.output,_.globstar=!0,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!Ce&&he()){_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=N(t)+(t.strictSlashes?")":"|$)"),A.value+=C,_.globstar=!0,_.output+=I.output+A.output,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&$[0]==="/"){let Vi=$[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=`${N(t)}${h}|${h}${Vi})`,A.value+=C,_.output+=I.output+A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&$[0]==="/"){A.type="globstar",A.value+=C,A.output=`(?:^|${h}|${N(t)}${h})`,_.output=A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-A.output.length),A.type="globstar",A.output=N(t),A.value+=C,_.output+=A.output,_.globstar=!0,De(C);continue}let ae={type:"star",value:C,output:Y};if(t.bash===!0){ae.output=".*?",(A.type==="bos"||A.type==="slash")&&(ae.output=R+ae.output),W(ae);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&t.regex===!0){ae.output=C,W(ae);continue}(_.index===_.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(_.output+=w,A.output+=w):t.dot===!0?(_.output+=k,A.output+=k):(_.output+=R,A.output+=R),V()!=="*"&&(_.output+=b,A.output+=b)),W(ae)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));_.output=Me.escapeLast(_.output,"["),Ft("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing",")"));_.output=Me.escapeLast(_.output,"("),Ft("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","}"));_.output=Me.escapeLast(_.output,"{"),Ft("braces")}if(t.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&W({type:"maybe_slash",value:"",output:`${h}?`}),_.backtrack===!0){_.output="";for(let $ of _.tokens)_.output+=$.output!=null?$.output:$.value,$.suffix&&(_.output+=$.suffix)}return _};xl.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=tg[r]||r;let s=Me.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:h,START_ANCHOR:b}=bs.globChars(s),v=t.dot?d:f,y=t.dot?p:f,w=t.capture?"":"?:",k={negated:!1,prefix:""},S=t.bash===!0?".*?":h;t.capture&&(S=`(${S})`);let E=R=>R.noglobstar===!0?S:`(${w}(?:(?!${b}${R.dot?c:a}).)*?)`,T=R=>{switch(R){case"*":return`${v}${l}${S}`;case".*":return`${a}${l}${S}`;case"*.*":return`${v}${S}${a}${l}${S}`;case"
O2
javascript
LibreSpark/LibreTV
libs/tailwindcss.min.js
https://github.com/LibreSpark/LibreTV/blob/master/libs/tailwindcss.min.js
Apache-2.0
function Vg(r,e,t){let i=new Set,n=[];if(r.walkAtRules("apply",l=>{let[c]=Ug(l.params);for(let f of c)i.add(f);n.push(l)}),n.length===0)return;let s=L2([t,q2(i,e)]);function a(l,c,f){let d=Il(l),p=Il(c),b=Il(`.${Te(f)}`).nodes[0].nodes[0];return d.each(v=>{let y=new Set;p.each(w=>{let k=!1;w=w.clone(),w.walkClasses(S=>{S.value===b.value&&(k||(S.replaceWith(...v.nodes.map(E=>E.clone())),y.add(w),k=!0))})});for(let w of y){let k=[[]];for(let S of w.nodes)S.type==="combinator"?(k.push(S),k.push([])):k[k.length-1].push(S);w.nodes=[];for(let S of k)Array.isArray(S)&&S.sort((E,T)=>E.type==="tag"&&T.type==="class"?-1:E.type==="class"&&T.type==="tag"?1:E.type==="class"&&T.type==="pseudo"&&T.value.startsWith("::")?-1:E.type==="pseudo"&&E.value.startsWith("::")&&T.type==="class"?1:0),w.nodes=w.nodes.concat(S)}v.replaceWith(...y)}),d.toString()}let o=new Map;for(let l of n){let[c]=o.get(l.parent)||[[],l.source];o.set(l.parent,[c,l.source]);let[f,d]=Ug(l.params);if(l.parent.type==="atrule"){if(l.parent.name==="screen"){let p=l.parent.params;throw l.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${f.map(h=>`${p}:${h}`).join(" ")} instead.`)}throw l.error(`@apply is not supported within nested at-rules like @${l.parent.name}. You can fix this by un-nesting @${l.parent.name}.`)}for(let p of f){if([jg(e,"group"),jg(e,"peer")].includes(p))throw l.error(`@apply should not be used with the '${p}' utility`);if(!s.has(p))throw l.error(`The \`${p}\` class does not exist. If \`${p}\` is a custom class, make sure it is defined within a \`@layer\` directive.`);let h=s.get(p);for(let[,b]of h)b.type!=="atrule"&&b.walkRules(()=>{throw l.error([`The \`${p}\` class cannot be used with \`@apply\` because \`@apply\` does not currently support nested CSS.`,"Rewrite the selector without nesting or configure the `tailwindcss/nesting` plugin:","https://tailwindcss.com/docs/using-with-preprocessors#nesting"].join(` `))});c.push([p,d,h])}}for(let[l,[c,f]]of o){let d=[];for(let[h,b,v]of c){let y=[h,...Fg([h],e.tailwindConfig.separator)];for(let[w,k]of v){let S=xs(l),E=xs(k);if(E=E.groups.filter(R=>R.some(F=>y.includes(F))).flat(),E=E.concat(Fg(E,e.tailwindConfig.separator)),S.some(R=>E.includes(R)))throw k.error(`You cannot \`@apply\` the \`${h}\` utility here because it creates a circular dependency.`);let B=ee.root({nodes:[k.clone()]});B.walk(R=>{R.source=f}),(k.type!=="atrule"||k.type==="atrule"&&k.name!=="keyframes")&&B.walkRules(R=>{if(!xs(R).some(U=>U===h)){R.remove();return}let F=typeof e.tailwindConfig.important=="string"?e.tailwindConfig.important:null,_=l.raws.tailwind!==void 0&&F&&l.selector.indexOf(F)===0?l.selector.slice(F.length):l.selector;_===""&&(_=l.selector),R.selector=a(_,R.selector,h),F&&_!==l.selector&&(R.selector=is(R.selector,F)),R.walkDecls(U=>{U.important=w.important||b});let Q=(0,vs.default)().astSync(R.selector);Q.each(U=>pr(U)),R.selector=Q.toString()}),!!B.nodes[0]&&d.push([w.sort,B.nodes[0]])}}let p=e.offsets.sort(d).map(h=>h[1]);l.after(p)}for(let l of n)l.parent.nodes.length>1?l.remove():l.parent.remove();Vg(r,e,t)}
":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:PE.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?jE:Hm}}});var qi=x(Re=>{u();"use strict";var UE=(et(),Ur),VE=m.platform==="win32",{REGEX_BACKSLASH:HE,REGEX_REMOVE_BACKSLASH:WE,REGEX_SPECIAL_CHARS:GE,REGEX_SPECIAL_CHARS_GLOBAL:QE}=Di();Re.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Re.hasRegexChars=r=>GE.test(r);Re.isRegexChar=r=>r.length===1&&Re.hasRegexChars(r);Re.escapeRegex=r=>r.replace(QE,"\\$1");Re.toPosixSlashes=r=>r.replace(HE,"/");Re.removeBackslashes=r=>r.replace(WE,e=>e==="\\"?"":e);Re.supportsLookbehinds=()=>{let r=m.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Re.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:VE===!0||UE.sep==="\\";Re.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?Re.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};Re.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Re.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var eg=x((u6,Jm)=>{u();"use strict";var Gm=qi(),{CHAR_ASTERISK:gl,CHAR_AT:YE,CHAR_BACKWARD_SLASH:$i,CHAR_COMMA:KE,CHAR_DOT:yl,CHAR_EXCLAMATION_MARK:bl,CHAR_FORWARD_SLASH:Qm,CHAR_LEFT_CURLY_BRACE:wl,CHAR_LEFT_PARENTHESES:vl,CHAR_LEFT_SQUARE_BRACKET:XE,CHAR_PLUS:ZE,CHAR_QUESTION_MARK:Ym,CHAR_RIGHT_CURLY_BRACE:JE,CHAR_RIGHT_PARENTHESES:Km,CHAR_RIGHT_SQUARE_BRACKET:e2}=Di(),Xm=r=>r===Qm||r===$i,Zm=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},t2=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],a=[],o=[],l=r,c=-1,f=0,d=0,p=!1,h=!1,b=!1,v=!1,y=!1,w=!1,k=!1,S=!1,E=!1,T=!1,B=0,N,R,F={value:"",depth:0,isGlob:!1},Y=()=>c>=i,_=()=>l.charCodeAt(c+1),Q=()=>(N=R,l.charCodeAt(++c));for(;c<i;){R=Q();let he;if(R===$i){k=F.backslashes=!0,R=Q(),R===wl&&(w=!0);continue}if(w===!0||R===wl){for(B++;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,Q();continue}if(R===wl){B++;continue}if(w!==!0&&R===yl&&(R=Q())===yl){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(w!==!0&&R===KE){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===JE&&(B--,B===0)){w=!1,p=F.isBrace=!0,T=!0;break}}if(n===!0)continue;break}if(R===Qm){if(s.push(c),a.push(F),F={value:"",depth:0,isGlob:!1},T===!0)continue;if(N===yl&&c===f+1){f+=2;continue}d=c+1;continue}if(t.noext!==!0&&(R===ZE||R===YE||R===gl||R===Ym||R===bl)===!0&&_()===vl){if(b=F.isGlob=!0,v=F.isExtglob=!0,T=!0,R===bl&&c===f&&(E=!0),n===!0){for(;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,R=Q();continue}if(R===Km){b=F.isGlob=!0,T=!0;break}}continue}break}if(R===gl){if(N===gl&&(y=F.isGlobstar=!0),b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===Ym){if(b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===XE){for(;Y()!==!0&&(he=Q());){if(he===$i){k=F.backslashes=!0,Q();continue}if(he===e2){h=F.isBracket=!0,b=F.isGlob=!0,T=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&R===bl&&c===f){S=F.negated=!0,f++;continue}if(t.noparen!==!0&&R===vl){if(b=F.isGlob=!0,n===!0){for(;Y()!==!0&&(R=Q());){if(R===vl){k=F.backslashes=!0,R=Q();continue}if(R===Km){T=!0;break}}continue}break}if(b===!0){if(T=!0,n===!0)continue;break}}t.noext===!0&&(v=!1,b=!1);let U=l,le="",A="";f>0&&(le=l.slice(0,f),l=l.slice(f),d-=f),U&&b===!0&&d>0?(U=l.slice(0,d),A=l.slice(d)):b===!0?(U="",A=l):U=l,U&&U!==""&&U!=="/"&&U!==l&&Xm(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),t.unescape===!0&&(A&&(A=Gm.removeBackslashes(A)),U&&k===!0&&(U=Gm.removeBackslashes(U)));let C={prefix:le,input:r,start:f,base:U,glob:A,isBrace:p,isBracket:h,isGlob:b,isExtglob:v,isGlobstar:y,negated:S,negatedExtglob:E};if(t.tokens===!0&&(C.maxDepth=0,Xm(R)||a.push(F),C.tokens=a),t.parts===!0||t.tokens===!0){let he;for(let V=0;V<s.length;V++){let Ee=he?he+1:f,Ie=s[V],De=r.slice(Ee,Ie);t.tokens&&(V===0&&f!==0?(a[V].isPrefix=!0,a[V].value=le):a[V].value=De,Zm(a[V]),C.maxDepth+=a[V].depth),(V!==0||De!=="")&&o.push(De),he=Ie}if(he&&he+1<r.length){let V=r.slice(he+1);o.push(V),t.tokens&&(a[a.length-1].value=V,Zm(a[a.length-1]),C.maxDepth+=a[a.length-1].depth)}C.slashes=s,C.parts=o}return C};Jm.exports=t2});var ig=x((f6,rg)=>{u();"use strict";var bs=Di(),Me=qi(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:r2,REGEX_NON_SPECIAL_CHARS:i2,REGEX_SPECIAL_CHARS_BACKREF:n2,REPLACEMENTS:tg}=bs,s2=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>Me.escapeRegex(n)).join("..")}return t},gr=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,xl=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=tg[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},a=[s],o=t.capture?"":"?:",l=Me.isWindows(e),c=bs.globChars(l),f=bs.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:k,QMARK:S,QMARK_NO_DOT:E,STAR:T,START_ANCHOR:B}=c,N=$=>`(${o}(?:(?!${B}${$.dot?v:d}).)*?)`,R=t.dot?"":y,F=t.dot?S:E,Y=t.bash===!0?N(t):T;t.capture&&(Y=`(${Y})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};r=Me.removePrefix(r,_),n=r.length;let Q=[],U=[],le=[],A=s,C,he=()=>_.index===n-1,V=_.peek=($=1)=>r[_.index+$],Ee=_.advance=()=>r[++_.index]||"",Ie=()=>r.slice(_.index+1),De=($="",ae=0)=>{_.consumed+=$,_.index+=ae},ji=$=>{_.output+=$.output!=null?$.output:$.value,De($.value)},Iv=()=>{let $=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)Ee(),_.start++,$++;return $%2==0?!1:(_.negated=!0,_.start++,!0)},zi=$=>{_[$]++,le.push($)},Ft=$=>{_[$]--,le.pop()},W=$=>{if(A.type==="globstar"){let ae=_.braces>0&&($.type==="comma"||$.type==="brace"),I=$.extglob===!0||Q.length&&($.type==="pipe"||$.type==="paren");$.type!=="slash"&&$.type!=="paren"&&!ae&&!I&&(_.output=_.output.slice(0,-A.output.length),A.type="star",A.value="*",A.output=Y,_.output+=A.output)}if(Q.length&&$.type!=="paren"&&(Q[Q.length-1].inner+=$.value),($.value||$.output)&&ji($),A&&A.type==="text"&&$.type==="text"){A.value+=$.value,A.output=(A.output||"")+$.value;return}$.prev=A,a.push($),A=$},Ui=($,ae)=>{let I={...f[ae],conditions:1,inner:""};I.prev=A,I.parens=_.parens,I.output=_.output;let H=(t.capture?"(":"")+I.open;zi("parens"),W({type:$,value:ae,output:_.output?"":b}),W({type:"paren",extglob:!0,value:Ee(),output:H}),Q.push(I)},Dv=$=>{let ae=$.close+(t.capture?")":""),I;if($.type==="negate"){let H=Y;if($.inner&&$.inner.length>1&&$.inner.includes("/")&&(H=N(t)),(H!==Y||he()||/^\)+$/.test(Ie()))&&(ae=$.close=`)$))${H}`),$.inner.includes("*")&&(I=Ie())&&/^\.[^\\/.]+$/.test(I)){let ce=xl(I,{...e,fastpaths:!1}).output;ae=$.close=`)${ce})${H})`}$.prev.type==="bos"&&(_.negatedExtglob=!0)}W({type:"paren",extglob:!0,value:C,output:ae}),Ft("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let $=!1,ae=r.replace(n2,(I,H,ce,Ce,ye,Bs)=>Ce==="\\"?($=!0,I):Ce==="?"?H?H+Ce+(ye?S.repeat(ye.length):""):Bs===0?F+(ye?S.repeat(ye.length):""):S.repeat(ce.length):Ce==="."?d.repeat(ce.length):Ce==="*"?H?H+Ce+(ye?Y:""):Y:H?I:`\\${I}`);return $===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,I=>I.length%2==0?"\\\\":I?"\\":"")),ae===r&&t.contains===!0?(_.output=r,_):(_.output=Me.wrapOutput(ae,_,e),_)}for(;!he();){if(C=Ee(),C==="\0")continue;if(C==="\\"){let I=V();if(I==="/"&&t.bash!==!0||I==="."||I===";")continue;if(!I){C+="\\",W({type:"text",value:C});continue}let H=/^\\+/.exec(Ie()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,_.index+=ce,ce%2!=0&&(C+="\\")),t.unescape===!0?C=Ee():C+=Ee(),_.brackets===0){W({type:"text",value:C});continue}}if(_.brackets>0&&(C!=="]"||A.value==="["||A.value==="[^")){if(t.posix!==!1&&C===":"){let I=A.value.slice(1);if(I.includes("[")&&(A.posix=!0,I.includes(":"))){let H=A.value.lastIndexOf("["),ce=A.value.slice(0,H),Ce=A.value.slice(H+2),ye=r2[Ce];if(ye){A.value=ce+ye,_.backtrack=!0,Ee(),!s.output&&a.indexOf(A)===1&&(s.output=b);continue}}}(C==="["&&V()!==":"||C==="-"&&V()==="]")&&(C=`\\${C}`),C==="]"&&(A.value==="["||A.value==="[^")&&(C=`\\${C}`),t.posix===!0&&C==="!"&&A.value==="["&&(C="^"),A.value+=C,ji({value:C});continue}if(_.quotes===1&&C!=='"'){C=Me.escapeRegex(C),A.value+=C,ji({value:C});continue}if(C==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&W({type:"text",value:C});continue}if(C==="("){zi("parens"),W({type:"paren",value:C});continue}if(C===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(gr("opening","("));let I=Q[Q.length-1];if(I&&_.parens===I.parens+1){Dv(Q.pop());continue}W({type:"paren",value:C,output:_.parens?")":"\\)"}),Ft("parens");continue}if(C==="["){if(t.nobracket===!0||!Ie().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));C=`\\${C}`}else zi("brackets");W({type:"bracket",value:C});continue}if(C==="]"){if(t.nobracket===!0||A&&A.type==="bracket"&&A.value.length===1){W({type:"text",value:C,output:`\\${C}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(gr("opening","["));W({type:"text",value:C,output:`\\${C}`});continue}Ft("brackets");let I=A.value.slice(1);if(A.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(C=`/${C}`),A.value+=C,ji({value:C}),t.literalBrackets===!1||Me.hasRegexChars(I))continue;let H=Me.escapeRegex(A.value);if(_.output=_.output.slice(0,-A.value.length),t.literalBrackets===!0){_.output+=H,A.value=H;continue}A.value=`(${o}${H}|${A.value})`,_.output+=A.value;continue}if(C==="{"&&t.nobrace!==!0){zi("braces");let I={type:"brace",value:C,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};U.push(I),W(I);continue}if(C==="}"){let I=U[U.length-1];if(t.nobrace===!0||!I){W({type:"text",value:C,output:C});continue}let H=")";if(I.dots===!0){let ce=a.slice(),Ce=[];for(let ye=ce.length-1;ye>=0&&(a.pop(),ce[ye].type!=="brace");ye--)ce[ye].type!=="dots"&&Ce.unshift(ce[ye].value);H=s2(Ce,t),_.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let ce=_.output.slice(0,I.outputIndex),Ce=_.tokens.slice(I.tokensIndex);I.value=I.output="\\{",C=H="\\}",_.output=ce;for(let ye of Ce)_.output+=ye.output||ye.value}W({type:"brace",value:C,output:H}),Ft("braces"),U.pop();continue}if(C==="|"){Q.length>0&&Q[Q.length-1].conditions++,W({type:"text",value:C});continue}if(C===","){let I=C,H=U[U.length-1];H&&le[le.length-1]==="braces"&&(H.comma=!0,I="|"),W({type:"comma",value:C,output:I});continue}if(C==="/"){if(A.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",a.pop(),A=s;continue}W({type:"slash",value:C,output:h});continue}if(C==="."){if(_.braces>0&&A.type==="dot"){A.value==="."&&(A.output=d);let I=U[U.length-1];A.type="dots",A.output+=C,A.value+=C,I.dots=!0;continue}if(_.braces+_.parens===0&&A.type!=="bos"&&A.type!=="slash"){W({type:"text",value:C,output:d});continue}W({type:"dot",value:C,output:d});continue}if(C==="?"){if(!(A&&A.value==="(")&&t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("qmark",C);continue}if(A&&A.type==="paren"){let H=V(),ce=C;if(H==="<"&&!Me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ce=`\\${C}`),W({type:"text",value:C,output:ce});continue}if(t.dot!==!0&&(A.type==="slash"||A.type==="bos")){W({type:"qmark",value:C,output:E});continue}W({type:"qmark",value:C,output:S});continue}if(C==="!"){if(t.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Ui("negate",C);continue}if(t.nonegate!==!0&&_.index===0){Iv();continue}}if(C==="+"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("plus",C);continue}if(A&&A.value==="("||t.regex===!1){W({type:"plus",value:C,output:p});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||_.parens>0){W({type:"plus",value:C});continue}W({type:"plus",value:p});continue}if(C==="@"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){W({type:"at",extglob:!0,value:C,output:""});continue}W({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let I=i2.exec(Ie());I&&(C+=I[0],_.index+=I[0].length),W({type:"text",value:C});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=C,A.output=Y,_.backtrack=!0,_.globstar=!0,De(C);continue}let $=Ie();if(t.noextglob!==!0&&/^\([^?]/.test($)){Ui("star",C);continue}if(A.type==="star"){if(t.noglobstar===!0){De(C);continue}let I=A.prev,H=I.prev,ce=I.type==="slash"||I.type==="bos",Ce=H&&(H.type==="star"||H.type==="globstar");if(t.bash===!0&&(!ce||$[0]&&$[0]!=="/")){W({type:"star",value:C,output:""});continue}let ye=_.braces>0&&(I.type==="comma"||I.type==="brace"),Bs=Q.length&&(I.type==="pipe"||I.type==="paren");if(!ce&&I.type!=="paren"&&!ye&&!Bs){W({type:"star",value:C,output:""});continue}for(;$.slice(0,3)==="/**";){let Vi=r[_.index+4];if(Vi&&Vi!=="/")break;$=$.slice(3),De("/**",3)}if(I.type==="bos"&&he()){A.type="globstar",A.value+=C,A.output=N(t),_.output=A.output,_.globstar=!0,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!Ce&&he()){_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=N(t)+(t.strictSlashes?")":"|$)"),A.value+=C,_.globstar=!0,_.output+=I.output+A.output,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&$[0]==="/"){let Vi=$[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=`${N(t)}${h}|${h}${Vi})`,A.value+=C,_.output+=I.output+A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&$[0]==="/"){A.type="globstar",A.value+=C,A.output=`(?:^|${h}|${N(t)}${h})`,_.output=A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-A.output.length),A.type="globstar",A.output=N(t),A.value+=C,_.output+=A.output,_.globstar=!0,De(C);continue}let ae={type:"star",value:C,output:Y};if(t.bash===!0){ae.output=".*?",(A.type==="bos"||A.type==="slash")&&(ae.output=R+ae.output),W(ae);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&t.regex===!0){ae.output=C,W(ae);continue}(_.index===_.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(_.output+=w,A.output+=w):t.dot===!0?(_.output+=k,A.output+=k):(_.output+=R,A.output+=R),V()!=="*"&&(_.output+=b,A.output+=b)),W(ae)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));_.output=Me.escapeLast(_.output,"["),Ft("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing",")"));_.output=Me.escapeLast(_.output,"("),Ft("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","}"));_.output=Me.escapeLast(_.output,"{"),Ft("braces")}if(t.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&W({type:"maybe_slash",value:"",output:`${h}?`}),_.backtrack===!0){_.output="";for(let $ of _.tokens)_.output+=$.output!=null?$.output:$.value,$.suffix&&(_.output+=$.suffix)}return _};xl.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=tg[r]||r;let s=Me.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:h,START_ANCHOR:b}=bs.globChars(s),v=t.dot?d:f,y=t.dot?p:f,w=t.capture?"":"?:",k={negated:!1,prefix:""},S=t.bash===!0?".*?":h;t.capture&&(S=`(${S})`);let E=R=>R.noglobstar===!0?S:`(${w}(?:(?!${b}${R.dot?c:a}).)*?)`,T=R=>{switch(R){case"*":return`${v}${l}${S}`;case".*":return`${a}${l}${S}`;case"*.*":return`${v}${S}${a}${l}${S}`;case"
Vg
javascript
LibreSpark/LibreTV
libs/tailwindcss.min.js
https://github.com/LibreSpark/LibreTV/blob/master/libs/tailwindcss.min.js
Apache-2.0
restoreBefore(e){let t=e.raw("before").split(` `),i=t[t.length-1];this.all.group(e).up(n=>{let s=n.raw("before").split(` `),a=s[s.length-1];a.length<i.length&&(i=a)}),t[t.length-1]=i,e.raws.before=t.join(` `)}
":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:PE.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?jE:Hm}}});var qi=x(Re=>{u();"use strict";var UE=(et(),Ur),VE=m.platform==="win32",{REGEX_BACKSLASH:HE,REGEX_REMOVE_BACKSLASH:WE,REGEX_SPECIAL_CHARS:GE,REGEX_SPECIAL_CHARS_GLOBAL:QE}=Di();Re.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Re.hasRegexChars=r=>GE.test(r);Re.isRegexChar=r=>r.length===1&&Re.hasRegexChars(r);Re.escapeRegex=r=>r.replace(QE,"\\$1");Re.toPosixSlashes=r=>r.replace(HE,"/");Re.removeBackslashes=r=>r.replace(WE,e=>e==="\\"?"":e);Re.supportsLookbehinds=()=>{let r=m.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Re.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:VE===!0||UE.sep==="\\";Re.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?Re.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};Re.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Re.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var eg=x((u6,Jm)=>{u();"use strict";var Gm=qi(),{CHAR_ASTERISK:gl,CHAR_AT:YE,CHAR_BACKWARD_SLASH:$i,CHAR_COMMA:KE,CHAR_DOT:yl,CHAR_EXCLAMATION_MARK:bl,CHAR_FORWARD_SLASH:Qm,CHAR_LEFT_CURLY_BRACE:wl,CHAR_LEFT_PARENTHESES:vl,CHAR_LEFT_SQUARE_BRACKET:XE,CHAR_PLUS:ZE,CHAR_QUESTION_MARK:Ym,CHAR_RIGHT_CURLY_BRACE:JE,CHAR_RIGHT_PARENTHESES:Km,CHAR_RIGHT_SQUARE_BRACKET:e2}=Di(),Xm=r=>r===Qm||r===$i,Zm=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},t2=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],a=[],o=[],l=r,c=-1,f=0,d=0,p=!1,h=!1,b=!1,v=!1,y=!1,w=!1,k=!1,S=!1,E=!1,T=!1,B=0,N,R,F={value:"",depth:0,isGlob:!1},Y=()=>c>=i,_=()=>l.charCodeAt(c+1),Q=()=>(N=R,l.charCodeAt(++c));for(;c<i;){R=Q();let he;if(R===$i){k=F.backslashes=!0,R=Q(),R===wl&&(w=!0);continue}if(w===!0||R===wl){for(B++;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,Q();continue}if(R===wl){B++;continue}if(w!==!0&&R===yl&&(R=Q())===yl){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(w!==!0&&R===KE){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===JE&&(B--,B===0)){w=!1,p=F.isBrace=!0,T=!0;break}}if(n===!0)continue;break}if(R===Qm){if(s.push(c),a.push(F),F={value:"",depth:0,isGlob:!1},T===!0)continue;if(N===yl&&c===f+1){f+=2;continue}d=c+1;continue}if(t.noext!==!0&&(R===ZE||R===YE||R===gl||R===Ym||R===bl)===!0&&_()===vl){if(b=F.isGlob=!0,v=F.isExtglob=!0,T=!0,R===bl&&c===f&&(E=!0),n===!0){for(;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,R=Q();continue}if(R===Km){b=F.isGlob=!0,T=!0;break}}continue}break}if(R===gl){if(N===gl&&(y=F.isGlobstar=!0),b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===Ym){if(b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===XE){for(;Y()!==!0&&(he=Q());){if(he===$i){k=F.backslashes=!0,Q();continue}if(he===e2){h=F.isBracket=!0,b=F.isGlob=!0,T=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&R===bl&&c===f){S=F.negated=!0,f++;continue}if(t.noparen!==!0&&R===vl){if(b=F.isGlob=!0,n===!0){for(;Y()!==!0&&(R=Q());){if(R===vl){k=F.backslashes=!0,R=Q();continue}if(R===Km){T=!0;break}}continue}break}if(b===!0){if(T=!0,n===!0)continue;break}}t.noext===!0&&(v=!1,b=!1);let U=l,le="",A="";f>0&&(le=l.slice(0,f),l=l.slice(f),d-=f),U&&b===!0&&d>0?(U=l.slice(0,d),A=l.slice(d)):b===!0?(U="",A=l):U=l,U&&U!==""&&U!=="/"&&U!==l&&Xm(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),t.unescape===!0&&(A&&(A=Gm.removeBackslashes(A)),U&&k===!0&&(U=Gm.removeBackslashes(U)));let C={prefix:le,input:r,start:f,base:U,glob:A,isBrace:p,isBracket:h,isGlob:b,isExtglob:v,isGlobstar:y,negated:S,negatedExtglob:E};if(t.tokens===!0&&(C.maxDepth=0,Xm(R)||a.push(F),C.tokens=a),t.parts===!0||t.tokens===!0){let he;for(let V=0;V<s.length;V++){let Ee=he?he+1:f,Ie=s[V],De=r.slice(Ee,Ie);t.tokens&&(V===0&&f!==0?(a[V].isPrefix=!0,a[V].value=le):a[V].value=De,Zm(a[V]),C.maxDepth+=a[V].depth),(V!==0||De!=="")&&o.push(De),he=Ie}if(he&&he+1<r.length){let V=r.slice(he+1);o.push(V),t.tokens&&(a[a.length-1].value=V,Zm(a[a.length-1]),C.maxDepth+=a[a.length-1].depth)}C.slashes=s,C.parts=o}return C};Jm.exports=t2});var ig=x((f6,rg)=>{u();"use strict";var bs=Di(),Me=qi(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:r2,REGEX_NON_SPECIAL_CHARS:i2,REGEX_SPECIAL_CHARS_BACKREF:n2,REPLACEMENTS:tg}=bs,s2=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>Me.escapeRegex(n)).join("..")}return t},gr=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,xl=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=tg[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},a=[s],o=t.capture?"":"?:",l=Me.isWindows(e),c=bs.globChars(l),f=bs.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:k,QMARK:S,QMARK_NO_DOT:E,STAR:T,START_ANCHOR:B}=c,N=$=>`(${o}(?:(?!${B}${$.dot?v:d}).)*?)`,R=t.dot?"":y,F=t.dot?S:E,Y=t.bash===!0?N(t):T;t.capture&&(Y=`(${Y})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};r=Me.removePrefix(r,_),n=r.length;let Q=[],U=[],le=[],A=s,C,he=()=>_.index===n-1,V=_.peek=($=1)=>r[_.index+$],Ee=_.advance=()=>r[++_.index]||"",Ie=()=>r.slice(_.index+1),De=($="",ae=0)=>{_.consumed+=$,_.index+=ae},ji=$=>{_.output+=$.output!=null?$.output:$.value,De($.value)},Iv=()=>{let $=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)Ee(),_.start++,$++;return $%2==0?!1:(_.negated=!0,_.start++,!0)},zi=$=>{_[$]++,le.push($)},Ft=$=>{_[$]--,le.pop()},W=$=>{if(A.type==="globstar"){let ae=_.braces>0&&($.type==="comma"||$.type==="brace"),I=$.extglob===!0||Q.length&&($.type==="pipe"||$.type==="paren");$.type!=="slash"&&$.type!=="paren"&&!ae&&!I&&(_.output=_.output.slice(0,-A.output.length),A.type="star",A.value="*",A.output=Y,_.output+=A.output)}if(Q.length&&$.type!=="paren"&&(Q[Q.length-1].inner+=$.value),($.value||$.output)&&ji($),A&&A.type==="text"&&$.type==="text"){A.value+=$.value,A.output=(A.output||"")+$.value;return}$.prev=A,a.push($),A=$},Ui=($,ae)=>{let I={...f[ae],conditions:1,inner:""};I.prev=A,I.parens=_.parens,I.output=_.output;let H=(t.capture?"(":"")+I.open;zi("parens"),W({type:$,value:ae,output:_.output?"":b}),W({type:"paren",extglob:!0,value:Ee(),output:H}),Q.push(I)},Dv=$=>{let ae=$.close+(t.capture?")":""),I;if($.type==="negate"){let H=Y;if($.inner&&$.inner.length>1&&$.inner.includes("/")&&(H=N(t)),(H!==Y||he()||/^\)+$/.test(Ie()))&&(ae=$.close=`)$))${H}`),$.inner.includes("*")&&(I=Ie())&&/^\.[^\\/.]+$/.test(I)){let ce=xl(I,{...e,fastpaths:!1}).output;ae=$.close=`)${ce})${H})`}$.prev.type==="bos"&&(_.negatedExtglob=!0)}W({type:"paren",extglob:!0,value:C,output:ae}),Ft("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let $=!1,ae=r.replace(n2,(I,H,ce,Ce,ye,Bs)=>Ce==="\\"?($=!0,I):Ce==="?"?H?H+Ce+(ye?S.repeat(ye.length):""):Bs===0?F+(ye?S.repeat(ye.length):""):S.repeat(ce.length):Ce==="."?d.repeat(ce.length):Ce==="*"?H?H+Ce+(ye?Y:""):Y:H?I:`\\${I}`);return $===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,I=>I.length%2==0?"\\\\":I?"\\":"")),ae===r&&t.contains===!0?(_.output=r,_):(_.output=Me.wrapOutput(ae,_,e),_)}for(;!he();){if(C=Ee(),C==="\0")continue;if(C==="\\"){let I=V();if(I==="/"&&t.bash!==!0||I==="."||I===";")continue;if(!I){C+="\\",W({type:"text",value:C});continue}let H=/^\\+/.exec(Ie()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,_.index+=ce,ce%2!=0&&(C+="\\")),t.unescape===!0?C=Ee():C+=Ee(),_.brackets===0){W({type:"text",value:C});continue}}if(_.brackets>0&&(C!=="]"||A.value==="["||A.value==="[^")){if(t.posix!==!1&&C===":"){let I=A.value.slice(1);if(I.includes("[")&&(A.posix=!0,I.includes(":"))){let H=A.value.lastIndexOf("["),ce=A.value.slice(0,H),Ce=A.value.slice(H+2),ye=r2[Ce];if(ye){A.value=ce+ye,_.backtrack=!0,Ee(),!s.output&&a.indexOf(A)===1&&(s.output=b);continue}}}(C==="["&&V()!==":"||C==="-"&&V()==="]")&&(C=`\\${C}`),C==="]"&&(A.value==="["||A.value==="[^")&&(C=`\\${C}`),t.posix===!0&&C==="!"&&A.value==="["&&(C="^"),A.value+=C,ji({value:C});continue}if(_.quotes===1&&C!=='"'){C=Me.escapeRegex(C),A.value+=C,ji({value:C});continue}if(C==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&W({type:"text",value:C});continue}if(C==="("){zi("parens"),W({type:"paren",value:C});continue}if(C===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(gr("opening","("));let I=Q[Q.length-1];if(I&&_.parens===I.parens+1){Dv(Q.pop());continue}W({type:"paren",value:C,output:_.parens?")":"\\)"}),Ft("parens");continue}if(C==="["){if(t.nobracket===!0||!Ie().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));C=`\\${C}`}else zi("brackets");W({type:"bracket",value:C});continue}if(C==="]"){if(t.nobracket===!0||A&&A.type==="bracket"&&A.value.length===1){W({type:"text",value:C,output:`\\${C}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(gr("opening","["));W({type:"text",value:C,output:`\\${C}`});continue}Ft("brackets");let I=A.value.slice(1);if(A.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(C=`/${C}`),A.value+=C,ji({value:C}),t.literalBrackets===!1||Me.hasRegexChars(I))continue;let H=Me.escapeRegex(A.value);if(_.output=_.output.slice(0,-A.value.length),t.literalBrackets===!0){_.output+=H,A.value=H;continue}A.value=`(${o}${H}|${A.value})`,_.output+=A.value;continue}if(C==="{"&&t.nobrace!==!0){zi("braces");let I={type:"brace",value:C,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};U.push(I),W(I);continue}if(C==="}"){let I=U[U.length-1];if(t.nobrace===!0||!I){W({type:"text",value:C,output:C});continue}let H=")";if(I.dots===!0){let ce=a.slice(),Ce=[];for(let ye=ce.length-1;ye>=0&&(a.pop(),ce[ye].type!=="brace");ye--)ce[ye].type!=="dots"&&Ce.unshift(ce[ye].value);H=s2(Ce,t),_.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let ce=_.output.slice(0,I.outputIndex),Ce=_.tokens.slice(I.tokensIndex);I.value=I.output="\\{",C=H="\\}",_.output=ce;for(let ye of Ce)_.output+=ye.output||ye.value}W({type:"brace",value:C,output:H}),Ft("braces"),U.pop();continue}if(C==="|"){Q.length>0&&Q[Q.length-1].conditions++,W({type:"text",value:C});continue}if(C===","){let I=C,H=U[U.length-1];H&&le[le.length-1]==="braces"&&(H.comma=!0,I="|"),W({type:"comma",value:C,output:I});continue}if(C==="/"){if(A.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",a.pop(),A=s;continue}W({type:"slash",value:C,output:h});continue}if(C==="."){if(_.braces>0&&A.type==="dot"){A.value==="."&&(A.output=d);let I=U[U.length-1];A.type="dots",A.output+=C,A.value+=C,I.dots=!0;continue}if(_.braces+_.parens===0&&A.type!=="bos"&&A.type!=="slash"){W({type:"text",value:C,output:d});continue}W({type:"dot",value:C,output:d});continue}if(C==="?"){if(!(A&&A.value==="(")&&t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("qmark",C);continue}if(A&&A.type==="paren"){let H=V(),ce=C;if(H==="<"&&!Me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ce=`\\${C}`),W({type:"text",value:C,output:ce});continue}if(t.dot!==!0&&(A.type==="slash"||A.type==="bos")){W({type:"qmark",value:C,output:E});continue}W({type:"qmark",value:C,output:S});continue}if(C==="!"){if(t.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Ui("negate",C);continue}if(t.nonegate!==!0&&_.index===0){Iv();continue}}if(C==="+"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("plus",C);continue}if(A&&A.value==="("||t.regex===!1){W({type:"plus",value:C,output:p});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||_.parens>0){W({type:"plus",value:C});continue}W({type:"plus",value:p});continue}if(C==="@"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){W({type:"at",extglob:!0,value:C,output:""});continue}W({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let I=i2.exec(Ie());I&&(C+=I[0],_.index+=I[0].length),W({type:"text",value:C});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=C,A.output=Y,_.backtrack=!0,_.globstar=!0,De(C);continue}let $=Ie();if(t.noextglob!==!0&&/^\([^?]/.test($)){Ui("star",C);continue}if(A.type==="star"){if(t.noglobstar===!0){De(C);continue}let I=A.prev,H=I.prev,ce=I.type==="slash"||I.type==="bos",Ce=H&&(H.type==="star"||H.type==="globstar");if(t.bash===!0&&(!ce||$[0]&&$[0]!=="/")){W({type:"star",value:C,output:""});continue}let ye=_.braces>0&&(I.type==="comma"||I.type==="brace"),Bs=Q.length&&(I.type==="pipe"||I.type==="paren");if(!ce&&I.type!=="paren"&&!ye&&!Bs){W({type:"star",value:C,output:""});continue}for(;$.slice(0,3)==="/**";){let Vi=r[_.index+4];if(Vi&&Vi!=="/")break;$=$.slice(3),De("/**",3)}if(I.type==="bos"&&he()){A.type="globstar",A.value+=C,A.output=N(t),_.output=A.output,_.globstar=!0,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!Ce&&he()){_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=N(t)+(t.strictSlashes?")":"|$)"),A.value+=C,_.globstar=!0,_.output+=I.output+A.output,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&$[0]==="/"){let Vi=$[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=`${N(t)}${h}|${h}${Vi})`,A.value+=C,_.output+=I.output+A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&$[0]==="/"){A.type="globstar",A.value+=C,A.output=`(?:^|${h}|${N(t)}${h})`,_.output=A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-A.output.length),A.type="globstar",A.output=N(t),A.value+=C,_.output+=A.output,_.globstar=!0,De(C);continue}let ae={type:"star",value:C,output:Y};if(t.bash===!0){ae.output=".*?",(A.type==="bos"||A.type==="slash")&&(ae.output=R+ae.output),W(ae);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&t.regex===!0){ae.output=C,W(ae);continue}(_.index===_.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(_.output+=w,A.output+=w):t.dot===!0?(_.output+=k,A.output+=k):(_.output+=R,A.output+=R),V()!=="*"&&(_.output+=b,A.output+=b)),W(ae)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));_.output=Me.escapeLast(_.output,"["),Ft("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing",")"));_.output=Me.escapeLast(_.output,"("),Ft("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","}"));_.output=Me.escapeLast(_.output,"{"),Ft("braces")}if(t.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&W({type:"maybe_slash",value:"",output:`${h}?`}),_.backtrack===!0){_.output="";for(let $ of _.tokens)_.output+=$.output!=null?$.output:$.value,$.suffix&&(_.output+=$.suffix)}return _};xl.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=tg[r]||r;let s=Me.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:h,START_ANCHOR:b}=bs.globChars(s),v=t.dot?d:f,y=t.dot?p:f,w=t.capture?"":"?:",k={negated:!1,prefix:""},S=t.bash===!0?".*?":h;t.capture&&(S=`(${S})`);let E=R=>R.noglobstar===!0?S:`(${w}(?:(?!${b}${R.dot?c:a}).)*?)`,T=R=>{switch(R){case"*":return`${v}${l}${S}`;case".*":return`${a}${l}${S}`;case"*.*":return`${v}${S}${a}${l}${S}`;case"
restoreBefore
javascript
LibreSpark/LibreTV
libs/tailwindcss.min.js
https://github.com/LibreSpark/LibreTV/blob/master/libs/tailwindcss.min.js
Apache-2.0
remove(e,t){let i=this.prefixes.remove["@resolution"];e.walkAtRules((n,s)=>{this.prefixes.remove[`@${n.name}`]?this.disabled(n,t)||n.parent.removeChild(s):n.name==="media"&&n.params.includes("-resolution")&&i&&i.clean(n)});for(let n of this.prefixes.remove.selectors)e.walkRules((s,a)=>{n.check(s)&&(this.disabled(s,t)||s.parent.removeChild(a))});return e.walkDecls((n,s)=>{if(this.disabled(n,t))return;let a=n.parent,o=this.prefixes.unprefixed(n.prop);if((n.prop==="transition"||n.prop==="transition-property")&&this.prefixes.transition.remove(n),this.prefixes.remove[n.prop]&&this.prefixes.remove[n.prop].remove){let l=this.prefixes.group(n).down(c=>this.prefixes.normalize(c.prop)===o);if(o==="flex-flow"&&(l=!0),n.prop==="-webkit-box-orient"){let c={"flex-direction":!0,"flex-flow":!0};if(!n.parent.some(f=>c[f.prop]))return}if(l&&!this.withHackValue(n)){n.raw("before").includes(` `)&&this.reduceSpaces(n),a.removeChild(s);return}}for(let l of this.prefixes.values("remove",o)){if(!l.check||!l.check(n.value))continue;if(o=l.unprefixed,this.prefixes.group(n).down(f=>f.value.includes(o))){a.removeChild(s);return}}})}
":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:PE.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?jE:Hm}}});var qi=x(Re=>{u();"use strict";var UE=(et(),Ur),VE=m.platform==="win32",{REGEX_BACKSLASH:HE,REGEX_REMOVE_BACKSLASH:WE,REGEX_SPECIAL_CHARS:GE,REGEX_SPECIAL_CHARS_GLOBAL:QE}=Di();Re.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Re.hasRegexChars=r=>GE.test(r);Re.isRegexChar=r=>r.length===1&&Re.hasRegexChars(r);Re.escapeRegex=r=>r.replace(QE,"\\$1");Re.toPosixSlashes=r=>r.replace(HE,"/");Re.removeBackslashes=r=>r.replace(WE,e=>e==="\\"?"":e);Re.supportsLookbehinds=()=>{let r=m.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Re.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:VE===!0||UE.sep==="\\";Re.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?Re.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};Re.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Re.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var eg=x((u6,Jm)=>{u();"use strict";var Gm=qi(),{CHAR_ASTERISK:gl,CHAR_AT:YE,CHAR_BACKWARD_SLASH:$i,CHAR_COMMA:KE,CHAR_DOT:yl,CHAR_EXCLAMATION_MARK:bl,CHAR_FORWARD_SLASH:Qm,CHAR_LEFT_CURLY_BRACE:wl,CHAR_LEFT_PARENTHESES:vl,CHAR_LEFT_SQUARE_BRACKET:XE,CHAR_PLUS:ZE,CHAR_QUESTION_MARK:Ym,CHAR_RIGHT_CURLY_BRACE:JE,CHAR_RIGHT_PARENTHESES:Km,CHAR_RIGHT_SQUARE_BRACKET:e2}=Di(),Xm=r=>r===Qm||r===$i,Zm=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},t2=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],a=[],o=[],l=r,c=-1,f=0,d=0,p=!1,h=!1,b=!1,v=!1,y=!1,w=!1,k=!1,S=!1,E=!1,T=!1,B=0,N,R,F={value:"",depth:0,isGlob:!1},Y=()=>c>=i,_=()=>l.charCodeAt(c+1),Q=()=>(N=R,l.charCodeAt(++c));for(;c<i;){R=Q();let he;if(R===$i){k=F.backslashes=!0,R=Q(),R===wl&&(w=!0);continue}if(w===!0||R===wl){for(B++;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,Q();continue}if(R===wl){B++;continue}if(w!==!0&&R===yl&&(R=Q())===yl){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(w!==!0&&R===KE){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===JE&&(B--,B===0)){w=!1,p=F.isBrace=!0,T=!0;break}}if(n===!0)continue;break}if(R===Qm){if(s.push(c),a.push(F),F={value:"",depth:0,isGlob:!1},T===!0)continue;if(N===yl&&c===f+1){f+=2;continue}d=c+1;continue}if(t.noext!==!0&&(R===ZE||R===YE||R===gl||R===Ym||R===bl)===!0&&_()===vl){if(b=F.isGlob=!0,v=F.isExtglob=!0,T=!0,R===bl&&c===f&&(E=!0),n===!0){for(;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,R=Q();continue}if(R===Km){b=F.isGlob=!0,T=!0;break}}continue}break}if(R===gl){if(N===gl&&(y=F.isGlobstar=!0),b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===Ym){if(b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===XE){for(;Y()!==!0&&(he=Q());){if(he===$i){k=F.backslashes=!0,Q();continue}if(he===e2){h=F.isBracket=!0,b=F.isGlob=!0,T=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&R===bl&&c===f){S=F.negated=!0,f++;continue}if(t.noparen!==!0&&R===vl){if(b=F.isGlob=!0,n===!0){for(;Y()!==!0&&(R=Q());){if(R===vl){k=F.backslashes=!0,R=Q();continue}if(R===Km){T=!0;break}}continue}break}if(b===!0){if(T=!0,n===!0)continue;break}}t.noext===!0&&(v=!1,b=!1);let U=l,le="",A="";f>0&&(le=l.slice(0,f),l=l.slice(f),d-=f),U&&b===!0&&d>0?(U=l.slice(0,d),A=l.slice(d)):b===!0?(U="",A=l):U=l,U&&U!==""&&U!=="/"&&U!==l&&Xm(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),t.unescape===!0&&(A&&(A=Gm.removeBackslashes(A)),U&&k===!0&&(U=Gm.removeBackslashes(U)));let C={prefix:le,input:r,start:f,base:U,glob:A,isBrace:p,isBracket:h,isGlob:b,isExtglob:v,isGlobstar:y,negated:S,negatedExtglob:E};if(t.tokens===!0&&(C.maxDepth=0,Xm(R)||a.push(F),C.tokens=a),t.parts===!0||t.tokens===!0){let he;for(let V=0;V<s.length;V++){let Ee=he?he+1:f,Ie=s[V],De=r.slice(Ee,Ie);t.tokens&&(V===0&&f!==0?(a[V].isPrefix=!0,a[V].value=le):a[V].value=De,Zm(a[V]),C.maxDepth+=a[V].depth),(V!==0||De!=="")&&o.push(De),he=Ie}if(he&&he+1<r.length){let V=r.slice(he+1);o.push(V),t.tokens&&(a[a.length-1].value=V,Zm(a[a.length-1]),C.maxDepth+=a[a.length-1].depth)}C.slashes=s,C.parts=o}return C};Jm.exports=t2});var ig=x((f6,rg)=>{u();"use strict";var bs=Di(),Me=qi(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:r2,REGEX_NON_SPECIAL_CHARS:i2,REGEX_SPECIAL_CHARS_BACKREF:n2,REPLACEMENTS:tg}=bs,s2=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>Me.escapeRegex(n)).join("..")}return t},gr=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,xl=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=tg[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},a=[s],o=t.capture?"":"?:",l=Me.isWindows(e),c=bs.globChars(l),f=bs.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:k,QMARK:S,QMARK_NO_DOT:E,STAR:T,START_ANCHOR:B}=c,N=$=>`(${o}(?:(?!${B}${$.dot?v:d}).)*?)`,R=t.dot?"":y,F=t.dot?S:E,Y=t.bash===!0?N(t):T;t.capture&&(Y=`(${Y})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};r=Me.removePrefix(r,_),n=r.length;let Q=[],U=[],le=[],A=s,C,he=()=>_.index===n-1,V=_.peek=($=1)=>r[_.index+$],Ee=_.advance=()=>r[++_.index]||"",Ie=()=>r.slice(_.index+1),De=($="",ae=0)=>{_.consumed+=$,_.index+=ae},ji=$=>{_.output+=$.output!=null?$.output:$.value,De($.value)},Iv=()=>{let $=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)Ee(),_.start++,$++;return $%2==0?!1:(_.negated=!0,_.start++,!0)},zi=$=>{_[$]++,le.push($)},Ft=$=>{_[$]--,le.pop()},W=$=>{if(A.type==="globstar"){let ae=_.braces>0&&($.type==="comma"||$.type==="brace"),I=$.extglob===!0||Q.length&&($.type==="pipe"||$.type==="paren");$.type!=="slash"&&$.type!=="paren"&&!ae&&!I&&(_.output=_.output.slice(0,-A.output.length),A.type="star",A.value="*",A.output=Y,_.output+=A.output)}if(Q.length&&$.type!=="paren"&&(Q[Q.length-1].inner+=$.value),($.value||$.output)&&ji($),A&&A.type==="text"&&$.type==="text"){A.value+=$.value,A.output=(A.output||"")+$.value;return}$.prev=A,a.push($),A=$},Ui=($,ae)=>{let I={...f[ae],conditions:1,inner:""};I.prev=A,I.parens=_.parens,I.output=_.output;let H=(t.capture?"(":"")+I.open;zi("parens"),W({type:$,value:ae,output:_.output?"":b}),W({type:"paren",extglob:!0,value:Ee(),output:H}),Q.push(I)},Dv=$=>{let ae=$.close+(t.capture?")":""),I;if($.type==="negate"){let H=Y;if($.inner&&$.inner.length>1&&$.inner.includes("/")&&(H=N(t)),(H!==Y||he()||/^\)+$/.test(Ie()))&&(ae=$.close=`)$))${H}`),$.inner.includes("*")&&(I=Ie())&&/^\.[^\\/.]+$/.test(I)){let ce=xl(I,{...e,fastpaths:!1}).output;ae=$.close=`)${ce})${H})`}$.prev.type==="bos"&&(_.negatedExtglob=!0)}W({type:"paren",extglob:!0,value:C,output:ae}),Ft("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let $=!1,ae=r.replace(n2,(I,H,ce,Ce,ye,Bs)=>Ce==="\\"?($=!0,I):Ce==="?"?H?H+Ce+(ye?S.repeat(ye.length):""):Bs===0?F+(ye?S.repeat(ye.length):""):S.repeat(ce.length):Ce==="."?d.repeat(ce.length):Ce==="*"?H?H+Ce+(ye?Y:""):Y:H?I:`\\${I}`);return $===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,I=>I.length%2==0?"\\\\":I?"\\":"")),ae===r&&t.contains===!0?(_.output=r,_):(_.output=Me.wrapOutput(ae,_,e),_)}for(;!he();){if(C=Ee(),C==="\0")continue;if(C==="\\"){let I=V();if(I==="/"&&t.bash!==!0||I==="."||I===";")continue;if(!I){C+="\\",W({type:"text",value:C});continue}let H=/^\\+/.exec(Ie()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,_.index+=ce,ce%2!=0&&(C+="\\")),t.unescape===!0?C=Ee():C+=Ee(),_.brackets===0){W({type:"text",value:C});continue}}if(_.brackets>0&&(C!=="]"||A.value==="["||A.value==="[^")){if(t.posix!==!1&&C===":"){let I=A.value.slice(1);if(I.includes("[")&&(A.posix=!0,I.includes(":"))){let H=A.value.lastIndexOf("["),ce=A.value.slice(0,H),Ce=A.value.slice(H+2),ye=r2[Ce];if(ye){A.value=ce+ye,_.backtrack=!0,Ee(),!s.output&&a.indexOf(A)===1&&(s.output=b);continue}}}(C==="["&&V()!==":"||C==="-"&&V()==="]")&&(C=`\\${C}`),C==="]"&&(A.value==="["||A.value==="[^")&&(C=`\\${C}`),t.posix===!0&&C==="!"&&A.value==="["&&(C="^"),A.value+=C,ji({value:C});continue}if(_.quotes===1&&C!=='"'){C=Me.escapeRegex(C),A.value+=C,ji({value:C});continue}if(C==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&W({type:"text",value:C});continue}if(C==="("){zi("parens"),W({type:"paren",value:C});continue}if(C===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(gr("opening","("));let I=Q[Q.length-1];if(I&&_.parens===I.parens+1){Dv(Q.pop());continue}W({type:"paren",value:C,output:_.parens?")":"\\)"}),Ft("parens");continue}if(C==="["){if(t.nobracket===!0||!Ie().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));C=`\\${C}`}else zi("brackets");W({type:"bracket",value:C});continue}if(C==="]"){if(t.nobracket===!0||A&&A.type==="bracket"&&A.value.length===1){W({type:"text",value:C,output:`\\${C}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(gr("opening","["));W({type:"text",value:C,output:`\\${C}`});continue}Ft("brackets");let I=A.value.slice(1);if(A.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(C=`/${C}`),A.value+=C,ji({value:C}),t.literalBrackets===!1||Me.hasRegexChars(I))continue;let H=Me.escapeRegex(A.value);if(_.output=_.output.slice(0,-A.value.length),t.literalBrackets===!0){_.output+=H,A.value=H;continue}A.value=`(${o}${H}|${A.value})`,_.output+=A.value;continue}if(C==="{"&&t.nobrace!==!0){zi("braces");let I={type:"brace",value:C,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};U.push(I),W(I);continue}if(C==="}"){let I=U[U.length-1];if(t.nobrace===!0||!I){W({type:"text",value:C,output:C});continue}let H=")";if(I.dots===!0){let ce=a.slice(),Ce=[];for(let ye=ce.length-1;ye>=0&&(a.pop(),ce[ye].type!=="brace");ye--)ce[ye].type!=="dots"&&Ce.unshift(ce[ye].value);H=s2(Ce,t),_.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let ce=_.output.slice(0,I.outputIndex),Ce=_.tokens.slice(I.tokensIndex);I.value=I.output="\\{",C=H="\\}",_.output=ce;for(let ye of Ce)_.output+=ye.output||ye.value}W({type:"brace",value:C,output:H}),Ft("braces"),U.pop();continue}if(C==="|"){Q.length>0&&Q[Q.length-1].conditions++,W({type:"text",value:C});continue}if(C===","){let I=C,H=U[U.length-1];H&&le[le.length-1]==="braces"&&(H.comma=!0,I="|"),W({type:"comma",value:C,output:I});continue}if(C==="/"){if(A.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",a.pop(),A=s;continue}W({type:"slash",value:C,output:h});continue}if(C==="."){if(_.braces>0&&A.type==="dot"){A.value==="."&&(A.output=d);let I=U[U.length-1];A.type="dots",A.output+=C,A.value+=C,I.dots=!0;continue}if(_.braces+_.parens===0&&A.type!=="bos"&&A.type!=="slash"){W({type:"text",value:C,output:d});continue}W({type:"dot",value:C,output:d});continue}if(C==="?"){if(!(A&&A.value==="(")&&t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("qmark",C);continue}if(A&&A.type==="paren"){let H=V(),ce=C;if(H==="<"&&!Me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ce=`\\${C}`),W({type:"text",value:C,output:ce});continue}if(t.dot!==!0&&(A.type==="slash"||A.type==="bos")){W({type:"qmark",value:C,output:E});continue}W({type:"qmark",value:C,output:S});continue}if(C==="!"){if(t.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Ui("negate",C);continue}if(t.nonegate!==!0&&_.index===0){Iv();continue}}if(C==="+"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("plus",C);continue}if(A&&A.value==="("||t.regex===!1){W({type:"plus",value:C,output:p});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||_.parens>0){W({type:"plus",value:C});continue}W({type:"plus",value:p});continue}if(C==="@"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){W({type:"at",extglob:!0,value:C,output:""});continue}W({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let I=i2.exec(Ie());I&&(C+=I[0],_.index+=I[0].length),W({type:"text",value:C});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=C,A.output=Y,_.backtrack=!0,_.globstar=!0,De(C);continue}let $=Ie();if(t.noextglob!==!0&&/^\([^?]/.test($)){Ui("star",C);continue}if(A.type==="star"){if(t.noglobstar===!0){De(C);continue}let I=A.prev,H=I.prev,ce=I.type==="slash"||I.type==="bos",Ce=H&&(H.type==="star"||H.type==="globstar");if(t.bash===!0&&(!ce||$[0]&&$[0]!=="/")){W({type:"star",value:C,output:""});continue}let ye=_.braces>0&&(I.type==="comma"||I.type==="brace"),Bs=Q.length&&(I.type==="pipe"||I.type==="paren");if(!ce&&I.type!=="paren"&&!ye&&!Bs){W({type:"star",value:C,output:""});continue}for(;$.slice(0,3)==="/**";){let Vi=r[_.index+4];if(Vi&&Vi!=="/")break;$=$.slice(3),De("/**",3)}if(I.type==="bos"&&he()){A.type="globstar",A.value+=C,A.output=N(t),_.output=A.output,_.globstar=!0,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!Ce&&he()){_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=N(t)+(t.strictSlashes?")":"|$)"),A.value+=C,_.globstar=!0,_.output+=I.output+A.output,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&$[0]==="/"){let Vi=$[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=`${N(t)}${h}|${h}${Vi})`,A.value+=C,_.output+=I.output+A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&$[0]==="/"){A.type="globstar",A.value+=C,A.output=`(?:^|${h}|${N(t)}${h})`,_.output=A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-A.output.length),A.type="globstar",A.output=N(t),A.value+=C,_.output+=A.output,_.globstar=!0,De(C);continue}let ae={type:"star",value:C,output:Y};if(t.bash===!0){ae.output=".*?",(A.type==="bos"||A.type==="slash")&&(ae.output=R+ae.output),W(ae);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&t.regex===!0){ae.output=C,W(ae);continue}(_.index===_.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(_.output+=w,A.output+=w):t.dot===!0?(_.output+=k,A.output+=k):(_.output+=R,A.output+=R),V()!=="*"&&(_.output+=b,A.output+=b)),W(ae)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));_.output=Me.escapeLast(_.output,"["),Ft("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing",")"));_.output=Me.escapeLast(_.output,"("),Ft("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","}"));_.output=Me.escapeLast(_.output,"{"),Ft("braces")}if(t.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&W({type:"maybe_slash",value:"",output:`${h}?`}),_.backtrack===!0){_.output="";for(let $ of _.tokens)_.output+=$.output!=null?$.output:$.value,$.suffix&&(_.output+=$.suffix)}return _};xl.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=tg[r]||r;let s=Me.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:h,START_ANCHOR:b}=bs.globChars(s),v=t.dot?d:f,y=t.dot?p:f,w=t.capture?"":"?:",k={negated:!1,prefix:""},S=t.bash===!0?".*?":h;t.capture&&(S=`(${S})`);let E=R=>R.noglobstar===!0?S:`(${w}(?:(?!${b}${R.dot?c:a}).)*?)`,T=R=>{switch(R){case"*":return`${v}${l}${S}`;case".*":return`${a}${l}${S}`;case"*.*":return`${v}${S}${a}${l}${S}`;case"
remove
javascript
LibreSpark/LibreTV
libs/tailwindcss.min.js
https://github.com/LibreSpark/LibreTV/blob/master/libs/tailwindcss.min.js
Apache-2.0
reduceSpaces(e){let t=!1;if(this.prefixes.group(e).up(()=>(t=!0,!0)),t)return;let i=e.raw("before").split(` `),n=i[i.length-1].length,s=!1;this.prefixes.group(e).down(a=>{i=a.raw("before").split(` `);let o=i.length-1;i[o].length>n&&(s===!1&&(s=i[o].length-n),i[o]=i[o].slice(0,-s),a.raws.before=i.join(` `))})}
":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:PE.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?jE:Hm}}});var qi=x(Re=>{u();"use strict";var UE=(et(),Ur),VE=m.platform==="win32",{REGEX_BACKSLASH:HE,REGEX_REMOVE_BACKSLASH:WE,REGEX_SPECIAL_CHARS:GE,REGEX_SPECIAL_CHARS_GLOBAL:QE}=Di();Re.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Re.hasRegexChars=r=>GE.test(r);Re.isRegexChar=r=>r.length===1&&Re.hasRegexChars(r);Re.escapeRegex=r=>r.replace(QE,"\\$1");Re.toPosixSlashes=r=>r.replace(HE,"/");Re.removeBackslashes=r=>r.replace(WE,e=>e==="\\"?"":e);Re.supportsLookbehinds=()=>{let r=m.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Re.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:VE===!0||UE.sep==="\\";Re.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?Re.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};Re.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Re.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var eg=x((u6,Jm)=>{u();"use strict";var Gm=qi(),{CHAR_ASTERISK:gl,CHAR_AT:YE,CHAR_BACKWARD_SLASH:$i,CHAR_COMMA:KE,CHAR_DOT:yl,CHAR_EXCLAMATION_MARK:bl,CHAR_FORWARD_SLASH:Qm,CHAR_LEFT_CURLY_BRACE:wl,CHAR_LEFT_PARENTHESES:vl,CHAR_LEFT_SQUARE_BRACKET:XE,CHAR_PLUS:ZE,CHAR_QUESTION_MARK:Ym,CHAR_RIGHT_CURLY_BRACE:JE,CHAR_RIGHT_PARENTHESES:Km,CHAR_RIGHT_SQUARE_BRACKET:e2}=Di(),Xm=r=>r===Qm||r===$i,Zm=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},t2=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],a=[],o=[],l=r,c=-1,f=0,d=0,p=!1,h=!1,b=!1,v=!1,y=!1,w=!1,k=!1,S=!1,E=!1,T=!1,B=0,N,R,F={value:"",depth:0,isGlob:!1},Y=()=>c>=i,_=()=>l.charCodeAt(c+1),Q=()=>(N=R,l.charCodeAt(++c));for(;c<i;){R=Q();let he;if(R===$i){k=F.backslashes=!0,R=Q(),R===wl&&(w=!0);continue}if(w===!0||R===wl){for(B++;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,Q();continue}if(R===wl){B++;continue}if(w!==!0&&R===yl&&(R=Q())===yl){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(w!==!0&&R===KE){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===JE&&(B--,B===0)){w=!1,p=F.isBrace=!0,T=!0;break}}if(n===!0)continue;break}if(R===Qm){if(s.push(c),a.push(F),F={value:"",depth:0,isGlob:!1},T===!0)continue;if(N===yl&&c===f+1){f+=2;continue}d=c+1;continue}if(t.noext!==!0&&(R===ZE||R===YE||R===gl||R===Ym||R===bl)===!0&&_()===vl){if(b=F.isGlob=!0,v=F.isExtglob=!0,T=!0,R===bl&&c===f&&(E=!0),n===!0){for(;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,R=Q();continue}if(R===Km){b=F.isGlob=!0,T=!0;break}}continue}break}if(R===gl){if(N===gl&&(y=F.isGlobstar=!0),b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===Ym){if(b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===XE){for(;Y()!==!0&&(he=Q());){if(he===$i){k=F.backslashes=!0,Q();continue}if(he===e2){h=F.isBracket=!0,b=F.isGlob=!0,T=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&R===bl&&c===f){S=F.negated=!0,f++;continue}if(t.noparen!==!0&&R===vl){if(b=F.isGlob=!0,n===!0){for(;Y()!==!0&&(R=Q());){if(R===vl){k=F.backslashes=!0,R=Q();continue}if(R===Km){T=!0;break}}continue}break}if(b===!0){if(T=!0,n===!0)continue;break}}t.noext===!0&&(v=!1,b=!1);let U=l,le="",A="";f>0&&(le=l.slice(0,f),l=l.slice(f),d-=f),U&&b===!0&&d>0?(U=l.slice(0,d),A=l.slice(d)):b===!0?(U="",A=l):U=l,U&&U!==""&&U!=="/"&&U!==l&&Xm(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),t.unescape===!0&&(A&&(A=Gm.removeBackslashes(A)),U&&k===!0&&(U=Gm.removeBackslashes(U)));let C={prefix:le,input:r,start:f,base:U,glob:A,isBrace:p,isBracket:h,isGlob:b,isExtglob:v,isGlobstar:y,negated:S,negatedExtglob:E};if(t.tokens===!0&&(C.maxDepth=0,Xm(R)||a.push(F),C.tokens=a),t.parts===!0||t.tokens===!0){let he;for(let V=0;V<s.length;V++){let Ee=he?he+1:f,Ie=s[V],De=r.slice(Ee,Ie);t.tokens&&(V===0&&f!==0?(a[V].isPrefix=!0,a[V].value=le):a[V].value=De,Zm(a[V]),C.maxDepth+=a[V].depth),(V!==0||De!=="")&&o.push(De),he=Ie}if(he&&he+1<r.length){let V=r.slice(he+1);o.push(V),t.tokens&&(a[a.length-1].value=V,Zm(a[a.length-1]),C.maxDepth+=a[a.length-1].depth)}C.slashes=s,C.parts=o}return C};Jm.exports=t2});var ig=x((f6,rg)=>{u();"use strict";var bs=Di(),Me=qi(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:r2,REGEX_NON_SPECIAL_CHARS:i2,REGEX_SPECIAL_CHARS_BACKREF:n2,REPLACEMENTS:tg}=bs,s2=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>Me.escapeRegex(n)).join("..")}return t},gr=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,xl=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=tg[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},a=[s],o=t.capture?"":"?:",l=Me.isWindows(e),c=bs.globChars(l),f=bs.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:k,QMARK:S,QMARK_NO_DOT:E,STAR:T,START_ANCHOR:B}=c,N=$=>`(${o}(?:(?!${B}${$.dot?v:d}).)*?)`,R=t.dot?"":y,F=t.dot?S:E,Y=t.bash===!0?N(t):T;t.capture&&(Y=`(${Y})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};r=Me.removePrefix(r,_),n=r.length;let Q=[],U=[],le=[],A=s,C,he=()=>_.index===n-1,V=_.peek=($=1)=>r[_.index+$],Ee=_.advance=()=>r[++_.index]||"",Ie=()=>r.slice(_.index+1),De=($="",ae=0)=>{_.consumed+=$,_.index+=ae},ji=$=>{_.output+=$.output!=null?$.output:$.value,De($.value)},Iv=()=>{let $=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)Ee(),_.start++,$++;return $%2==0?!1:(_.negated=!0,_.start++,!0)},zi=$=>{_[$]++,le.push($)},Ft=$=>{_[$]--,le.pop()},W=$=>{if(A.type==="globstar"){let ae=_.braces>0&&($.type==="comma"||$.type==="brace"),I=$.extglob===!0||Q.length&&($.type==="pipe"||$.type==="paren");$.type!=="slash"&&$.type!=="paren"&&!ae&&!I&&(_.output=_.output.slice(0,-A.output.length),A.type="star",A.value="*",A.output=Y,_.output+=A.output)}if(Q.length&&$.type!=="paren"&&(Q[Q.length-1].inner+=$.value),($.value||$.output)&&ji($),A&&A.type==="text"&&$.type==="text"){A.value+=$.value,A.output=(A.output||"")+$.value;return}$.prev=A,a.push($),A=$},Ui=($,ae)=>{let I={...f[ae],conditions:1,inner:""};I.prev=A,I.parens=_.parens,I.output=_.output;let H=(t.capture?"(":"")+I.open;zi("parens"),W({type:$,value:ae,output:_.output?"":b}),W({type:"paren",extglob:!0,value:Ee(),output:H}),Q.push(I)},Dv=$=>{let ae=$.close+(t.capture?")":""),I;if($.type==="negate"){let H=Y;if($.inner&&$.inner.length>1&&$.inner.includes("/")&&(H=N(t)),(H!==Y||he()||/^\)+$/.test(Ie()))&&(ae=$.close=`)$))${H}`),$.inner.includes("*")&&(I=Ie())&&/^\.[^\\/.]+$/.test(I)){let ce=xl(I,{...e,fastpaths:!1}).output;ae=$.close=`)${ce})${H})`}$.prev.type==="bos"&&(_.negatedExtglob=!0)}W({type:"paren",extglob:!0,value:C,output:ae}),Ft("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let $=!1,ae=r.replace(n2,(I,H,ce,Ce,ye,Bs)=>Ce==="\\"?($=!0,I):Ce==="?"?H?H+Ce+(ye?S.repeat(ye.length):""):Bs===0?F+(ye?S.repeat(ye.length):""):S.repeat(ce.length):Ce==="."?d.repeat(ce.length):Ce==="*"?H?H+Ce+(ye?Y:""):Y:H?I:`\\${I}`);return $===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,I=>I.length%2==0?"\\\\":I?"\\":"")),ae===r&&t.contains===!0?(_.output=r,_):(_.output=Me.wrapOutput(ae,_,e),_)}for(;!he();){if(C=Ee(),C==="\0")continue;if(C==="\\"){let I=V();if(I==="/"&&t.bash!==!0||I==="."||I===";")continue;if(!I){C+="\\",W({type:"text",value:C});continue}let H=/^\\+/.exec(Ie()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,_.index+=ce,ce%2!=0&&(C+="\\")),t.unescape===!0?C=Ee():C+=Ee(),_.brackets===0){W({type:"text",value:C});continue}}if(_.brackets>0&&(C!=="]"||A.value==="["||A.value==="[^")){if(t.posix!==!1&&C===":"){let I=A.value.slice(1);if(I.includes("[")&&(A.posix=!0,I.includes(":"))){let H=A.value.lastIndexOf("["),ce=A.value.slice(0,H),Ce=A.value.slice(H+2),ye=r2[Ce];if(ye){A.value=ce+ye,_.backtrack=!0,Ee(),!s.output&&a.indexOf(A)===1&&(s.output=b);continue}}}(C==="["&&V()!==":"||C==="-"&&V()==="]")&&(C=`\\${C}`),C==="]"&&(A.value==="["||A.value==="[^")&&(C=`\\${C}`),t.posix===!0&&C==="!"&&A.value==="["&&(C="^"),A.value+=C,ji({value:C});continue}if(_.quotes===1&&C!=='"'){C=Me.escapeRegex(C),A.value+=C,ji({value:C});continue}if(C==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&W({type:"text",value:C});continue}if(C==="("){zi("parens"),W({type:"paren",value:C});continue}if(C===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(gr("opening","("));let I=Q[Q.length-1];if(I&&_.parens===I.parens+1){Dv(Q.pop());continue}W({type:"paren",value:C,output:_.parens?")":"\\)"}),Ft("parens");continue}if(C==="["){if(t.nobracket===!0||!Ie().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));C=`\\${C}`}else zi("brackets");W({type:"bracket",value:C});continue}if(C==="]"){if(t.nobracket===!0||A&&A.type==="bracket"&&A.value.length===1){W({type:"text",value:C,output:`\\${C}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(gr("opening","["));W({type:"text",value:C,output:`\\${C}`});continue}Ft("brackets");let I=A.value.slice(1);if(A.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(C=`/${C}`),A.value+=C,ji({value:C}),t.literalBrackets===!1||Me.hasRegexChars(I))continue;let H=Me.escapeRegex(A.value);if(_.output=_.output.slice(0,-A.value.length),t.literalBrackets===!0){_.output+=H,A.value=H;continue}A.value=`(${o}${H}|${A.value})`,_.output+=A.value;continue}if(C==="{"&&t.nobrace!==!0){zi("braces");let I={type:"brace",value:C,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};U.push(I),W(I);continue}if(C==="}"){let I=U[U.length-1];if(t.nobrace===!0||!I){W({type:"text",value:C,output:C});continue}let H=")";if(I.dots===!0){let ce=a.slice(),Ce=[];for(let ye=ce.length-1;ye>=0&&(a.pop(),ce[ye].type!=="brace");ye--)ce[ye].type!=="dots"&&Ce.unshift(ce[ye].value);H=s2(Ce,t),_.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let ce=_.output.slice(0,I.outputIndex),Ce=_.tokens.slice(I.tokensIndex);I.value=I.output="\\{",C=H="\\}",_.output=ce;for(let ye of Ce)_.output+=ye.output||ye.value}W({type:"brace",value:C,output:H}),Ft("braces"),U.pop();continue}if(C==="|"){Q.length>0&&Q[Q.length-1].conditions++,W({type:"text",value:C});continue}if(C===","){let I=C,H=U[U.length-1];H&&le[le.length-1]==="braces"&&(H.comma=!0,I="|"),W({type:"comma",value:C,output:I});continue}if(C==="/"){if(A.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",a.pop(),A=s;continue}W({type:"slash",value:C,output:h});continue}if(C==="."){if(_.braces>0&&A.type==="dot"){A.value==="."&&(A.output=d);let I=U[U.length-1];A.type="dots",A.output+=C,A.value+=C,I.dots=!0;continue}if(_.braces+_.parens===0&&A.type!=="bos"&&A.type!=="slash"){W({type:"text",value:C,output:d});continue}W({type:"dot",value:C,output:d});continue}if(C==="?"){if(!(A&&A.value==="(")&&t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("qmark",C);continue}if(A&&A.type==="paren"){let H=V(),ce=C;if(H==="<"&&!Me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ce=`\\${C}`),W({type:"text",value:C,output:ce});continue}if(t.dot!==!0&&(A.type==="slash"||A.type==="bos")){W({type:"qmark",value:C,output:E});continue}W({type:"qmark",value:C,output:S});continue}if(C==="!"){if(t.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Ui("negate",C);continue}if(t.nonegate!==!0&&_.index===0){Iv();continue}}if(C==="+"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("plus",C);continue}if(A&&A.value==="("||t.regex===!1){W({type:"plus",value:C,output:p});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||_.parens>0){W({type:"plus",value:C});continue}W({type:"plus",value:p});continue}if(C==="@"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){W({type:"at",extglob:!0,value:C,output:""});continue}W({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let I=i2.exec(Ie());I&&(C+=I[0],_.index+=I[0].length),W({type:"text",value:C});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=C,A.output=Y,_.backtrack=!0,_.globstar=!0,De(C);continue}let $=Ie();if(t.noextglob!==!0&&/^\([^?]/.test($)){Ui("star",C);continue}if(A.type==="star"){if(t.noglobstar===!0){De(C);continue}let I=A.prev,H=I.prev,ce=I.type==="slash"||I.type==="bos",Ce=H&&(H.type==="star"||H.type==="globstar");if(t.bash===!0&&(!ce||$[0]&&$[0]!=="/")){W({type:"star",value:C,output:""});continue}let ye=_.braces>0&&(I.type==="comma"||I.type==="brace"),Bs=Q.length&&(I.type==="pipe"||I.type==="paren");if(!ce&&I.type!=="paren"&&!ye&&!Bs){W({type:"star",value:C,output:""});continue}for(;$.slice(0,3)==="/**";){let Vi=r[_.index+4];if(Vi&&Vi!=="/")break;$=$.slice(3),De("/**",3)}if(I.type==="bos"&&he()){A.type="globstar",A.value+=C,A.output=N(t),_.output=A.output,_.globstar=!0,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!Ce&&he()){_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=N(t)+(t.strictSlashes?")":"|$)"),A.value+=C,_.globstar=!0,_.output+=I.output+A.output,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&$[0]==="/"){let Vi=$[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=`${N(t)}${h}|${h}${Vi})`,A.value+=C,_.output+=I.output+A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&$[0]==="/"){A.type="globstar",A.value+=C,A.output=`(?:^|${h}|${N(t)}${h})`,_.output=A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-A.output.length),A.type="globstar",A.output=N(t),A.value+=C,_.output+=A.output,_.globstar=!0,De(C);continue}let ae={type:"star",value:C,output:Y};if(t.bash===!0){ae.output=".*?",(A.type==="bos"||A.type==="slash")&&(ae.output=R+ae.output),W(ae);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&t.regex===!0){ae.output=C,W(ae);continue}(_.index===_.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(_.output+=w,A.output+=w):t.dot===!0?(_.output+=k,A.output+=k):(_.output+=R,A.output+=R),V()!=="*"&&(_.output+=b,A.output+=b)),W(ae)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));_.output=Me.escapeLast(_.output,"["),Ft("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing",")"));_.output=Me.escapeLast(_.output,"("),Ft("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","}"));_.output=Me.escapeLast(_.output,"{"),Ft("braces")}if(t.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&W({type:"maybe_slash",value:"",output:`${h}?`}),_.backtrack===!0){_.output="";for(let $ of _.tokens)_.output+=$.output!=null?$.output:$.value,$.suffix&&(_.output+=$.suffix)}return _};xl.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=tg[r]||r;let s=Me.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:h,START_ANCHOR:b}=bs.globChars(s),v=t.dot?d:f,y=t.dot?p:f,w=t.capture?"":"?:",k={negated:!1,prefix:""},S=t.bash===!0?".*?":h;t.capture&&(S=`(${S})`);let E=R=>R.noglobstar===!0?S:`(${w}(?:(?!${b}${R.dot?c:a}).)*?)`,T=R=>{switch(R){case"*":return`${v}${l}${S}`;case".*":return`${a}${l}${S}`;case"*.*":return`${v}${S}${a}${l}${S}`;case"
reduceSpaces
javascript
LibreSpark/LibreTV
libs/tailwindcss.min.js
https://github.com/LibreSpark/LibreTV/blob/master/libs/tailwindcss.min.js
Apache-2.0
function H5(r,e){e.browsers.selected.length!==0&&(e.add.selectors.length>0||Object.keys(e.add).length>2||r.warn(`Autoprefixer target browsers do not need any prefixes.You do not need Autoprefixer anymore. Check your Browserslist config to be sure that your targets are set up correctly. Learn more at: https://github.com/postcss/autoprefixer#readme https://github.com/browserslist/browserslist#readme `))}
":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:PE.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?jE:Hm}}});var qi=x(Re=>{u();"use strict";var UE=(et(),Ur),VE=m.platform==="win32",{REGEX_BACKSLASH:HE,REGEX_REMOVE_BACKSLASH:WE,REGEX_SPECIAL_CHARS:GE,REGEX_SPECIAL_CHARS_GLOBAL:QE}=Di();Re.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Re.hasRegexChars=r=>GE.test(r);Re.isRegexChar=r=>r.length===1&&Re.hasRegexChars(r);Re.escapeRegex=r=>r.replace(QE,"\\$1");Re.toPosixSlashes=r=>r.replace(HE,"/");Re.removeBackslashes=r=>r.replace(WE,e=>e==="\\"?"":e);Re.supportsLookbehinds=()=>{let r=m.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Re.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:VE===!0||UE.sep==="\\";Re.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?Re.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};Re.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Re.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",n=t.contains?"":"$",s=`${i}(?:${r})${n}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var eg=x((u6,Jm)=>{u();"use strict";var Gm=qi(),{CHAR_ASTERISK:gl,CHAR_AT:YE,CHAR_BACKWARD_SLASH:$i,CHAR_COMMA:KE,CHAR_DOT:yl,CHAR_EXCLAMATION_MARK:bl,CHAR_FORWARD_SLASH:Qm,CHAR_LEFT_CURLY_BRACE:wl,CHAR_LEFT_PARENTHESES:vl,CHAR_LEFT_SQUARE_BRACKET:XE,CHAR_PLUS:ZE,CHAR_QUESTION_MARK:Ym,CHAR_RIGHT_CURLY_BRACE:JE,CHAR_RIGHT_PARENTHESES:Km,CHAR_RIGHT_SQUARE_BRACKET:e2}=Di(),Xm=r=>r===Qm||r===$i,Zm=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},t2=(r,e)=>{let t=e||{},i=r.length-1,n=t.parts===!0||t.scanToEnd===!0,s=[],a=[],o=[],l=r,c=-1,f=0,d=0,p=!1,h=!1,b=!1,v=!1,y=!1,w=!1,k=!1,S=!1,E=!1,T=!1,B=0,N,R,F={value:"",depth:0,isGlob:!1},Y=()=>c>=i,_=()=>l.charCodeAt(c+1),Q=()=>(N=R,l.charCodeAt(++c));for(;c<i;){R=Q();let he;if(R===$i){k=F.backslashes=!0,R=Q(),R===wl&&(w=!0);continue}if(w===!0||R===wl){for(B++;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,Q();continue}if(R===wl){B++;continue}if(w!==!0&&R===yl&&(R=Q())===yl){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(w!==!0&&R===KE){if(p=F.isBrace=!0,b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===JE&&(B--,B===0)){w=!1,p=F.isBrace=!0,T=!0;break}}if(n===!0)continue;break}if(R===Qm){if(s.push(c),a.push(F),F={value:"",depth:0,isGlob:!1},T===!0)continue;if(N===yl&&c===f+1){f+=2;continue}d=c+1;continue}if(t.noext!==!0&&(R===ZE||R===YE||R===gl||R===Ym||R===bl)===!0&&_()===vl){if(b=F.isGlob=!0,v=F.isExtglob=!0,T=!0,R===bl&&c===f&&(E=!0),n===!0){for(;Y()!==!0&&(R=Q());){if(R===$i){k=F.backslashes=!0,R=Q();continue}if(R===Km){b=F.isGlob=!0,T=!0;break}}continue}break}if(R===gl){if(N===gl&&(y=F.isGlobstar=!0),b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===Ym){if(b=F.isGlob=!0,T=!0,n===!0)continue;break}if(R===XE){for(;Y()!==!0&&(he=Q());){if(he===$i){k=F.backslashes=!0,Q();continue}if(he===e2){h=F.isBracket=!0,b=F.isGlob=!0,T=!0;break}}if(n===!0)continue;break}if(t.nonegate!==!0&&R===bl&&c===f){S=F.negated=!0,f++;continue}if(t.noparen!==!0&&R===vl){if(b=F.isGlob=!0,n===!0){for(;Y()!==!0&&(R=Q());){if(R===vl){k=F.backslashes=!0,R=Q();continue}if(R===Km){T=!0;break}}continue}break}if(b===!0){if(T=!0,n===!0)continue;break}}t.noext===!0&&(v=!1,b=!1);let U=l,le="",A="";f>0&&(le=l.slice(0,f),l=l.slice(f),d-=f),U&&b===!0&&d>0?(U=l.slice(0,d),A=l.slice(d)):b===!0?(U="",A=l):U=l,U&&U!==""&&U!=="/"&&U!==l&&Xm(U.charCodeAt(U.length-1))&&(U=U.slice(0,-1)),t.unescape===!0&&(A&&(A=Gm.removeBackslashes(A)),U&&k===!0&&(U=Gm.removeBackslashes(U)));let C={prefix:le,input:r,start:f,base:U,glob:A,isBrace:p,isBracket:h,isGlob:b,isExtglob:v,isGlobstar:y,negated:S,negatedExtglob:E};if(t.tokens===!0&&(C.maxDepth=0,Xm(R)||a.push(F),C.tokens=a),t.parts===!0||t.tokens===!0){let he;for(let V=0;V<s.length;V++){let Ee=he?he+1:f,Ie=s[V],De=r.slice(Ee,Ie);t.tokens&&(V===0&&f!==0?(a[V].isPrefix=!0,a[V].value=le):a[V].value=De,Zm(a[V]),C.maxDepth+=a[V].depth),(V!==0||De!=="")&&o.push(De),he=Ie}if(he&&he+1<r.length){let V=r.slice(he+1);o.push(V),t.tokens&&(a[a.length-1].value=V,Zm(a[a.length-1]),C.maxDepth+=a[a.length-1].depth)}C.slashes=s,C.parts=o}return C};Jm.exports=t2});var ig=x((f6,rg)=>{u();"use strict";var bs=Di(),Me=qi(),{MAX_LENGTH:ws,POSIX_REGEX_SOURCE:r2,REGEX_NON_SPECIAL_CHARS:i2,REGEX_SPECIAL_CHARS_BACKREF:n2,REPLACEMENTS:tg}=bs,s2=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch(i){return r.map(n=>Me.escapeRegex(n)).join("..")}return t},gr=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,xl=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=tg[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);let s={type:"bos",value:"",output:t.prepend||""},a=[s],o=t.capture?"":"?:",l=Me.isWindows(e),c=bs.globChars(l),f=bs.extglobChars(c),{DOT_LITERAL:d,PLUS_LITERAL:p,SLASH_LITERAL:h,ONE_CHAR:b,DOTS_SLASH:v,NO_DOT:y,NO_DOT_SLASH:w,NO_DOTS_SLASH:k,QMARK:S,QMARK_NO_DOT:E,STAR:T,START_ANCHOR:B}=c,N=$=>`(${o}(?:(?!${B}${$.dot?v:d}).)*?)`,R=t.dot?"":y,F=t.dot?S:E,Y=t.bash===!0?N(t):T;t.capture&&(Y=`(${Y})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let _={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};r=Me.removePrefix(r,_),n=r.length;let Q=[],U=[],le=[],A=s,C,he=()=>_.index===n-1,V=_.peek=($=1)=>r[_.index+$],Ee=_.advance=()=>r[++_.index]||"",Ie=()=>r.slice(_.index+1),De=($="",ae=0)=>{_.consumed+=$,_.index+=ae},ji=$=>{_.output+=$.output!=null?$.output:$.value,De($.value)},Iv=()=>{let $=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)Ee(),_.start++,$++;return $%2==0?!1:(_.negated=!0,_.start++,!0)},zi=$=>{_[$]++,le.push($)},Ft=$=>{_[$]--,le.pop()},W=$=>{if(A.type==="globstar"){let ae=_.braces>0&&($.type==="comma"||$.type==="brace"),I=$.extglob===!0||Q.length&&($.type==="pipe"||$.type==="paren");$.type!=="slash"&&$.type!=="paren"&&!ae&&!I&&(_.output=_.output.slice(0,-A.output.length),A.type="star",A.value="*",A.output=Y,_.output+=A.output)}if(Q.length&&$.type!=="paren"&&(Q[Q.length-1].inner+=$.value),($.value||$.output)&&ji($),A&&A.type==="text"&&$.type==="text"){A.value+=$.value,A.output=(A.output||"")+$.value;return}$.prev=A,a.push($),A=$},Ui=($,ae)=>{let I={...f[ae],conditions:1,inner:""};I.prev=A,I.parens=_.parens,I.output=_.output;let H=(t.capture?"(":"")+I.open;zi("parens"),W({type:$,value:ae,output:_.output?"":b}),W({type:"paren",extglob:!0,value:Ee(),output:H}),Q.push(I)},Dv=$=>{let ae=$.close+(t.capture?")":""),I;if($.type==="negate"){let H=Y;if($.inner&&$.inner.length>1&&$.inner.includes("/")&&(H=N(t)),(H!==Y||he()||/^\)+$/.test(Ie()))&&(ae=$.close=`)$))${H}`),$.inner.includes("*")&&(I=Ie())&&/^\.[^\\/.]+$/.test(I)){let ce=xl(I,{...e,fastpaths:!1}).output;ae=$.close=`)${ce})${H})`}$.prev.type==="bos"&&(_.negatedExtglob=!0)}W({type:"paren",extglob:!0,value:C,output:ae}),Ft("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let $=!1,ae=r.replace(n2,(I,H,ce,Ce,ye,Bs)=>Ce==="\\"?($=!0,I):Ce==="?"?H?H+Ce+(ye?S.repeat(ye.length):""):Bs===0?F+(ye?S.repeat(ye.length):""):S.repeat(ce.length):Ce==="."?d.repeat(ce.length):Ce==="*"?H?H+Ce+(ye?Y:""):Y:H?I:`\\${I}`);return $===!0&&(t.unescape===!0?ae=ae.replace(/\\/g,""):ae=ae.replace(/\\+/g,I=>I.length%2==0?"\\\\":I?"\\":"")),ae===r&&t.contains===!0?(_.output=r,_):(_.output=Me.wrapOutput(ae,_,e),_)}for(;!he();){if(C=Ee(),C==="\0")continue;if(C==="\\"){let I=V();if(I==="/"&&t.bash!==!0||I==="."||I===";")continue;if(!I){C+="\\",W({type:"text",value:C});continue}let H=/^\\+/.exec(Ie()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,_.index+=ce,ce%2!=0&&(C+="\\")),t.unescape===!0?C=Ee():C+=Ee(),_.brackets===0){W({type:"text",value:C});continue}}if(_.brackets>0&&(C!=="]"||A.value==="["||A.value==="[^")){if(t.posix!==!1&&C===":"){let I=A.value.slice(1);if(I.includes("[")&&(A.posix=!0,I.includes(":"))){let H=A.value.lastIndexOf("["),ce=A.value.slice(0,H),Ce=A.value.slice(H+2),ye=r2[Ce];if(ye){A.value=ce+ye,_.backtrack=!0,Ee(),!s.output&&a.indexOf(A)===1&&(s.output=b);continue}}}(C==="["&&V()!==":"||C==="-"&&V()==="]")&&(C=`\\${C}`),C==="]"&&(A.value==="["||A.value==="[^")&&(C=`\\${C}`),t.posix===!0&&C==="!"&&A.value==="["&&(C="^"),A.value+=C,ji({value:C});continue}if(_.quotes===1&&C!=='"'){C=Me.escapeRegex(C),A.value+=C,ji({value:C});continue}if(C==='"'){_.quotes=_.quotes===1?0:1,t.keepQuotes===!0&&W({type:"text",value:C});continue}if(C==="("){zi("parens"),W({type:"paren",value:C});continue}if(C===")"){if(_.parens===0&&t.strictBrackets===!0)throw new SyntaxError(gr("opening","("));let I=Q[Q.length-1];if(I&&_.parens===I.parens+1){Dv(Q.pop());continue}W({type:"paren",value:C,output:_.parens?")":"\\)"}),Ft("parens");continue}if(C==="["){if(t.nobracket===!0||!Ie().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));C=`\\${C}`}else zi("brackets");W({type:"bracket",value:C});continue}if(C==="]"){if(t.nobracket===!0||A&&A.type==="bracket"&&A.value.length===1){W({type:"text",value:C,output:`\\${C}`});continue}if(_.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(gr("opening","["));W({type:"text",value:C,output:`\\${C}`});continue}Ft("brackets");let I=A.value.slice(1);if(A.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(C=`/${C}`),A.value+=C,ji({value:C}),t.literalBrackets===!1||Me.hasRegexChars(I))continue;let H=Me.escapeRegex(A.value);if(_.output=_.output.slice(0,-A.value.length),t.literalBrackets===!0){_.output+=H,A.value=H;continue}A.value=`(${o}${H}|${A.value})`,_.output+=A.value;continue}if(C==="{"&&t.nobrace!==!0){zi("braces");let I={type:"brace",value:C,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};U.push(I),W(I);continue}if(C==="}"){let I=U[U.length-1];if(t.nobrace===!0||!I){W({type:"text",value:C,output:C});continue}let H=")";if(I.dots===!0){let ce=a.slice(),Ce=[];for(let ye=ce.length-1;ye>=0&&(a.pop(),ce[ye].type!=="brace");ye--)ce[ye].type!=="dots"&&Ce.unshift(ce[ye].value);H=s2(Ce,t),_.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){let ce=_.output.slice(0,I.outputIndex),Ce=_.tokens.slice(I.tokensIndex);I.value=I.output="\\{",C=H="\\}",_.output=ce;for(let ye of Ce)_.output+=ye.output||ye.value}W({type:"brace",value:C,output:H}),Ft("braces"),U.pop();continue}if(C==="|"){Q.length>0&&Q[Q.length-1].conditions++,W({type:"text",value:C});continue}if(C===","){let I=C,H=U[U.length-1];H&&le[le.length-1]==="braces"&&(H.comma=!0,I="|"),W({type:"comma",value:C,output:I});continue}if(C==="/"){if(A.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",a.pop(),A=s;continue}W({type:"slash",value:C,output:h});continue}if(C==="."){if(_.braces>0&&A.type==="dot"){A.value==="."&&(A.output=d);let I=U[U.length-1];A.type="dots",A.output+=C,A.value+=C,I.dots=!0;continue}if(_.braces+_.parens===0&&A.type!=="bos"&&A.type!=="slash"){W({type:"text",value:C,output:d});continue}W({type:"dot",value:C,output:d});continue}if(C==="?"){if(!(A&&A.value==="(")&&t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("qmark",C);continue}if(A&&A.type==="paren"){let H=V(),ce=C;if(H==="<"&&!Me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(Ie()))&&(ce=`\\${C}`),W({type:"text",value:C,output:ce});continue}if(t.dot!==!0&&(A.type==="slash"||A.type==="bos")){W({type:"qmark",value:C,output:E});continue}W({type:"qmark",value:C,output:S});continue}if(C==="!"){if(t.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Ui("negate",C);continue}if(t.nonegate!==!0&&_.index===0){Iv();continue}}if(C==="+"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){Ui("plus",C);continue}if(A&&A.value==="("||t.regex===!1){W({type:"plus",value:C,output:p});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||_.parens>0){W({type:"plus",value:C});continue}W({type:"plus",value:p});continue}if(C==="@"){if(t.noextglob!==!0&&V()==="("&&V(2)!=="?"){W({type:"at",extglob:!0,value:C,output:""});continue}W({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);let I=i2.exec(Ie());I&&(C+=I[0],_.index+=I[0].length),W({type:"text",value:C});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=C,A.output=Y,_.backtrack=!0,_.globstar=!0,De(C);continue}let $=Ie();if(t.noextglob!==!0&&/^\([^?]/.test($)){Ui("star",C);continue}if(A.type==="star"){if(t.noglobstar===!0){De(C);continue}let I=A.prev,H=I.prev,ce=I.type==="slash"||I.type==="bos",Ce=H&&(H.type==="star"||H.type==="globstar");if(t.bash===!0&&(!ce||$[0]&&$[0]!=="/")){W({type:"star",value:C,output:""});continue}let ye=_.braces>0&&(I.type==="comma"||I.type==="brace"),Bs=Q.length&&(I.type==="pipe"||I.type==="paren");if(!ce&&I.type!=="paren"&&!ye&&!Bs){W({type:"star",value:C,output:""});continue}for(;$.slice(0,3)==="/**";){let Vi=r[_.index+4];if(Vi&&Vi!=="/")break;$=$.slice(3),De("/**",3)}if(I.type==="bos"&&he()){A.type="globstar",A.value+=C,A.output=N(t),_.output=A.output,_.globstar=!0,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!Ce&&he()){_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=N(t)+(t.strictSlashes?")":"|$)"),A.value+=C,_.globstar=!0,_.output+=I.output+A.output,De(C);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&$[0]==="/"){let Vi=$[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(I.output+A.output).length),I.output=`(?:${I.output}`,A.type="globstar",A.output=`${N(t)}${h}|${h}${Vi})`,A.value+=C,_.output+=I.output+A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&$[0]==="/"){A.type="globstar",A.value+=C,A.output=`(?:^|${h}|${N(t)}${h})`,_.output=A.output,_.globstar=!0,De(C+Ee()),W({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-A.output.length),A.type="globstar",A.output=N(t),A.value+=C,_.output+=A.output,_.globstar=!0,De(C);continue}let ae={type:"star",value:C,output:Y};if(t.bash===!0){ae.output=".*?",(A.type==="bos"||A.type==="slash")&&(ae.output=R+ae.output),W(ae);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&t.regex===!0){ae.output=C,W(ae);continue}(_.index===_.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(_.output+=w,A.output+=w):t.dot===!0?(_.output+=k,A.output+=k):(_.output+=R,A.output+=R),V()!=="*"&&(_.output+=b,A.output+=b)),W(ae)}for(;_.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","]"));_.output=Me.escapeLast(_.output,"["),Ft("brackets")}for(;_.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing",")"));_.output=Me.escapeLast(_.output,"("),Ft("parens")}for(;_.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(gr("closing","}"));_.output=Me.escapeLast(_.output,"{"),Ft("braces")}if(t.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&W({type:"maybe_slash",value:"",output:`${h}?`}),_.backtrack===!0){_.output="";for(let $ of _.tokens)_.output+=$.output!=null?$.output:$.value,$.suffix&&(_.output+=$.suffix)}return _};xl.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(ws,t.maxLength):ws,n=r.length;if(n>i)throw new SyntaxError(`Input length: ${n}, exceeds maximum allowed length: ${i}`);r=tg[r]||r;let s=Me.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,DOTS_SLASH:c,NO_DOT:f,NO_DOTS:d,NO_DOTS_SLASH:p,STAR:h,START_ANCHOR:b}=bs.globChars(s),v=t.dot?d:f,y=t.dot?p:f,w=t.capture?"":"?:",k={negated:!1,prefix:""},S=t.bash===!0?".*?":h;t.capture&&(S=`(${S})`);let E=R=>R.noglobstar===!0?S:`(${w}(?:(?!${b}${R.dot?c:a}).)*?)`,T=R=>{switch(R){case"*":return`${v}${l}${S}`;case".*":return`${a}${l}${S}`;case"*.*":return`${v}${S}${a}${l}${S}`;case"
H5
javascript
LibreSpark/LibreTV
libs/tailwindcss.min.js
https://github.com/LibreSpark/LibreTV/blob/master/libs/tailwindcss.min.js
Apache-2.0
function QR8bitByte(data) { this.mode = QRMode.MODE_8BIT_BYTE; this.data = data; this.parsedData = []; // Added to support UTF-8 Characters for (var i = 0, l = this.data.length; i < l; i++) { var byteArray = []; var code = this.data.charCodeAt(i); if (code > 0x10000) { byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18); byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12); byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6); byteArray[3] = 0x80 | (code & 0x3F); } else if (code > 0x800) { byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12); byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6); byteArray[2] = 0x80 | (code & 0x3F); } else if (code > 0x80) { byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6); byteArray[1] = 0x80 | (code & 0x3F); } else { byteArray[0] = code; } this.parsedData.push(byteArray); } this.parsedData = Array.prototype.concat.apply([], this.parsedData); if (this.parsedData.length != this.data.length) { this.parsedData.unshift(191); this.parsedData.unshift(187); this.parsedData.unshift(239); } }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
QR8bitByte
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function QRCodeModel(typeNumber, errorCorrectLevel) { this.typeNumber = typeNumber; this.errorCorrectLevel = errorCorrectLevel; this.modules = null; this.moduleCount = 0; this.dataCache = null; this.dataList = []; }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
QRCodeModel
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function QRPolynomial(num,shift){if(num.length==undefined){throw new Error(num.length+"/"+shift);} var offset=0;while(offset<num.length&&num[offset]==0){offset++;} this.num=new Array(num.length-offset+shift);for(var i=0;i<num.length-offset;i++){this.num[i]=num[i+offset];}}
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
QRPolynomial
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function _isSupportCanvas() { return typeof CanvasRenderingContext2D != "undefined"; }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
_isSupportCanvas
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function _getAndroid() { var android = false; var sAgent = navigator.userAgent; if (/android/i.test(sAgent)) { // android android = true; var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); if (aMat && aMat[1]) { android = parseFloat(aMat[1]); } } return android; }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
_getAndroid
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
Drawing = function (el, htOption) { this._el = el; this._htOption = htOption; }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
Drawing
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function makeSVG(tag, attrs) { var el = document.createElementNS('http://www.w3.org/2000/svg', tag); for (var k in attrs) if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); return el; }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
makeSVG
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
Drawing = function (el, htOption) { this._el = el; this._htOption = htOption; }
@fileoverview - Using the 'QRCode for Javascript library' - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - this library has no dependencies. @author davidshimjs @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a> @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a> IMPORTANT NOTE: I CUSTOMIZED THIS FILE TO ALLOW IT TO BE IMPORTED AS AN ES6 MODULE. I CHANGED THREE LINES: 1. THE LAST LINE (ASSIGNING THE VAR TO THE WINDOW OBJECT) 2. CALLING TWO IFFE FUNCTIONS WITH "GLOBALTHIS" AS THEIR CONTEXT, BECAUSE "THIS" IS UNDEFINED IN MODULES (PREVIOUSLY, THIS CODE ASSUMED "THIS" MEANT "WINDOW").
Drawing
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function _safeSetDataURI(fSuccess, fFail) { var self = this; self._fFail = fFail; self._fSuccess = fSuccess; // Check it just once if (self._bSupportDataURI === null) { var el = document.createElement("img"); var fOnError = function() { self._bSupportDataURI = false; if (self._fFail) { self._fFail.call(self); } }; var fOnSuccess = function() { self._bSupportDataURI = true; if (self._fSuccess) { self._fSuccess.call(self); } }; el.onabort = fOnError; el.onerror = fOnError; el.onload = fOnSuccess; el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data. return; } else if (self._bSupportDataURI === true && self._fSuccess) { self._fSuccess.call(self); } else if (self._bSupportDataURI === false && self._fFail) { self._fFail.call(self); } }
Check whether the user's browser supports Data URI or not @private @param {Function} fSuccess Occurs if it supports Data URI @param {Function} fFail Occurs if it doesn't support Data URI
_safeSetDataURI
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
fOnError = function() { self._bSupportDataURI = false; if (self._fFail) { self._fFail.call(self); } }
Check whether the user's browser supports Data URI or not @private @param {Function} fSuccess Occurs if it supports Data URI @param {Function} fFail Occurs if it doesn't support Data URI
fOnError
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
fOnSuccess = function() { self._bSupportDataURI = true; if (self._fSuccess) { self._fSuccess.call(self); } }
Check whether the user's browser supports Data URI or not @private @param {Function} fSuccess Occurs if it supports Data URI @param {Function} fFail Occurs if it doesn't support Data URI
fOnSuccess
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
Drawing = function (el, htOption) { this._bIsPainted = false; this._android = _getAndroid(); this._htOption = htOption; this._elCanvas = document.createElement("canvas"); this._elCanvas.width = htOption.width; this._elCanvas.height = htOption.height; el.appendChild(this._elCanvas); this._el = el; this._oContext = this._elCanvas.getContext("2d"); this._bIsPainted = false; this._elImage = document.createElement("img"); this._elImage.alt = "Scan me!"; this._elImage.style.display = "none"; this._el.appendChild(this._elImage); this._bSupportDataURI = null; }
Drawing QRCode by using canvas @constructor @param {HTMLElement} el @param {Object} htOption QRCode Options
Drawing
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT
function _getTypeNumber(sText, nCorrectLevel) { var nType = 1; var length = _getUTF8Length(sText); for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { var nLimit = 0; switch (nCorrectLevel) { case QRErrorCorrectLevel.L : nLimit = QRCodeLimitLength[i][0]; break; case QRErrorCorrectLevel.M : nLimit = QRCodeLimitLength[i][1]; break; case QRErrorCorrectLevel.Q : nLimit = QRCodeLimitLength[i][2]; break; case QRErrorCorrectLevel.H : nLimit = QRCodeLimitLength[i][3]; break; } if (length <= nLimit) { break; } else { nType++; } } if (nType > QRCodeLimitLength.length) { throw new Error("Too long data"); } return nType; }
Get the type by string length @private @param {String} sText @param {Number} nCorrectLevel @return {Number} type
_getTypeNumber
javascript
bryanbraun/checkboxland
docs/demos/qr-code/qrcode.js
https://github.com/bryanbraun/checkboxland/blob/master/docs/demos/qr-code/qrcode.js
MIT