2017-09-25 09:37:41 +00:00
// Do not edit this file; automatically generated by build.py.
'use strict' ;
2018-01-16 21:13:23 +00:00
var $jscomp = $jscomp || { } ; $jscomp . scope = { } ; var COMPILED = ! 0 , goog = goog || { } ; goog . global = this ; goog . isDef = function ( a ) { return void 0 !== a } ; goog . isString = function ( a ) { return "string" == typeof a } ; goog . isBoolean = function ( a ) { return "boolean" == typeof a } ; goog . isNumber = function ( a ) { return "number" == typeof a } ;
2018-08-17 13:32:56 +00:00
goog . exportPath _ = function ( a , b , c ) { a = a . split ( "." ) ; c = c || goog . global ; a [ 0 ] in c || "undefined" == typeof c . execScript || c . execScript ( "var " + a [ 0 ] ) ; for ( var d ; a . length && ( d = a . shift ( ) ) ; ) ! a . length && goog . isDef ( b ) ? c [ d ] = b : c = c [ d ] && c [ d ] !== Object . prototype [ d ] ? c [ d ] : c [ d ] = { } } ;
2018-01-16 21:13:23 +00:00
goog . define = function ( a , b ) { var c = b ; if ( ! COMPILED ) { var d = goog . global . CLOSURE _UNCOMPILED _DEFINES , e = goog . global . CLOSURE _DEFINES ; d && void 0 === d . nodeType && Object . prototype . hasOwnProperty . call ( d , a ) ? c = d [ a ] : e && void 0 === e . nodeType && Object . prototype . hasOwnProperty . call ( e , a ) && ( c = e [ a ] ) } goog . exportPath _ ( a , c ) } ; goog . DEBUG = ! 1 ; goog . LOCALE = "en" ; goog . TRUSTED _SITE = ! 0 ; goog . STRICT _MODE _COMPATIBLE = ! 1 ; goog . DISALLOW _TEST _ONLY _CODE = COMPILED && ! goog . DEBUG ; goog . ENABLE _CHROME _APP _SAFE _SCRIPT _LOADING = ! 1 ;
2018-08-17 13:32:56 +00:00
goog . provide = function ( a ) { if ( goog . isInModuleLoader _ ( ) ) throw Error ( "goog.provide cannot be used within a module." ) ; if ( ! COMPILED && goog . isProvided _ ( a ) ) throw Error ( 'Namespace "' + a + '" already declared.' ) ; goog . constructNamespace _ ( a ) } ; goog . constructNamespace _ = function ( a , b ) { if ( ! COMPILED ) { delete goog . implicitNamespaces _ [ a ] ; for ( var c = a ; ( c = c . substring ( 0 , c . lastIndexOf ( "." ) ) ) && ! goog . getObjectByName ( c ) ; ) goog . implicitNamespaces _ [ c ] = ! 0 } goog . exportPath _ ( a , b ) } ;
goog . getScriptNonce = function ( ) { null === goog . cspNonce _ && ( goog . cspNonce _ = goog . getScriptNonce _ ( goog . global . document ) || "" ) ; return goog . cspNonce _ } ; goog . NONCE _PATTERN _ = /^[\w+/_-]+[=]{0,2}$/ ; goog . cspNonce _ = null ; goog . getScriptNonce _ = function ( a ) { return ( a = a . querySelector ( "script[nonce]" ) ) && ( a = a . nonce || a . getAttribute ( "nonce" ) ) && goog . NONCE _PATTERN _ . test ( a ) ? a : null } ; goog . VALID _MODULE _RE _ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/ ;
goog . module = function ( a ) { if ( ! goog . isString ( a ) || ! a || - 1 == a . search ( goog . VALID _MODULE _RE _ ) ) throw Error ( "Invalid module identifier" ) ; if ( ! goog . isInGoogModuleLoader _ ( ) ) throw Error ( "Module " + a + " has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide." ) ;
2018-01-16 21:13:23 +00:00
if ( goog . moduleLoaderState _ . moduleName ) throw Error ( "goog.module may only be called once per module." ) ; goog . moduleLoaderState _ . moduleName = a ; if ( ! COMPILED ) { if ( goog . isProvided _ ( a ) ) throw Error ( 'Namespace "' + a + '" already declared.' ) ; delete goog . implicitNamespaces _ [ a ] } } ; goog . module . get = function ( a ) { return goog . module . getInternal _ ( a ) } ;
2018-08-17 13:32:56 +00:00
goog . module . getInternal _ = function ( a ) { if ( ! COMPILED ) { if ( a in goog . loadedModules _ ) return goog . loadedModules _ [ a ] . exports ; if ( ! goog . implicitNamespaces _ [ a ] ) return a = goog . getObjectByName ( a ) , null != a ? a : null } return null } ; goog . ModuleType = { ES6 : "es6" , GOOG : "goog" } ; goog . moduleLoaderState _ = null ; goog . isInModuleLoader _ = function ( ) { return goog . isInGoogModuleLoader _ ( ) || goog . isInEs6ModuleLoader _ ( ) } ; goog . isInGoogModuleLoader _ = function ( ) { return ! ! goog . moduleLoaderState _ && goog . moduleLoaderState _ . type == goog . ModuleType . GOOG } ;
goog . isInEs6ModuleLoader _ = function ( ) { if ( goog . moduleLoaderState _ && goog . moduleLoaderState _ . type == goog . ModuleType . ES6 ) return ! 0 ; var a = goog . global . $jscomp ; return a ? "function" != typeof a . getCurrentModulePath ? ! 1 : ! ! a . getCurrentModulePath ( ) : ! 1 } ;
goog . module . declareLegacyNamespace = function ( ) { if ( ! COMPILED && ! goog . isInGoogModuleLoader _ ( ) ) throw Error ( "goog.module.declareLegacyNamespace must be called from within a goog.module" ) ; if ( ! COMPILED && ! goog . moduleLoaderState _ . moduleName ) throw Error ( "goog.module must be called prior to goog.module.declareLegacyNamespace." ) ; goog . moduleLoaderState _ . declareLegacyNamespace = ! 0 } ;
goog . module . declareNamespace = function ( a ) { if ( ! COMPILED ) { if ( ! goog . isInEs6ModuleLoader _ ( ) ) throw Error ( "goog.module.declareNamespace may only be called from within an ES6 module" ) ; if ( goog . moduleLoaderState _ && goog . moduleLoaderState _ . moduleName ) throw Error ( "goog.module.declareNamespace may only be called once per module." ) ; if ( a in goog . loadedModules _ ) throw Error ( 'Module with namespace "' + a + '" already exists.' ) ; } if ( goog . moduleLoaderState _ ) goog . moduleLoaderState _ . moduleName = a ; else { var b = goog . global . $jscomp ;
if ( ! b || "function" != typeof b . getCurrentModulePath ) throw Error ( 'Module with namespace "' + a + '" has been loaded incorrectly.' ) ; b = b . require ( b . getCurrentModulePath ( ) ) ; goog . loadedModules _ [ a ] = { exports : b , type : goog . ModuleType . ES6 , moduleId : a } } } ; goog . setTestOnly = function ( a ) { if ( goog . DISALLOW _TEST _ONLY _CODE ) throw a = a || "" , Error ( "Importing test-only code into non-debug environment" + ( a ? ": " + a : "." ) ) ; } ; goog . forwardDeclare = function ( a ) { } ;
COMPILED || ( goog . isProvided _ = function ( a ) { return a in goog . loadedModules _ || ! goog . implicitNamespaces _ [ a ] && goog . isDefAndNotNull ( goog . getObjectByName ( a ) ) } , goog . implicitNamespaces _ = { "goog.module" : ! 0 } ) ; goog . getObjectByName = function ( a , b ) { for ( var c = a . split ( "." ) , d = b || goog . global , e = 0 ; e < c . length ; e ++ ) if ( d = d [ c [ e ] ] , ! goog . isDefAndNotNull ( d ) ) return null ; return d } ; goog . globalize = function ( a , b ) { var c = b || goog . global , d ; for ( d in a ) c [ d ] = a [ d ] } ;
goog . addDependency = function ( a , b , c , d ) { ! COMPILED && goog . DEPENDENCIES _ENABLED && goog . debugLoader _ . addDependency ( a , b , c , d ) } ; goog . ENABLE _DEBUG _LOADER = ! 0 ; goog . logToConsole _ = function ( a ) { goog . global . console && goog . global . console . error ( a ) } ;
goog . require = function ( a ) { if ( ! COMPILED ) { goog . ENABLE _DEBUG _LOADER && goog . debugLoader _ . requested ( a ) ; if ( goog . isProvided _ ( a ) ) { if ( goog . isInModuleLoader _ ( ) ) return goog . module . getInternal _ ( a ) } else if ( goog . ENABLE _DEBUG _LOADER ) { var b = goog . moduleLoaderState _ ; goog . moduleLoaderState _ = null ; try { goog . debugLoader _ . load _ ( a ) } finally { goog . moduleLoaderState _ = b } } return null } } ; goog . basePath = "" ; goog . nullFunction = function ( ) { } ; goog . abstractMethod = function ( ) { throw Error ( "unimplemented abstract method" ) ; } ;
goog . addSingletonGetter = function ( a ) { a . instance _ = void 0 ; a . getInstance = function ( ) { if ( a . instance _ ) return a . instance _ ; goog . DEBUG && ( goog . instantiatedSingletons _ [ goog . instantiatedSingletons _ . length ] = a ) ; return a . instance _ = new a } } ; goog . instantiatedSingletons _ = [ ] ; goog . LOAD _MODULE _USING _EVAL = ! 0 ; goog . SEAL _MODULE _EXPORTS = goog . DEBUG ; goog . loadedModules _ = { } ; goog . DEPENDENCIES _ENABLED = ! COMPILED && goog . ENABLE _DEBUG _LOADER ; goog . TRANSPILE = "detect" ; goog . TRANSPILER = "transpile.js" ; goog . hasBadLetScoping = null ;
goog . useSafari10Workaround = function ( ) { if ( null == goog . hasBadLetScoping ) { try { var a = ! eval ( '"use strict";let x = 1; function f() { return typeof x; };f() == "number";' ) } catch ( b ) { a = ! 1 } goog . hasBadLetScoping = a } return goog . hasBadLetScoping } ; goog . workaroundSafari10EvalBug = function ( a ) { return "(function(){" + a + "\n;})();\n" } ;
goog . loadModule = function ( a ) { var b = goog . moduleLoaderState _ ; try { goog . moduleLoaderState _ = { moduleName : "" , declareLegacyNamespace : ! 1 , type : goog . ModuleType . GOOG } ; if ( goog . isFunction ( a ) ) var c = a . call ( void 0 , { } ) ; else if ( goog . isString ( a ) ) goog . useSafari10Workaround ( ) && ( a = goog . workaroundSafari10EvalBug ( a ) ) , c = goog . loadModuleFromSource _ . call ( void 0 , a ) ; else throw Error ( "Invalid module definition" ) ; var d = goog . moduleLoaderState _ . moduleName ; if ( goog . isString ( d ) && d ) goog . moduleLoaderState _ . declareLegacyNamespace ? goog . constructNamespace _ ( d ,
c ) : goog . SEAL _MODULE _EXPORTS && Object . seal && "object" == typeof c && null != c && Object . seal ( c ) , goog . loadedModules _ [ d ] = { exports : c , type : goog . ModuleType . GOOG , moduleId : goog . moduleLoaderState _ . moduleName } ; else throw Error ( 'Invalid module name "' + d + '"' ) ; } finally { goog . moduleLoaderState _ = b } } ; goog . loadModuleFromSource _ = function ( a ) { eval ( a ) ; return { } } ; goog . normalizePath _ = function ( a ) { a = a . split ( "/" ) ; for ( var b = 0 ; b < a . length ; ) "." == a [ b ] ? a . splice ( b , 1 ) : b && ".." == a [ b ] && a [ b - 1 ] && ".." != a [ b - 1 ] ? a . splice ( -- b , 2 ) : b ++ ; return a . join ( "/" ) } ;
2017-09-25 09:37:41 +00:00
goog . loadFileSync _ = function ( a ) { if ( goog . global . CLOSURE _LOAD _FILE _SYNC ) return goog . global . CLOSURE _LOAD _FILE _SYNC ( a ) ; try { var b = new goog . global . XMLHttpRequest ; b . open ( "get" , a , ! 1 ) ; b . send ( ) ; return 0 == b . status || 200 == b . status ? b . responseText : null } catch ( c ) { return null } } ;
2018-01-16 21:13:23 +00:00
goog . transpile _ = function ( a , b ) { var c = goog . global . $jscomp ; c || ( goog . global . $jscomp = c = { } ) ; var d = c . transpile ; if ( ! d ) { var e = goog . basePath + goog . TRANSPILER , f = goog . loadFileSync _ ( e ) ; if ( f ) { ( function ( ) { eval ( f + "\n//# sourceURL=" + e ) } ) . call ( goog . global ) ; if ( goog . global . $gwtExport && goog . global . $gwtExport . $jscomp && ! goog . global . $gwtExport . $jscomp . transpile ) throw Error ( 'The transpiler did not properly export the "transpile" method. $gwtExport: ' + JSON . stringify ( goog . global . $gwtExport ) ) ; goog . global . $jscomp . transpile = goog . global . $gwtExport . $jscomp . transpile ;
2017-09-25 09:37:41 +00:00
c = goog . global . $jscomp ; d = c . transpile } } d || ( d = c . transpile = function ( a , b ) { goog . logToConsole _ ( b + " requires transpilation but no transpiler was found." ) ; return a } ) ; return d ( a , b ) } ;
goog . typeOf = function ( a ) { var b = typeof a ; if ( "object" == b ) if ( a ) { if ( a instanceof Array ) return "array" ; if ( a instanceof Object ) return b ; var c = Object . prototype . toString . call ( a ) ; if ( "[object Window]" == c ) return "object" ; if ( "[object Array]" == c || "number" == typeof a . length && "undefined" != typeof a . splice && "undefined" != typeof a . propertyIsEnumerable && ! a . propertyIsEnumerable ( "splice" ) ) return "array" ; if ( "[object Function]" == c || "undefined" != typeof a . call && "undefined" != typeof a . propertyIsEnumerable && ! a . propertyIsEnumerable ( "call" ) ) return "function" } else return "null" ;
2018-01-16 21:13:23 +00:00
else if ( "function" == b && "undefined" == typeof a . call ) return "object" ; return b } ; goog . isNull = function ( a ) { return null === a } ; goog . isDefAndNotNull = function ( a ) { return null != a } ; goog . isArray = function ( a ) { return "array" == goog . typeOf ( a ) } ; goog . isArrayLike = function ( a ) { var b = goog . typeOf ( a ) ; return "array" == b || "object" == b && "number" == typeof a . length } ; goog . isDateLike = function ( a ) { return goog . isObject ( a ) && "function" == typeof a . getFullYear } ; goog . isFunction = function ( a ) { return "function" == goog . typeOf ( a ) } ;
goog . isObject = function ( a ) { var b = typeof a ; return "object" == b && null != a || "function" == b } ; goog . getUid = function ( a ) { return a [ goog . UID _PROPERTY _ ] || ( a [ goog . UID _PROPERTY _ ] = ++ goog . uidCounter _ ) } ; goog . hasUid = function ( a ) { return ! ! a [ goog . UID _PROPERTY _ ] } ; goog . removeUid = function ( a ) { null !== a && "removeAttribute" in a && a . removeAttribute ( goog . UID _PROPERTY _ ) ; try { delete a [ goog . UID _PROPERTY _ ] } catch ( b ) { } } ; goog . UID _PROPERTY _ = "closure_uid_" + ( 1E9 * Math . random ( ) >>> 0 ) ; goog . uidCounter _ = 0 ; goog . getHashCode = goog . getUid ;
2018-08-17 13:32:56 +00:00
goog . removeHashCode = goog . removeUid ; goog . cloneObject = function ( a ) { var b = goog . typeOf ( a ) ; if ( "object" == b || "array" == b ) { if ( "function" === typeof a . clone ) return a . clone ( ) ; b = "array" == b ? [ ] : { } ; for ( var c in a ) b [ c ] = goog . cloneObject ( a [ c ] ) ; return b } return a } ; goog . bindNative _ = function ( a , b , c ) { return a . call . apply ( a . bind , arguments ) } ;
2018-01-16 21:13:23 +00:00
goog . bindJs _ = function ( a , b , c ) { if ( ! a ) throw Error ( ) ; if ( 2 < arguments . length ) { var d = Array . prototype . slice . call ( arguments , 2 ) ; return function ( ) { var c = Array . prototype . slice . call ( arguments ) ; Array . prototype . unshift . apply ( c , d ) ; return a . apply ( b , c ) } } return function ( ) { return a . apply ( b , arguments ) } } ; goog . bind = function ( a , b , c ) { Function . prototype . bind && - 1 != Function . prototype . bind . toString ( ) . indexOf ( "native code" ) ? goog . bind = goog . bindNative _ : goog . bind = goog . bindJs _ ; return goog . bind . apply ( null , arguments ) } ;
goog . partial = function ( a , b ) { var c = Array . prototype . slice . call ( arguments , 1 ) ; return function ( ) { var b = c . slice ( ) ; b . push . apply ( b , arguments ) ; return a . apply ( this , b ) } } ; goog . mixin = function ( a , b ) { for ( var c in b ) a [ c ] = b [ c ] } ; goog . now = goog . TRUSTED _SITE && Date . now || function ( ) { return + new Date } ;
goog . globalEval = function ( a ) { if ( goog . global . execScript ) goog . global . execScript ( a , "JavaScript" ) ; else if ( goog . global . eval ) { if ( null == goog . evalWorksForGlobals _ ) { try { goog . global . eval ( "var _evalTest_ = 1;" ) } catch ( d ) { } if ( "undefined" != typeof goog . global . _evalTest _ ) { try { delete goog . global . _evalTest _ } catch ( d ) { } goog . evalWorksForGlobals _ = ! 0 } else goog . evalWorksForGlobals _ = ! 1 } if ( goog . evalWorksForGlobals _ ) goog . global . eval ( a ) ; else { var b = goog . global . document , c = b . createElement ( "SCRIPT" ) ; c . type = "text/javascript" ; c . defer =
! 1 ; c . appendChild ( b . createTextNode ( a ) ) ; b . head . appendChild ( c ) ; b . head . removeChild ( c ) } } else throw Error ( "goog.globalEval not available" ) ; } ; goog . evalWorksForGlobals _ = null ;
goog . getCssName = function ( a , b ) { if ( "." == String ( a ) . charAt ( 0 ) ) throw Error ( 'className passed in goog.getCssName must not start with ".". You passed: ' + a ) ; var c = function ( a ) { return goog . cssNameMapping _ [ a ] || a } , d = function ( a ) { a = a . split ( "-" ) ; for ( var b = [ ] , d = 0 ; d < a . length ; d ++ ) b . push ( c ( a [ d ] ) ) ; return b . join ( "-" ) } ; d = goog . cssNameMapping _ ? "BY_WHOLE" == goog . cssNameMappingStyle _ ? c : d : function ( a ) { return a } ; d = b ? a + "-" + d ( b ) : d ( a ) ; return goog . global . CLOSURE _CSS _NAME _MAP _FN ? goog . global . CLOSURE _CSS _NAME _MAP _FN ( d ) : d } ;
2017-09-25 09:37:41 +00:00
goog . setCssNameMapping = function ( a , b ) { goog . cssNameMapping _ = a ; goog . cssNameMappingStyle _ = b } ; ! COMPILED && goog . global . CLOSURE _CSS _NAME _MAPPING && ( goog . cssNameMapping _ = goog . global . CLOSURE _CSS _NAME _MAPPING ) ; goog . getMsg = function ( a , b ) { b && ( a = a . replace ( /\{\$([^}]+)}/g , function ( a , d ) { return null != b && d in b ? b [ d ] : a } ) ) ; return a } ; goog . getMsgWithFallback = function ( a , b ) { return a } ; goog . exportSymbol = function ( a , b , c ) { goog . exportPath _ ( a , b , c ) } ; goog . exportProperty = function ( a , b , c ) { a [ b ] = c } ;
goog . inherits = function ( a , b ) { function c ( ) { } c . prototype = b . prototype ; a . superClass _ = b . prototype ; a . prototype = new c ; a . prototype . constructor = a ; a . base = function ( a , c , f ) { for ( var d = Array ( arguments . length - 2 ) , e = 2 ; e < arguments . length ; e ++ ) d [ e - 2 ] = arguments [ e ] ; return b . prototype [ c ] . apply ( a , d ) } } ;
2018-08-17 13:32:56 +00:00
goog . base = function ( a , b , c ) { var d = arguments . callee . caller ; if ( goog . STRICT _MODE _COMPATIBLE || goog . DEBUG && ! d ) throw Error ( "arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C" ) ; if ( "undefined" !== typeof d . superClass _ ) { for ( var e = Array ( arguments . length - 1 ) , f = 1 ; f < arguments . length ; f ++ ) e [ f - 1 ] = arguments [ f ] ; return d . superClass _ . constructor . apply ( a , e ) } if ( "string" != typeof b && "symbol" != typeof b ) throw Error ( "method names provided to goog.base must be a string or a symbol" ) ;
e = Array ( arguments . length - 2 ) ; for ( f = 2 ; f < arguments . length ; f ++ ) e [ f - 2 ] = arguments [ f ] ; f = ! 1 ; for ( var g = a . constructor ; g ; g = g . superClass _ && g . superClass _ . constructor ) if ( g . prototype [ b ] === d ) f = ! 0 ; else if ( f ) return g . prototype [ b ] . apply ( a , e ) ; if ( a [ b ] === d ) return a . constructor . prototype [ b ] . apply ( a , e ) ; throw Error ( "goog.base called from a method of one name to a method of a different name" ) ; } ; goog . scope = function ( a ) { if ( goog . isInModuleLoader _ ( ) ) throw Error ( "goog.scope is not supported within a module." ) ; a . call ( goog . global ) } ;
COMPILED || ( goog . global . COMPILED = COMPILED ) ; goog . defineClass = function ( a , b ) { var c = b . constructor , d = b . statics ; c && c != Object . prototype . constructor || ( c = function ( ) { throw Error ( "cannot instantiate an interface (no constructor defined)." ) ; } ) ; c = goog . defineClass . createSealingConstructor _ ( c , a ) ; a && goog . inherits ( c , a ) ; delete b . constructor ; delete b . statics ; goog . defineClass . applyProperties _ ( c . prototype , b ) ; null != d && ( d instanceof Function ? d ( c ) : goog . defineClass . applyProperties _ ( c , d ) ) ; return c } ;
goog . defineClass . SEAL _CLASS _INSTANCES = goog . DEBUG ; goog . defineClass . createSealingConstructor _ = function ( a , b ) { if ( ! goog . defineClass . SEAL _CLASS _INSTANCES ) return a ; var c = ! goog . defineClass . isUnsealable _ ( b ) , d = function ( ) { var b = a . apply ( this , arguments ) || this ; b [ goog . UID _PROPERTY _ ] = b [ goog . UID _PROPERTY _ ] ; this . constructor === d && c && Object . seal instanceof Function && Object . seal ( b ) ; return b } ; return d } ; goog . defineClass . isUnsealable _ = function ( a ) { return a && a . prototype && a . prototype [ goog . UNSEALABLE _CONSTRUCTOR _PROPERTY _ ] } ;
goog . defineClass . OBJECT _PROTOTYPE _FIELDS _ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf" . split ( " " ) ; goog . defineClass . applyProperties _ = function ( a , b ) { for ( var c in b ) Object . prototype . hasOwnProperty . call ( b , c ) && ( a [ c ] = b [ c ] ) ; for ( var d = 0 ; d < goog . defineClass . OBJECT _PROTOTYPE _FIELDS _ . length ; d ++ ) c = goog . defineClass . OBJECT _PROTOTYPE _FIELDS _ [ d ] , Object . prototype . hasOwnProperty . call ( b , c ) && ( a [ c ] = b [ c ] ) } ;
goog . tagUnsealableClass = function ( a ) { ! COMPILED && goog . defineClass . SEAL _CLASS _INSTANCES && ( a . prototype [ goog . UNSEALABLE _CONSTRUCTOR _PROPERTY _ ] = ! 0 ) } ; goog . UNSEALABLE _CONSTRUCTOR _PROPERTY _ = "goog_defineClass_legacy_unsealable" ;
! COMPILED && goog . DEPENDENCIES _ENABLED && ( goog . inHtmlDocument _ = function ( ) { var a = goog . global . document ; return null != a && "write" in a } , goog . isDocumentLoading _ = function ( ) { var a = goog . global . document ; return a . attachEvent ? "complete" != a . readyState : "loading" == a . readyState } , goog . findBasePath _ = function ( ) { if ( goog . isDef ( goog . global . CLOSURE _BASE _PATH ) && goog . isString ( goog . global . CLOSURE _BASE _PATH ) ) goog . basePath = goog . global . CLOSURE _BASE _PATH ; else if ( goog . inHtmlDocument _ ( ) ) { var a = goog . global . document , b = a . currentScript ;
a = b ? [ b ] : a . getElementsByTagName ( "SCRIPT" ) ; for ( b = a . length - 1 ; 0 <= b ; -- b ) { var c = a [ b ] . src , d = c . lastIndexOf ( "?" ) ; d = - 1 == d ? c . length : d ; if ( "base.js" == c . substr ( d - 7 , 7 ) ) { goog . basePath = c . substr ( 0 , d - 7 ) ; break } } } } , goog . findBasePath _ ( ) , goog . Transpiler = function ( ) { this . requiresTranspilation _ = null } , goog . Transpiler . prototype . createRequiresTranspilation _ = function ( ) { function a ( a , b ) { d ? c [ a ] = ! 0 : b ( ) ? c [ a ] = ! 1 : d = c [ a ] = ! 0 } function b ( a ) { try { return ! ! eval ( a ) } catch ( g ) { return ! 1 } } var c = { es3 : ! 1 } , d = ! 1 , e = goog . global . navigator && goog . global . navigator . userAgent ?
goog . global . navigator . userAgent : "" ; a ( "es5" , function ( ) { return b ( "[1,].length==1" ) } ) ; a ( "es6" , function ( ) { var a = e . match ( /Edge\/(\d+)(\.\d)*/i ) ; return a && 15 > Number ( a [ 1 ] ) ? ! 1 : b ( '(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()' ) } ) ; a ( "es6-impl" , function ( ) { return ! 0 } ) ; a ( "es7" , function ( ) { return b ( "2 ** 2 == 4" ) } ) ;
a ( "es8" , function ( ) { return b ( "async () => 1, true" ) } ) ; a ( "es9" , function ( ) { return b ( "({...rest} = {}), true" ) } ) ; a ( "es_next" , function ( ) { return ! 1 } ) ; return c } , goog . Transpiler . prototype . needsTranspile = function ( a , b ) { if ( "always" == goog . TRANSPILE ) return ! 0 ; if ( "never" == goog . TRANSPILE ) return ! 1 ; this . requiresTranspilation _ || ( this . requiresTranspilation _ = this . createRequiresTranspilation _ ( ) ) ; if ( a in this . requiresTranspilation _ ) return this . requiresTranspilation _ [ a ] ? ! 0 : ! goog . inHtmlDocument _ ( ) || "es6" != b || "noModule" in goog . global . document . createElement ( "script" ) ?
! 1 : ! 0 ; throw Error ( "Unknown language mode: " + a ) ; } , goog . Transpiler . prototype . transpile = function ( a , b ) { return goog . transpile _ ( a , b ) } , goog . transpiler _ = new goog . Transpiler , goog . protectScriptTag _ = function ( a ) { return a . replace ( /<\/(SCRIPT)/ig , "\\x3c/$1" ) } , goog . DebugLoader _ = function ( ) { this . dependencies _ = { } ; this . idToPath _ = { } ; this . written _ = { } ; this . loadingDeps _ = [ ] ; this . depsToLoad _ = [ ] ; this . paused _ = ! 1 ; this . factory _ = new goog . DependencyFactory ( goog . transpiler _ ) ; this . deferredCallbacks _ = { } ; this . deferredQueue _ = [ ] } , goog . DebugLoader _ . prototype . bootstrap =
function ( a , b ) { function c ( ) { d && ( goog . global . setTimeout ( d , 0 ) , d = null ) } var d = b ; if ( a . length ) { for ( var e = [ ] , f = 0 ; f < a . length ; f ++ ) { var g = this . getPathFromDeps _ ( a [ f ] ) ; if ( ! g ) throw Error ( "Unregonized namespace: " + a [ f ] ) ; e . push ( this . dependencies _ [ g ] ) } g = goog . require ; var h = 0 ; for ( f = 0 ; f < a . length ; f ++ ) g ( a [ f ] ) , e [ f ] . onLoad ( function ( ) { ++ h == a . length && c ( ) } ) } else c ( ) } , goog . DebugLoader _ . prototype . loadClosureDeps = function ( ) { this . depsToLoad _ . push ( this . factory _ . createDependency ( goog . normalizePath _ ( goog . basePath + "deps.js" ) , "deps.js" ,
[ ] , [ ] , { } , ! 1 ) ) ; this . loadDeps _ ( ) } , goog . DebugLoader _ . prototype . requested = function ( a , b ) { var c = this . getPathFromDeps _ ( a ) ; if ( c && ( b || this . areDepsLoaded _ ( this . dependencies _ [ c ] . requires ) ) ) { var d = this . deferredCallbacks _ [ c ] ; d && ( delete this . deferredCallbacks _ [ c ] , d ( ) ) } } , goog . DebugLoader _ . prototype . setDependencyFactory = function ( a ) { this . factory _ = a } , goog . DebugLoader _ . prototype . load _ = function ( a ) { if ( this . getPathFromDeps _ ( a ) ) { var b = this , c = [ ] , d = function ( a ) { var e = b . getPathFromDeps _ ( a ) ; if ( ! e ) throw Error ( "Bad dependency path or symbol: " +
a ) ; if ( ! b . written _ [ e ] ) { b . written _ [ e ] = ! 0 ; a = b . dependencies _ [ e ] ; for ( e = 0 ; e < a . requires . length ; e ++ ) goog . isProvided _ ( a . requires [ e ] ) || d ( a . requires [ e ] ) ; c . push ( a ) } } ; d ( a ) ; a = ! ! this . depsToLoad _ . length ; this . depsToLoad _ = this . depsToLoad _ . concat ( c ) ; this . paused _ || a || this . loadDeps _ ( ) } else throw a = "goog.require could not find: " + a , goog . logToConsole _ ( a ) , Error ( a ) ; } , goog . DebugLoader _ . prototype . loadDeps _ = function ( ) { for ( var a = this , b = this . paused _ ; this . depsToLoad _ . length && ! b ; ) ( function ( ) { var c = ! 1 , d = a . depsToLoad _ . shift ( ) , e = ! 1 ;
a . loading _ ( d ) ; var f = { pause : function ( ) { if ( c ) throw Error ( "Cannot call pause after the call to load." ) ; b = ! 0 } , resume : function ( ) { c ? a . resume _ ( ) : b = ! 1 } , loaded : function ( ) { if ( e ) throw Error ( "Double call to loaded." ) ; e = ! 0 ; a . loaded _ ( d ) } , pending : function ( ) { for ( var b = [ ] , c = 0 ; c < a . loadingDeps _ . length ; c ++ ) b . push ( a . loadingDeps _ [ c ] ) ; return b } , setModuleState : function ( a ) { goog . moduleLoaderState _ = { type : a , moduleName : "" , declareLegacyNamespace : ! 1 } } , registerEs6ModuleExports : function ( a , b , c ) { c && ( goog . loadedModules _ [ c ] = { exports : b ,
type : goog . ModuleType . ES6 , moduleId : c || "" } ) } , registerGoogModuleExports : function ( a , b ) { goog . loadedModules _ [ a ] = { exports : b , type : goog . ModuleType . GOOG , moduleId : a } } , clearModuleState : function ( ) { goog . moduleLoaderState _ = null } , defer : function ( b ) { if ( c ) throw Error ( "Cannot register with defer after the call to load." ) ; a . defer _ ( d , b ) } , areDepsLoaded : function ( ) { return a . areDepsLoaded _ ( d . requires ) } } ; try { d . load ( f ) } finally { c = ! 0 } } ) ( ) ; b && this . pause _ ( ) } , goog . DebugLoader _ . prototype . pause _ = function ( ) { this . paused _ = ! 0 } , goog . DebugLoader _ . prototype . resume _ =
function ( ) { this . paused _ && ( this . paused _ = ! 1 , this . loadDeps _ ( ) ) } , goog . DebugLoader _ . prototype . loading _ = function ( a ) { this . loadingDeps _ . push ( a ) } , goog . DebugLoader _ . prototype . loaded _ = function ( a ) { for ( var b = 0 ; b < this . loadingDeps _ . length ; b ++ ) if ( this . loadingDeps _ [ b ] == a ) { this . loadingDeps _ . splice ( b , 1 ) ; break } for ( b = 0 ; b < this . deferredQueue _ . length ; b ++ ) if ( this . deferredQueue _ [ b ] == a . path ) { this . deferredQueue _ . splice ( b , 1 ) ; break } if ( this . loadingDeps _ . length == this . deferredQueue _ . length && ! this . depsToLoad _ . length ) for ( ; this . deferredQueue _ . length ; ) this . requested ( this . deferredQueue _ . shift ( ) ,
! 0 ) ; a . loaded ( ) } , goog . DebugLoader _ . prototype . areDepsLoaded _ = function ( a ) { for ( var b = 0 ; b < a . length ; b ++ ) { var c = this . getPathFromDeps _ ( a [ b ] ) ; if ( ! c || ! ( c in this . deferredCallbacks _ || goog . isProvided _ ( a [ b ] ) ) ) return ! 1 } return ! 0 } , goog . DebugLoader _ . prototype . getPathFromDeps _ = function ( a ) { return a in this . idToPath _ ? this . idToPath _ [ a ] : a in this . dependencies _ ? a : null } , goog . DebugLoader _ . prototype . defer _ = function ( a , b ) { this . deferredCallbacks _ [ a . path ] = b ; this . deferredQueue _ . push ( a . path ) } , goog . LoadController = function ( ) { } , goog . LoadController . prototype . pause =
function ( ) { } , goog . LoadController . prototype . resume = function ( ) { } , goog . LoadController . prototype . loaded = function ( ) { } , goog . LoadController . prototype . pending = function ( ) { } , goog . LoadController . prototype . registerEs6ModuleExports = function ( a , b , c ) { } , goog . LoadController . prototype . setModuleState = function ( a ) { } , goog . LoadController . prototype . clearModuleState = function ( ) { } , goog . LoadController . prototype . defer = function ( a ) { } , goog . LoadController . prototype . areDepsLoaded = function ( ) { } , goog . Dependency = function ( a , b , c , d , e ) { this . path =
a ; this . relativePath = b ; this . provides = c ; this . requires = d ; this . loadFlags = e ; this . loaded _ = ! 1 ; this . loadCallbacks _ = [ ] } , goog . Dependency . prototype . onLoad = function ( a ) { this . loaded _ ? a ( ) : this . loadCallbacks _ . push ( a ) } , goog . Dependency . prototype . loaded = function ( ) { this . loaded _ = ! 0 ; var a = this . loadCallbacks _ ; this . loadCallbacks _ = [ ] ; for ( var b = 0 ; b < a . length ; b ++ ) a [ b ] ( ) } , goog . Dependency . defer _ = ! 1 , goog . Dependency . callbackMap _ = { } , goog . Dependency . registerCallback _ = function ( a ) { var b = Math . random ( ) . toString ( 32 ) ; goog . Dependency . callbackMap _ [ b ] =
a ; return b } , goog . Dependency . unregisterCallback _ = function ( a ) { delete goog . Dependency . callbackMap _ [ a ] } , goog . Dependency . callback _ = function ( a , b ) { if ( a in goog . Dependency . callbackMap _ ) { for ( var c = goog . Dependency . callbackMap _ [ a ] , d = [ ] , e = 1 ; e < arguments . length ; e ++ ) d . push ( arguments [ e ] ) ; c . apply ( void 0 , d ) } else throw Error ( "Callback key " + a + " does not exist (was base.js loaded more than once?)." ) ; } , goog . Dependency . prototype . load = function ( a ) { if ( goog . global . CLOSURE _IMPORT _SCRIPT ) goog . global . CLOSURE _IMPORT _SCRIPT ( this . path ) ?
a . loaded ( ) : a . pause ( ) ; else if ( goog . inHtmlDocument _ ( ) ) { var b = goog . global . document ; if ( "complete" == b . readyState && ! goog . ENABLE _CHROME _APP _SAFE _SCRIPT _LOADING ) { if ( /\bdeps.js$/ . test ( this . path ) ) { a . loaded ( ) ; return } throw Error ( 'Cannot write "' + this . path + '" after document load' ) ; } if ( ! goog . ENABLE _CHROME _APP _SAFE _SCRIPT _LOADING && goog . isDocumentLoading _ ( ) ) { var c = goog . Dependency . registerCallback _ ( function ( b ) { goog . DebugLoader _ . IS _OLD _IE _ && "complete" != b . readyState || ( goog . Dependency . unregisterCallback _ ( c ) , a . loaded ( ) ) } ) ,
d = ! goog . DebugLoader _ . IS _OLD _IE _ && goog . getScriptNonce ( ) ? ' nonce="' + goog . getScriptNonce ( ) + '"' : "" ; b . write ( '<script src="' + this . path + '" ' + ( goog . DebugLoader _ . IS _OLD _IE _ ? "onreadystatechange" : "onload" ) + "=\"goog.Dependency.callback_('" + c + '\', this)" type="text/javascript" ' + ( goog . Dependency . defer _ ? "defer" : "" ) + d + ">\x3c/script>" ) } else { var e = b . createElement ( "script" ) ; e . defer = goog . Dependency . defer _ ; e . async = ! 1 ; e . type = "text/javascript" ; ( d = goog . getScriptNonce ( ) ) && e . setAttribute ( "nonce" , d ) ; goog . DebugLoader _ . IS _OLD _IE _ ?
( a . pause ( ) , e . onreadystatechange = function ( ) { if ( "loaded" == e . readyState || "complete" == e . readyState ) a . loaded ( ) , a . resume ( ) } ) : e . onload = function ( ) { e . onload = null ; a . loaded ( ) } ; e . src = this . path ; b . head . appendChild ( e ) } } else goog . logToConsole _ ( "Cannot use default debug loader outside of HTML documents." ) , "deps.js" == this . relativePath ? ( goog . logToConsole _ ( "Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or seting CLOSURE_NO_DEPS to true." ) , a . loaded ( ) ) : a . pause ( ) } , goog . Es6ModuleDependency = function ( a , b ,
c , d , e ) { goog . Dependency . call ( this , a , b , c , d , e ) } , goog . inherits ( goog . Es6ModuleDependency , goog . Dependency ) , goog . Es6ModuleDependency . prototype . load = function ( a ) { function b ( a , b ) { b ? d . write ( '<script type="module" crossorigin>' + b + "\x3c/script>" ) : d . write ( '<script type="module" crossorigin src="' + a + '">\x3c/script>' ) } function c ( a , b ) { var c = d . createElement ( "script" ) ; c . defer = ! 0 ; c . async = ! 1 ; c . type = "module" ; c . setAttribute ( "crossorigin" , ! 0 ) ; var e = goog . getScriptNonce ( ) ; e && c . setAttribute ( "nonce" , e ) ; b ? c . textContent = b : c . src =
a ; d . head . appendChild ( c ) } if ( goog . global . CLOSURE _IMPORT _SCRIPT ) goog . global . CLOSURE _IMPORT _SCRIPT ( this . path ) ? a . loaded ( ) : a . pause ( ) ; else if ( goog . inHtmlDocument _ ( ) ) { var d = goog . global . document , e = this ; if ( goog . isDocumentLoading _ ( ) ) { var f = b ; goog . Dependency . defer _ = ! 0 } else f = c ; var g = goog . Dependency . registerCallback _ ( function ( ) { goog . Dependency . unregisterCallback _ ( g ) ; a . setModuleState ( goog . ModuleType . ES6 ) } ) ; f ( void 0 , 'goog.Dependency.callback_("' + g + '")' ) ; f ( this . path , void 0 ) ; var h = goog . Dependency . registerCallback _ ( function ( b ) { goog . Dependency . unregisterCallback _ ( h ) ;
a . registerEs6ModuleExports ( e . path , b , goog . moduleLoaderState _ . moduleName ) } ) ; f ( void 0 , 'import * as m from "' + this . path + '"; goog.Dependency.callback_("' + h + '", m)' ) ; var k = goog . Dependency . registerCallback _ ( function ( ) { goog . Dependency . unregisterCallback _ ( k ) ; a . clearModuleState ( ) ; a . loaded ( ) } ) ; f ( void 0 , 'goog.Dependency.callback_("' + k + '")' ) } else goog . logToConsole _ ( "Cannot use default debug loader outside of HTML documents." ) , a . pause ( ) } , goog . TransformedDependency = function ( a , b , c , d , e ) { goog . Dependency . call ( this ,
a , b , c , d , e ) ; this . contents _ = null } , goog . inherits ( goog . TransformedDependency , goog . Dependency ) , goog . TransformedDependency . prototype . load = function ( a ) { function b ( ) { e . contents _ = goog . loadFileSync _ ( e . path ) ; e . contents _ && ( e . contents _ = e . transform ( e . contents _ ) , e . contents _ && ( e . contents _ += "\n//# sourceURL=" + e . path ) ) } function c ( ) { b ( ) ; if ( e . contents _ ) { f && a . setModuleState ( goog . ModuleType . ES6 ) ; try { var c = e . contents _ ; e . contents _ = null ; goog . globalEval ( c ) ; if ( f ) var d = goog . moduleLoaderState _ . moduleName } finally { f && a . clearModuleState ( ) } f &&
goog . global . $jscomp . require . ensure ( [ e . path ] , function ( ) { a . registerEs6ModuleExports ( e . path , goog . global . $jscomp . require ( e . path ) , d ) } ) ; a . loaded ( ) } } function d ( ) { var a = goog . global . document , b = goog . Dependency . registerCallback _ ( function ( ) { goog . Dependency . unregisterCallback _ ( b ) ; c ( ) } ) ; a . write ( '<script type="text/javascript">' + goog . protectScriptTag _ ( 'goog.Dependency.callback_("' + b + '");' ) + "\x3c/script>" ) } var e = this ; if ( goog . global . CLOSURE _IMPORT _SCRIPT ) b ( ) , this . contents _ && goog . global . CLOSURE _IMPORT _SCRIPT ( "" , this . contents _ ) ?
( this . contents _ = null , a . loaded ( ) ) : a . pause ( ) ; else { var f = this . loadFlags . module == goog . ModuleType . ES6 , g = 1 < a . pending ( ) . length , h = g && goog . DebugLoader _ . IS _OLD _IE _ ; g = goog . Dependency . defer _ && ( g || goog . isDocumentLoading _ ( ) ) ; if ( h || g ) a . defer ( function ( ) { c ( ) } ) ; else { var k = goog . global . document ; h = goog . inHtmlDocument _ ( ) && "ActiveXObject" in goog . global ; if ( f && goog . inHtmlDocument _ ( ) && goog . isDocumentLoading _ ( ) && ! h ) { goog . Dependency . defer _ = ! 0 ; a . pause ( ) ; var l = k . onreadystatechange ; k . onreadystatechange = function ( ) { "interactive" ==
k . readyState && ( k . onreadystatechange = l , c ( ) , a . resume ( ) ) ; goog . isFunction ( l ) && l . apply ( void 0 , arguments ) } } else ! goog . DebugLoader _ . IS _OLD _IE _ && goog . inHtmlDocument _ ( ) && goog . isDocumentLoading _ ( ) ? d ( ) : c ( ) } } } , goog . TransformedDependency . prototype . transform = function ( a ) { } , goog . TranspiledDependency = function ( a , b , c , d , e , f ) { goog . TransformedDependency . call ( this , a , b , c , d , e ) ; this . transpiler = f } , goog . inherits ( goog . TranspiledDependency , goog . TransformedDependency ) , goog . TranspiledDependency . prototype . transform = function ( a ) { return this . transpiler . transpile ( a ,
this . path ) } , goog . GoogModuleDependency = function ( a , b , c , d , e , f , g ) { goog . TransformedDependency . call ( this , a , b , c , d , e ) ; this . needsTranspile _ = f ; this . transpiler _ = g } , goog . inherits ( goog . GoogModuleDependency , goog . TransformedDependency ) , goog . GoogModuleDependency . prototype . transform = function ( a ) { this . needsTranspile _ && ( a = this . transpiler _ . transpile ( a , this . path ) ) ; return goog . LOAD _MODULE _USING _EVAL && goog . isDef ( goog . global . JSON ) ? "goog.loadModule(" + goog . global . JSON . stringify ( a + "\n//# sourceURL=" + this . path + "\n" ) + ");" : 'goog.loadModule(function(exports) {"use strict";' +
a + "\n;return exports});\n//# sourceURL=" + this . path + "\n" } , goog . DebugLoader _ . IS _OLD _IE _ = ! ( goog . global . atob || ! goog . global . document || ! goog . global . document . all ) , goog . DebugLoader _ . prototype . addDependency = function ( a , b , c , d ) { b = b || [ ] ; a = a . replace ( /\\/g , "/" ) ; var e = goog . normalizePath _ ( goog . basePath + a ) ; d && "boolean" !== typeof d || ( d = d ? { module : goog . ModuleType . GOOG } : { } ) ; c = this . factory _ . createDependency ( e , a , b , c , d , goog . transpiler _ . needsTranspile ( d . lang || "es3" , d . module ) ) ; this . dependencies _ [ e ] = c ; for ( c = 0 ; c < b . length ; c ++ ) this . idToPath _ [ b [ c ] ] =
e ; this . idToPath _ [ a ] = e } , goog . DependencyFactory = function ( a ) { this . transpiler = a } , goog . DependencyFactory . prototype . createDependency = function ( a , b , c , d , e , f ) { return e . module == goog . ModuleType . GOOG ? new goog . GoogModuleDependency ( a , b , c , d , e , f , this . transpiler ) : f ? new goog . TranspiledDependency ( a , b , c , d , e , this . transpiler ) : e . module == goog . ModuleType . ES6 ? new goog . Es6ModuleDependency ( a , b , c , d , e ) : new goog . Dependency ( a , b , c , d , e ) } , goog . debugLoader _ = new goog . DebugLoader _ , goog . loadClosureDeps = function ( ) { goog . debugLoader _ . loadClosureDeps ( ) } ,
goog . setDependencyFactory = function ( a ) { goog . debugLoader _ . setDependencyFactory ( a ) } , goog . global . CLOSURE _NO _DEPS || goog . debugLoader _ . loadClosureDeps ( ) , goog . bootstrap = function ( a , b ) { goog . debugLoader _ . bootstrap ( a , b ) } ) ; goog . debug = { } ; goog . debug . Error = function ( a ) { if ( Error . captureStackTrace ) Error . captureStackTrace ( this , goog . debug . Error ) ; else { var b = Error ( ) . stack ; b && ( this . stack = b ) } a && ( this . message = String ( a ) ) ; this . reportErrorToServer = ! 0 } ; goog . inherits ( goog . debug . Error , Error ) ; goog . debug . Error . prototype . name = "CustomError" ; goog . dom = { } ; goog . dom . NodeType = { ELEMENT : 1 , ATTRIBUTE : 2 , TEXT : 3 , CDATA _SECTION : 4 , ENTITY _REFERENCE : 5 , ENTITY : 6 , PROCESSING _INSTRUCTION : 7 , COMMENT : 8 , DOCUMENT : 9 , DOCUMENT _TYPE : 10 , DOCUMENT _FRAGMENT : 11 , NOTATION : 12 } ; goog . asserts = { } ; goog . asserts . ENABLE _ASSERTS = goog . DEBUG ; goog . asserts . AssertionError = function ( a , b ) { goog . debug . Error . call ( this , goog . asserts . subs _ ( a , b ) ) ; this . messagePattern = a } ; goog . inherits ( goog . asserts . AssertionError , goog . debug . Error ) ; goog . asserts . AssertionError . prototype . name = "AssertionError" ; goog . asserts . DEFAULT _ERROR _HANDLER = function ( a ) { throw a ; } ; goog . asserts . errorHandler _ = goog . asserts . DEFAULT _ERROR _HANDLER ;
2018-01-16 21:13:23 +00:00
goog . asserts . subs _ = function ( a , b ) { for ( var c = a . split ( "%s" ) , d = "" , e = c . length - 1 , f = 0 ; f < e ; f ++ ) d += c [ f ] + ( f < b . length ? b [ f ] : "%s" ) ; return d + c [ e ] } ; goog . asserts . doAssertFailure _ = function ( a , b , c , d ) { var e = "Assertion failed" ; if ( c ) { e += ": " + c ; var f = d } else a && ( e += ": " + a , f = b ) ; a = new goog . asserts . AssertionError ( "" + e , f || [ ] ) ; goog . asserts . errorHandler _ ( a ) } ; goog . asserts . setErrorHandler = function ( a ) { goog . asserts . ENABLE _ASSERTS && ( goog . asserts . errorHandler _ = a ) } ;
goog . asserts . assert = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! a && goog . asserts . doAssertFailure _ ( "" , null , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ; goog . asserts . fail = function ( a , b ) { goog . asserts . ENABLE _ASSERTS && goog . asserts . errorHandler _ ( new goog . asserts . AssertionError ( "Failure" + ( a ? ": " + a : "" ) , Array . prototype . slice . call ( arguments , 1 ) ) ) } ;
goog . asserts . assertNumber = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! goog . isNumber ( a ) && goog . asserts . doAssertFailure _ ( "Expected number but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ; goog . asserts . assertString = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! goog . isString ( a ) && goog . asserts . doAssertFailure _ ( "Expected string but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ;
goog . asserts . assertFunction = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! goog . isFunction ( a ) && goog . asserts . doAssertFailure _ ( "Expected function but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ; goog . asserts . assertObject = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! goog . isObject ( a ) && goog . asserts . doAssertFailure _ ( "Expected object but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ;
goog . asserts . assertArray = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! goog . isArray ( a ) && goog . asserts . doAssertFailure _ ( "Expected array but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ; goog . asserts . assertBoolean = function ( a , b , c ) { goog . asserts . ENABLE _ASSERTS && ! goog . isBoolean ( a ) && goog . asserts . doAssertFailure _ ( "Expected boolean but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ;
goog . asserts . assertElement = function ( a , b , c ) { ! goog . asserts . ENABLE _ASSERTS || goog . isObject ( a ) && a . nodeType == goog . dom . NodeType . ELEMENT || goog . asserts . doAssertFailure _ ( "Expected Element but got %s: %s." , [ goog . typeOf ( a ) , a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ;
goog . asserts . assertInstanceof = function ( a , b , c , d ) { ! goog . asserts . ENABLE _ASSERTS || a instanceof b || goog . asserts . doAssertFailure _ ( "Expected instanceof %s but got %s." , [ goog . asserts . getType _ ( b ) , goog . asserts . getType _ ( a ) ] , c , Array . prototype . slice . call ( arguments , 3 ) ) ; return a } ; goog . asserts . assertFinite = function ( a , b , c ) { ! goog . asserts . ENABLE _ASSERTS || "number" == typeof a && isFinite ( a ) || goog . asserts . doAssertFailure _ ( "Expected %s to be a finite number but it is not." , [ a ] , b , Array . prototype . slice . call ( arguments , 2 ) ) ; return a } ;
goog . asserts . assertObjectPrototypeIsIntact = function ( ) { for ( var a in Object . prototype ) goog . asserts . fail ( a + " should not be enumerable in Object.prototype." ) } ; goog . asserts . getType _ = function ( a ) { return a instanceof Function ? a . displayName || a . name || "unknown type name" : a instanceof Object ? a . constructor . displayName || a . constructor . name || Object . prototype . toString . call ( a ) : null === a ? "null" : typeof a } ; goog . array = { } ; goog . NATIVE _ARRAY _PROTOTYPES = goog . TRUSTED _SITE ; goog . array . ASSUME _NATIVE _FUNCTIONS = ! 1 ; goog . array . peek = function ( a ) { return a [ a . length - 1 ] } ; goog . array . last = goog . array . peek ;
goog . array . indexOf = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . indexOf ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . indexOf . call ( a , b , c ) } : function ( a , b , c ) { c = null == c ? 0 : 0 > c ? Math . max ( 0 , a . length + c ) : c ; if ( goog . isString ( a ) ) return goog . isString ( b ) && 1 == b . length ? a . indexOf ( b , c ) : - 1 ; for ( ; c < a . length ; c ++ ) if ( c in a && a [ c ] === b ) return c ; return - 1 } ;
goog . array . lastIndexOf = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . lastIndexOf ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . lastIndexOf . call ( a , b , null == c ? a . length - 1 : c ) } : function ( a , b , c ) { c = null == c ? a . length - 1 : c ; 0 > c && ( c = Math . max ( 0 , a . length + c ) ) ; if ( goog . isString ( a ) ) return goog . isString ( b ) && 1 == b . length ? a . lastIndexOf ( b , c ) : - 1 ; for ( ; 0 <= c ; c -- ) if ( c in a && a [ c ] === b ) return c ; return - 1 } ;
goog . array . forEach = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . forEach ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; Array . prototype . forEach . call ( a , b , c ) } : function ( a , b , c ) { for ( var d = a . length , e = goog . isString ( a ) ? a . split ( "" ) : a , f = 0 ; f < d ; f ++ ) f in e && b . call ( c , e [ f ] , f , a ) } ; goog . array . forEachRight = function ( a , b , c ) { var d = a . length , e = goog . isString ( a ) ? a . split ( "" ) : a ; for ( -- d ; 0 <= d ; -- d ) d in e && b . call ( c , e [ d ] , d , a ) } ;
goog . array . filter = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . filter ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . filter . call ( a , b , c ) } : function ( a , b , c ) { for ( var d = a . length , e = [ ] , f = 0 , g = goog . isString ( a ) ? a . split ( "" ) : a , h = 0 ; h < d ; h ++ ) if ( h in g ) { var k = g [ h ] ; b . call ( c , k , h , a ) && ( e [ f ++ ] = k ) } return e } ;
goog . array . map = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . map ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . map . call ( a , b , c ) } : function ( a , b , c ) { for ( var d = a . length , e = Array ( d ) , f = goog . isString ( a ) ? a . split ( "" ) : a , g = 0 ; g < d ; g ++ ) g in f && ( e [ g ] = b . call ( c , f [ g ] , g , a ) ) ; return e } ;
goog . array . reduce = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . reduce ) ? function ( a , b , c , d ) { goog . asserts . assert ( null != a . length ) ; d && ( b = goog . bind ( b , d ) ) ; return Array . prototype . reduce . call ( a , b , c ) } : function ( a , b , c , d ) { var e = c ; goog . array . forEach ( a , function ( c , g ) { e = b . call ( d , e , c , g , a ) } ) ; return e } ;
goog . array . reduceRight = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . reduceRight ) ? function ( a , b , c , d ) { goog . asserts . assert ( null != a . length ) ; goog . asserts . assert ( null != b ) ; d && ( b = goog . bind ( b , d ) ) ; return Array . prototype . reduceRight . call ( a , b , c ) } : function ( a , b , c , d ) { var e = c ; goog . array . forEachRight ( a , function ( c , g ) { e = b . call ( d , e , c , g , a ) } ) ; return e } ;
goog . array . some = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . some ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . some . call ( a , b , c ) } : function ( a , b , c ) { for ( var d = a . length , e = goog . isString ( a ) ? a . split ( "" ) : a , f = 0 ; f < d ; f ++ ) if ( f in e && b . call ( c , e [ f ] , f , a ) ) return ! 0 ; return ! 1 } ;
goog . array . every = goog . NATIVE _ARRAY _PROTOTYPES && ( goog . array . ASSUME _NATIVE _FUNCTIONS || Array . prototype . every ) ? function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . every . call ( a , b , c ) } : function ( a , b , c ) { for ( var d = a . length , e = goog . isString ( a ) ? a . split ( "" ) : a , f = 0 ; f < d ; f ++ ) if ( f in e && ! b . call ( c , e [ f ] , f , a ) ) return ! 1 ; return ! 0 } ; goog . array . count = function ( a , b , c ) { var d = 0 ; goog . array . forEach ( a , function ( a , f , g ) { b . call ( c , a , f , g ) && ++ d } , c ) ; return d } ;
goog . array . find = function ( a , b , c ) { b = goog . array . findIndex ( a , b , c ) ; return 0 > b ? null : goog . isString ( a ) ? a . charAt ( b ) : a [ b ] } ; goog . array . findIndex = function ( a , b , c ) { for ( var d = a . length , e = goog . isString ( a ) ? a . split ( "" ) : a , f = 0 ; f < d ; f ++ ) if ( f in e && b . call ( c , e [ f ] , f , a ) ) return f ; return - 1 } ; goog . array . findRight = function ( a , b , c ) { b = goog . array . findIndexRight ( a , b , c ) ; return 0 > b ? null : goog . isString ( a ) ? a . charAt ( b ) : a [ b ] } ;
goog . array . findIndexRight = function ( a , b , c ) { var d = a . length , e = goog . isString ( a ) ? a . split ( "" ) : a ; for ( -- d ; 0 <= d ; d -- ) if ( d in e && b . call ( c , e [ d ] , d , a ) ) return d ; return - 1 } ; goog . array . contains = function ( a , b ) { return 0 <= goog . array . indexOf ( a , b ) } ; goog . array . isEmpty = function ( a ) { return 0 == a . length } ; goog . array . clear = function ( a ) { if ( ! goog . isArray ( a ) ) for ( var b = a . length - 1 ; 0 <= b ; b -- ) delete a [ b ] ; a . length = 0 } ; goog . array . insert = function ( a , b ) { goog . array . contains ( a , b ) || a . push ( b ) } ;
goog . array . insertAt = function ( a , b , c ) { goog . array . splice ( a , c , 0 , b ) } ; goog . array . insertArrayAt = function ( a , b , c ) { goog . partial ( goog . array . splice , a , c , 0 ) . apply ( null , b ) } ; goog . array . insertBefore = function ( a , b , c ) { var d ; 2 == arguments . length || 0 > ( d = goog . array . indexOf ( a , c ) ) ? a . push ( b ) : goog . array . insertAt ( a , b , d ) } ; goog . array . remove = function ( a , b ) { var c = goog . array . indexOf ( a , b ) , d ; ( d = 0 <= c ) && goog . array . removeAt ( a , c ) ; return d } ;
goog . array . removeLast = function ( a , b ) { var c = goog . array . lastIndexOf ( a , b ) ; return 0 <= c ? ( goog . array . removeAt ( a , c ) , ! 0 ) : ! 1 } ; goog . array . removeAt = function ( a , b ) { goog . asserts . assert ( null != a . length ) ; return 1 == Array . prototype . splice . call ( a , b , 1 ) . length } ; goog . array . removeIf = function ( a , b , c ) { b = goog . array . findIndex ( a , b , c ) ; return 0 <= b ? ( goog . array . removeAt ( a , b ) , ! 0 ) : ! 1 } ; goog . array . removeAllIf = function ( a , b , c ) { var d = 0 ; goog . array . forEachRight ( a , function ( e , f ) { b . call ( c , e , f , a ) && goog . array . removeAt ( a , f ) && d ++ } ) ; return d } ;
goog . array . concat = function ( a ) { return Array . prototype . concat . apply ( [ ] , arguments ) } ; goog . array . join = function ( a ) { return Array . prototype . concat . apply ( [ ] , arguments ) } ; goog . array . toArray = function ( a ) { var b = a . length ; if ( 0 < b ) { for ( var c = Array ( b ) , d = 0 ; d < b ; d ++ ) c [ d ] = a [ d ] ; return c } return [ ] } ; goog . array . clone = goog . array . toArray ; goog . array . extend = function ( a , b ) { for ( var c = 1 ; c < arguments . length ; c ++ ) { var d = arguments [ c ] ; if ( goog . isArrayLike ( d ) ) { var e = a . length || 0 , f = d . length || 0 ; a . length = e + f ; for ( var g = 0 ; g < f ; g ++ ) a [ e + g ] = d [ g ] } else a . push ( d ) } } ;
goog . array . splice = function ( a , b , c , d ) { goog . asserts . assert ( null != a . length ) ; return Array . prototype . splice . apply ( a , goog . array . slice ( arguments , 1 ) ) } ; goog . array . slice = function ( a , b , c ) { goog . asserts . assert ( null != a . length ) ; return 2 >= arguments . length ? Array . prototype . slice . call ( a , b ) : Array . prototype . slice . call ( a , b , c ) } ;
goog . array . removeDuplicates = function ( a , b , c ) { b = b || a ; var d = function ( a ) { return goog . isObject ( a ) ? "o" + goog . getUid ( a ) : ( typeof a ) . charAt ( 0 ) + a } ; c = c || d ; d = { } ; for ( var e = 0 , f = 0 ; f < a . length ; ) { var g = a [ f ++ ] , h = c ( g ) ; Object . prototype . hasOwnProperty . call ( d , h ) || ( d [ h ] = ! 0 , b [ e ++ ] = g ) } b . length = e } ; goog . array . binarySearch = function ( a , b , c ) { return goog . array . binarySearch _ ( a , c || goog . array . defaultCompare , ! 1 , b ) } ; goog . array . binarySelect = function ( a , b , c ) { return goog . array . binarySearch _ ( a , b , ! 0 , void 0 , c ) } ;
2018-08-17 13:32:56 +00:00
goog . array . binarySearch _ = function ( a , b , c , d , e ) { for ( var f = 0 , g = a . length , h ; f < g ; ) { var k = f + g >> 1 ; var l = c ? b . call ( e , a [ k ] , k , a ) : b ( d , a [ k ] ) ; 0 < l ? f = k + 1 : ( g = k , h = ! l ) } return h ? f : ~ f } ; goog . array . sort = function ( a , b ) { a . sort ( b || goog . array . defaultCompare ) } ; goog . array . stableSort = function ( a , b ) { for ( var c = Array ( a . length ) , d = 0 ; d < a . length ; d ++ ) c [ d ] = { index : d , value : a [ d ] } ; var e = b || goog . array . defaultCompare ; goog . array . sort ( c , function ( a , b ) { return e ( a . value , b . value ) || a . index - b . index } ) ; for ( d = 0 ; d < a . length ; d ++ ) a [ d ] = c [ d ] . value } ;
2018-01-16 21:13:23 +00:00
goog . array . sortByKey = function ( a , b , c ) { var d = c || goog . array . defaultCompare ; goog . array . sort ( a , function ( a , c ) { return d ( b ( a ) , b ( c ) ) } ) } ; goog . array . sortObjectsByKey = function ( a , b , c ) { goog . array . sortByKey ( a , function ( a ) { return a [ b ] } , c ) } ; goog . array . isSorted = function ( a , b , c ) { b = b || goog . array . defaultCompare ; for ( var d = 1 ; d < a . length ; d ++ ) { var e = b ( a [ d - 1 ] , a [ d ] ) ; if ( 0 < e || 0 == e && c ) return ! 1 } return ! 0 } ;
goog . array . equals = function ( a , b , c ) { if ( ! goog . isArrayLike ( a ) || ! goog . isArrayLike ( b ) || a . length != b . length ) return ! 1 ; var d = a . length ; c = c || goog . array . defaultCompareEquality ; for ( var e = 0 ; e < d ; e ++ ) if ( ! c ( a [ e ] , b [ e ] ) ) return ! 1 ; return ! 0 } ; goog . array . compare3 = function ( a , b , c ) { c = c || goog . array . defaultCompare ; for ( var d = Math . min ( a . length , b . length ) , e = 0 ; e < d ; e ++ ) { var f = c ( a [ e ] , b [ e ] ) ; if ( 0 != f ) return f } return goog . array . defaultCompare ( a . length , b . length ) } ; goog . array . defaultCompare = function ( a , b ) { return a > b ? 1 : a < b ? - 1 : 0 } ;
goog . array . inverseDefaultCompare = function ( a , b ) { return - goog . array . defaultCompare ( a , b ) } ; goog . array . defaultCompareEquality = function ( a , b ) { return a === b } ; goog . array . binaryInsert = function ( a , b , c ) { c = goog . array . binarySearch ( a , b , c ) ; return 0 > c ? ( goog . array . insertAt ( a , b , - ( c + 1 ) ) , ! 0 ) : ! 1 } ; goog . array . binaryRemove = function ( a , b , c ) { b = goog . array . binarySearch ( a , b , c ) ; return 0 <= b ? goog . array . removeAt ( a , b ) : ! 1 } ;
goog . array . bucket = function ( a , b , c ) { for ( var d = { } , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] , g = b . call ( c , f , e , a ) ; goog . isDef ( g ) && ( d [ g ] || ( d [ g ] = [ ] ) ) . push ( f ) } return d } ; goog . array . toObject = function ( a , b , c ) { var d = { } ; goog . array . forEach ( a , function ( e , f ) { d [ b . call ( c , e , f , a ) ] = e } ) ; return d } ; goog . array . range = function ( a , b , c ) { var d = [ ] , e = 0 , f = a ; c = c || 1 ; void 0 !== b && ( e = a , f = b ) ; if ( 0 > c * ( f - e ) ) return [ ] ; if ( 0 < c ) for ( a = e ; a < f ; a += c ) d . push ( a ) ; else for ( a = e ; a > f ; a += c ) d . push ( a ) ; return d } ;
goog . array . repeat = function ( a , b ) { for ( var c = [ ] , d = 0 ; d < b ; d ++ ) c [ d ] = a ; return c } ; goog . array . flatten = function ( a ) { for ( var b = [ ] , c = 0 ; c < arguments . length ; c ++ ) { var d = arguments [ c ] ; if ( goog . isArray ( d ) ) for ( var e = 0 ; e < d . length ; e += 8192 ) { var f = goog . array . slice ( d , e , e + 8192 ) ; f = goog . array . flatten . apply ( null , f ) ; for ( var g = 0 ; g < f . length ; g ++ ) b . push ( f [ g ] ) } else b . push ( d ) } return b } ;
goog . array . rotate = function ( a , b ) { goog . asserts . assert ( null != a . length ) ; a . length && ( b %= a . length , 0 < b ? Array . prototype . unshift . apply ( a , a . splice ( - b , b ) ) : 0 > b && Array . prototype . push . apply ( a , a . splice ( 0 , - b ) ) ) ; return a } ; goog . array . moveItem = function ( a , b , c ) { goog . asserts . assert ( 0 <= b && b < a . length ) ; goog . asserts . assert ( 0 <= c && c < a . length ) ; b = Array . prototype . splice . call ( a , b , 1 ) ; Array . prototype . splice . call ( a , c , 0 , b [ 0 ] ) } ;
goog . array . zip = function ( a ) { if ( ! arguments . length ) return [ ] ; for ( var b = [ ] , c = arguments [ 0 ] . length , d = 1 ; d < arguments . length ; d ++ ) arguments [ d ] . length < c && ( c = arguments [ d ] . length ) ; for ( d = 0 ; d < c ; d ++ ) { for ( var e = [ ] , f = 0 ; f < arguments . length ; f ++ ) e . push ( arguments [ f ] [ d ] ) ; b . push ( e ) } return b } ; goog . array . shuffle = function ( a , b ) { for ( var c = b || Math . random , d = a . length - 1 ; 0 < d ; d -- ) { var e = Math . floor ( c ( ) * ( d + 1 ) ) , f = a [ d ] ; a [ d ] = a [ e ] ; a [ e ] = f } } ; goog . array . copyByIndex = function ( a , b ) { var c = [ ] ; goog . array . forEach ( b , function ( b ) { c . push ( a [ b ] ) } ) ; return c } ;
goog . array . concatMap = function ( a , b , c ) { return goog . array . concat . apply ( [ ] , goog . array . map ( a , b , c ) ) } ; goog . math = { } ; goog . math . randomInt = function ( a ) { return Math . floor ( Math . random ( ) * a ) } ; goog . math . uniformRandom = function ( a , b ) { return a + Math . random ( ) * ( b - a ) } ; goog . math . clamp = function ( a , b , c ) { return Math . min ( Math . max ( a , b ) , c ) } ; goog . math . modulo = function ( a , b ) { var c = a % b ; return 0 > c * b ? c + b : c } ; goog . math . lerp = function ( a , b , c ) { return a + c * ( b - a ) } ; goog . math . nearlyEquals = function ( a , b , c ) { return Math . abs ( a - b ) <= ( c || 1E-6 ) } ; goog . math . standardAngle = function ( a ) { return goog . math . modulo ( a , 360 ) } ;
goog . math . standardAngleInRadians = function ( a ) { return goog . math . modulo ( a , 2 * Math . PI ) } ; goog . math . toRadians = function ( a ) { return a * Math . PI / 180 } ; goog . math . toDegrees = function ( a ) { return 180 * a / Math . PI } ; goog . math . angleDx = function ( a , b ) { return b * Math . cos ( goog . math . toRadians ( a ) ) } ; goog . math . angleDy = function ( a , b ) { return b * Math . sin ( goog . math . toRadians ( a ) ) } ; goog . math . angle = function ( a , b , c , d ) { return goog . math . standardAngle ( goog . math . toDegrees ( Math . atan2 ( d - b , c - a ) ) ) } ;
goog . math . angleDifference = function ( a , b ) { var c = goog . math . standardAngle ( b ) - goog . math . standardAngle ( a ) ; 180 < c ? c -= 360 : - 180 >= c && ( c = 360 + c ) ; return c } ; goog . math . sign = function ( a ) { return 0 < a ? 1 : 0 > a ? - 1 : a } ;
2018-08-17 13:32:56 +00:00
goog . math . longestCommonSubsequence = function ( a , b , c , d ) { c = c || function ( a , b ) { return a == b } ; d = d || function ( b , c ) { return a [ b ] } ; for ( var e = a . length , f = b . length , g = [ ] , h = 0 ; h < e + 1 ; h ++ ) g [ h ] = [ ] , g [ h ] [ 0 ] = 0 ; for ( var k = 0 ; k < f + 1 ; k ++ ) g [ 0 ] [ k ] = 0 ; for ( h = 1 ; h <= e ; h ++ ) for ( k = 1 ; k <= f ; k ++ ) c ( a [ h - 1 ] , b [ k - 1 ] ) ? g [ h ] [ k ] = g [ h - 1 ] [ k - 1 ] + 1 : g [ h ] [ k ] = Math . max ( g [ h - 1 ] [ k ] , g [ h ] [ k - 1 ] ) ; var l = [ ] ; h = e ; for ( k = f ; 0 < h && 0 < k ; ) c ( a [ h - 1 ] , b [ k - 1 ] ) ? ( l . unshift ( d ( h - 1 , k - 1 ) ) , h -- , k -- ) : g [ h - 1 ] [ k ] > g [ h ] [ k - 1 ] ? h -- : k -- ; return l } ;
2018-01-16 21:13:23 +00:00
goog . math . sum = function ( a ) { return goog . array . reduce ( arguments , function ( a , c ) { return a + c } , 0 ) } ; goog . math . average = function ( a ) { return goog . math . sum . apply ( null , arguments ) / arguments . length } ; goog . math . sampleVariance = function ( a ) { var b = arguments . length ; if ( 2 > b ) return 0 ; var c = goog . math . average . apply ( null , arguments ) ; return goog . math . sum . apply ( null , goog . array . map ( arguments , function ( a ) { return Math . pow ( a - c , 2 ) } ) ) / ( b - 1 ) } ; goog . math . standardDeviation = function ( a ) { return Math . sqrt ( goog . math . sampleVariance . apply ( null , arguments ) ) } ;
goog . math . isInt = function ( a ) { return isFinite ( a ) && 0 == a % 1 } ; goog . math . isFiniteNumber = function ( a ) { return isFinite ( a ) } ; goog . math . isNegativeZero = function ( a ) { return 0 == a && 0 > 1 / a } ; goog . math . log10Floor = function ( a ) { if ( 0 < a ) { var b = Math . round ( Math . log ( a ) * Math . LOG10E ) ; return b - ( parseFloat ( "1e" + b ) > a ? 1 : 0 ) } return 0 == a ? - Infinity : NaN } ; goog . math . safeFloor = function ( a , b ) { goog . asserts . assert ( ! goog . isDef ( b ) || 0 < b ) ; return Math . floor ( a + ( b || 2E-15 ) ) } ;
goog . math . safeCeil = function ( a , b ) { goog . asserts . assert ( ! goog . isDef ( b ) || 0 < b ) ; return Math . ceil ( a - ( b || 2E-15 ) ) } ; goog . math . Coordinate = function ( a , b ) { this . x = goog . isDef ( a ) ? a : 0 ; this . y = goog . isDef ( b ) ? b : 0 } ; goog . math . Coordinate . prototype . clone = function ( ) { return new goog . math . Coordinate ( this . x , this . y ) } ; goog . DEBUG && ( goog . math . Coordinate . prototype . toString = function ( ) { return "(" + this . x + ", " + this . y + ")" } ) ; goog . math . Coordinate . prototype . equals = function ( a ) { return a instanceof goog . math . Coordinate && goog . math . Coordinate . equals ( this , a ) } ; goog . math . Coordinate . equals = function ( a , b ) { return a == b ? ! 0 : a && b ? a . x == b . x && a . y == b . y : ! 1 } ;
goog . math . Coordinate . distance = function ( a , b ) { var c = a . x - b . x , d = a . y - b . y ; return Math . sqrt ( c * c + d * d ) } ; goog . math . Coordinate . magnitude = function ( a ) { return Math . sqrt ( a . x * a . x + a . y * a . y ) } ; goog . math . Coordinate . azimuth = function ( a ) { return goog . math . angle ( 0 , 0 , a . x , a . y ) } ; goog . math . Coordinate . squaredDistance = function ( a , b ) { var c = a . x - b . x , d = a . y - b . y ; return c * c + d * d } ; goog . math . Coordinate . difference = function ( a , b ) { return new goog . math . Coordinate ( a . x - b . x , a . y - b . y ) } ;
goog . math . Coordinate . sum = function ( a , b ) { return new goog . math . Coordinate ( a . x + b . x , a . y + b . y ) } ; goog . math . Coordinate . prototype . ceil = function ( ) { this . x = Math . ceil ( this . x ) ; this . y = Math . ceil ( this . y ) ; return this } ; goog . math . Coordinate . prototype . floor = function ( ) { this . x = Math . floor ( this . x ) ; this . y = Math . floor ( this . y ) ; return this } ; goog . math . Coordinate . prototype . round = function ( ) { this . x = Math . round ( this . x ) ; this . y = Math . round ( this . y ) ; return this } ;
goog . math . Coordinate . prototype . translate = function ( a , b ) { a instanceof goog . math . Coordinate ? ( this . x += a . x , this . y += a . y ) : ( this . x += Number ( a ) , goog . isNumber ( b ) && ( this . y += b ) ) ; return this } ; goog . math . Coordinate . prototype . scale = function ( a , b ) { var c = goog . isNumber ( b ) ? b : a ; this . x *= a ; this . y *= c ; return this } ; goog . math . Coordinate . prototype . rotateRadians = function ( a , b ) { var c = b || new goog . math . Coordinate ( 0 , 0 ) , d = this . x , e = this . y , f = Math . cos ( a ) , g = Math . sin ( a ) ; this . x = ( d - c . x ) * f - ( e - c . y ) * g + c . x ; this . y = ( d - c . x ) * g + ( e - c . y ) * f + c . y } ;
goog . math . Coordinate . prototype . rotateDegrees = function ( a , b ) { this . rotateRadians ( goog . math . toRadians ( a ) , b ) } ; goog . string = { } ; goog . string . DETECT _DOUBLE _ESCAPING = ! 1 ; goog . string . FORCE _NON _DOM _HTML _UNESCAPING = ! 1 ; goog . string . Unicode = { NBSP : "\u00a0" } ; goog . string . startsWith = function ( a , b ) { return 0 == a . lastIndexOf ( b , 0 ) } ; goog . string . endsWith = function ( a , b ) { var c = a . length - b . length ; return 0 <= c && a . indexOf ( b , c ) == c } ; goog . string . caseInsensitiveStartsWith = function ( a , b ) { return 0 == goog . string . caseInsensitiveCompare ( b , a . substr ( 0 , b . length ) ) } ;
2017-09-25 09:37:41 +00:00
goog . string . caseInsensitiveEndsWith = function ( a , b ) { return 0 == goog . string . caseInsensitiveCompare ( b , a . substr ( a . length - b . length , b . length ) ) } ; goog . string . caseInsensitiveEquals = function ( a , b ) { return a . toLowerCase ( ) == b . toLowerCase ( ) } ; goog . string . subs = function ( a , b ) { for ( var c = a . split ( "%s" ) , d = "" , e = Array . prototype . slice . call ( arguments , 1 ) ; e . length && 1 < c . length ; ) d += c . shift ( ) + e . shift ( ) ; return d + c . join ( "%s" ) } ; goog . string . collapseWhitespace = function ( a ) { return a . replace ( /[\s\xa0]+/g , " " ) . replace ( /^\s+|\s+$/g , "" ) } ;
goog . string . isEmptyOrWhitespace = function ( a ) { return /^[\s\xa0]*$/ . test ( a ) } ; goog . string . isEmptyString = function ( a ) { return 0 == a . length } ; goog . string . isEmpty = goog . string . isEmptyOrWhitespace ; goog . string . isEmptyOrWhitespaceSafe = function ( a ) { return goog . string . isEmptyOrWhitespace ( goog . string . makeSafe ( a ) ) } ; goog . string . isEmptySafe = goog . string . isEmptyOrWhitespaceSafe ; goog . string . isBreakingWhitespace = function ( a ) { return ! /[^\t\n\r ]/ . test ( a ) } ; goog . string . isAlpha = function ( a ) { return ! /[^a-zA-Z]/ . test ( a ) } ;
goog . string . isNumeric = function ( a ) { return ! /[^0-9]/ . test ( a ) } ; goog . string . isAlphaNumeric = function ( a ) { return ! /[^a-zA-Z0-9]/ . test ( a ) } ; goog . string . isSpace = function ( a ) { return " " == a } ; goog . string . isUnicodeChar = function ( a ) { return 1 == a . length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a } ; goog . string . stripNewlines = function ( a ) { return a . replace ( /(\r\n|\r|\n)+/g , " " ) } ; goog . string . canonicalizeNewlines = function ( a ) { return a . replace ( /(\r\n|\r|\n)/g , "\n" ) } ;
2018-01-16 21:13:23 +00:00
goog . string . normalizeWhitespace = function ( a ) { return a . replace ( /\xa0|\s/g , " " ) } ; goog . string . normalizeSpaces = function ( a ) { return a . replace ( /\xa0|[ \t]+/g , " " ) } ; goog . string . collapseBreakingSpaces = function ( a ) { return a . replace ( /[\t\r\n ]+/g , " " ) . replace ( /^[\t\r\n ]+|[\t\r\n ]+$/g , "" ) } ; goog . string . trim = goog . TRUSTED _SITE && String . prototype . trim ? function ( a ) { return a . trim ( ) } : function ( a ) { return /^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/ . exec ( a ) [ 1 ] } ; goog . string . trimLeft = function ( a ) { return a . replace ( /^[\s\xa0]+/ , "" ) } ;
2017-09-25 09:37:41 +00:00
goog . string . trimRight = function ( a ) { return a . replace ( /[\s\xa0]+$/ , "" ) } ; goog . string . caseInsensitiveCompare = function ( a , b ) { var c = String ( a ) . toLowerCase ( ) , d = String ( b ) . toLowerCase ( ) ; return c < d ? - 1 : c == d ? 0 : 1 } ;
goog . string . numberAwareCompare _ = function ( a , b , c ) { if ( a == b ) return 0 ; if ( ! a ) return - 1 ; if ( ! b ) return 1 ; for ( var d = a . toLowerCase ( ) . match ( c ) , e = b . toLowerCase ( ) . match ( c ) , f = Math . min ( d . length , e . length ) , g = 0 ; g < f ; g ++ ) { c = d [ g ] ; var h = e [ g ] ; if ( c != h ) return a = parseInt ( c , 10 ) , ! isNaN ( a ) && ( b = parseInt ( h , 10 ) , ! isNaN ( b ) && a - b ) ? a - b : c < h ? - 1 : 1 } return d . length != e . length ? d . length - e . length : a < b ? - 1 : 1 } ; goog . string . intAwareCompare = function ( a , b ) { return goog . string . numberAwareCompare _ ( a , b , /\d+|\D+/g ) } ;
goog . string . floatAwareCompare = function ( a , b ) { return goog . string . numberAwareCompare _ ( a , b , /\d+|\.\d+|\D+/g ) } ; goog . string . numerateCompare = goog . string . floatAwareCompare ; goog . string . urlEncode = function ( a ) { return encodeURIComponent ( String ( a ) ) } ; goog . string . urlDecode = function ( a ) { return decodeURIComponent ( a . replace ( /\+/g , " " ) ) } ; goog . string . newLineToBr = function ( a , b ) { return a . replace ( /(\r\n|\r|\n)/g , b ? "<br />" : "<br>" ) } ;
goog . string . htmlEscape = function ( a , b ) { if ( b ) a = a . replace ( goog . string . AMP _RE _ , "&" ) . replace ( goog . string . LT _RE _ , "<" ) . replace ( goog . string . GT _RE _ , ">" ) . replace ( goog . string . QUOT _RE _ , """ ) . replace ( goog . string . SINGLE _QUOTE _RE _ , "'" ) . replace ( goog . string . NULL _RE _ , "�" ) , goog . string . DETECT _DOUBLE _ESCAPING && ( a = a . replace ( goog . string . E _RE _ , "e" ) ) ; else { if ( ! goog . string . ALL _RE _ . test ( a ) ) return a ; - 1 != a . indexOf ( "&" ) && ( a = a . replace ( goog . string . AMP _RE _ , "&" ) ) ; - 1 != a . indexOf ( "<" ) && ( a = a . replace ( goog . string . LT _RE _ ,
"<" ) ) ; - 1 != a . indexOf ( ">" ) && ( a = a . replace ( goog . string . GT _RE _ , ">" ) ) ; - 1 != a . indexOf ( '"' ) && ( a = a . replace ( goog . string . QUOT _RE _ , """ ) ) ; - 1 != a . indexOf ( "'" ) && ( a = a . replace ( goog . string . SINGLE _QUOTE _RE _ , "'" ) ) ; - 1 != a . indexOf ( "\x00" ) && ( a = a . replace ( goog . string . NULL _RE _ , "�" ) ) ; goog . string . DETECT _DOUBLE _ESCAPING && - 1 != a . indexOf ( "e" ) && ( a = a . replace ( goog . string . E _RE _ , "e" ) ) } return a } ; goog . string . AMP _RE _ = /&/g ; goog . string . LT _RE _ = /</g ; goog . string . GT _RE _ = />/g ; goog . string . QUOT _RE _ = /"/g ;
goog . string . SINGLE _QUOTE _RE _ = /'/g ; goog . string . NULL _RE _ = /\x00/g ; goog . string . E _RE _ = /e/g ; goog . string . ALL _RE _ = goog . string . DETECT _DOUBLE _ESCAPING ? /[\x00&<>"'e]/ : /[\x00&<>"']/ ; goog . string . unescapeEntities = function ( a ) { return goog . string . contains ( a , "&" ) ? ! goog . string . FORCE _NON _DOM _HTML _UNESCAPING && "document" in goog . global ? goog . string . unescapeEntitiesUsingDom _ ( a ) : goog . string . unescapePureXmlEntities _ ( a ) : a } ;
goog . string . unescapeEntitiesWithDocument = function ( a , b ) { return goog . string . contains ( a , "&" ) ? goog . string . unescapeEntitiesUsingDom _ ( a , b ) : a } ;
2018-01-16 21:13:23 +00:00
goog . string . unescapeEntitiesUsingDom _ = function ( a , b ) { var c = { "&" : "&" , "<" : "<" , ">" : ">" , """ : '"' } ; var d = b ? b . createElement ( "div" ) : goog . global . document . createElement ( "div" ) ; return a . replace ( goog . string . HTML _ENTITY _PATTERN _ , function ( a , b ) { var e = c [ a ] ; if ( e ) return e ; if ( "#" == b . charAt ( 0 ) ) { var f = Number ( "0" + b . substr ( 1 ) ) ; isNaN ( f ) || ( e = String . fromCharCode ( f ) ) } e || ( d . innerHTML = a + " " , e = d . firstChild . nodeValue . slice ( 0 , - 1 ) ) ; return c [ a ] = e } ) } ;
2017-09-25 09:37:41 +00:00
goog . string . unescapePureXmlEntities _ = function ( a ) { return a . replace ( /&([^;]+);/g , function ( a , c ) { switch ( c ) { case "amp" : return "&" ; case "lt" : return "<" ; case "gt" : return ">" ; case "quot" : return '"' ; default : if ( "#" == c . charAt ( 0 ) ) { var b = Number ( "0" + c . substr ( 1 ) ) ; if ( ! isNaN ( b ) ) return String . fromCharCode ( b ) } return a } } ) } ; goog . string . HTML _ENTITY _PATTERN _ = /&([^;\s<&]+);?/g ; goog . string . whitespaceEscape = function ( a , b ) { return goog . string . newLineToBr ( a . replace ( / /g , "  " ) , b ) } ;
goog . string . preserveSpaces = function ( a ) { return a . replace ( /(^|[\n ]) /g , "$1" + goog . string . Unicode . NBSP ) } ; goog . string . stripQuotes = function ( a , b ) { for ( var c = b . length , d = 0 ; d < c ; d ++ ) { var e = 1 == c ? b : b . charAt ( d ) ; if ( a . charAt ( 0 ) == e && a . charAt ( a . length - 1 ) == e ) return a . substring ( 1 , a . length - 1 ) } return a } ; goog . string . truncate = function ( a , b , c ) { c && ( a = goog . string . unescapeEntities ( a ) ) ; a . length > b && ( a = a . substring ( 0 , b - 3 ) + "..." ) ; c && ( a = goog . string . htmlEscape ( a ) ) ; return a } ;
goog . string . truncateMiddle = function ( a , b , c , d ) { c && ( a = goog . string . unescapeEntities ( a ) ) ; if ( d && a . length > b ) { d > b && ( d = b ) ; var e = a . length - d ; a = a . substring ( 0 , b - d ) + "..." + a . substring ( e ) } else a . length > b && ( d = Math . floor ( b / 2 ) , e = a . length - d , a = a . substring ( 0 , d + b % 2 ) + "..." + a . substring ( e ) ) ; c && ( a = goog . string . htmlEscape ( a ) ) ; return a } ; goog . string . specialEscapeChars _ = { "\x00" : "\\0" , "\b" : "\\b" , "\f" : "\\f" , "\n" : "\\n" , "\r" : "\\r" , "\t" : "\\t" , "\x0B" : "\\x0B" , '"' : '\\"' , "\\" : "\\\\" , "<" : "<" } ; goog . string . jsEscapeCache _ = { "'" : "\\'" } ;
goog . string . quote = function ( a ) { a = String ( a ) ; for ( var b = [ '"' ] , c = 0 ; c < a . length ; c ++ ) { var d = a . charAt ( c ) , e = d . charCodeAt ( 0 ) ; b [ c + 1 ] = goog . string . specialEscapeChars _ [ d ] || ( 31 < e && 127 > e ? d : goog . string . escapeChar ( d ) ) } b . push ( '"' ) ; return b . join ( "" ) } ; goog . string . escapeString = function ( a ) { for ( var b = [ ] , c = 0 ; c < a . length ; c ++ ) b [ c ] = goog . string . escapeChar ( a . charAt ( c ) ) ; return b . join ( "" ) } ;
2018-01-16 21:13:23 +00:00
goog . string . escapeChar = function ( a ) { if ( a in goog . string . jsEscapeCache _ ) return goog . string . jsEscapeCache _ [ a ] ; if ( a in goog . string . specialEscapeChars _ ) return goog . string . jsEscapeCache _ [ a ] = goog . string . specialEscapeChars _ [ a ] ; var b = a . charCodeAt ( 0 ) ; if ( 31 < b && 127 > b ) var c = a ; else { if ( 256 > b ) { if ( c = "\\x" , 16 > b || 256 < b ) c += "0" } else c = "\\u" , 4096 > b && ( c += "0" ) ; c += b . toString ( 16 ) . toUpperCase ( ) } return goog . string . jsEscapeCache _ [ a ] = c } ; goog . string . contains = function ( a , b ) { return - 1 != a . indexOf ( b ) } ;
2017-09-25 09:37:41 +00:00
goog . string . caseInsensitiveContains = function ( a , b ) { return goog . string . contains ( a . toLowerCase ( ) , b . toLowerCase ( ) ) } ; goog . string . countOf = function ( a , b ) { return a && b ? a . split ( b ) . length - 1 : 0 } ; goog . string . removeAt = function ( a , b , c ) { var d = a ; 0 <= b && b < a . length && 0 < c && ( d = a . substr ( 0 , b ) + a . substr ( b + c , a . length - b - c ) ) ; return d } ; goog . string . remove = function ( a , b ) { return a . replace ( b , "" ) } ; goog . string . removeAll = function ( a , b ) { var c = new RegExp ( goog . string . regExpEscape ( b ) , "g" ) ; return a . replace ( c , "" ) } ;
goog . string . replaceAll = function ( a , b , c ) { b = new RegExp ( goog . string . regExpEscape ( b ) , "g" ) ; return a . replace ( b , c . replace ( /\$/g , "$$$$" ) ) } ; goog . string . regExpEscape = function ( a ) { return String ( a ) . replace ( /([-()\[\]{}+?*.$\^|,:#<!\\])/g , "\\$1" ) . replace ( /\x08/g , "\\x08" ) } ; goog . string . repeat = String . prototype . repeat ? function ( a , b ) { return a . repeat ( b ) } : function ( a , b ) { return Array ( b + 1 ) . join ( a ) } ;
goog . string . padNumber = function ( a , b , c ) { a = goog . isDef ( c ) ? a . toFixed ( c ) : String ( a ) ; c = a . indexOf ( "." ) ; - 1 == c && ( c = a . length ) ; return goog . string . repeat ( "0" , Math . max ( 0 , b - c ) ) + a } ; goog . string . makeSafe = function ( a ) { return null == a ? "" : String ( a ) } ; goog . string . buildString = function ( a ) { return Array . prototype . join . call ( arguments , "" ) } ; goog . string . getRandomString = function ( ) { return Math . floor ( 2147483648 * Math . random ( ) ) . toString ( 36 ) + Math . abs ( Math . floor ( 2147483648 * Math . random ( ) ) ^ goog . now ( ) ) . toString ( 36 ) } ;
2018-08-17 13:32:56 +00:00
goog . string . compareVersions = function ( a , b ) { for ( var c = 0 , d = goog . string . trim ( String ( a ) ) . split ( "." ) , e = goog . string . trim ( String ( b ) ) . split ( "." ) , f = Math . max ( d . length , e . length ) , g = 0 ; 0 == c && g < f ; g ++ ) { var h = d [ g ] || "" , k = e [ g ] || "" ; do { h = /(\d*)(\D*)(.*)/ . exec ( h ) || [ "" , "" , "" , "" ] ; k = /(\d*)(\D*)(.*)/ . exec ( k ) || [ "" , "" , "" , "" ] ; if ( 0 == h [ 0 ] . length && 0 == k [ 0 ] . length ) break ; c = 0 == h [ 1 ] . length ? 0 : parseInt ( h [ 1 ] , 10 ) ; var l = 0 == k [ 1 ] . length ? 0 : parseInt ( k [ 1 ] , 10 ) ; c = goog . string . compareElements _ ( c , l ) || goog . string . compareElements _ ( 0 == h [ 2 ] . length , 0 == k [ 2 ] . length ) ||
2018-01-16 21:13:23 +00:00
goog . string . compareElements _ ( h [ 2 ] , k [ 2 ] ) ; h = h [ 3 ] ; k = k [ 3 ] } while ( 0 == c ) } return c } ; goog . string . compareElements _ = function ( a , b ) { return a < b ? - 1 : a > b ? 1 : 0 } ; goog . string . hashCode = function ( a ) { for ( var b = 0 , c = 0 ; c < a . length ; ++ c ) b = 31 * b + a . charCodeAt ( c ) >>> 0 ; return b } ; goog . string . uniqueStringCounter _ = 2147483648 * Math . random ( ) | 0 ; goog . string . createUniqueString = function ( ) { return "goog_" + goog . string . uniqueStringCounter _ ++ } ; goog . string . toNumber = function ( a ) { var b = Number ( a ) ; return 0 == b && goog . string . isEmptyOrWhitespace ( a ) ? NaN : b } ;
2017-09-25 09:37:41 +00:00
goog . string . isLowerCamelCase = function ( a ) { return /^[a-z]+([A-Z][a-z]*)*$/ . test ( a ) } ; goog . string . isUpperCamelCase = function ( a ) { return /^([A-Z][a-z]*)+$/ . test ( a ) } ; goog . string . toCamelCase = function ( a ) { return String ( a ) . replace ( /\-([a-z])/g , function ( a , c ) { return c . toUpperCase ( ) } ) } ; goog . string . toSelectorCase = function ( a ) { return String ( a ) . replace ( /([A-Z])/g , "-$1" ) . toLowerCase ( ) } ;
goog . string . toTitleCase = function ( a , b ) { var c = goog . isString ( b ) ? goog . string . regExpEscape ( b ) : "\\s" ; return a . replace ( new RegExp ( "(^" + ( c ? "|[" + c + "]+" : "" ) + ")([a-z])" , "g" ) , function ( a , b , c ) { return b + c . toUpperCase ( ) } ) } ; goog . string . capitalize = function ( a ) { return String ( a . charAt ( 0 ) ) . toUpperCase ( ) + String ( a . substr ( 1 ) ) . toLowerCase ( ) } ; goog . string . parseInt = function ( a ) { isFinite ( a ) && ( a = String ( a ) ) ; return goog . isString ( a ) ? /^\s*-?0x/i . test ( a ) ? parseInt ( a , 16 ) : parseInt ( a , 10 ) : NaN } ;
goog . string . splitLimit = function ( a , b , c ) { a = a . split ( b ) ; for ( var d = [ ] ; 0 < c && a . length ; ) d . push ( a . shift ( ) ) , c -- ; a . length && d . push ( a . join ( b ) ) ; return d } ; goog . string . lastComponent = function ( a , b ) { if ( b ) "string" == typeof b && ( b = [ b ] ) ; else return a ; for ( var c = - 1 , d = 0 ; d < b . length ; d ++ ) if ( "" != b [ d ] ) { var e = a . lastIndexOf ( b [ d ] ) ; e > c && ( c = e ) } return - 1 == c ? a : a . slice ( c + 1 ) } ;
2018-01-16 21:13:23 +00:00
goog . string . editDistance = function ( a , b ) { var c = [ ] , d = [ ] ; if ( a == b ) return 0 ; if ( ! a . length || ! b . length ) return Math . max ( a . length , b . length ) ; for ( var e = 0 ; e < b . length + 1 ; e ++ ) c [ e ] = e ; for ( e = 0 ; e < a . length ; e ++ ) { d [ 0 ] = e + 1 ; for ( var f = 0 ; f < b . length ; f ++ ) d [ f + 1 ] = Math . min ( d [ f ] + 1 , c [ f + 1 ] + 1 , c [ f ] + Number ( a [ e ] != b [ f ] ) ) ; for ( f = 0 ; f < c . length ; f ++ ) c [ f ] = d [ f ] } return d [ b . length ] } ; goog . labs = { } ; goog . labs . userAgent = { } ; goog . labs . userAgent . util = { } ; goog . labs . userAgent . util . getNativeUserAgentString _ = function ( ) { var a = goog . labs . userAgent . util . getNavigator _ ( ) ; return a && ( a = a . userAgent ) ? a : "" } ; goog . labs . userAgent . util . getNavigator _ = function ( ) { return goog . global . navigator } ; goog . labs . userAgent . util . userAgent _ = goog . labs . userAgent . util . getNativeUserAgentString _ ( ) ; goog . labs . userAgent . util . setUserAgent = function ( a ) { goog . labs . userAgent . util . userAgent _ = a || goog . labs . userAgent . util . getNativeUserAgentString _ ( ) } ;
2017-09-25 09:37:41 +00:00
goog . labs . userAgent . util . getUserAgent = function ( ) { return goog . labs . userAgent . util . userAgent _ } ; goog . labs . userAgent . util . matchUserAgent = function ( a ) { var b = goog . labs . userAgent . util . getUserAgent ( ) ; return goog . string . contains ( b , a ) } ; goog . labs . userAgent . util . matchUserAgentIgnoreCase = function ( a ) { var b = goog . labs . userAgent . util . getUserAgent ( ) ; return goog . string . caseInsensitiveContains ( b , a ) } ;
goog . labs . userAgent . util . extractVersionTuples = function ( a ) { for ( var b = RegExp ( "(\\w[\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?" , "g" ) , c = [ ] , d ; d = b . exec ( a ) ; ) c . push ( [ d [ 1 ] , d [ 2 ] , d [ 3 ] || void 0 ] ) ; return c } ; goog . object = { } ; goog . object . is = function ( a , b ) { return a === b ? 0 !== a || 1 / a === 1 / b : a !== a && b !== b } ; goog . object . forEach = function ( a , b , c ) { for ( var d in a ) b . call ( c , a [ d ] , d , a ) } ; goog . object . filter = function ( a , b , c ) { var d = { } , e ; for ( e in a ) b . call ( c , a [ e ] , e , a ) && ( d [ e ] = a [ e ] ) ; return d } ; goog . object . map = function ( a , b , c ) { var d = { } , e ; for ( e in a ) d [ e ] = b . call ( c , a [ e ] , e , a ) ; return d } ; goog . object . some = function ( a , b , c ) { for ( var d in a ) if ( b . call ( c , a [ d ] , d , a ) ) return ! 0 ; return ! 1 } ;
goog . object . every = function ( a , b , c ) { for ( var d in a ) if ( ! b . call ( c , a [ d ] , d , a ) ) return ! 1 ; return ! 0 } ; goog . object . getCount = function ( a ) { var b = 0 , c ; for ( c in a ) b ++ ; return b } ; goog . object . getAnyKey = function ( a ) { for ( var b in a ) return b } ; goog . object . getAnyValue = function ( a ) { for ( var b in a ) return a [ b ] } ; goog . object . contains = function ( a , b ) { return goog . object . containsValue ( a , b ) } ; goog . object . getValues = function ( a ) { var b = [ ] , c = 0 , d ; for ( d in a ) b [ c ++ ] = a [ d ] ; return b } ;
2018-01-16 21:13:23 +00:00
goog . object . getKeys = function ( a ) { var b = [ ] , c = 0 , d ; for ( d in a ) b [ c ++ ] = d ; return b } ; goog . object . getValueByKeys = function ( a , b ) { var c = goog . isArrayLike ( b ) , d = c ? b : arguments ; for ( c = c ? 0 : 1 ; c < d . length ; c ++ ) { if ( null == a ) return ; a = a [ d [ c ] ] } return a } ; goog . object . containsKey = function ( a , b ) { return null !== a && b in a } ; goog . object . containsValue = function ( a , b ) { for ( var c in a ) if ( a [ c ] == b ) return ! 0 ; return ! 1 } ; goog . object . findKey = function ( a , b , c ) { for ( var d in a ) if ( b . call ( c , a [ d ] , d , a ) ) return d } ;
2017-09-25 09:37:41 +00:00
goog . object . findValue = function ( a , b , c ) { return ( b = goog . object . findKey ( a , b , c ) ) && a [ b ] } ; goog . object . isEmpty = function ( a ) { for ( var b in a ) return ! 1 ; return ! 0 } ; goog . object . clear = function ( a ) { for ( var b in a ) delete a [ b ] } ; goog . object . remove = function ( a , b ) { var c ; ( c = b in a ) && delete a [ b ] ; return c } ; goog . object . add = function ( a , b , c ) { if ( null !== a && b in a ) throw Error ( 'The object already contains the key "' + b + '"' ) ; goog . object . set ( a , b , c ) } ; goog . object . get = function ( a , b , c ) { return null !== a && b in a ? a [ b ] : c } ;
goog . object . set = function ( a , b , c ) { a [ b ] = c } ; goog . object . setIfUndefined = function ( a , b , c ) { return b in a ? a [ b ] : a [ b ] = c } ; goog . object . setWithReturnValueIfNotSet = function ( a , b , c ) { if ( b in a ) return a [ b ] ; c = c ( ) ; return a [ b ] = c } ; goog . object . equals = function ( a , b ) { for ( var c in a ) if ( ! ( c in b ) || a [ c ] !== b [ c ] ) return ! 1 ; for ( c in b ) if ( ! ( c in a ) ) return ! 1 ; return ! 0 } ; goog . object . clone = function ( a ) { var b = { } , c ; for ( c in a ) b [ c ] = a [ c ] ; return b } ;
2018-01-16 21:13:23 +00:00
goog . object . unsafeClone = function ( a ) { var b = goog . typeOf ( a ) ; if ( "object" == b || "array" == b ) { if ( goog . isFunction ( a . clone ) ) return a . clone ( ) ; b = "array" == b ? [ ] : { } ; for ( var c in a ) b [ c ] = goog . object . unsafeClone ( a [ c ] ) ; return b } return a } ; goog . object . transpose = function ( a ) { var b = { } , c ; for ( c in a ) b [ a [ c ] ] = c ; return b } ; goog . object . PROTOTYPE _FIELDS _ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf" . split ( " " ) ;
2017-09-25 09:37:41 +00:00
goog . object . extend = function ( a , b ) { for ( var c , d , e = 1 ; e < arguments . length ; e ++ ) { d = arguments [ e ] ; for ( c in d ) a [ c ] = d [ c ] ; for ( var f = 0 ; f < goog . object . PROTOTYPE _FIELDS _ . length ; f ++ ) c = goog . object . PROTOTYPE _FIELDS _ [ f ] , Object . prototype . hasOwnProperty . call ( d , c ) && ( a [ c ] = d [ c ] ) } } ;
goog . object . create = function ( a ) { var b = arguments . length ; if ( 1 == b && goog . isArray ( arguments [ 0 ] ) ) return goog . object . create . apply ( null , arguments [ 0 ] ) ; if ( b % 2 ) throw Error ( "Uneven number of arguments" ) ; for ( var c = { } , d = 0 ; d < b ; d += 2 ) c [ arguments [ d ] ] = arguments [ d + 1 ] ; return c } ; goog . object . createSet = function ( a ) { var b = arguments . length ; if ( 1 == b && goog . isArray ( arguments [ 0 ] ) ) return goog . object . createSet . apply ( null , arguments [ 0 ] ) ; for ( var c = { } , d = 0 ; d < b ; d ++ ) c [ arguments [ d ] ] = ! 0 ; return c } ;
2018-01-16 21:13:23 +00:00
goog . object . createImmutableView = function ( a ) { var b = a ; Object . isFrozen && ! Object . isFrozen ( a ) && ( b = Object . create ( a ) , Object . freeze ( b ) ) ; return b } ; goog . object . isImmutableView = function ( a ) { return ! ! Object . isFrozen && Object . isFrozen ( a ) } ;
goog . object . getAllPropertyNames = function ( a , b , c ) { if ( ! a ) return [ ] ; if ( ! Object . getOwnPropertyNames || ! Object . getPrototypeOf ) return goog . object . getKeys ( a ) ; for ( var d = { } ; a && ( a !== Object . prototype || b ) && ( a !== Function . prototype || c ) ; ) { for ( var e = Object . getOwnPropertyNames ( a ) , f = 0 ; f < e . length ; f ++ ) d [ e [ f ] ] = ! 0 ; a = Object . getPrototypeOf ( a ) } return goog . object . getKeys ( d ) } ; goog . labs . userAgent . browser = { } ; goog . labs . userAgent . browser . matchOpera _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Opera" ) } ; goog . labs . userAgent . browser . matchIE _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Trident" ) || goog . labs . userAgent . util . matchUserAgent ( "MSIE" ) } ; goog . labs . userAgent . browser . matchEdge _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Edge" ) } ; goog . labs . userAgent . browser . matchFirefox _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Firefox" ) } ;
2017-09-25 09:37:41 +00:00
goog . labs . userAgent . browser . matchSafari _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Safari" ) && ! ( goog . labs . userAgent . browser . matchChrome _ ( ) || goog . labs . userAgent . browser . matchCoast _ ( ) || goog . labs . userAgent . browser . matchOpera _ ( ) || goog . labs . userAgent . browser . matchEdge _ ( ) || goog . labs . userAgent . browser . isSilk ( ) || goog . labs . userAgent . util . matchUserAgent ( "Android" ) ) } ; goog . labs . userAgent . browser . matchCoast _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Coast" ) } ;
goog . labs . userAgent . browser . matchIosWebview _ = function ( ) { return ( goog . labs . userAgent . util . matchUserAgent ( "iPad" ) || goog . labs . userAgent . util . matchUserAgent ( "iPhone" ) ) && ! goog . labs . userAgent . browser . matchSafari _ ( ) && ! goog . labs . userAgent . browser . matchChrome _ ( ) && ! goog . labs . userAgent . browser . matchCoast _ ( ) && goog . labs . userAgent . util . matchUserAgent ( "AppleWebKit" ) } ;
goog . labs . userAgent . browser . matchChrome _ = function ( ) { return ( goog . labs . userAgent . util . matchUserAgent ( "Chrome" ) || goog . labs . userAgent . util . matchUserAgent ( "CriOS" ) ) && ! goog . labs . userAgent . browser . matchEdge _ ( ) } ; goog . labs . userAgent . browser . matchAndroidBrowser _ = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Android" ) && ! ( goog . labs . userAgent . browser . isChrome ( ) || goog . labs . userAgent . browser . isFirefox ( ) || goog . labs . userAgent . browser . isOpera ( ) || goog . labs . userAgent . browser . isSilk ( ) ) } ;
goog . labs . userAgent . browser . isOpera = goog . labs . userAgent . browser . matchOpera _ ; goog . labs . userAgent . browser . isIE = goog . labs . userAgent . browser . matchIE _ ; goog . labs . userAgent . browser . isEdge = goog . labs . userAgent . browser . matchEdge _ ; goog . labs . userAgent . browser . isFirefox = goog . labs . userAgent . browser . matchFirefox _ ; goog . labs . userAgent . browser . isSafari = goog . labs . userAgent . browser . matchSafari _ ; goog . labs . userAgent . browser . isCoast = goog . labs . userAgent . browser . matchCoast _ ; goog . labs . userAgent . browser . isIosWebview = goog . labs . userAgent . browser . matchIosWebview _ ;
goog . labs . userAgent . browser . isChrome = goog . labs . userAgent . browser . matchChrome _ ; goog . labs . userAgent . browser . isAndroidBrowser = goog . labs . userAgent . browser . matchAndroidBrowser _ ; goog . labs . userAgent . browser . isSilk = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Silk" ) } ;
2018-01-16 21:13:23 +00:00
goog . labs . userAgent . browser . getVersion = function ( ) { function a ( a ) { a = goog . array . find ( a , d ) ; return c [ a ] || "" } var b = goog . labs . userAgent . util . getUserAgent ( ) ; if ( goog . labs . userAgent . browser . isIE ( ) ) return goog . labs . userAgent . browser . getIEVersion _ ( b ) ; b = goog . labs . userAgent . util . extractVersionTuples ( b ) ; var c = { } ; goog . array . forEach ( b , function ( a ) { c [ a [ 0 ] ] = a [ 1 ] } ) ; var d = goog . partial ( goog . object . containsKey , c ) ; return goog . labs . userAgent . browser . isOpera ( ) ? a ( [ "Version" , "Opera" ] ) : goog . labs . userAgent . browser . isEdge ( ) ? a ( [ "Edge" ] ) :
2017-09-25 09:37:41 +00:00
goog . labs . userAgent . browser . isChrome ( ) ? a ( [ "Chrome" , "CriOS" ] ) : ( b = b [ 2 ] ) && b [ 1 ] || "" } ; goog . labs . userAgent . browser . isVersionOrHigher = function ( a ) { return 0 <= goog . string . compareVersions ( goog . labs . userAgent . browser . getVersion ( ) , a ) } ;
2018-01-16 21:13:23 +00:00
goog . labs . userAgent . browser . getIEVersion _ = function ( a ) { var b = /rv: *([\d\.]*)/ . exec ( a ) ; if ( b && b [ 1 ] ) return b [ 1 ] ; b = "" ; var c = /MSIE +([\d\.]+)/ . exec ( a ) ; if ( c && c [ 1 ] ) if ( a = /Trident\/(\d.\d)/ . exec ( a ) , "7.0" == c [ 1 ] ) if ( a && a [ 1 ] ) switch ( a [ 1 ] ) { case "4.0" : b = "8.0" ; break ; case "5.0" : b = "9.0" ; break ; case "6.0" : b = "10.0" ; break ; case "7.0" : b = "11.0" } else b = "7.0" ; else b = c [ 1 ] ; return b } ; goog . labs . userAgent . engine = { } ; goog . labs . userAgent . engine . isPresto = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Presto" ) } ; goog . labs . userAgent . engine . isTrident = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Trident" ) || goog . labs . userAgent . util . matchUserAgent ( "MSIE" ) } ; goog . labs . userAgent . engine . isEdge = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Edge" ) } ;
2017-09-25 09:37:41 +00:00
goog . labs . userAgent . engine . isWebKit = function ( ) { return goog . labs . userAgent . util . matchUserAgentIgnoreCase ( "WebKit" ) && ! goog . labs . userAgent . engine . isEdge ( ) } ; goog . labs . userAgent . engine . isGecko = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Gecko" ) && ! goog . labs . userAgent . engine . isWebKit ( ) && ! goog . labs . userAgent . engine . isTrident ( ) && ! goog . labs . userAgent . engine . isEdge ( ) } ;
2018-01-16 21:13:23 +00:00
goog . labs . userAgent . engine . getVersion = function ( ) { var a = goog . labs . userAgent . util . getUserAgent ( ) ; if ( a ) { a = goog . labs . userAgent . util . extractVersionTuples ( a ) ; var b = goog . labs . userAgent . engine . getEngineTuple _ ( a ) ; if ( b ) return "Gecko" == b [ 0 ] ? goog . labs . userAgent . engine . getVersionForKey _ ( a , "Firefox" ) : b [ 1 ] ; a = a [ 0 ] ; var c ; if ( a && ( c = a [ 2 ] ) && ( c = /Trident\/([^\s;]+)/ . exec ( c ) ) ) return c [ 1 ] } return "" } ;
2017-09-25 09:37:41 +00:00
goog . labs . userAgent . engine . getEngineTuple _ = function ( a ) { if ( ! goog . labs . userAgent . engine . isEdge ( ) ) return a [ 1 ] ; for ( var b = 0 ; b < a . length ; b ++ ) { var c = a [ b ] ; if ( "Edge" == c [ 0 ] ) return c } } ; goog . labs . userAgent . engine . isVersionOrHigher = function ( a ) { return 0 <= goog . string . compareVersions ( goog . labs . userAgent . engine . getVersion ( ) , a ) } ; goog . labs . userAgent . engine . getVersionForKey _ = function ( a , b ) { var c = goog . array . find ( a , function ( a ) { return b == a [ 0 ] } ) ; return c && c [ 1 ] || "" } ; goog . labs . userAgent . platform = { } ; goog . labs . userAgent . platform . isAndroid = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Android" ) } ; goog . labs . userAgent . platform . isIpod = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "iPod" ) } ; goog . labs . userAgent . platform . isIphone = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "iPhone" ) && ! goog . labs . userAgent . util . matchUserAgent ( "iPod" ) && ! goog . labs . userAgent . util . matchUserAgent ( "iPad" ) } ; goog . labs . userAgent . platform . isIpad = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "iPad" ) } ;
goog . labs . userAgent . platform . isIos = function ( ) { return goog . labs . userAgent . platform . isIphone ( ) || goog . labs . userAgent . platform . isIpad ( ) || goog . labs . userAgent . platform . isIpod ( ) } ; goog . labs . userAgent . platform . isMacintosh = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Macintosh" ) } ; goog . labs . userAgent . platform . isLinux = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Linux" ) } ; goog . labs . userAgent . platform . isWindows = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "Windows" ) } ;
2018-01-16 21:13:23 +00:00
goog . labs . userAgent . platform . isChromeOS = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "CrOS" ) } ; goog . labs . userAgent . platform . isChromecast = function ( ) { return goog . labs . userAgent . util . matchUserAgent ( "CrKey" ) } ;
2017-09-25 09:37:41 +00:00
goog . labs . userAgent . platform . getVersion = function ( ) { var a = goog . labs . userAgent . util . getUserAgent ( ) , b = "" ; goog . labs . userAgent . platform . isWindows ( ) ? ( b = /Windows (?:NT|Phone) ([0-9.]+)/ , b = ( a = b . exec ( a ) ) ? a [ 1 ] : "0.0" ) : goog . labs . userAgent . platform . isIos ( ) ? ( b = /(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/ , b = ( a = b . exec ( a ) ) && a [ 1 ] . replace ( /_/g , "." ) ) : goog . labs . userAgent . platform . isMacintosh ( ) ? ( b = /Mac OS X ([0-9_.]+)/ , b = ( a = b . exec ( a ) ) ? a [ 1 ] . replace ( /_/g , "." ) : "10" ) : goog . labs . userAgent . platform . isAndroid ( ) ? ( b = /Android\s+([^\);]+)(\)|;)/ ,
b = ( a = b . exec ( a ) ) && a [ 1 ] ) : goog . labs . userAgent . platform . isChromeOS ( ) && ( b = /(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/ , b = ( a = b . exec ( a ) ) && a [ 1 ] ) ; return b || "" } ; goog . labs . userAgent . platform . isVersionOrHigher = function ( a ) { return 0 <= goog . string . compareVersions ( goog . labs . userAgent . platform . getVersion ( ) , a ) } ; goog . reflect = { } ; goog . reflect . object = function ( a , b ) { return b } ; goog . reflect . objectProperty = function ( a , b ) { return a } ; goog . reflect . sinkValue = function ( a ) { goog . reflect . sinkValue [ " " ] ( a ) ; return a } ; goog . reflect . sinkValue [ " " ] = goog . nullFunction ; goog . reflect . canAccessProperty = function ( a , b ) { try { return goog . reflect . sinkValue ( a [ b ] ) , ! 0 } catch ( c ) { } return ! 1 } ; goog . reflect . cache = function ( a , b , c , d ) { d = d ? d ( b ) : b ; return Object . prototype . hasOwnProperty . call ( a , d ) ? a [ d ] : a [ d ] = c ( b ) } ; goog . userAgent = { } ; goog . userAgent . ASSUME _IE = ! 1 ; goog . userAgent . ASSUME _EDGE = ! 1 ; goog . userAgent . ASSUME _GECKO = ! 1 ; goog . userAgent . ASSUME _WEBKIT = ! 1 ; goog . userAgent . ASSUME _MOBILE _WEBKIT = ! 1 ; goog . userAgent . ASSUME _OPERA = ! 1 ; goog . userAgent . ASSUME _ANY _VERSION = ! 1 ; goog . userAgent . BROWSER _KNOWN _ = goog . userAgent . ASSUME _IE || goog . userAgent . ASSUME _EDGE || goog . userAgent . ASSUME _GECKO || goog . userAgent . ASSUME _MOBILE _WEBKIT || goog . userAgent . ASSUME _WEBKIT || goog . userAgent . ASSUME _OPERA ; goog . userAgent . getUserAgentString = function ( ) { return goog . labs . userAgent . util . getUserAgent ( ) } ;
2018-08-17 13:32:56 +00:00
goog . userAgent . getNavigatorTyped = function ( ) { return goog . global . navigator || null } ; goog . userAgent . getNavigator = function ( ) { return goog . userAgent . getNavigatorTyped ( ) } ; goog . userAgent . OPERA = goog . userAgent . BROWSER _KNOWN _ ? goog . userAgent . ASSUME _OPERA : goog . labs . userAgent . browser . isOpera ( ) ; goog . userAgent . IE = goog . userAgent . BROWSER _KNOWN _ ? goog . userAgent . ASSUME _IE : goog . labs . userAgent . browser . isIE ( ) ; goog . userAgent . EDGE = goog . userAgent . BROWSER _KNOWN _ ? goog . userAgent . ASSUME _EDGE : goog . labs . userAgent . engine . isEdge ( ) ;
goog . userAgent . EDGE _OR _IE = goog . userAgent . EDGE || goog . userAgent . IE ; goog . userAgent . GECKO = goog . userAgent . BROWSER _KNOWN _ ? goog . userAgent . ASSUME _GECKO : goog . labs . userAgent . engine . isGecko ( ) ; goog . userAgent . WEBKIT = goog . userAgent . BROWSER _KNOWN _ ? goog . userAgent . ASSUME _WEBKIT || goog . userAgent . ASSUME _MOBILE _WEBKIT : goog . labs . userAgent . engine . isWebKit ( ) ; goog . userAgent . isMobile _ = function ( ) { return goog . userAgent . WEBKIT && goog . labs . userAgent . util . matchUserAgent ( "Mobile" ) } ;
goog . userAgent . MOBILE = goog . userAgent . ASSUME _MOBILE _WEBKIT || goog . userAgent . isMobile _ ( ) ; goog . userAgent . SAFARI = goog . userAgent . WEBKIT ; goog . userAgent . determinePlatform _ = function ( ) { var a = goog . userAgent . getNavigatorTyped ( ) ; return a && a . platform || "" } ; goog . userAgent . PLATFORM = goog . userAgent . determinePlatform _ ( ) ; goog . userAgent . ASSUME _MAC = ! 1 ; goog . userAgent . ASSUME _WINDOWS = ! 1 ; goog . userAgent . ASSUME _LINUX = ! 1 ; goog . userAgent . ASSUME _X11 = ! 1 ; goog . userAgent . ASSUME _ANDROID = ! 1 ; goog . userAgent . ASSUME _IPHONE = ! 1 ;
goog . userAgent . ASSUME _IPAD = ! 1 ; goog . userAgent . ASSUME _IPOD = ! 1 ; goog . userAgent . PLATFORM _KNOWN _ = goog . userAgent . ASSUME _MAC || goog . userAgent . ASSUME _WINDOWS || goog . userAgent . ASSUME _LINUX || goog . userAgent . ASSUME _X11 || goog . userAgent . ASSUME _ANDROID || goog . userAgent . ASSUME _IPHONE || goog . userAgent . ASSUME _IPAD || goog . userAgent . ASSUME _IPOD ; goog . userAgent . MAC = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _MAC : goog . labs . userAgent . platform . isMacintosh ( ) ;
goog . userAgent . WINDOWS = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _WINDOWS : goog . labs . userAgent . platform . isWindows ( ) ; goog . userAgent . isLegacyLinux _ = function ( ) { return goog . labs . userAgent . platform . isLinux ( ) || goog . labs . userAgent . platform . isChromeOS ( ) } ; goog . userAgent . LINUX = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _LINUX : goog . userAgent . isLegacyLinux _ ( ) ; goog . userAgent . isX11 _ = function ( ) { var a = goog . userAgent . getNavigatorTyped ( ) ; return ! ! a && goog . string . contains ( a . appVersion || "" , "X11" ) } ;
goog . userAgent . X11 = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _X11 : goog . userAgent . isX11 _ ( ) ; goog . userAgent . ANDROID = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _ANDROID : goog . labs . userAgent . platform . isAndroid ( ) ; goog . userAgent . IPHONE = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _IPHONE : goog . labs . userAgent . platform . isIphone ( ) ; goog . userAgent . IPAD = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _IPAD : goog . labs . userAgent . platform . isIpad ( ) ;
goog . userAgent . IPOD = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _IPOD : goog . labs . userAgent . platform . isIpod ( ) ; goog . userAgent . IOS = goog . userAgent . PLATFORM _KNOWN _ ? goog . userAgent . ASSUME _IPHONE || goog . userAgent . ASSUME _IPAD || goog . userAgent . ASSUME _IPOD : goog . labs . userAgent . platform . isIos ( ) ; goog . userAgent . determineVersion _ = function ( ) { var a = "" , b = goog . userAgent . getVersionRegexResult _ ( ) ; b && ( a = b ? b [ 1 ] : "" ) ; return goog . userAgent . IE && ( b = goog . userAgent . getDocumentMode _ ( ) , null != b && b > parseFloat ( a ) ) ? String ( b ) : a } ;
2018-01-16 21:13:23 +00:00
goog . userAgent . getVersionRegexResult _ = function ( ) { var a = goog . userAgent . getUserAgentString ( ) ; if ( goog . userAgent . GECKO ) return /rv:([^\);]+)(\)|;)/ . exec ( a ) ; if ( goog . userAgent . EDGE ) return /Edge\/([\d\.]+)/ . exec ( a ) ; if ( goog . userAgent . IE ) return /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/ . exec ( a ) ; if ( goog . userAgent . WEBKIT ) return /WebKit\/(\S+)/ . exec ( a ) ; if ( goog . userAgent . OPERA ) return /(?:Version)[ \/]?(\S+)/ . exec ( a ) } ; goog . userAgent . getDocumentMode _ = function ( ) { var a = goog . global . document ; return a ? a . documentMode : void 0 } ;
2017-09-25 09:37:41 +00:00
goog . userAgent . VERSION = goog . userAgent . determineVersion _ ( ) ; goog . userAgent . compare = function ( a , b ) { return goog . string . compareVersions ( a , b ) } ; goog . userAgent . isVersionOrHigherCache _ = { } ; goog . userAgent . isVersionOrHigher = function ( a ) { return goog . userAgent . ASSUME _ANY _VERSION || goog . reflect . cache ( goog . userAgent . isVersionOrHigherCache _ , a , function ( ) { return 0 <= goog . string . compareVersions ( goog . userAgent . VERSION , a ) } ) } ; goog . userAgent . isVersion = goog . userAgent . isVersionOrHigher ;
2018-08-17 13:32:56 +00:00
goog . userAgent . isDocumentModeOrHigher = function ( a ) { return Number ( goog . userAgent . DOCUMENT _MODE ) >= a } ; goog . userAgent . isDocumentMode = goog . userAgent . isDocumentModeOrHigher ; goog . userAgent . DOCUMENT _MODE = function ( ) { var a = goog . global . document , b = goog . userAgent . getDocumentMode _ ( ) ; if ( a && goog . userAgent . IE ) return b || ( "CSS1Compat" == a . compatMode ? parseInt ( goog . userAgent . VERSION , 10 ) : 5 ) } ( ) ; goog . dom . BrowserFeature = { CAN _ADD _NAME _OR _TYPE _ATTRIBUTES : ! goog . userAgent . IE || goog . userAgent . isDocumentModeOrHigher ( 9 ) , CAN _USE _CHILDREN _ATTRIBUTE : ! goog . userAgent . GECKO && ! goog . userAgent . IE || goog . userAgent . IE && goog . userAgent . isDocumentModeOrHigher ( 9 ) || goog . userAgent . GECKO && goog . userAgent . isVersionOrHigher ( "1.9.1" ) , CAN _USE _INNER _TEXT : goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "9" ) , CAN _USE _PARENT _ELEMENT _PROPERTY : goog . userAgent . IE || goog . userAgent . OPERA || goog . userAgent . WEBKIT , INNER _HTML _NEEDS _SCOPED _ELEMENT : goog . userAgent . IE ,
LEGACY _IE _RANGES : goog . userAgent . IE && ! goog . userAgent . isDocumentModeOrHigher ( 9 ) } ; goog . dom . HtmlElement = function ( ) { } ; goog . dom . TagName = function ( a ) { this . tagName _ = a } ; goog . dom . TagName . prototype . toString = function ( ) { return this . tagName _ } ; goog . dom . TagName . A = new goog . dom . TagName ( "A" ) ; goog . dom . TagName . ABBR = new goog . dom . TagName ( "ABBR" ) ; goog . dom . TagName . ACRONYM = new goog . dom . TagName ( "ACRONYM" ) ; goog . dom . TagName . ADDRESS = new goog . dom . TagName ( "ADDRESS" ) ; goog . dom . TagName . APPLET = new goog . dom . TagName ( "APPLET" ) ; goog . dom . TagName . AREA = new goog . dom . TagName ( "AREA" ) ; goog . dom . TagName . ARTICLE = new goog . dom . TagName ( "ARTICLE" ) ;
2018-01-16 21:13:23 +00:00
goog . dom . TagName . ASIDE = new goog . dom . TagName ( "ASIDE" ) ; goog . dom . TagName . AUDIO = new goog . dom . TagName ( "AUDIO" ) ; goog . dom . TagName . B = new goog . dom . TagName ( "B" ) ; goog . dom . TagName . BASE = new goog . dom . TagName ( "BASE" ) ; goog . dom . TagName . BASEFONT = new goog . dom . TagName ( "BASEFONT" ) ; goog . dom . TagName . BDI = new goog . dom . TagName ( "BDI" ) ; goog . dom . TagName . BDO = new goog . dom . TagName ( "BDO" ) ; goog . dom . TagName . BIG = new goog . dom . TagName ( "BIG" ) ; goog . dom . TagName . BLOCKQUOTE = new goog . dom . TagName ( "BLOCKQUOTE" ) ; goog . dom . TagName . BODY = new goog . dom . TagName ( "BODY" ) ;
goog . dom . TagName . BR = new goog . dom . TagName ( "BR" ) ; goog . dom . TagName . BUTTON = new goog . dom . TagName ( "BUTTON" ) ; goog . dom . TagName . CANVAS = new goog . dom . TagName ( "CANVAS" ) ; goog . dom . TagName . CAPTION = new goog . dom . TagName ( "CAPTION" ) ; goog . dom . TagName . CENTER = new goog . dom . TagName ( "CENTER" ) ; goog . dom . TagName . CITE = new goog . dom . TagName ( "CITE" ) ; goog . dom . TagName . CODE = new goog . dom . TagName ( "CODE" ) ; goog . dom . TagName . COL = new goog . dom . TagName ( "COL" ) ; goog . dom . TagName . COLGROUP = new goog . dom . TagName ( "COLGROUP" ) ;
goog . dom . TagName . COMMAND = new goog . dom . TagName ( "COMMAND" ) ; goog . dom . TagName . DATA = new goog . dom . TagName ( "DATA" ) ; goog . dom . TagName . DATALIST = new goog . dom . TagName ( "DATALIST" ) ; goog . dom . TagName . DD = new goog . dom . TagName ( "DD" ) ; goog . dom . TagName . DEL = new goog . dom . TagName ( "DEL" ) ; goog . dom . TagName . DETAILS = new goog . dom . TagName ( "DETAILS" ) ; goog . dom . TagName . DFN = new goog . dom . TagName ( "DFN" ) ; goog . dom . TagName . DIALOG = new goog . dom . TagName ( "DIALOG" ) ; goog . dom . TagName . DIR = new goog . dom . TagName ( "DIR" ) ; goog . dom . TagName . DIV = new goog . dom . TagName ( "DIV" ) ;
goog . dom . TagName . DL = new goog . dom . TagName ( "DL" ) ; goog . dom . TagName . DT = new goog . dom . TagName ( "DT" ) ; goog . dom . TagName . EM = new goog . dom . TagName ( "EM" ) ; goog . dom . TagName . EMBED = new goog . dom . TagName ( "EMBED" ) ; goog . dom . TagName . FIELDSET = new goog . dom . TagName ( "FIELDSET" ) ; goog . dom . TagName . FIGCAPTION = new goog . dom . TagName ( "FIGCAPTION" ) ; goog . dom . TagName . FIGURE = new goog . dom . TagName ( "FIGURE" ) ; goog . dom . TagName . FONT = new goog . dom . TagName ( "FONT" ) ; goog . dom . TagName . FOOTER = new goog . dom . TagName ( "FOOTER" ) ; goog . dom . TagName . FORM = new goog . dom . TagName ( "FORM" ) ;
goog . dom . TagName . FRAME = new goog . dom . TagName ( "FRAME" ) ; goog . dom . TagName . FRAMESET = new goog . dom . TagName ( "FRAMESET" ) ; goog . dom . TagName . H1 = new goog . dom . TagName ( "H1" ) ; goog . dom . TagName . H2 = new goog . dom . TagName ( "H2" ) ; goog . dom . TagName . H3 = new goog . dom . TagName ( "H3" ) ; goog . dom . TagName . H4 = new goog . dom . TagName ( "H4" ) ; goog . dom . TagName . H5 = new goog . dom . TagName ( "H5" ) ; goog . dom . TagName . H6 = new goog . dom . TagName ( "H6" ) ; goog . dom . TagName . HEAD = new goog . dom . TagName ( "HEAD" ) ; goog . dom . TagName . HEADER = new goog . dom . TagName ( "HEADER" ) ;
goog . dom . TagName . HGROUP = new goog . dom . TagName ( "HGROUP" ) ; goog . dom . TagName . HR = new goog . dom . TagName ( "HR" ) ; goog . dom . TagName . HTML = new goog . dom . TagName ( "HTML" ) ; goog . dom . TagName . I = new goog . dom . TagName ( "I" ) ; goog . dom . TagName . IFRAME = new goog . dom . TagName ( "IFRAME" ) ; goog . dom . TagName . IMG = new goog . dom . TagName ( "IMG" ) ; goog . dom . TagName . INPUT = new goog . dom . TagName ( "INPUT" ) ; goog . dom . TagName . INS = new goog . dom . TagName ( "INS" ) ; goog . dom . TagName . ISINDEX = new goog . dom . TagName ( "ISINDEX" ) ; goog . dom . TagName . KBD = new goog . dom . TagName ( "KBD" ) ;
goog . dom . TagName . KEYGEN = new goog . dom . TagName ( "KEYGEN" ) ; goog . dom . TagName . LABEL = new goog . dom . TagName ( "LABEL" ) ; goog . dom . TagName . LEGEND = new goog . dom . TagName ( "LEGEND" ) ; goog . dom . TagName . LI = new goog . dom . TagName ( "LI" ) ; goog . dom . TagName . LINK = new goog . dom . TagName ( "LINK" ) ; goog . dom . TagName . MAIN = new goog . dom . TagName ( "MAIN" ) ; goog . dom . TagName . MAP = new goog . dom . TagName ( "MAP" ) ; goog . dom . TagName . MARK = new goog . dom . TagName ( "MARK" ) ; goog . dom . TagName . MATH = new goog . dom . TagName ( "MATH" ) ; goog . dom . TagName . MENU = new goog . dom . TagName ( "MENU" ) ;
goog . dom . TagName . MENUITEM = new goog . dom . TagName ( "MENUITEM" ) ; goog . dom . TagName . META = new goog . dom . TagName ( "META" ) ; goog . dom . TagName . METER = new goog . dom . TagName ( "METER" ) ; goog . dom . TagName . NAV = new goog . dom . TagName ( "NAV" ) ; goog . dom . TagName . NOFRAMES = new goog . dom . TagName ( "NOFRAMES" ) ; goog . dom . TagName . NOSCRIPT = new goog . dom . TagName ( "NOSCRIPT" ) ; goog . dom . TagName . OBJECT = new goog . dom . TagName ( "OBJECT" ) ; goog . dom . TagName . OL = new goog . dom . TagName ( "OL" ) ; goog . dom . TagName . OPTGROUP = new goog . dom . TagName ( "OPTGROUP" ) ;
goog . dom . TagName . OPTION = new goog . dom . TagName ( "OPTION" ) ; goog . dom . TagName . OUTPUT = new goog . dom . TagName ( "OUTPUT" ) ; goog . dom . TagName . P = new goog . dom . TagName ( "P" ) ; goog . dom . TagName . PARAM = new goog . dom . TagName ( "PARAM" ) ; goog . dom . TagName . PICTURE = new goog . dom . TagName ( "PICTURE" ) ; goog . dom . TagName . PRE = new goog . dom . TagName ( "PRE" ) ; goog . dom . TagName . PROGRESS = new goog . dom . TagName ( "PROGRESS" ) ; goog . dom . TagName . Q = new goog . dom . TagName ( "Q" ) ; goog . dom . TagName . RP = new goog . dom . TagName ( "RP" ) ; goog . dom . TagName . RT = new goog . dom . TagName ( "RT" ) ;
goog . dom . TagName . RTC = new goog . dom . TagName ( "RTC" ) ; goog . dom . TagName . RUBY = new goog . dom . TagName ( "RUBY" ) ; goog . dom . TagName . S = new goog . dom . TagName ( "S" ) ; goog . dom . TagName . SAMP = new goog . dom . TagName ( "SAMP" ) ; goog . dom . TagName . SCRIPT = new goog . dom . TagName ( "SCRIPT" ) ; goog . dom . TagName . SECTION = new goog . dom . TagName ( "SECTION" ) ; goog . dom . TagName . SELECT = new goog . dom . TagName ( "SELECT" ) ; goog . dom . TagName . SMALL = new goog . dom . TagName ( "SMALL" ) ; goog . dom . TagName . SOURCE = new goog . dom . TagName ( "SOURCE" ) ; goog . dom . TagName . SPAN = new goog . dom . TagName ( "SPAN" ) ;
goog . dom . TagName . STRIKE = new goog . dom . TagName ( "STRIKE" ) ; goog . dom . TagName . STRONG = new goog . dom . TagName ( "STRONG" ) ; goog . dom . TagName . STYLE = new goog . dom . TagName ( "STYLE" ) ; goog . dom . TagName . SUB = new goog . dom . TagName ( "SUB" ) ; goog . dom . TagName . SUMMARY = new goog . dom . TagName ( "SUMMARY" ) ; goog . dom . TagName . SUP = new goog . dom . TagName ( "SUP" ) ; goog . dom . TagName . SVG = new goog . dom . TagName ( "SVG" ) ; goog . dom . TagName . TABLE = new goog . dom . TagName ( "TABLE" ) ; goog . dom . TagName . TBODY = new goog . dom . TagName ( "TBODY" ) ; goog . dom . TagName . TD = new goog . dom . TagName ( "TD" ) ;
goog . dom . TagName . TEMPLATE = new goog . dom . TagName ( "TEMPLATE" ) ; goog . dom . TagName . TEXTAREA = new goog . dom . TagName ( "TEXTAREA" ) ; goog . dom . TagName . TFOOT = new goog . dom . TagName ( "TFOOT" ) ; goog . dom . TagName . TH = new goog . dom . TagName ( "TH" ) ; goog . dom . TagName . THEAD = new goog . dom . TagName ( "THEAD" ) ; goog . dom . TagName . TIME = new goog . dom . TagName ( "TIME" ) ; goog . dom . TagName . TITLE = new goog . dom . TagName ( "TITLE" ) ; goog . dom . TagName . TR = new goog . dom . TagName ( "TR" ) ; goog . dom . TagName . TRACK = new goog . dom . TagName ( "TRACK" ) ; goog . dom . TagName . TT = new goog . dom . TagName ( "TT" ) ;
2018-08-17 13:32:56 +00:00
goog . dom . TagName . U = new goog . dom . TagName ( "U" ) ; goog . dom . TagName . UL = new goog . dom . TagName ( "UL" ) ; goog . dom . TagName . VAR = new goog . dom . TagName ( "VAR" ) ; goog . dom . TagName . VIDEO = new goog . dom . TagName ( "VIDEO" ) ; goog . dom . TagName . WBR = new goog . dom . TagName ( "WBR" ) ; goog . dom . asserts = { } ; goog . dom . asserts . assertIsLocation = function ( a ) { if ( goog . asserts . ENABLE _ASSERTS ) { var b = goog . dom . asserts . getWindow _ ( a ) ; "undefined" != typeof b . Location && "undefined" != typeof b . Element && goog . asserts . assert ( a && ( a instanceof b . Location || ! ( a instanceof b . Element ) ) , "Argument is not a Location (or a non-Element mock); got: %s" , goog . dom . asserts . debugStringForType _ ( a ) ) } return a } ;
2018-01-16 21:13:23 +00:00
goog . dom . asserts . assertIsElementType _ = function ( a , b ) { if ( goog . asserts . ENABLE _ASSERTS ) { var c = goog . dom . asserts . getWindow _ ( a ) ; "undefined" != typeof c [ b ] && "undefined" != typeof c . Location && "undefined" != typeof c . Element && goog . asserts . assert ( a && ( a instanceof c [ b ] || ! ( a instanceof c . Location || a instanceof c . Element ) ) , "Argument is not a %s (or a non-Element, non-Location mock); got: %s" , b , goog . dom . asserts . debugStringForType _ ( a ) ) } return a } ;
goog . dom . asserts . assertIsHTMLAnchorElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLAnchorElement" ) } ; goog . dom . asserts . assertIsHTMLButtonElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLButtonElement" ) } ; goog . dom . asserts . assertIsHTMLLinkElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLLinkElement" ) } ; goog . dom . asserts . assertIsHTMLImageElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLImageElement" ) } ;
goog . dom . asserts . assertIsHTMLVideoElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLVideoElement" ) } ; goog . dom . asserts . assertIsHTMLInputElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLInputElement" ) } ; goog . dom . asserts . assertIsHTMLEmbedElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLEmbedElement" ) } ; goog . dom . asserts . assertIsHTMLFormElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLFormElement" ) } ;
goog . dom . asserts . assertIsHTMLFrameElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLFrameElement" ) } ; goog . dom . asserts . assertIsHTMLIFrameElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLIFrameElement" ) } ; goog . dom . asserts . assertIsHTMLObjectElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLObjectElement" ) } ; goog . dom . asserts . assertIsHTMLScriptElement = function ( a ) { return goog . dom . asserts . assertIsElementType _ ( a , "HTMLScriptElement" ) } ;
goog . dom . asserts . debugStringForType _ = function ( a ) { return goog . isObject ( a ) ? a . constructor . displayName || a . constructor . name || Object . prototype . toString . call ( a ) : void 0 === a ? "undefined" : null === a ? "null" : typeof a } ; goog . dom . asserts . getWindow _ = function ( a ) { return ( a = a && a . ownerDocument ) && ( a . defaultView || a . parentWindow ) || goog . global } ; goog . dom . tags = { } ; goog . dom . tags . VOID _TAGS _ = { area : ! 0 , base : ! 0 , br : ! 0 , col : ! 0 , command : ! 0 , embed : ! 0 , hr : ! 0 , img : ! 0 , input : ! 0 , keygen : ! 0 , link : ! 0 , meta : ! 0 , param : ! 0 , source : ! 0 , track : ! 0 , wbr : ! 0 } ; goog . dom . tags . isVoidTag = function ( a ) { return ! 0 === goog . dom . tags . VOID _TAGS _ [ a ] } ; goog . string . TypedString = function ( ) { } ; goog . string . Const = function ( ) { this . stringConstValueWithSecurityContract _ _googStringSecurityPrivate _ = "" ; this . STRING _CONST _TYPE _MARKER _ _GOOG _STRING _SECURITY _PRIVATE _ = goog . string . Const . TYPE _MARKER _ } ; goog . string . Const . prototype . implementsGoogStringTypedString = ! 0 ; goog . string . Const . prototype . getTypedStringValue = function ( ) { return this . stringConstValueWithSecurityContract _ _googStringSecurityPrivate _ } ;
2017-09-25 09:37:41 +00:00
goog . string . Const . prototype . toString = function ( ) { return "Const{" + this . stringConstValueWithSecurityContract _ _googStringSecurityPrivate _ + "}" } ; goog . string . Const . unwrap = function ( a ) { if ( a instanceof goog . string . Const && a . constructor === goog . string . Const && a . STRING _CONST _TYPE _MARKER _ _GOOG _STRING _SECURITY _PRIVATE _ === goog . string . Const . TYPE _MARKER _ ) return a . stringConstValueWithSecurityContract _ _googStringSecurityPrivate _ ; goog . asserts . fail ( "expected object of type Const, got '" + a + "'" ) ; return "type_error:Const" } ;
goog . string . Const . from = function ( a ) { return goog . string . Const . create _ _googStringSecurityPrivate _ ( a ) } ; goog . string . Const . TYPE _MARKER _ = { } ; goog . string . Const . create _ _googStringSecurityPrivate _ = function ( a ) { var b = new goog . string . Const ; b . stringConstValueWithSecurityContract _ _googStringSecurityPrivate _ = a ; return b } ; goog . string . Const . EMPTY = goog . string . Const . from ( "" ) ; goog . html = { } ; goog . html . SafeScript = function ( ) { this . privateDoNotAccessOrElseSafeScriptWrappedValue _ = "" ; this . SAFE _SCRIPT _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = goog . html . SafeScript . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ } ; goog . html . SafeScript . prototype . implementsGoogStringTypedString = ! 0 ; goog . html . SafeScript . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = { } ; goog . html . SafeScript . fromConstant = function ( a ) { a = goog . string . Const . unwrap ( a ) ; return 0 === a . length ? goog . html . SafeScript . EMPTY : goog . html . SafeScript . createSafeScriptSecurityPrivateDoNotAccessOrElse ( a ) } ;
2018-08-17 13:32:56 +00:00
goog . html . SafeScript . fromConstantAndArgs = function ( a , b ) { for ( var c = [ ] , d = 1 ; d < arguments . length ; d ++ ) c . push ( goog . html . SafeScript . stringify _ ( arguments [ d ] ) ) ; return goog . html . SafeScript . createSafeScriptSecurityPrivateDoNotAccessOrElse ( "(" + goog . string . Const . unwrap ( a ) + ")(" + c . join ( ", " ) + ");" ) } ; goog . html . SafeScript . prototype . getTypedStringValue = function ( ) { return this . privateDoNotAccessOrElseSafeScriptWrappedValue _ } ;
goog . DEBUG && ( goog . html . SafeScript . prototype . toString = function ( ) { return "SafeScript{" + this . privateDoNotAccessOrElseSafeScriptWrappedValue _ + "}" } ) ;
goog . html . SafeScript . unwrap = function ( a ) { if ( a instanceof goog . html . SafeScript && a . constructor === goog . html . SafeScript && a . SAFE _SCRIPT _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ === goog . html . SafeScript . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ) return a . privateDoNotAccessOrElseSafeScriptWrappedValue _ ; goog . asserts . fail ( "expected object of type SafeScript, got '" + a + "' of type " + goog . typeOf ( a ) ) ; return "type_error:SafeScript" } ; goog . html . SafeScript . stringify _ = function ( a ) { return JSON . stringify ( a ) . replace ( /</g , "\\x3c" ) } ;
goog . html . SafeScript . createSafeScriptSecurityPrivateDoNotAccessOrElse = function ( a ) { return ( new goog . html . SafeScript ) . initSecurityPrivateDoNotAccessOrElse _ ( a ) } ; goog . html . SafeScript . prototype . initSecurityPrivateDoNotAccessOrElse _ = function ( a ) { this . privateDoNotAccessOrElseSafeScriptWrappedValue _ = a ; return this } ; goog . html . SafeScript . EMPTY = goog . html . SafeScript . createSafeScriptSecurityPrivateDoNotAccessOrElse ( "" ) ; goog . fs = { } ; goog . fs . url = { } ; goog . fs . url . createObjectUrl = function ( a ) { return goog . fs . url . getUrlObject _ ( ) . createObjectURL ( a ) } ; goog . fs . url . revokeObjectUrl = function ( a ) { goog . fs . url . getUrlObject _ ( ) . revokeObjectURL ( a ) } ; goog . fs . url . getUrlObject _ = function ( ) { var a = goog . fs . url . findUrlObject _ ( ) ; if ( null != a ) return a ; throw Error ( "This browser doesn't seem to support blob URLs" ) ; } ;
2017-09-25 09:37:41 +00:00
goog . fs . url . findUrlObject _ = function ( ) { return goog . isDef ( goog . global . URL ) && goog . isDef ( goog . global . URL . createObjectURL ) ? goog . global . URL : goog . isDef ( goog . global . webkitURL ) && goog . isDef ( goog . global . webkitURL . createObjectURL ) ? goog . global . webkitURL : goog . isDef ( goog . global . createObjectURL ) ? goog . global : null } ; goog . fs . url . browserSupportsObjectUrls = function ( ) { return null != goog . fs . url . findUrlObject _ ( ) } ; goog . i18n = { } ; goog . i18n . bidi = { } ; goog . i18n . bidi . FORCE _RTL = ! 1 ;
goog . i18n . bidi . IS _RTL = goog . i18n . bidi . FORCE _RTL || ( "ar" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "fa" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "he" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "iw" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "ps" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "sd" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "ug" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "ur" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) || "yi" == goog . LOCALE . substring ( 0 , 2 ) . toLowerCase ( ) ) && ( 2 == goog . LOCALE . length ||
"-" == goog . LOCALE . substring ( 2 , 3 ) || "_" == goog . LOCALE . substring ( 2 , 3 ) ) || 3 <= goog . LOCALE . length && "ckb" == goog . LOCALE . substring ( 0 , 3 ) . toLowerCase ( ) && ( 3 == goog . LOCALE . length || "-" == goog . LOCALE . substring ( 3 , 4 ) || "_" == goog . LOCALE . substring ( 3 , 4 ) ) ; goog . i18n . bidi . Format = { LRE : "\u202a" , RLE : "\u202b" , PDF : "\u202c" , LRM : "\u200e" , RLM : "\u200f" } ; goog . i18n . bidi . Dir = { LTR : 1 , RTL : - 1 , NEUTRAL : 0 } ; goog . i18n . bidi . RIGHT = "right" ; goog . i18n . bidi . LEFT = "left" ; goog . i18n . bidi . I18N _RIGHT = goog . i18n . bidi . IS _RTL ? goog . i18n . bidi . LEFT : goog . i18n . bidi . RIGHT ;
goog . i18n . bidi . I18N _LEFT = goog . i18n . bidi . IS _RTL ? goog . i18n . bidi . RIGHT : goog . i18n . bidi . LEFT ; goog . i18n . bidi . toDir = function ( a , b ) { return "number" == typeof a ? 0 < a ? goog . i18n . bidi . Dir . LTR : 0 > a ? goog . i18n . bidi . Dir . RTL : b ? null : goog . i18n . bidi . Dir . NEUTRAL : null == a ? null : a ? goog . i18n . bidi . Dir . RTL : goog . i18n . bidi . Dir . LTR } ; goog . i18n . bidi . ltrChars _ = "A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff" ; goog . i18n . bidi . rtlChars _ = "\u0591-\u06ef\u06fa-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc" ;
goog . i18n . bidi . htmlSkipReg _ = /<[^>]*>|&[^;]+;/g ; goog . i18n . bidi . stripHtmlIfNeeded _ = function ( a , b ) { return b ? a . replace ( goog . i18n . bidi . htmlSkipReg _ , "" ) : a } ; goog . i18n . bidi . rtlCharReg _ = new RegExp ( "[" + goog . i18n . bidi . rtlChars _ + "]" ) ; goog . i18n . bidi . ltrCharReg _ = new RegExp ( "[" + goog . i18n . bidi . ltrChars _ + "]" ) ; goog . i18n . bidi . hasAnyRtl = function ( a , b ) { return goog . i18n . bidi . rtlCharReg _ . test ( goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ) } ; goog . i18n . bidi . hasRtlChar = goog . i18n . bidi . hasAnyRtl ;
goog . i18n . bidi . hasAnyLtr = function ( a , b ) { return goog . i18n . bidi . ltrCharReg _ . test ( goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ) } ; goog . i18n . bidi . ltrRe _ = new RegExp ( "^[" + goog . i18n . bidi . ltrChars _ + "]" ) ; goog . i18n . bidi . rtlRe _ = new RegExp ( "^[" + goog . i18n . bidi . rtlChars _ + "]" ) ; goog . i18n . bidi . isRtlChar = function ( a ) { return goog . i18n . bidi . rtlRe _ . test ( a ) } ; goog . i18n . bidi . isLtrChar = function ( a ) { return goog . i18n . bidi . ltrRe _ . test ( a ) } ; goog . i18n . bidi . isNeutralChar = function ( a ) { return ! goog . i18n . bidi . isLtrChar ( a ) && ! goog . i18n . bidi . isRtlChar ( a ) } ;
goog . i18n . bidi . ltrDirCheckRe _ = new RegExp ( "^[^" + goog . i18n . bidi . rtlChars _ + "]*[" + goog . i18n . bidi . ltrChars _ + "]" ) ; goog . i18n . bidi . rtlDirCheckRe _ = new RegExp ( "^[^" + goog . i18n . bidi . ltrChars _ + "]*[" + goog . i18n . bidi . rtlChars _ + "]" ) ; goog . i18n . bidi . startsWithRtl = function ( a , b ) { return goog . i18n . bidi . rtlDirCheckRe _ . test ( goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ) } ; goog . i18n . bidi . isRtlText = goog . i18n . bidi . startsWithRtl ;
goog . i18n . bidi . startsWithLtr = function ( a , b ) { return goog . i18n . bidi . ltrDirCheckRe _ . test ( goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ) } ; goog . i18n . bidi . isLtrText = goog . i18n . bidi . startsWithLtr ; goog . i18n . bidi . isRequiredLtrRe _ = /^http:\/\/.*/ ; goog . i18n . bidi . isNeutralText = function ( a , b ) { a = goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ; return goog . i18n . bidi . isRequiredLtrRe _ . test ( a ) || ! goog . i18n . bidi . hasAnyLtr ( a ) && ! goog . i18n . bidi . hasAnyRtl ( a ) } ;
goog . i18n . bidi . ltrExitDirCheckRe _ = new RegExp ( "[" + goog . i18n . bidi . ltrChars _ + "][^" + goog . i18n . bidi . rtlChars _ + "]*$" ) ; goog . i18n . bidi . rtlExitDirCheckRe _ = new RegExp ( "[" + goog . i18n . bidi . rtlChars _ + "][^" + goog . i18n . bidi . ltrChars _ + "]*$" ) ; goog . i18n . bidi . endsWithLtr = function ( a , b ) { return goog . i18n . bidi . ltrExitDirCheckRe _ . test ( goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ) } ; goog . i18n . bidi . isLtrExitText = goog . i18n . bidi . endsWithLtr ;
goog . i18n . bidi . endsWithRtl = function ( a , b ) { return goog . i18n . bidi . rtlExitDirCheckRe _ . test ( goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) ) } ; goog . i18n . bidi . isRtlExitText = goog . i18n . bidi . endsWithRtl ; goog . i18n . bidi . rtlLocalesRe _ = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i ; goog . i18n . bidi . isRtlLanguage = function ( a ) { return goog . i18n . bidi . rtlLocalesRe _ . test ( a ) } ; goog . i18n . bidi . bracketGuardTextRe _ = /(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g ;
goog . i18n . bidi . guardBracketInText = function ( a , b ) { var c = ( void 0 === b ? goog . i18n . bidi . hasAnyRtl ( a ) : b ) ? goog . i18n . bidi . Format . RLM : goog . i18n . bidi . Format . LRM ; return a . replace ( goog . i18n . bidi . bracketGuardTextRe _ , c + "$&" + c ) } ; goog . i18n . bidi . enforceRtlInHtml = function ( a ) { return "<" == a . charAt ( 0 ) ? a . replace ( /<\w+/ , "$& dir=rtl" ) : "\n<span dir=rtl>" + a + "</span>" } ; goog . i18n . bidi . enforceRtlInText = function ( a ) { return goog . i18n . bidi . Format . RLE + a + goog . i18n . bidi . Format . PDF } ;
goog . i18n . bidi . enforceLtrInHtml = function ( a ) { return "<" == a . charAt ( 0 ) ? a . replace ( /<\w+/ , "$& dir=ltr" ) : "\n<span dir=ltr>" + a + "</span>" } ; goog . i18n . bidi . enforceLtrInText = function ( a ) { return goog . i18n . bidi . Format . LRE + a + goog . i18n . bidi . Format . PDF } ; goog . i18n . bidi . dimensionsRe _ = /:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g ; goog . i18n . bidi . leftRe _ = /left/gi ; goog . i18n . bidi . rightRe _ = /right/gi ; goog . i18n . bidi . tempRe _ = /%%%%/g ;
goog . i18n . bidi . mirrorCSS = function ( a ) { return a . replace ( goog . i18n . bidi . dimensionsRe _ , ":$1 $4 $3 $2" ) . replace ( goog . i18n . bidi . leftRe _ , "%%%%" ) . replace ( goog . i18n . bidi . rightRe _ , goog . i18n . bidi . LEFT ) . replace ( goog . i18n . bidi . tempRe _ , goog . i18n . bidi . RIGHT ) } ; goog . i18n . bidi . doubleQuoteSubstituteRe _ = /([\u0591-\u05f2])"/g ; goog . i18n . bidi . singleQuoteSubstituteRe _ = /([\u0591-\u05f2])'/g ;
goog . i18n . bidi . normalizeHebrewQuote = function ( a ) { return a . replace ( goog . i18n . bidi . doubleQuoteSubstituteRe _ , "$1\u05f4" ) . replace ( goog . i18n . bidi . singleQuoteSubstituteRe _ , "$1\u05f3" ) } ; goog . i18n . bidi . wordSeparatorRe _ = /\s+/ ; goog . i18n . bidi . hasNumeralsRe _ = /[\d\u06f0-\u06f9]/ ; goog . i18n . bidi . rtlDetectionThreshold _ = . 4 ;
goog . i18n . bidi . estimateDirection = function ( a , b ) { for ( var c = 0 , d = 0 , e = ! 1 , f = goog . i18n . bidi . stripHtmlIfNeeded _ ( a , b ) . split ( goog . i18n . bidi . wordSeparatorRe _ ) , g = 0 ; g < f . length ; g ++ ) { var h = f [ g ] ; goog . i18n . bidi . startsWithRtl ( h ) ? ( c ++ , d ++ ) : goog . i18n . bidi . isRequiredLtrRe _ . test ( h ) ? e = ! 0 : goog . i18n . bidi . hasAnyLtr ( h ) ? d ++ : goog . i18n . bidi . hasNumeralsRe _ . test ( h ) && ( e = ! 0 ) } return 0 == d ? e ? goog . i18n . bidi . Dir . LTR : goog . i18n . bidi . Dir . NEUTRAL : c / d > goog . i18n . bidi . rtlDetectionThreshold _ ? goog . i18n . bidi . Dir . RTL : goog . i18n . bidi . Dir . LTR } ;
goog . i18n . bidi . detectRtlDirectionality = function ( a , b ) { return goog . i18n . bidi . estimateDirection ( a , b ) == goog . i18n . bidi . Dir . RTL } ; goog . i18n . bidi . setElementDirAndAlign = function ( a , b ) { a && ( b = goog . i18n . bidi . toDir ( b ) ) && ( a . style . textAlign = b == goog . i18n . bidi . Dir . RTL ? goog . i18n . bidi . RIGHT : goog . i18n . bidi . LEFT , a . dir = b == goog . i18n . bidi . Dir . RTL ? "rtl" : "ltr" ) } ;
goog . i18n . bidi . setElementDirByTextDirectionality = function ( a , b ) { switch ( goog . i18n . bidi . estimateDirection ( b ) ) { case goog . i18n . bidi . Dir . LTR : a . dir = "ltr" ; break ; case goog . i18n . bidi . Dir . RTL : a . dir = "rtl" ; break ; default : a . removeAttribute ( "dir" ) } } ; goog . i18n . bidi . DirectionalString = function ( ) { } ; goog . html . TrustedResourceUrl = function ( ) { this . privateDoNotAccessOrElseTrustedResourceUrlWrappedValue _ = "" ; this . TRUSTED _RESOURCE _URL _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = goog . html . TrustedResourceUrl . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ } ; goog . html . TrustedResourceUrl . prototype . implementsGoogStringTypedString = ! 0 ; goog . html . TrustedResourceUrl . prototype . getTypedStringValue = function ( ) { return this . privateDoNotAccessOrElseTrustedResourceUrlWrappedValue _ } ;
2018-08-17 13:32:56 +00:00
goog . html . TrustedResourceUrl . prototype . implementsGoogI18nBidiDirectionalString = ! 0 ; goog . html . TrustedResourceUrl . prototype . getDirection = function ( ) { return goog . i18n . bidi . Dir . LTR } ;
goog . html . TrustedResourceUrl . prototype . cloneWithParams = function ( a ) { var b = goog . html . TrustedResourceUrl . unwrap ( this ) ; if ( /#/ . test ( b ) ) throw Error ( "Found a hash in url (" + b + "), appending not supported." ) ; var c = /\?/ . test ( b ) ? "&" : "?" , d ; for ( d in a ) for ( var e = goog . isArray ( a [ d ] ) ? a [ d ] : [ a [ d ] ] , f = 0 ; f < e . length ; f ++ ) null != e [ f ] && ( b += c + encodeURIComponent ( d ) + "=" + encodeURIComponent ( String ( e [ f ] ) ) , c = "&" ) ; return goog . html . TrustedResourceUrl . createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse ( b ) } ;
2018-01-16 21:13:23 +00:00
goog . DEBUG && ( goog . html . TrustedResourceUrl . prototype . toString = function ( ) { return "TrustedResourceUrl{" + this . privateDoNotAccessOrElseTrustedResourceUrlWrappedValue _ + "}" } ) ;
2017-09-25 09:37:41 +00:00
goog . html . TrustedResourceUrl . unwrap = function ( a ) { if ( a instanceof goog . html . TrustedResourceUrl && a . constructor === goog . html . TrustedResourceUrl && a . TRUSTED _RESOURCE _URL _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ === goog . html . TrustedResourceUrl . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ) return a . privateDoNotAccessOrElseTrustedResourceUrlWrappedValue _ ; goog . asserts . fail ( "expected object of type TrustedResourceUrl, got '" + a + "' of type " + goog . typeOf ( a ) ) ; return "type_error:TrustedResourceUrl" } ;
goog . html . TrustedResourceUrl . format = function ( a , b ) { var c = goog . string . Const . unwrap ( a ) ; if ( ! goog . html . TrustedResourceUrl . BASE _URL _ . test ( c ) ) throw Error ( "Invalid TrustedResourceUrl format: " + c ) ; var d = c . replace ( goog . html . TrustedResourceUrl . FORMAT _MARKER _ , function ( a , d ) { if ( ! Object . prototype . hasOwnProperty . call ( b , d ) ) throw Error ( 'Found marker, "' + d + '", in format string, "' + c + '", but no valid label mapping found in args: ' + JSON . stringify ( b ) ) ; var e = b [ d ] ; return e instanceof goog . string . Const ? goog . string . Const . unwrap ( e ) :
2018-01-16 21:13:23 +00:00
encodeURIComponent ( String ( e ) ) } ) ; return goog . html . TrustedResourceUrl . createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse ( d ) } ; goog . html . TrustedResourceUrl . FORMAT _MARKER _ = /%{(\w+)}/g ; goog . html . TrustedResourceUrl . BASE _URL _ = /^(?:https:)?\/\/[0-9a-z.:[\]-]+\/|^\/[^\/\\]|^about:blank#/i ; goog . html . TrustedResourceUrl . formatWithParams = function ( a , b , c ) { return goog . html . TrustedResourceUrl . format ( a , b ) . cloneWithParams ( c ) } ; goog . html . TrustedResourceUrl . fromConstant = function ( a ) { return goog . html . TrustedResourceUrl . createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse ( goog . string . Const . unwrap ( a ) ) } ;
2017-09-25 09:37:41 +00:00
goog . html . TrustedResourceUrl . fromConstants = function ( a ) { for ( var b = "" , c = 0 ; c < a . length ; c ++ ) b += goog . string . Const . unwrap ( a [ c ] ) ; return goog . html . TrustedResourceUrl . createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse ( b ) } ; goog . html . TrustedResourceUrl . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = { } ; goog . html . TrustedResourceUrl . createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse = function ( a ) { var b = new goog . html . TrustedResourceUrl ; b . privateDoNotAccessOrElseTrustedResourceUrlWrappedValue _ = a ; return b } ; goog . html . SafeUrl = function ( ) { this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ = "" ; this . SAFE _URL _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = goog . html . SafeUrl . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ } ; goog . html . SafeUrl . INNOCUOUS _STRING = "about:invalid#zClosurez" ; goog . html . SafeUrl . prototype . implementsGoogStringTypedString = ! 0 ; goog . html . SafeUrl . prototype . getTypedStringValue = function ( ) { return this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ } ;
goog . html . SafeUrl . prototype . implementsGoogI18nBidiDirectionalString = ! 0 ; goog . html . SafeUrl . prototype . getDirection = function ( ) { return goog . i18n . bidi . Dir . LTR } ; goog . DEBUG && ( goog . html . SafeUrl . prototype . toString = function ( ) { return "SafeUrl{" + this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ + "}" } ) ;
goog . html . SafeUrl . unwrap = function ( a ) { if ( a instanceof goog . html . SafeUrl && a . constructor === goog . html . SafeUrl && a . SAFE _URL _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ === goog . html . SafeUrl . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ) return a . privateDoNotAccessOrElseSafeHtmlWrappedValue _ ; goog . asserts . fail ( "expected object of type SafeUrl, got '" + a + "' of type " + goog . typeOf ( a ) ) ; return "type_error:SafeUrl" } ; goog . html . SafeUrl . fromConstant = function ( a ) { return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( goog . string . Const . unwrap ( a ) ) } ;
2018-08-17 13:32:56 +00:00
goog . html . SAFE _MIME _TYPE _PATTERN _ = /^(?:audio\/(?:3gpp|3gpp2|aac|midi|mp4|mpeg|ogg|x-m4a|x-wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime))$/i ; goog . html . SafeUrl . fromBlob = function ( a ) { a = goog . html . SAFE _MIME _TYPE _PATTERN _ . test ( a . type ) ? goog . fs . url . createObjectUrl ( a ) : goog . html . SafeUrl . INNOCUOUS _STRING ; return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( a ) } ; goog . html . DATA _URL _PATTERN _ = /^data:([^;,]*);base64,[a-z0-9+\/]+=*$/i ;
2018-01-16 21:13:23 +00:00
goog . html . SafeUrl . fromDataUrl = function ( a ) { var b = a . match ( goog . html . DATA _URL _PATTERN _ ) ; b = b && goog . html . SAFE _MIME _TYPE _PATTERN _ . test ( b [ 1 ] ) ; return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( b ? a : goog . html . SafeUrl . INNOCUOUS _STRING ) } ; goog . html . SafeUrl . fromTelUrl = function ( a ) { goog . string . caseInsensitiveStartsWith ( a , "tel:" ) || ( a = goog . html . SafeUrl . INNOCUOUS _STRING ) ; return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( a ) } ; goog . html . SafeUrl . fromTrustedResourceUrl = function ( a ) { return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( goog . html . TrustedResourceUrl . unwrap ( a ) ) } ;
goog . html . SAFE _URL _PATTERN _ = /^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i ; goog . html . SafeUrl . sanitize = function ( a ) { if ( a instanceof goog . html . SafeUrl ) return a ; a = a . implementsGoogStringTypedString ? a . getTypedStringValue ( ) : String ( a ) ; goog . html . SAFE _URL _PATTERN _ . test ( a ) || ( a = goog . html . SafeUrl . INNOCUOUS _STRING ) ; return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( a ) } ;
goog . html . SafeUrl . sanitizeAssertUnchanged = function ( a ) { if ( a instanceof goog . html . SafeUrl ) return a ; a = a . implementsGoogStringTypedString ? a . getTypedStringValue ( ) : String ( a ) ; goog . asserts . assert ( goog . html . SAFE _URL _PATTERN _ . test ( a ) ) || ( a = goog . html . SafeUrl . INNOCUOUS _STRING ) ; return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( a ) } ; goog . html . SafeUrl . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = { } ;
goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse = function ( a ) { var b = new goog . html . SafeUrl ; b . privateDoNotAccessOrElseSafeHtmlWrappedValue _ = a ; return b } ; goog . html . SafeUrl . ABOUT _BLANK = goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( "about:blank" ) ; goog . html . SafeStyle = function ( ) { this . privateDoNotAccessOrElseSafeStyleWrappedValue _ = "" ; this . SAFE _STYLE _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = goog . html . SafeStyle . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ } ; goog . html . SafeStyle . prototype . implementsGoogStringTypedString = ! 0 ; goog . html . SafeStyle . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = { } ;
goog . html . SafeStyle . fromConstant = function ( a ) { a = goog . string . Const . unwrap ( a ) ; if ( 0 === a . length ) return goog . html . SafeStyle . EMPTY ; goog . html . SafeStyle . checkStyle _ ( a ) ; goog . asserts . assert ( goog . string . endsWith ( a , ";" ) , "Last character of style string is not ';': " + a ) ; goog . asserts . assert ( goog . string . contains ( a , ":" ) , "Style string must contain at least one ':', to specify a \"name: value\" pair: " + a ) ; return goog . html . SafeStyle . createSafeStyleSecurityPrivateDoNotAccessOrElse ( a ) } ;
goog . html . SafeStyle . checkStyle _ = function ( a ) { goog . asserts . assert ( ! /[<>]/ . test ( a ) , "Forbidden characters in style string: " + a ) } ; goog . html . SafeStyle . prototype . getTypedStringValue = function ( ) { return this . privateDoNotAccessOrElseSafeStyleWrappedValue _ } ; goog . DEBUG && ( goog . html . SafeStyle . prototype . toString = function ( ) { return "SafeStyle{" + this . privateDoNotAccessOrElseSafeStyleWrappedValue _ + "}" } ) ;
goog . html . SafeStyle . unwrap = function ( a ) { if ( a instanceof goog . html . SafeStyle && a . constructor === goog . html . SafeStyle && a . SAFE _STYLE _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ === goog . html . SafeStyle . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ) return a . privateDoNotAccessOrElseSafeStyleWrappedValue _ ; goog . asserts . fail ( "expected object of type SafeStyle, got '" + a + "' of type " + goog . typeOf ( a ) ) ; return "type_error:SafeStyle" } ; goog . html . SafeStyle . createSafeStyleSecurityPrivateDoNotAccessOrElse = function ( a ) { return ( new goog . html . SafeStyle ) . initSecurityPrivateDoNotAccessOrElse _ ( a ) } ;
goog . html . SafeStyle . prototype . initSecurityPrivateDoNotAccessOrElse _ = function ( a ) { this . privateDoNotAccessOrElseSafeStyleWrappedValue _ = a ; return this } ; goog . html . SafeStyle . EMPTY = goog . html . SafeStyle . createSafeStyleSecurityPrivateDoNotAccessOrElse ( "" ) ; goog . html . SafeStyle . INNOCUOUS _STRING = "zClosurez" ;
goog . html . SafeStyle . create = function ( a ) { var b = "" , c ; for ( c in a ) { if ( ! /^[-_a-zA-Z0-9]+$/ . test ( c ) ) throw Error ( "Name allows only [-_a-zA-Z0-9], got: " + c ) ; var d = a [ c ] ; null != d && ( d = goog . isArray ( d ) ? goog . array . map ( d , goog . html . SafeStyle . sanitizePropertyValue _ ) . join ( " " ) : goog . html . SafeStyle . sanitizePropertyValue _ ( d ) , b += c + ":" + d + ";" ) } if ( ! b ) return goog . html . SafeStyle . EMPTY ; goog . html . SafeStyle . checkStyle _ ( b ) ; return goog . html . SafeStyle . createSafeStyleSecurityPrivateDoNotAccessOrElse ( b ) } ;
goog . html . SafeStyle . sanitizePropertyValue _ = function ( a ) { if ( a instanceof goog . html . SafeUrl ) return 'url("' + goog . html . SafeUrl . unwrap ( a ) . replace ( /</g , "%3c" ) . replace ( /[\\"]/g , "\\$&" ) + '")' ; a = a instanceof goog . string . Const ? goog . string . Const . unwrap ( a ) : goog . html . SafeStyle . sanitizePropertyValueString _ ( String ( a ) ) ; goog . asserts . assert ( ! /[{;}]/ . test ( a ) , "Value does not allow [{;}]." ) ; return a } ;
2018-08-17 13:32:56 +00:00
goog . html . SafeStyle . sanitizePropertyValueString _ = function ( a ) { var b = a . replace ( goog . html . SafeStyle . FUNCTIONS _RE _ , "$1" ) . replace ( goog . html . SafeStyle . URL _RE _ , "url" ) ; return goog . html . SafeStyle . VALUE _RE _ . test ( b ) ? goog . html . SafeStyle . hasBalancedQuotes _ ( a ) ? goog . html . SafeStyle . sanitizeUrl _ ( a ) : ( goog . asserts . fail ( "String value requires balanced quotes, got: " + a ) , goog . html . SafeStyle . INNOCUOUS _STRING ) : ( goog . asserts . fail ( "String value allows only " + goog . html . SafeStyle . VALUE _ALLOWED _CHARS _ + " and simple functions, got: " +
a ) , goog . html . SafeStyle . INNOCUOUS _STRING ) } ; goog . html . SafeStyle . hasBalancedQuotes _ = function ( a ) { for ( var b = ! 0 , c = ! 0 , d = 0 ; d < a . length ; d ++ ) { var e = a . charAt ( d ) ; "'" == e && c ? b = ! b : '"' == e && b && ( c = ! c ) } return b && c } ; goog . html . SafeStyle . VALUE _ALLOWED _CHARS _ = "[-,.\"'%_!# a-zA-Z0-9]" ; goog . html . SafeStyle . VALUE _RE _ = new RegExp ( "^" + goog . html . SafeStyle . VALUE _ALLOWED _CHARS _ + "+$" ) ; goog . html . SafeStyle . URL _RE _ = RegExp ( "\\b(url\\([ \t\n]*)('[ -&(-\\[\\]-~]*'|\"[ !#-\\[\\]-~]*\"|[!#-&*-\\[\\]-~]*)([ \t\n]*\\))" , "g" ) ;
goog . html . SafeStyle . FUNCTIONS _RE _ = RegExp ( "\\b(hsl|hsla|rgb|rgba|matrix|(rotate|scale|translate)(X|Y|Z|3d)?)\\([-0-9a-z.%, ]+\\)" , "g" ) ; goog . html . SafeStyle . sanitizeUrl _ = function ( a ) { return a . replace ( goog . html . SafeStyle . URL _RE _ , function ( a , c , d , e ) { var b = "" ; d = d . replace ( /^(['"])(.*)\1$/ , function ( a , c , d ) { b = c ; return d } ) ; a = goog . html . SafeUrl . sanitize ( d ) . getTypedStringValue ( ) ; return c + b + a + b + e } ) } ;
2018-01-16 21:13:23 +00:00
goog . html . SafeStyle . concat = function ( a ) { var b = "" , c = function ( a ) { goog . isArray ( a ) ? goog . array . forEach ( a , c ) : b += goog . html . SafeStyle . unwrap ( a ) } ; goog . array . forEach ( arguments , c ) ; return b ? goog . html . SafeStyle . createSafeStyleSecurityPrivateDoNotAccessOrElse ( b ) : goog . html . SafeStyle . EMPTY } ; goog . html . SafeStyleSheet = function ( ) { this . privateDoNotAccessOrElseSafeStyleSheetWrappedValue _ = "" ; this . SAFE _STYLE _SHEET _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = goog . html . SafeStyleSheet . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ } ; goog . html . SafeStyleSheet . prototype . implementsGoogStringTypedString = ! 0 ; goog . html . SafeStyleSheet . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = { } ;
goog . html . SafeStyleSheet . createRule = function ( a , b ) { if ( goog . string . contains ( a , "<" ) ) throw Error ( "Selector does not allow '<', got: " + a ) ; var c = a . replace ( /('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g , "" ) ; if ( ! /^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/ . test ( c ) ) throw Error ( "Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: " + a ) ; if ( ! goog . html . SafeStyleSheet . hasBalancedBrackets _ ( c ) ) throw Error ( "() and [] in selector must be balanced, got: " + a ) ; b instanceof goog . html . SafeStyle || ( b = goog . html . SafeStyle . create ( b ) ) ;
c = a + "{" + goog . html . SafeStyle . unwrap ( b ) + "}" ; return goog . html . SafeStyleSheet . createSafeStyleSheetSecurityPrivateDoNotAccessOrElse ( c ) } ; goog . html . SafeStyleSheet . hasBalancedBrackets _ = function ( a ) { for ( var b = { "(" : ")" , "[" : "]" } , c = [ ] , d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] ; if ( b [ e ] ) c . push ( b [ e ] ) ; else if ( goog . object . contains ( b , e ) && c . pop ( ) != e ) return ! 1 } return 0 == c . length } ;
goog . html . SafeStyleSheet . concat = function ( a ) { var b = "" , c = function ( a ) { goog . isArray ( a ) ? goog . array . forEach ( a , c ) : b += goog . html . SafeStyleSheet . unwrap ( a ) } ; goog . array . forEach ( arguments , c ) ; return goog . html . SafeStyleSheet . createSafeStyleSheetSecurityPrivateDoNotAccessOrElse ( b ) } ;
goog . html . SafeStyleSheet . fromConstant = function ( a ) { a = goog . string . Const . unwrap ( a ) ; if ( 0 === a . length ) return goog . html . SafeStyleSheet . EMPTY ; goog . asserts . assert ( ! goog . string . contains ( a , "<" ) , "Forbidden '<' character in style sheet string: " + a ) ; return goog . html . SafeStyleSheet . createSafeStyleSheetSecurityPrivateDoNotAccessOrElse ( a ) } ; goog . html . SafeStyleSheet . prototype . getTypedStringValue = function ( ) { return this . privateDoNotAccessOrElseSafeStyleSheetWrappedValue _ } ;
goog . DEBUG && ( goog . html . SafeStyleSheet . prototype . toString = function ( ) { return "SafeStyleSheet{" + this . privateDoNotAccessOrElseSafeStyleSheetWrappedValue _ + "}" } ) ;
goog . html . SafeStyleSheet . unwrap = function ( a ) { if ( a instanceof goog . html . SafeStyleSheet && a . constructor === goog . html . SafeStyleSheet && a . SAFE _STYLE _SHEET _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ === goog . html . SafeStyleSheet . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ) return a . privateDoNotAccessOrElseSafeStyleSheetWrappedValue _ ; goog . asserts . fail ( "expected object of type SafeStyleSheet, got '" + a + "' of type " + goog . typeOf ( a ) ) ; return "type_error:SafeStyleSheet" } ;
goog . html . SafeStyleSheet . createSafeStyleSheetSecurityPrivateDoNotAccessOrElse = function ( a ) { return ( new goog . html . SafeStyleSheet ) . initSecurityPrivateDoNotAccessOrElse _ ( a ) } ; goog . html . SafeStyleSheet . prototype . initSecurityPrivateDoNotAccessOrElse _ = function ( a ) { this . privateDoNotAccessOrElseSafeStyleSheetWrappedValue _ = a ; return this } ; goog . html . SafeStyleSheet . EMPTY = goog . html . SafeStyleSheet . createSafeStyleSheetSecurityPrivateDoNotAccessOrElse ( "" ) ; goog . html . SafeHtml = function ( ) { this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ = "" ; this . SAFE _HTML _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = goog . html . SafeHtml . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ; this . dir _ = null } ; goog . html . SafeHtml . prototype . implementsGoogI18nBidiDirectionalString = ! 0 ; goog . html . SafeHtml . prototype . getDirection = function ( ) { return this . dir _ } ; goog . html . SafeHtml . prototype . implementsGoogStringTypedString = ! 0 ; goog . html . SafeHtml . prototype . getTypedStringValue = function ( ) { return this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ } ;
2017-09-25 09:37:41 +00:00
goog . DEBUG && ( goog . html . SafeHtml . prototype . toString = function ( ) { return "SafeHtml{" + this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ + "}" } ) ;
goog . html . SafeHtml . unwrap = function ( a ) { if ( a instanceof goog . html . SafeHtml && a . constructor === goog . html . SafeHtml && a . SAFE _HTML _TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ === goog . html . SafeHtml . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ ) return a . privateDoNotAccessOrElseSafeHtmlWrappedValue _ ; goog . asserts . fail ( "expected object of type SafeHtml, got '" + a + "' of type " + goog . typeOf ( a ) ) ; return "type_error:SafeHtml" } ;
goog . html . SafeHtml . htmlEscape = function ( a ) { if ( a instanceof goog . html . SafeHtml ) return a ; var b = null ; a . implementsGoogI18nBidiDirectionalString && ( b = a . getDirection ( ) ) ; a = a . implementsGoogStringTypedString ? a . getTypedStringValue ( ) : String ( a ) ; return goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( goog . string . htmlEscape ( a ) , b ) } ;
goog . html . SafeHtml . htmlEscapePreservingNewlines = function ( a ) { if ( a instanceof goog . html . SafeHtml ) return a ; a = goog . html . SafeHtml . htmlEscape ( a ) ; return goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( goog . string . newLineToBr ( goog . html . SafeHtml . unwrap ( a ) ) , a . getDirection ( ) ) } ;
goog . html . SafeHtml . htmlEscapePreservingNewlinesAndSpaces = function ( a ) { if ( a instanceof goog . html . SafeHtml ) return a ; a = goog . html . SafeHtml . htmlEscape ( a ) ; return goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( goog . string . whitespaceEscape ( goog . html . SafeHtml . unwrap ( a ) ) , a . getDirection ( ) ) } ; goog . html . SafeHtml . from = goog . html . SafeHtml . htmlEscape ; goog . html . SafeHtml . VALID _NAMES _IN _TAG _ = /^[a-zA-Z0-9-]+$/ ;
goog . html . SafeHtml . URL _ATTRIBUTES _ = { action : ! 0 , cite : ! 0 , data : ! 0 , formaction : ! 0 , href : ! 0 , manifest : ! 0 , poster : ! 0 , src : ! 0 } ; goog . html . SafeHtml . NOT _ALLOWED _TAG _NAMES _ = { APPLET : ! 0 , BASE : ! 0 , EMBED : ! 0 , IFRAME : ! 0 , LINK : ! 0 , MATH : ! 0 , META : ! 0 , OBJECT : ! 0 , SCRIPT : ! 0 , STYLE : ! 0 , SVG : ! 0 , TEMPLATE : ! 0 } ; goog . html . SafeHtml . create = function ( a , b , c ) { goog . html . SafeHtml . verifyTagName ( String ( a ) ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( String ( a ) , b , c ) } ;
goog . html . SafeHtml . verifyTagName = function ( a ) { if ( ! goog . html . SafeHtml . VALID _NAMES _IN _TAG _ . test ( a ) ) throw Error ( "Invalid tag name <" + a + ">." ) ; if ( a . toUpperCase ( ) in goog . html . SafeHtml . NOT _ALLOWED _TAG _NAMES _ ) throw Error ( "Tag name <" + a + "> is not allowed for SafeHtml." ) ; } ;
goog . html . SafeHtml . createIframe = function ( a , b , c , d ) { a && goog . html . TrustedResourceUrl . unwrap ( a ) ; var e = { } ; e . src = a || null ; e . srcdoc = b && goog . html . SafeHtml . unwrap ( b ) ; a = goog . html . SafeHtml . combineAttributes ( e , { sandbox : "" } , c ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( "iframe" , a , d ) } ;
goog . html . SafeHtml . createSandboxIframe = function ( a , b , c , d ) { if ( ! goog . html . SafeHtml . canUseSandboxIframe ( ) ) throw Error ( "The browser does not support sandboxed iframes." ) ; var e = { } ; e . src = a ? goog . html . SafeUrl . unwrap ( goog . html . SafeUrl . sanitize ( a ) ) : null ; e . srcdoc = b || null ; e . sandbox = "" ; a = goog . html . SafeHtml . combineAttributes ( e , { } , c ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( "iframe" , a , d ) } ;
goog . html . SafeHtml . canUseSandboxIframe = function ( ) { return goog . global . HTMLIFrameElement && "sandbox" in goog . global . HTMLIFrameElement . prototype } ; goog . html . SafeHtml . createScriptSrc = function ( a , b ) { goog . html . TrustedResourceUrl . unwrap ( a ) ; var c = goog . html . SafeHtml . combineAttributes ( { src : a } , { } , b ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( "script" , c ) } ;
goog . html . SafeHtml . createScript = function ( a , b ) { for ( var c in b ) { var d = c . toLowerCase ( ) ; if ( "language" == d || "src" == d || "text" == d || "type" == d ) throw Error ( 'Cannot set "' + d + '" attribute' ) ; } c = "" ; a = goog . array . concat ( a ) ; for ( d = 0 ; d < a . length ; d ++ ) c += goog . html . SafeScript . unwrap ( a [ d ] ) ; c = goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( c , goog . i18n . bidi . Dir . NEUTRAL ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( "script" , b , c ) } ;
goog . html . SafeHtml . createStyle = function ( a , b ) { var c = goog . html . SafeHtml . combineAttributes ( { type : "text/css" } , { } , b ) , d = "" ; a = goog . array . concat ( a ) ; for ( var e = 0 ; e < a . length ; e ++ ) d += goog . html . SafeStyleSheet . unwrap ( a [ e ] ) ; d = goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( d , goog . i18n . bidi . Dir . NEUTRAL ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( "style" , c , d ) } ;
goog . html . SafeHtml . createMetaRefresh = function ( a , b ) { var c = goog . html . SafeUrl . unwrap ( goog . html . SafeUrl . sanitize ( a ) ) ; ( goog . labs . userAgent . browser . isIE ( ) || goog . labs . userAgent . browser . isEdge ( ) ) && goog . string . contains ( c , ";" ) && ( c = "'" + c . replace ( /'/g , "%27" ) + "'" ) ; return goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse ( "meta" , { "http-equiv" : "refresh" , content : ( b || 0 ) + "; url=" + c } ) } ;
goog . html . SafeHtml . getAttrNameAndValue _ = function ( a , b , c ) { if ( c instanceof goog . string . Const ) c = goog . string . Const . unwrap ( c ) ; else if ( "style" == b . toLowerCase ( ) ) c = goog . html . SafeHtml . getStyleValue _ ( c ) ; else { if ( /^on/i . test ( b ) ) throw Error ( 'Attribute "' + b + '" requires goog.string.Const value, "' + c + '" given.' ) ; if ( b . toLowerCase ( ) in goog . html . SafeHtml . URL _ATTRIBUTES _ ) if ( c instanceof goog . html . TrustedResourceUrl ) c = goog . html . TrustedResourceUrl . unwrap ( c ) ; else if ( c instanceof goog . html . SafeUrl ) c = goog . html . SafeUrl . unwrap ( c ) ;
else if ( goog . isString ( c ) ) c = goog . html . SafeUrl . sanitize ( c ) . getTypedStringValue ( ) ; else throw Error ( 'Attribute "' + b + '" on tag "' + a + '" requires goog.html.SafeUrl, goog.string.Const, or string, value "' + c + '" given.' ) ; } c . implementsGoogStringTypedString && ( c = c . getTypedStringValue ( ) ) ; goog . asserts . assert ( goog . isString ( c ) || goog . isNumber ( c ) , "String or number value expected, got " + typeof c + " with value: " + c ) ; return b + '="' + goog . string . htmlEscape ( String ( c ) ) + '"' } ;
goog . html . SafeHtml . getStyleValue _ = function ( a ) { if ( ! goog . isObject ( a ) ) throw Error ( 'The "style" attribute requires goog.html.SafeStyle or map of style properties, ' + typeof a + " given: " + a ) ; a instanceof goog . html . SafeStyle || ( a = goog . html . SafeStyle . create ( a ) ) ; return goog . html . SafeStyle . unwrap ( a ) } ; goog . html . SafeHtml . createWithDir = function ( a , b , c , d ) { b = goog . html . SafeHtml . create ( b , c , d ) ; b . dir _ = a ; return b } ;
goog . html . SafeHtml . concat = function ( a ) { var b = goog . i18n . bidi . Dir . NEUTRAL , c = "" , d = function ( a ) { goog . isArray ( a ) ? goog . array . forEach ( a , d ) : ( a = goog . html . SafeHtml . htmlEscape ( a ) , c += goog . html . SafeHtml . unwrap ( a ) , a = a . getDirection ( ) , b == goog . i18n . bidi . Dir . NEUTRAL ? b = a : a != goog . i18n . bidi . Dir . NEUTRAL && b != a && ( b = null ) ) } ; goog . array . forEach ( arguments , d ) ; return goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( c , b ) } ;
goog . html . SafeHtml . concatWithDir = function ( a , b ) { var c = goog . html . SafeHtml . concat ( goog . array . slice ( arguments , 1 ) ) ; c . dir _ = a ; return c } ; goog . html . SafeHtml . TYPE _MARKER _GOOG _HTML _SECURITY _PRIVATE _ = { } ; goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse = function ( a , b ) { return ( new goog . html . SafeHtml ) . initSecurityPrivateDoNotAccessOrElse _ ( a , b ) } ; goog . html . SafeHtml . prototype . initSecurityPrivateDoNotAccessOrElse _ = function ( a , b ) { this . privateDoNotAccessOrElseSafeHtmlWrappedValue _ = a ; this . dir _ = b ; return this } ;
2018-01-16 21:13:23 +00:00
goog . html . SafeHtml . createSafeHtmlTagSecurityPrivateDoNotAccessOrElse = function ( a , b , c ) { var d = null ; var e = "<" + a + goog . html . SafeHtml . stringifyAttributes ( a , b ) ; goog . isDefAndNotNull ( c ) ? goog . isArray ( c ) || ( c = [ c ] ) : c = [ ] ; goog . dom . tags . isVoidTag ( a . toLowerCase ( ) ) ? ( goog . asserts . assert ( ! c . length , "Void tag <" + a + "> does not allow content." ) , e += ">" ) : ( d = goog . html . SafeHtml . concat ( c ) , e += ">" + goog . html . SafeHtml . unwrap ( d ) + "</" + a + ">" , d = d . getDirection ( ) ) ; ( a = b && b . dir ) && ( d = /^(ltr|rtl|auto)$/i . test ( a ) ? goog . i18n . bidi . Dir . NEUTRAL :
null ) ; return goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( e , d ) } ; goog . html . SafeHtml . stringifyAttributes = function ( a , b ) { var c = "" ; if ( b ) for ( var d in b ) { if ( ! goog . html . SafeHtml . VALID _NAMES _IN _TAG _ . test ( d ) ) throw Error ( 'Invalid attribute name "' + d + '".' ) ; var e = b [ d ] ; goog . isDefAndNotNull ( e ) && ( c += " " + goog . html . SafeHtml . getAttrNameAndValue _ ( a , d , e ) ) } return c } ;
2017-09-25 09:37:41 +00:00
goog . html . SafeHtml . combineAttributes = function ( a , b , c ) { var d = { } , e ; for ( e in a ) goog . asserts . assert ( e . toLowerCase ( ) == e , "Must be lower case" ) , d [ e ] = a [ e ] ; for ( e in b ) goog . asserts . assert ( e . toLowerCase ( ) == e , "Must be lower case" ) , d [ e ] = b [ e ] ; for ( e in c ) { var f = e . toLowerCase ( ) ; if ( f in a ) throw Error ( 'Cannot override "' + f + '" attribute, got "' + e + '" with value "' + c [ e ] + '"' ) ; f in b && delete d [ f ] ; d [ e ] = c [ e ] } return d } ;
goog . html . SafeHtml . DOCTYPE _HTML = goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( "<!DOCTYPE html>" , goog . i18n . bidi . Dir . NEUTRAL ) ; goog . html . SafeHtml . EMPTY = goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( "" , goog . i18n . bidi . Dir . NEUTRAL ) ; goog . html . SafeHtml . BR = goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( "<br>" , goog . i18n . bidi . Dir . NEUTRAL ) ; goog . dom . safe = { } ; goog . dom . safe . InsertAdjacentHtmlPosition = { AFTERBEGIN : "afterbegin" , AFTEREND : "afterend" , BEFOREBEGIN : "beforebegin" , BEFOREEND : "beforeend" } ; goog . dom . safe . insertAdjacentHtml = function ( a , b , c ) { a . insertAdjacentHTML ( b , goog . html . SafeHtml . unwrap ( c ) ) } ; goog . dom . safe . SET _INNER _HTML _DISALLOWED _TAGS _ = { MATH : ! 0 , SCRIPT : ! 0 , STYLE : ! 0 , SVG : ! 0 , TEMPLATE : ! 0 } ;
2018-01-16 21:13:23 +00:00
goog . dom . safe . setInnerHtml = function ( a , b ) { if ( goog . asserts . ENABLE _ASSERTS ) { var c = a . tagName . toUpperCase ( ) ; if ( goog . dom . safe . SET _INNER _HTML _DISALLOWED _TAGS _ [ c ] ) throw Error ( "goog.dom.safe.setInnerHtml cannot be used to set content of " + a . tagName + "." ) ; } a . innerHTML = goog . html . SafeHtml . unwrap ( b ) } ; goog . dom . safe . setOuterHtml = function ( a , b ) { a . outerHTML = goog . html . SafeHtml . unwrap ( b ) } ;
2018-08-17 13:32:56 +00:00
goog . dom . safe . setFormElementAction = function ( a , b ) { var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; goog . dom . asserts . assertIsHTMLFormElement ( a ) . action = goog . html . SafeUrl . unwrap ( c ) } ; goog . dom . safe . setButtonFormAction = function ( a , b ) { var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; goog . dom . asserts . assertIsHTMLButtonElement ( a ) . formAction = goog . html . SafeUrl . unwrap ( c ) } ;
goog . dom . safe . setInputFormAction = function ( a , b ) { var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; goog . dom . asserts . assertIsHTMLInputElement ( a ) . formAction = goog . html . SafeUrl . unwrap ( c ) } ; goog . dom . safe . setStyle = function ( a , b ) { a . style . cssText = goog . html . SafeStyle . unwrap ( b ) } ; goog . dom . safe . documentWrite = function ( a , b ) { a . write ( goog . html . SafeHtml . unwrap ( b ) ) } ;
2018-01-16 21:13:23 +00:00
goog . dom . safe . setAnchorHref = function ( a , b ) { goog . dom . asserts . assertIsHTMLAnchorElement ( a ) ; var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; a . href = goog . html . SafeUrl . unwrap ( c ) } ; goog . dom . safe . setImageSrc = function ( a , b ) { goog . dom . asserts . assertIsHTMLImageElement ( a ) ; var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; a . src = goog . html . SafeUrl . unwrap ( c ) } ;
goog . dom . safe . setVideoSrc = function ( a , b ) { goog . dom . asserts . assertIsHTMLVideoElement ( a ) ; var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; a . src = goog . html . SafeUrl . unwrap ( c ) } ; goog . dom . safe . setEmbedSrc = function ( a , b ) { goog . dom . asserts . assertIsHTMLEmbedElement ( a ) ; a . src = goog . html . TrustedResourceUrl . unwrap ( b ) } ; goog . dom . safe . setFrameSrc = function ( a , b ) { goog . dom . asserts . assertIsHTMLFrameElement ( a ) ; a . src = goog . html . TrustedResourceUrl . unwrap ( b ) } ;
goog . dom . safe . setIframeSrc = function ( a , b ) { goog . dom . asserts . assertIsHTMLIFrameElement ( a ) ; a . src = goog . html . TrustedResourceUrl . unwrap ( b ) } ; goog . dom . safe . setIframeSrcdoc = function ( a , b ) { goog . dom . asserts . assertIsHTMLIFrameElement ( a ) ; a . srcdoc = goog . html . SafeHtml . unwrap ( b ) } ;
goog . dom . safe . setLinkHrefAndRel = function ( a , b , c ) { goog . dom . asserts . assertIsHTMLLinkElement ( a ) ; a . rel = c ; goog . string . caseInsensitiveContains ( c , "stylesheet" ) ? ( goog . asserts . assert ( b instanceof goog . html . TrustedResourceUrl , 'URL must be TrustedResourceUrl because "rel" contains "stylesheet"' ) , a . href = goog . html . TrustedResourceUrl . unwrap ( b ) ) : a . href = b instanceof goog . html . TrustedResourceUrl ? goog . html . TrustedResourceUrl . unwrap ( b ) : b instanceof goog . html . SafeUrl ? goog . html . SafeUrl . unwrap ( b ) : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) . getTypedStringValue ( ) } ;
2018-08-17 13:32:56 +00:00
goog . dom . safe . setObjectData = function ( a , b ) { goog . dom . asserts . assertIsHTMLObjectElement ( a ) ; a . data = goog . html . TrustedResourceUrl . unwrap ( b ) } ; goog . dom . safe . setScriptSrc = function ( a , b ) { goog . dom . asserts . assertIsHTMLScriptElement ( a ) ; a . src = goog . html . TrustedResourceUrl . unwrap ( b ) ; var c = goog . getScriptNonce ( ) ; c && a . setAttribute ( "nonce" , c ) } ;
goog . dom . safe . setScriptContent = function ( a , b ) { goog . dom . asserts . assertIsHTMLScriptElement ( a ) ; a . text = goog . html . SafeScript . unwrap ( b ) ; var c = goog . getScriptNonce ( ) ; c && a . setAttribute ( "nonce" , c ) } ; goog . dom . safe . setLocationHref = function ( a , b ) { goog . dom . asserts . assertIsLocation ( a ) ; var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; a . href = goog . html . SafeUrl . unwrap ( c ) } ;
goog . dom . safe . replaceLocation = function ( a , b ) { goog . dom . asserts . assertIsLocation ( a ) ; var c = b instanceof goog . html . SafeUrl ? b : goog . html . SafeUrl . sanitizeAssertUnchanged ( b ) ; a . replace ( goog . html . SafeUrl . unwrap ( c ) ) } ; goog . dom . safe . openInWindow = function ( a , b , c , d , e ) { a = a instanceof goog . html . SafeUrl ? a : goog . html . SafeUrl . sanitizeAssertUnchanged ( a ) ; return ( b || window ) . open ( goog . html . SafeUrl . unwrap ( a ) , c ? goog . string . Const . unwrap ( c ) : "" , d , e ) } ; goog . html . uncheckedconversions = { } ; goog . html . uncheckedconversions . safeHtmlFromStringKnownToSatisfyTypeContract = function ( a , b , c ) { goog . asserts . assertString ( goog . string . Const . unwrap ( a ) , "must provide justification" ) ; goog . asserts . assert ( ! goog . string . isEmptyOrWhitespace ( goog . string . Const . unwrap ( a ) ) , "must provide non-empty justification" ) ; return goog . html . SafeHtml . createSafeHtmlSecurityPrivateDoNotAccessOrElse ( b , c || null ) } ;
2018-01-16 21:13:23 +00:00
goog . html . uncheckedconversions . safeScriptFromStringKnownToSatisfyTypeContract = function ( a , b ) { goog . asserts . assertString ( goog . string . Const . unwrap ( a ) , "must provide justification" ) ; goog . asserts . assert ( ! goog . string . isEmptyOrWhitespace ( goog . string . Const . unwrap ( a ) ) , "must provide non-empty justification" ) ; return goog . html . SafeScript . createSafeScriptSecurityPrivateDoNotAccessOrElse ( b ) } ;
2017-09-25 09:37:41 +00:00
goog . html . uncheckedconversions . safeStyleFromStringKnownToSatisfyTypeContract = function ( a , b ) { goog . asserts . assertString ( goog . string . Const . unwrap ( a ) , "must provide justification" ) ; goog . asserts . assert ( ! goog . string . isEmptyOrWhitespace ( goog . string . Const . unwrap ( a ) ) , "must provide non-empty justification" ) ; return goog . html . SafeStyle . createSafeStyleSecurityPrivateDoNotAccessOrElse ( b ) } ;
goog . html . uncheckedconversions . safeStyleSheetFromStringKnownToSatisfyTypeContract = function ( a , b ) { goog . asserts . assertString ( goog . string . Const . unwrap ( a ) , "must provide justification" ) ; goog . asserts . assert ( ! goog . string . isEmptyOrWhitespace ( goog . string . Const . unwrap ( a ) ) , "must provide non-empty justification" ) ; return goog . html . SafeStyleSheet . createSafeStyleSheetSecurityPrivateDoNotAccessOrElse ( b ) } ;
goog . html . uncheckedconversions . safeUrlFromStringKnownToSatisfyTypeContract = function ( a , b ) { goog . asserts . assertString ( goog . string . Const . unwrap ( a ) , "must provide justification" ) ; goog . asserts . assert ( ! goog . string . isEmptyOrWhitespace ( goog . string . Const . unwrap ( a ) ) , "must provide non-empty justification" ) ; return goog . html . SafeUrl . createSafeUrlSecurityPrivateDoNotAccessOrElse ( b ) } ;
2018-01-16 21:13:23 +00:00
goog . html . uncheckedconversions . trustedResourceUrlFromStringKnownToSatisfyTypeContract = function ( a , b ) { goog . asserts . assertString ( goog . string . Const . unwrap ( a ) , "must provide justification" ) ; goog . asserts . assert ( ! goog . string . isEmptyOrWhitespace ( goog . string . Const . unwrap ( a ) ) , "must provide non-empty justification" ) ; return goog . html . TrustedResourceUrl . createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse ( b ) } ; goog . math . Size = function ( a , b ) { this . width = a ; this . height = b } ; goog . math . Size . equals = function ( a , b ) { return a == b ? ! 0 : a && b ? a . width == b . width && a . height == b . height : ! 1 } ; goog . math . Size . prototype . clone = function ( ) { return new goog . math . Size ( this . width , this . height ) } ; goog . DEBUG && ( goog . math . Size . prototype . toString = function ( ) { return "(" + this . width + " x " + this . height + ")" } ) ; goog . math . Size . prototype . getLongest = function ( ) { return Math . max ( this . width , this . height ) } ;
2017-09-25 09:37:41 +00:00
goog . math . Size . prototype . getShortest = function ( ) { return Math . min ( this . width , this . height ) } ; goog . math . Size . prototype . area = function ( ) { return this . width * this . height } ; goog . math . Size . prototype . perimeter = function ( ) { return 2 * ( this . width + this . height ) } ; goog . math . Size . prototype . aspectRatio = function ( ) { return this . width / this . height } ; goog . math . Size . prototype . isEmpty = function ( ) { return ! this . area ( ) } ; goog . math . Size . prototype . ceil = function ( ) { this . width = Math . ceil ( this . width ) ; this . height = Math . ceil ( this . height ) ; return this } ;
goog . math . Size . prototype . fitsInside = function ( a ) { return this . width <= a . width && this . height <= a . height } ; goog . math . Size . prototype . floor = function ( ) { this . width = Math . floor ( this . width ) ; this . height = Math . floor ( this . height ) ; return this } ; goog . math . Size . prototype . round = function ( ) { this . width = Math . round ( this . width ) ; this . height = Math . round ( this . height ) ; return this } ; goog . math . Size . prototype . scale = function ( a , b ) { var c = goog . isNumber ( b ) ? b : a ; this . width *= a ; this . height *= c ; return this } ;
goog . math . Size . prototype . scaleToCover = function ( a ) { a = this . aspectRatio ( ) <= a . aspectRatio ( ) ? a . width / this . width : a . height / this . height ; return this . scale ( a ) } ; goog . math . Size . prototype . scaleToFit = function ( a ) { a = this . aspectRatio ( ) > a . aspectRatio ( ) ? a . width / this . width : a . height / this . height ; return this . scale ( a ) } ; goog . dom . ASSUME _QUIRKS _MODE = ! 1 ; goog . dom . ASSUME _STANDARDS _MODE = ! 1 ; goog . dom . COMPAT _MODE _KNOWN _ = goog . dom . ASSUME _QUIRKS _MODE || goog . dom . ASSUME _STANDARDS _MODE ; goog . dom . getDomHelper = function ( a ) { return a ? new goog . dom . DomHelper ( goog . dom . getOwnerDocument ( a ) ) : goog . dom . defaultDomHelper _ || ( goog . dom . defaultDomHelper _ = new goog . dom . DomHelper ) } ; goog . dom . getDocument = function ( ) { return document } ; goog . dom . getElement = function ( a ) { return goog . dom . getElementHelper _ ( document , a ) } ;
goog . dom . getElementHelper _ = function ( a , b ) { return goog . isString ( b ) ? a . getElementById ( b ) : b } ; goog . dom . getRequiredElement = function ( a ) { return goog . dom . getRequiredElementHelper _ ( document , a ) } ; goog . dom . getRequiredElementHelper _ = function ( a , b ) { goog . asserts . assertString ( b ) ; var c = goog . dom . getElementHelper _ ( a , b ) ; return c = goog . asserts . assertElement ( c , "No element found with id: " + b ) } ; goog . dom . $ = goog . dom . getElement ; goog . dom . getElementsByTagName = function ( a , b ) { return ( b || document ) . getElementsByTagName ( String ( a ) ) } ;
2018-01-16 21:13:23 +00:00
goog . dom . getElementsByTagNameAndClass = function ( a , b , c ) { return goog . dom . getElementsByTagNameAndClass _ ( document , a , b , c ) } ; goog . dom . getElementByTagNameAndClass = function ( a , b , c ) { return goog . dom . getElementByTagNameAndClass _ ( document , a , b , c ) } ; goog . dom . getElementsByClass = function ( a , b ) { var c = b || document ; return goog . dom . canUseQuerySelector _ ( c ) ? c . querySelectorAll ( "." + a ) : goog . dom . getElementsByTagNameAndClass _ ( document , "*" , a , b ) } ;
goog . dom . getElementByClass = function ( a , b ) { var c = b || document ; return ( c . getElementsByClassName ? c . getElementsByClassName ( a ) [ 0 ] : goog . dom . getElementByTagNameAndClass _ ( document , "*" , a , b ) ) || null } ; goog . dom . getRequiredElementByClass = function ( a , b ) { var c = goog . dom . getElementByClass ( a , b ) ; return goog . asserts . assert ( c , "No element found with className: " + a ) } ; goog . dom . canUseQuerySelector _ = function ( a ) { return ! ( ! a . querySelectorAll || ! a . querySelector ) } ;
2017-09-25 09:37:41 +00:00
goog . dom . getElementsByTagNameAndClass _ = function ( a , b , c , d ) { a = d || a ; b = b && "*" != b ? String ( b ) . toUpperCase ( ) : "" ; if ( goog . dom . canUseQuerySelector _ ( a ) && ( b || c ) ) return a . querySelectorAll ( b + ( c ? "." + c : "" ) ) ; if ( c && a . getElementsByClassName ) { a = a . getElementsByClassName ( c ) ; if ( b ) { d = { } ; for ( var e = 0 , f = 0 , g ; g = a [ f ] ; f ++ ) b == g . nodeName && ( d [ e ++ ] = g ) ; d . length = e ; return d } return a } a = a . getElementsByTagName ( b || "*" ) ; if ( c ) { d = { } ; for ( f = e = 0 ; g = a [ f ] ; f ++ ) b = g . className , "function" == typeof b . split && goog . array . contains ( b . split ( /\s+/ ) , c ) && ( d [ e ++ ] = g ) ;
2018-01-16 21:13:23 +00:00
d . length = e ; return d } return a } ; goog . dom . getElementByTagNameAndClass _ = function ( a , b , c , d ) { var e = d || a , f = b && "*" != b ? String ( b ) . toUpperCase ( ) : "" ; return goog . dom . canUseQuerySelector _ ( e ) && ( f || c ) ? e . querySelector ( f + ( c ? "." + c : "" ) ) : goog . dom . getElementsByTagNameAndClass _ ( a , b , c , d ) [ 0 ] || null } ; goog . dom . $$ = goog . dom . getElementsByTagNameAndClass ;
goog . dom . setProperties = function ( a , b ) { goog . object . forEach ( b , function ( b , d ) { b && b . implementsGoogStringTypedString && ( b = b . getTypedStringValue ( ) ) ; "style" == d ? a . style . cssText = b : "class" == d ? a . className = b : "for" == d ? a . htmlFor = b : goog . dom . DIRECT _ATTRIBUTE _MAP _ . hasOwnProperty ( d ) ? a . setAttribute ( goog . dom . DIRECT _ATTRIBUTE _MAP _ [ d ] , b ) : goog . string . startsWith ( d , "aria-" ) || goog . string . startsWith ( d , "data-" ) ? a . setAttribute ( d , b ) : a [ d ] = b } ) } ;
2017-09-25 09:37:41 +00:00
goog . dom . DIRECT _ATTRIBUTE _MAP _ = { cellpadding : "cellPadding" , cellspacing : "cellSpacing" , colspan : "colSpan" , frameborder : "frameBorder" , height : "height" , maxlength : "maxLength" , nonce : "nonce" , role : "role" , rowspan : "rowSpan" , type : "type" , usemap : "useMap" , valign : "vAlign" , width : "width" } ; goog . dom . getViewportSize = function ( a ) { return goog . dom . getViewportSize _ ( a || window ) } ; goog . dom . getViewportSize _ = function ( a ) { a = a . document ; a = goog . dom . isCss1CompatMode _ ( a ) ? a . documentElement : a . body ; return new goog . math . Size ( a . clientWidth , a . clientHeight ) } ;
goog . dom . getDocumentHeight = function ( ) { return goog . dom . getDocumentHeight _ ( window ) } ; goog . dom . getDocumentHeightForWindow = function ( a ) { return goog . dom . getDocumentHeight _ ( a ) } ;
2018-01-16 21:13:23 +00:00
goog . dom . getDocumentHeight _ = function ( a ) { var b = a . document , c = 0 ; if ( b ) { c = b . body ; var d = b . documentElement ; if ( ! d || ! c ) return 0 ; a = goog . dom . getViewportSize _ ( a ) . height ; if ( goog . dom . isCss1CompatMode _ ( b ) && d . scrollHeight ) c = d . scrollHeight != a ? d . scrollHeight : d . offsetHeight ; else { b = d . scrollHeight ; var e = d . offsetHeight ; d . clientHeight != e && ( b = c . scrollHeight , e = c . offsetHeight ) ; c = b > a ? b > e ? b : e : b < e ? b : e } } return c } ; goog . dom . getPageScroll = function ( a ) { return goog . dom . getDomHelper ( ( a || goog . global || window ) . document ) . getDocumentScroll ( ) } ;
2017-09-25 09:37:41 +00:00
goog . dom . getDocumentScroll = function ( ) { return goog . dom . getDocumentScroll _ ( document ) } ; goog . dom . getDocumentScroll _ = function ( a ) { var b = goog . dom . getDocumentScrollElement _ ( a ) ; a = goog . dom . getWindow _ ( a ) ; return goog . userAgent . IE && goog . userAgent . isVersionOrHigher ( "10" ) && a . pageYOffset != b . scrollTop ? new goog . math . Coordinate ( b . scrollLeft , b . scrollTop ) : new goog . math . Coordinate ( a . pageXOffset || b . scrollLeft , a . pageYOffset || b . scrollTop ) } ; goog . dom . getDocumentScrollElement = function ( ) { return goog . dom . getDocumentScrollElement _ ( document ) } ;
goog . dom . getDocumentScrollElement _ = function ( a ) { return a . scrollingElement ? a . scrollingElement : ! goog . userAgent . WEBKIT && goog . dom . isCss1CompatMode _ ( a ) ? a . documentElement : a . body || a . documentElement } ; goog . dom . getWindow = function ( a ) { return a ? goog . dom . getWindow _ ( a ) : window } ; goog . dom . getWindow _ = function ( a ) { return a . parentWindow || a . defaultView } ; goog . dom . createDom = function ( a , b , c ) { return goog . dom . createDom _ ( document , arguments ) } ;
goog . dom . createDom _ = function ( a , b ) { var c = String ( b [ 0 ] ) , d = b [ 1 ] ; if ( ! goog . dom . BrowserFeature . CAN _ADD _NAME _OR _TYPE _ATTRIBUTES && d && ( d . name || d . type ) ) { c = [ "<" , c ] ; d . name && c . push ( ' name="' , goog . string . htmlEscape ( d . name ) , '"' ) ; if ( d . type ) { c . push ( ' type="' , goog . string . htmlEscape ( d . type ) , '"' ) ; var e = { } ; goog . object . extend ( e , d ) ; delete e . type ; d = e } c . push ( ">" ) ; c = c . join ( "" ) } c = a . createElement ( c ) ; d && ( goog . isString ( d ) ? c . className = d : goog . isArray ( d ) ? c . className = d . join ( " " ) : goog . dom . setProperties ( c , d ) ) ; 2 < b . length && goog . dom . append _ ( a ,
c , b , 2 ) ; return c } ; goog . dom . append _ = function ( a , b , c , d ) { function e ( c ) { c && b . appendChild ( goog . isString ( c ) ? a . createTextNode ( c ) : c ) } for ( ; d < c . length ; d ++ ) { var f = c [ d ] ; goog . isArrayLike ( f ) && ! goog . dom . isNodeLike ( f ) ? goog . array . forEach ( goog . dom . isNodeList ( f ) ? goog . array . toArray ( f ) : f , e ) : e ( f ) } } ; goog . dom . $dom = goog . dom . createDom ; goog . dom . createElement = function ( a ) { return goog . dom . createElement _ ( document , a ) } ; goog . dom . createElement _ = function ( a , b ) { return a . createElement ( String ( b ) ) } ; goog . dom . createTextNode = function ( a ) { return document . createTextNode ( String ( a ) ) } ;
2018-08-17 13:32:56 +00:00
goog . dom . createTable = function ( a , b , c ) { return goog . dom . createTable _ ( document , a , b , ! ! c ) } ; goog . dom . createTable _ = function ( a , b , c , d ) { for ( var e = goog . dom . createElement _ ( a , "TABLE" ) , f = e . appendChild ( goog . dom . createElement _ ( a , "TBODY" ) ) , g = 0 ; g < b ; g ++ ) { for ( var h = goog . dom . createElement _ ( a , "TR" ) , k = 0 ; k < c ; k ++ ) { var l = goog . dom . createElement _ ( a , "TD" ) ; d && goog . dom . setTextContent ( l , goog . string . Unicode . NBSP ) ; h . appendChild ( l ) } f . appendChild ( h ) } return e } ;
2018-01-16 21:13:23 +00:00
goog . dom . constHtmlToNode = function ( a ) { var b = goog . array . map ( arguments , goog . string . Const . unwrap ) ; b = goog . html . uncheckedconversions . safeHtmlFromStringKnownToSatisfyTypeContract ( goog . string . Const . from ( "Constant HTML string, that gets turned into a Node later, so it will be automatically balanced." ) , b . join ( "" ) ) ; return goog . dom . safeHtmlToNode ( b ) } ; goog . dom . safeHtmlToNode = function ( a ) { return goog . dom . safeHtmlToNode _ ( document , a ) } ;
2017-09-25 09:37:41 +00:00
goog . dom . safeHtmlToNode _ = function ( a , b ) { var c = goog . dom . createElement _ ( a , "DIV" ) ; goog . dom . BrowserFeature . INNER _HTML _NEEDS _SCOPED _ELEMENT ? ( goog . dom . safe . setInnerHtml ( c , goog . html . SafeHtml . concat ( goog . html . SafeHtml . BR , b ) ) , c . removeChild ( c . firstChild ) ) : goog . dom . safe . setInnerHtml ( c , b ) ; return goog . dom . childrenToNode _ ( a , c ) } ; goog . dom . childrenToNode _ = function ( a , b ) { if ( 1 == b . childNodes . length ) return b . removeChild ( b . firstChild ) ; for ( var c = a . createDocumentFragment ( ) ; b . firstChild ; ) c . appendChild ( b . firstChild ) ; return c } ;
goog . dom . isCss1CompatMode = function ( ) { return goog . dom . isCss1CompatMode _ ( document ) } ; goog . dom . isCss1CompatMode _ = function ( a ) { return goog . dom . COMPAT _MODE _KNOWN _ ? goog . dom . ASSUME _STANDARDS _MODE : "CSS1Compat" == a . compatMode } ; goog . dom . canHaveChildren = function ( a ) { if ( a . nodeType != goog . dom . NodeType . ELEMENT ) return ! 1 ; switch ( a . tagName ) { case "APPLET" : case "AREA" : case "BASE" : case "BR" : case "COL" : case "COMMAND" : case "EMBED" : case "FRAME" : case "HR" : case "IMG" : case "INPUT" : case "IFRAME" : case "ISINDEX" : case "KEYGEN" : case "LINK" : case "NOFRAMES" : case "NOSCRIPT" : case "META" : case "OBJECT" : case "PARAM" : case "SCRIPT" : case "SOURCE" : case "STYLE" : case "TRACK" : case "WBR" : return ! 1 } return ! 0 } ;
goog . dom . appendChild = function ( a , b ) { a . appendChild ( b ) } ; goog . dom . append = function ( a , b ) { goog . dom . append _ ( goog . dom . getOwnerDocument ( a ) , a , arguments , 1 ) } ; goog . dom . removeChildren = function ( a ) { for ( var b ; b = a . firstChild ; ) a . removeChild ( b ) } ; goog . dom . insertSiblingBefore = function ( a , b ) { b . parentNode && b . parentNode . insertBefore ( a , b ) } ; goog . dom . insertSiblingAfter = function ( a , b ) { b . parentNode && b . parentNode . insertBefore ( a , b . nextSibling ) } ; goog . dom . insertChildAt = function ( a , b , c ) { a . insertBefore ( b , a . childNodes [ c ] || null ) } ;
goog . dom . removeNode = function ( a ) { return a && a . parentNode ? a . parentNode . removeChild ( a ) : null } ; goog . dom . replaceNode = function ( a , b ) { var c = b . parentNode ; c && c . replaceChild ( a , b ) } ; goog . dom . flattenElement = function ( a ) { var b , c = a . parentNode ; if ( c && c . nodeType != goog . dom . NodeType . DOCUMENT _FRAGMENT ) { if ( a . removeNode ) return a . removeNode ( ! 1 ) ; for ( ; b = a . firstChild ; ) c . insertBefore ( b , a ) ; return goog . dom . removeNode ( a ) } } ;
goog . dom . getChildren = function ( a ) { return goog . dom . BrowserFeature . CAN _USE _CHILDREN _ATTRIBUTE && void 0 != a . children ? a . children : goog . array . filter ( a . childNodes , function ( a ) { return a . nodeType == goog . dom . NodeType . ELEMENT } ) } ; goog . dom . getFirstElementChild = function ( a ) { return goog . isDef ( a . firstElementChild ) ? a . firstElementChild : goog . dom . getNextElementNode _ ( a . firstChild , ! 0 ) } ; goog . dom . getLastElementChild = function ( a ) { return goog . isDef ( a . lastElementChild ) ? a . lastElementChild : goog . dom . getNextElementNode _ ( a . lastChild , ! 1 ) } ;
goog . dom . getNextElementSibling = function ( a ) { return goog . isDef ( a . nextElementSibling ) ? a . nextElementSibling : goog . dom . getNextElementNode _ ( a . nextSibling , ! 0 ) } ; goog . dom . getPreviousElementSibling = function ( a ) { return goog . isDef ( a . previousElementSibling ) ? a . previousElementSibling : goog . dom . getNextElementNode _ ( a . previousSibling , ! 1 ) } ; goog . dom . getNextElementNode _ = function ( a , b ) { for ( ; a && a . nodeType != goog . dom . NodeType . ELEMENT ; ) a = b ? a . nextSibling : a . previousSibling ; return a } ;
goog . dom . getNextNode = function ( a ) { if ( ! a ) return null ; if ( a . firstChild ) return a . firstChild ; for ( ; a && ! a . nextSibling ; ) a = a . parentNode ; return a ? a . nextSibling : null } ; goog . dom . getPreviousNode = function ( a ) { if ( ! a ) return null ; if ( ! a . previousSibling ) return a . parentNode ; for ( a = a . previousSibling ; a && a . lastChild ; ) a = a . lastChild ; return a } ; goog . dom . isNodeLike = function ( a ) { return goog . isObject ( a ) && 0 < a . nodeType } ; goog . dom . isElement = function ( a ) { return goog . isObject ( a ) && a . nodeType == goog . dom . NodeType . ELEMENT } ;
goog . dom . isWindow = function ( a ) { return goog . isObject ( a ) && a . window == a } ; goog . dom . getParentElement = function ( a ) { var b ; if ( goog . dom . BrowserFeature . CAN _USE _PARENT _ELEMENT _PROPERTY && ! ( goog . userAgent . IE && goog . userAgent . isVersionOrHigher ( "9" ) && ! goog . userAgent . isVersionOrHigher ( "10" ) && goog . global . SVGElement && a instanceof goog . global . SVGElement ) && ( b = a . parentElement ) ) return b ; b = a . parentNode ; return goog . dom . isElement ( b ) ? b : null } ;
goog . dom . contains = function ( a , b ) { if ( ! a || ! b ) return ! 1 ; if ( a . contains && b . nodeType == goog . dom . NodeType . ELEMENT ) return a == b || a . contains ( b ) ; if ( "undefined" != typeof a . compareDocumentPosition ) return a == b || ! ! ( a . compareDocumentPosition ( b ) & 16 ) ; for ( ; b && a != b ; ) b = b . parentNode ; return b == a } ;
goog . dom . compareNodeOrder = function ( a , b ) { if ( a == b ) return 0 ; if ( a . compareDocumentPosition ) return a . compareDocumentPosition ( b ) & 2 ? 1 : - 1 ; if ( goog . userAgent . IE && ! goog . userAgent . isDocumentModeOrHigher ( 9 ) ) { if ( a . nodeType == goog . dom . NodeType . DOCUMENT ) return - 1 ; if ( b . nodeType == goog . dom . NodeType . DOCUMENT ) return 1 } if ( "sourceIndex" in a || a . parentNode && "sourceIndex" in a . parentNode ) { var c = a . nodeType == goog . dom . NodeType . ELEMENT , d = b . nodeType == goog . dom . NodeType . ELEMENT ; if ( c && d ) return a . sourceIndex - b . sourceIndex ; var e = a . parentNode ,
f = b . parentNode ; return e == f ? goog . dom . compareSiblingOrder _ ( a , b ) : ! c && goog . dom . contains ( e , b ) ? - 1 * goog . dom . compareParentsDescendantNodeIe _ ( a , b ) : ! d && goog . dom . contains ( f , a ) ? goog . dom . compareParentsDescendantNodeIe _ ( b , a ) : ( c ? a . sourceIndex : e . sourceIndex ) - ( d ? b . sourceIndex : f . sourceIndex ) } d = goog . dom . getOwnerDocument ( a ) ; c = d . createRange ( ) ; c . selectNode ( a ) ; c . collapse ( ! 0 ) ; d = d . createRange ( ) ; d . selectNode ( b ) ; d . collapse ( ! 0 ) ; return c . compareBoundaryPoints ( goog . global . Range . START _TO _END , d ) } ;
goog . dom . compareParentsDescendantNodeIe _ = function ( a , b ) { var c = a . parentNode ; if ( c == b ) return - 1 ; for ( var d = b ; d . parentNode != c ; ) d = d . parentNode ; return goog . dom . compareSiblingOrder _ ( d , a ) } ; goog . dom . compareSiblingOrder _ = function ( a , b ) { for ( var c = b ; c = c . previousSibling ; ) if ( c == a ) return - 1 ; return 1 } ;
2018-01-16 21:13:23 +00:00
goog . dom . findCommonAncestor = function ( a ) { var b , c = arguments . length ; if ( ! c ) return null ; if ( 1 == c ) return arguments [ 0 ] ; var d = [ ] , e = Infinity ; for ( b = 0 ; b < c ; b ++ ) { for ( var f = [ ] , g = arguments [ b ] ; g ; ) f . unshift ( g ) , g = g . parentNode ; d . push ( f ) ; e = Math . min ( e , f . length ) } f = null ; for ( b = 0 ; b < e ; b ++ ) { g = d [ 0 ] [ b ] ; for ( var h = 1 ; h < c ; h ++ ) if ( g != d [ h ] [ b ] ) return f ; f = g } return f } ; goog . dom . getOwnerDocument = function ( a ) { goog . asserts . assert ( a , "Node cannot be null or undefined." ) ; return a . nodeType == goog . dom . NodeType . DOCUMENT ? a : a . ownerDocument || a . document } ;
2017-09-25 09:37:41 +00:00
goog . dom . getFrameContentDocument = function ( a ) { return a . contentDocument || a . contentWindow . document } ; goog . dom . getFrameContentWindow = function ( a ) { try { return a . contentWindow || ( a . contentDocument ? goog . dom . getWindow ( a . contentDocument ) : null ) } catch ( b ) { } return null } ;
2018-01-16 21:13:23 +00:00
goog . dom . setTextContent = function ( a , b ) { goog . asserts . assert ( null != a , "goog.dom.setTextContent expects a non-null value for node" ) ; if ( "textContent" in a ) a . textContent = b ; else if ( a . nodeType == goog . dom . NodeType . TEXT ) a . data = String ( b ) ; else if ( a . firstChild && a . firstChild . nodeType == goog . dom . NodeType . TEXT ) { for ( ; a . lastChild != a . firstChild ; ) a . removeChild ( a . lastChild ) ; a . firstChild . data = String ( b ) } else { goog . dom . removeChildren ( a ) ; var c = goog . dom . getOwnerDocument ( a ) ; a . appendChild ( c . createTextNode ( String ( b ) ) ) } } ;
goog . dom . getOuterHtml = function ( a ) { goog . asserts . assert ( null !== a , "goog.dom.getOuterHtml expects a non-null value for element" ) ; if ( "outerHTML" in a ) return a . outerHTML ; var b = goog . dom . getOwnerDocument ( a ) ; b = goog . dom . createElement _ ( b , "DIV" ) ; b . appendChild ( a . cloneNode ( ! 0 ) ) ; return b . innerHTML } ; goog . dom . findNode = function ( a , b ) { var c = [ ] ; return goog . dom . findNodes _ ( a , b , c , ! 0 ) ? c [ 0 ] : void 0 } ; goog . dom . findNodes = function ( a , b ) { var c = [ ] ; goog . dom . findNodes _ ( a , b , c , ! 1 ) ; return c } ;
2017-09-25 09:37:41 +00:00
goog . dom . findNodes _ = function ( a , b , c , d ) { if ( null != a ) for ( a = a . firstChild ; a ; ) { if ( b ( a ) && ( c . push ( a ) , d ) || goog . dom . findNodes _ ( a , b , c , d ) ) return ! 0 ; a = a . nextSibling } return ! 1 } ; goog . dom . TAGS _TO _IGNORE _ = { SCRIPT : 1 , STYLE : 1 , HEAD : 1 , IFRAME : 1 , OBJECT : 1 } ; goog . dom . PREDEFINED _TAG _VALUES _ = { IMG : " " , BR : "\n" } ; goog . dom . isFocusableTabIndex = function ( a ) { return goog . dom . hasSpecifiedTabIndex _ ( a ) && goog . dom . isTabIndexFocusable _ ( a ) } ; goog . dom . setFocusableTabIndex = function ( a , b ) { b ? a . tabIndex = 0 : ( a . tabIndex = - 1 , a . removeAttribute ( "tabIndex" ) ) } ;
goog . dom . isFocusable = function ( a ) { var b ; return ( b = goog . dom . nativelySupportsFocus _ ( a ) ? ! a . disabled && ( ! goog . dom . hasSpecifiedTabIndex _ ( a ) || goog . dom . isTabIndexFocusable _ ( a ) ) : goog . dom . isFocusableTabIndex ( a ) ) && goog . userAgent . IE ? goog . dom . hasNonZeroBoundingRect _ ( a ) : b } ; goog . dom . hasSpecifiedTabIndex _ = function ( a ) { return goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "9" ) ? ( a = a . getAttributeNode ( "tabindex" ) , goog . isDefAndNotNull ( a ) && a . specified ) : a . hasAttribute ( "tabindex" ) } ;
goog . dom . isTabIndexFocusable _ = function ( a ) { a = a . tabIndex ; return goog . isNumber ( a ) && 0 <= a && 32768 > a } ; goog . dom . nativelySupportsFocus _ = function ( a ) { return "A" == a . tagName || "INPUT" == a . tagName || "TEXTAREA" == a . tagName || "SELECT" == a . tagName || "BUTTON" == a . tagName } ; goog . dom . hasNonZeroBoundingRect _ = function ( a ) { a = ! goog . isFunction ( a . getBoundingClientRect ) || goog . userAgent . IE && null == a . parentElement ? { height : a . offsetHeight , width : a . offsetWidth } : a . getBoundingClientRect ( ) ; return goog . isDefAndNotNull ( a ) && 0 < a . height && 0 < a . width } ;
goog . dom . getTextContent = function ( a ) { if ( goog . dom . BrowserFeature . CAN _USE _INNER _TEXT && null !== a && "innerText" in a ) a = goog . string . canonicalizeNewlines ( a . innerText ) ; else { var b = [ ] ; goog . dom . getTextContent _ ( a , b , ! 0 ) ; a = b . join ( "" ) } a = a . replace ( / \xAD /g , " " ) . replace ( /\xAD/g , "" ) ; a = a . replace ( /\u200B/g , "" ) ; goog . dom . BrowserFeature . CAN _USE _INNER _TEXT || ( a = a . replace ( / +/g , " " ) ) ; " " != a && ( a = a . replace ( /^\s*/ , "" ) ) ; return a } ; goog . dom . getRawTextContent = function ( a ) { var b = [ ] ; goog . dom . getTextContent _ ( a , b , ! 1 ) ; return b . join ( "" ) } ;
goog . dom . getTextContent _ = function ( a , b , c ) { if ( ! ( a . nodeName in goog . dom . TAGS _TO _IGNORE _ ) ) if ( a . nodeType == goog . dom . NodeType . TEXT ) c ? b . push ( String ( a . nodeValue ) . replace ( /(\r\n|\r|\n)/g , "" ) ) : b . push ( a . nodeValue ) ; else if ( a . nodeName in goog . dom . PREDEFINED _TAG _VALUES _ ) b . push ( goog . dom . PREDEFINED _TAG _VALUES _ [ a . nodeName ] ) ; else for ( a = a . firstChild ; a ; ) goog . dom . getTextContent _ ( a , b , c ) , a = a . nextSibling } ; goog . dom . getNodeTextLength = function ( a ) { return goog . dom . getTextContent ( a ) . length } ;
goog . dom . getNodeTextOffset = function ( a , b ) { for ( var c = b || goog . dom . getOwnerDocument ( a ) . body , d = [ ] ; a && a != c ; ) { for ( var e = a ; e = e . previousSibling ; ) d . unshift ( goog . dom . getTextContent ( e ) ) ; a = a . parentNode } return goog . string . trimLeft ( d . join ( "" ) ) . replace ( / +/g , " " ) . length } ;
2018-01-16 21:13:23 +00:00
goog . dom . getNodeAtOffset = function ( a , b , c ) { a = [ a ] ; for ( var d = 0 , e = null ; 0 < a . length && d < b ; ) if ( e = a . pop ( ) , ! ( e . nodeName in goog . dom . TAGS _TO _IGNORE _ ) ) if ( e . nodeType == goog . dom . NodeType . TEXT ) { var f = e . nodeValue . replace ( /(\r\n|\r|\n)/g , "" ) . replace ( / +/g , " " ) ; d += f . length } else if ( e . nodeName in goog . dom . PREDEFINED _TAG _VALUES _ ) d += goog . dom . PREDEFINED _TAG _VALUES _ [ e . nodeName ] . length ; else for ( f = e . childNodes . length - 1 ; 0 <= f ; f -- ) a . push ( e . childNodes [ f ] ) ; goog . isObject ( c ) && ( c . remainder = e ? e . nodeValue . length + b - d - 1 : 0 , c . node = e ) ; return e } ;
2017-09-25 09:37:41 +00:00
goog . dom . isNodeList = function ( a ) { if ( a && "number" == typeof a . length ) { if ( goog . isObject ( a ) ) return "function" == typeof a . item || "string" == typeof a . item ; if ( goog . isFunction ( a ) ) return "function" == typeof a . item } return ! 1 } ; goog . dom . getAncestorByTagNameAndClass = function ( a , b , c , d ) { if ( ! b && ! c ) return null ; var e = b ? String ( b ) . toUpperCase ( ) : null ; return goog . dom . getAncestor ( a , function ( a ) { return ( ! e || a . nodeName == e ) && ( ! c || goog . isString ( a . className ) && goog . array . contains ( a . className . split ( /\s+/ ) , c ) ) } , ! 0 , d ) } ;
2018-08-17 13:32:56 +00:00
goog . dom . getAncestorByClass = function ( a , b , c ) { return goog . dom . getAncestorByTagNameAndClass ( a , null , b , c ) } ; goog . dom . getAncestor = function ( a , b , c , d ) { a && ! c && ( a = a . parentNode ) ; for ( c = 0 ; a && ( null == d || c <= d ) ; ) { goog . asserts . assert ( "parentNode" != a . name ) ; if ( b ( a ) ) return a ; a = a . parentNode ; c ++ } return null } ; goog . dom . getActiveElement = function ( a ) { try { var b = a && a . activeElement ; return b && b . nodeName ? b : null } catch ( c ) { return null } } ;
2017-09-25 09:37:41 +00:00
goog . dom . getPixelRatio = function ( ) { var a = goog . dom . getWindow ( ) ; return goog . isDef ( a . devicePixelRatio ) ? a . devicePixelRatio : a . matchMedia ? goog . dom . matchesPixelRatio _ ( 3 ) || goog . dom . matchesPixelRatio _ ( 2 ) || goog . dom . matchesPixelRatio _ ( 1.5 ) || goog . dom . matchesPixelRatio _ ( 1 ) || . 75 : 1 } ; goog . dom . matchesPixelRatio _ = function ( a ) { return goog . dom . getWindow ( ) . matchMedia ( "(min-resolution: " + a + "dppx),(min--moz-device-pixel-ratio: " + a + "),(min-resolution: " + 96 * a + "dpi)" ) . matches ? a : 0 } ; goog . dom . getCanvasContext2D = function ( a ) { return a . getContext ( "2d" ) } ;
goog . dom . DomHelper = function ( a ) { this . document _ = a || goog . global . document || document } ; goog . dom . DomHelper . prototype . getDomHelper = goog . dom . getDomHelper ; goog . dom . DomHelper . prototype . setDocument = function ( a ) { this . document _ = a } ; goog . dom . DomHelper . prototype . getDocument = function ( ) { return this . document _ } ; goog . dom . DomHelper . prototype . getElement = function ( a ) { return goog . dom . getElementHelper _ ( this . document _ , a ) } ;
goog . dom . DomHelper . prototype . getRequiredElement = function ( a ) { return goog . dom . getRequiredElementHelper _ ( this . document _ , a ) } ; goog . dom . DomHelper . prototype . $ = goog . dom . DomHelper . prototype . getElement ; goog . dom . DomHelper . prototype . getElementsByTagName = function ( a , b ) { return ( b || this . document _ ) . getElementsByTagName ( String ( a ) ) } ; goog . dom . DomHelper . prototype . getElementsByTagNameAndClass = function ( a , b , c ) { return goog . dom . getElementsByTagNameAndClass _ ( this . document _ , a , b , c ) } ;
2018-01-16 21:13:23 +00:00
goog . dom . DomHelper . prototype . getElementByTagNameAndClass = function ( a , b , c ) { return goog . dom . getElementByTagNameAndClass _ ( this . document _ , a , b , c ) } ; goog . dom . DomHelper . prototype . getElementsByClass = function ( a , b ) { return goog . dom . getElementsByClass ( a , b || this . document _ ) } ; goog . dom . DomHelper . prototype . getElementByClass = function ( a , b ) { return goog . dom . getElementByClass ( a , b || this . document _ ) } ; goog . dom . DomHelper . prototype . getRequiredElementByClass = function ( a , b ) { return goog . dom . getRequiredElementByClass ( a , b || this . document _ ) } ;
goog . dom . DomHelper . prototype . $$ = goog . dom . DomHelper . prototype . getElementsByTagNameAndClass ; goog . dom . DomHelper . prototype . setProperties = goog . dom . setProperties ; goog . dom . DomHelper . prototype . getViewportSize = function ( a ) { return goog . dom . getViewportSize ( a || this . getWindow ( ) ) } ; goog . dom . DomHelper . prototype . getDocumentHeight = function ( ) { return goog . dom . getDocumentHeight _ ( this . getWindow ( ) ) } ; goog . dom . DomHelper . prototype . createDom = function ( a , b , c ) { return goog . dom . createDom _ ( this . document _ , arguments ) } ;
goog . dom . DomHelper . prototype . $dom = goog . dom . DomHelper . prototype . createDom ; goog . dom . DomHelper . prototype . createElement = function ( a ) { return goog . dom . createElement _ ( this . document _ , a ) } ; goog . dom . DomHelper . prototype . createTextNode = function ( a ) { return this . document _ . createTextNode ( String ( a ) ) } ; goog . dom . DomHelper . prototype . createTable = function ( a , b , c ) { return goog . dom . createTable _ ( this . document _ , a , b , ! ! c ) } ; goog . dom . DomHelper . prototype . safeHtmlToNode = function ( a ) { return goog . dom . safeHtmlToNode _ ( this . document _ , a ) } ;
goog . dom . DomHelper . prototype . isCss1CompatMode = function ( ) { return goog . dom . isCss1CompatMode _ ( this . document _ ) } ; goog . dom . DomHelper . prototype . getWindow = function ( ) { return goog . dom . getWindow _ ( this . document _ ) } ; goog . dom . DomHelper . prototype . getDocumentScrollElement = function ( ) { return goog . dom . getDocumentScrollElement _ ( this . document _ ) } ; goog . dom . DomHelper . prototype . getDocumentScroll = function ( ) { return goog . dom . getDocumentScroll _ ( this . document _ ) } ;
goog . dom . DomHelper . prototype . getActiveElement = function ( a ) { return goog . dom . getActiveElement ( a || this . document _ ) } ; goog . dom . DomHelper . prototype . appendChild = goog . dom . appendChild ; goog . dom . DomHelper . prototype . append = goog . dom . append ; goog . dom . DomHelper . prototype . canHaveChildren = goog . dom . canHaveChildren ; goog . dom . DomHelper . prototype . removeChildren = goog . dom . removeChildren ; goog . dom . DomHelper . prototype . insertSiblingBefore = goog . dom . insertSiblingBefore ; goog . dom . DomHelper . prototype . insertSiblingAfter = goog . dom . insertSiblingAfter ;
goog . dom . DomHelper . prototype . insertChildAt = goog . dom . insertChildAt ; goog . dom . DomHelper . prototype . removeNode = goog . dom . removeNode ; goog . dom . DomHelper . prototype . replaceNode = goog . dom . replaceNode ; goog . dom . DomHelper . prototype . flattenElement = goog . dom . flattenElement ; goog . dom . DomHelper . prototype . getChildren = goog . dom . getChildren ; goog . dom . DomHelper . prototype . getFirstElementChild = goog . dom . getFirstElementChild ; goog . dom . DomHelper . prototype . getLastElementChild = goog . dom . getLastElementChild ;
goog . dom . DomHelper . prototype . getNextElementSibling = goog . dom . getNextElementSibling ; goog . dom . DomHelper . prototype . getPreviousElementSibling = goog . dom . getPreviousElementSibling ; goog . dom . DomHelper . prototype . getNextNode = goog . dom . getNextNode ; goog . dom . DomHelper . prototype . getPreviousNode = goog . dom . getPreviousNode ; goog . dom . DomHelper . prototype . isNodeLike = goog . dom . isNodeLike ; goog . dom . DomHelper . prototype . isElement = goog . dom . isElement ; goog . dom . DomHelper . prototype . isWindow = goog . dom . isWindow ;
goog . dom . DomHelper . prototype . getParentElement = goog . dom . getParentElement ; goog . dom . DomHelper . prototype . contains = goog . dom . contains ; goog . dom . DomHelper . prototype . compareNodeOrder = goog . dom . compareNodeOrder ; goog . dom . DomHelper . prototype . findCommonAncestor = goog . dom . findCommonAncestor ; goog . dom . DomHelper . prototype . getOwnerDocument = goog . dom . getOwnerDocument ; goog . dom . DomHelper . prototype . getFrameContentDocument = goog . dom . getFrameContentDocument ; goog . dom . DomHelper . prototype . getFrameContentWindow = goog . dom . getFrameContentWindow ;
goog . dom . DomHelper . prototype . setTextContent = goog . dom . setTextContent ; goog . dom . DomHelper . prototype . getOuterHtml = goog . dom . getOuterHtml ; goog . dom . DomHelper . prototype . findNode = goog . dom . findNode ; goog . dom . DomHelper . prototype . findNodes = goog . dom . findNodes ; goog . dom . DomHelper . prototype . isFocusableTabIndex = goog . dom . isFocusableTabIndex ; goog . dom . DomHelper . prototype . setFocusableTabIndex = goog . dom . setFocusableTabIndex ; goog . dom . DomHelper . prototype . isFocusable = goog . dom . isFocusable ;
goog . dom . DomHelper . prototype . getTextContent = goog . dom . getTextContent ; goog . dom . DomHelper . prototype . getNodeTextLength = goog . dom . getNodeTextLength ; goog . dom . DomHelper . prototype . getNodeTextOffset = goog . dom . getNodeTextOffset ; goog . dom . DomHelper . prototype . getNodeAtOffset = goog . dom . getNodeAtOffset ; goog . dom . DomHelper . prototype . isNodeList = goog . dom . isNodeList ; goog . dom . DomHelper . prototype . getAncestorByTagNameAndClass = goog . dom . getAncestorByTagNameAndClass ; goog . dom . DomHelper . prototype . getAncestorByClass = goog . dom . getAncestorByClass ;
goog . dom . DomHelper . prototype . getAncestor = goog . dom . getAncestor ; goog . dom . DomHelper . prototype . getCanvasContext2D = goog . dom . getCanvasContext2D ; goog . color = { } ;
goog . color . names = { aliceblue : "#f0f8ff" , antiquewhite : "#faebd7" , aqua : "#00ffff" , aquamarine : "#7fffd4" , azure : "#f0ffff" , beige : "#f5f5dc" , bisque : "#ffe4c4" , black : "#000000" , blanchedalmond : "#ffebcd" , blue : "#0000ff" , blueviolet : "#8a2be2" , brown : "#a52a2a" , burlywood : "#deb887" , cadetblue : "#5f9ea0" , chartreuse : "#7fff00" , chocolate : "#d2691e" , coral : "#ff7f50" , cornflowerblue : "#6495ed" , cornsilk : "#fff8dc" , crimson : "#dc143c" , cyan : "#00ffff" , darkblue : "#00008b" , darkcyan : "#008b8b" , darkgoldenrod : "#b8860b" , darkgray : "#a9a9a9" , darkgreen : "#006400" ,
darkgrey : "#a9a9a9" , darkkhaki : "#bdb76b" , darkmagenta : "#8b008b" , darkolivegreen : "#556b2f" , darkorange : "#ff8c00" , darkorchid : "#9932cc" , darkred : "#8b0000" , darksalmon : "#e9967a" , darkseagreen : "#8fbc8f" , darkslateblue : "#483d8b" , darkslategray : "#2f4f4f" , darkslategrey : "#2f4f4f" , darkturquoise : "#00ced1" , darkviolet : "#9400d3" , deeppink : "#ff1493" , deepskyblue : "#00bfff" , dimgray : "#696969" , dimgrey : "#696969" , dodgerblue : "#1e90ff" , firebrick : "#b22222" , floralwhite : "#fffaf0" , forestgreen : "#228b22" , fuchsia : "#ff00ff" , gainsboro : "#dcdcdc" ,
ghostwhite : "#f8f8ff" , gold : "#ffd700" , goldenrod : "#daa520" , gray : "#808080" , green : "#008000" , greenyellow : "#adff2f" , grey : "#808080" , honeydew : "#f0fff0" , hotpink : "#ff69b4" , indianred : "#cd5c5c" , indigo : "#4b0082" , ivory : "#fffff0" , khaki : "#f0e68c" , lavender : "#e6e6fa" , lavenderblush : "#fff0f5" , lawngreen : "#7cfc00" , lemonchiffon : "#fffacd" , lightblue : "#add8e6" , lightcoral : "#f08080" , lightcyan : "#e0ffff" , lightgoldenrodyellow : "#fafad2" , lightgray : "#d3d3d3" , lightgreen : "#90ee90" , lightgrey : "#d3d3d3" , lightpink : "#ffb6c1" , lightsalmon : "#ffa07a" ,
lightseagreen : "#20b2aa" , lightskyblue : "#87cefa" , lightslategray : "#778899" , lightslategrey : "#778899" , lightsteelblue : "#b0c4de" , lightyellow : "#ffffe0" , lime : "#00ff00" , limegreen : "#32cd32" , linen : "#faf0e6" , magenta : "#ff00ff" , maroon : "#800000" , mediumaquamarine : "#66cdaa" , mediumblue : "#0000cd" , mediumorchid : "#ba55d3" , mediumpurple : "#9370db" , mediumseagreen : "#3cb371" , mediumslateblue : "#7b68ee" , mediumspringgreen : "#00fa9a" , mediumturquoise : "#48d1cc" , mediumvioletred : "#c71585" , midnightblue : "#191970" , mintcream : "#f5fffa" , mistyrose : "#ffe4e1" ,
moccasin : "#ffe4b5" , navajowhite : "#ffdead" , navy : "#000080" , oldlace : "#fdf5e6" , olive : "#808000" , olivedrab : "#6b8e23" , orange : "#ffa500" , orangered : "#ff4500" , orchid : "#da70d6" , palegoldenrod : "#eee8aa" , palegreen : "#98fb98" , paleturquoise : "#afeeee" , palevioletred : "#db7093" , papayawhip : "#ffefd5" , peachpuff : "#ffdab9" , peru : "#cd853f" , pink : "#ffc0cb" , plum : "#dda0dd" , powderblue : "#b0e0e6" , purple : "#800080" , red : "#ff0000" , rosybrown : "#bc8f8f" , royalblue : "#4169e1" , saddlebrown : "#8b4513" , salmon : "#fa8072" , sandybrown : "#f4a460" , seagreen : "#2e8b57" ,
seashell : "#fff5ee" , sienna : "#a0522d" , silver : "#c0c0c0" , skyblue : "#87ceeb" , slateblue : "#6a5acd" , slategray : "#708090" , slategrey : "#708090" , snow : "#fffafa" , springgreen : "#00ff7f" , steelblue : "#4682b4" , tan : "#d2b48c" , teal : "#008080" , thistle : "#d8bfd8" , tomato : "#ff6347" , turquoise : "#40e0d0" , violet : "#ee82ee" , wheat : "#f5deb3" , white : "#ffffff" , whitesmoke : "#f5f5f5" , yellow : "#ffff00" , yellowgreen : "#9acd32" } ; goog . color . parse = function ( a ) { var b = { } ; a = String ( a ) ; var c = goog . color . prependHashIfNecessaryHelper ( a ) ; if ( goog . color . isValidHexColor _ ( c ) ) return b . hex = goog . color . normalizeHex ( c ) , b . type = "hex" , b ; c = goog . color . isValidRgbColor _ ( a ) ; if ( c . length ) return b . hex = goog . color . rgbArrayToHex ( c ) , b . type = "rgb" , b ; if ( goog . color . names && ( c = goog . color . names [ a . toLowerCase ( ) ] ) ) return b . hex = c , b . type = "named" , b ; throw Error ( a + " is not a valid color string" ) ; } ;
goog . color . isValidColor = function ( a ) { var b = goog . color . prependHashIfNecessaryHelper ( a ) ; return ! ! ( goog . color . isValidHexColor _ ( b ) || goog . color . isValidRgbColor _ ( a ) . length || goog . color . names && goog . color . names [ a . toLowerCase ( ) ] ) } ; goog . color . parseRgb = function ( a ) { var b = goog . color . isValidRgbColor _ ( a ) ; if ( ! b . length ) throw Error ( a + " is not a valid RGB color" ) ; return b } ; goog . color . hexToRgbStyle = function ( a ) { return goog . color . rgbStyle _ ( goog . color . hexToRgb ( a ) ) } ; goog . color . hexTripletRe _ = /#(.)(.)(.)/ ;
goog . color . normalizeHex = function ( a ) { if ( ! goog . color . isValidHexColor _ ( a ) ) throw Error ( "'" + a + "' is not a valid hex color" ) ; 4 == a . length && ( a = a . replace ( goog . color . hexTripletRe _ , "#$1$1$2$2$3$3" ) ) ; return a . toLowerCase ( ) } ; goog . color . hexToRgb = function ( a ) { a = goog . color . normalizeHex ( a ) ; var b = parseInt ( a . substr ( 1 , 2 ) , 16 ) , c = parseInt ( a . substr ( 3 , 2 ) , 16 ) ; a = parseInt ( a . substr ( 5 , 2 ) , 16 ) ; return [ b , c , a ] } ;
goog . color . rgbToHex = function ( a , b , c ) { a = Number ( a ) ; b = Number ( b ) ; c = Number ( c ) ; if ( a != ( a & 255 ) || b != ( b & 255 ) || c != ( c & 255 ) ) throw Error ( '"(' + a + "," + b + "," + c + '") is not a valid RGB color' ) ; a = goog . color . prependZeroIfNecessaryHelper ( a . toString ( 16 ) ) ; b = goog . color . prependZeroIfNecessaryHelper ( b . toString ( 16 ) ) ; c = goog . color . prependZeroIfNecessaryHelper ( c . toString ( 16 ) ) ; return "#" + a + b + c } ; goog . color . rgbArrayToHex = function ( a ) { return goog . color . rgbToHex ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ;
goog . color . rgbToHsl = function ( a , b , c ) { a /= 255 ; b /= 255 ; c /= 255 ; var d = Math . max ( a , b , c ) , e = Math . min ( a , b , c ) , f = 0 , g = 0 , h = . 5 * ( d + e ) ; d != e && ( d == a ? f = 60 * ( b - c ) / ( d - e ) : d == b ? f = 60 * ( c - a ) / ( d - e ) + 120 : d == c && ( f = 60 * ( a - b ) / ( d - e ) + 240 ) , g = 0 < h && . 5 >= h ? ( d - e ) / ( 2 * h ) : ( d - e ) / ( 2 - 2 * h ) ) ; return [ Math . round ( f + 360 ) % 360 , g , h ] } ; goog . color . rgbArrayToHsl = function ( a ) { return goog . color . rgbToHsl ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ; goog . color . hueToRgb _ = function ( a , b , c ) { 0 > c ? c += 1 : 1 < c && -- c ; return 1 > 6 * c ? a + 6 * ( b - a ) * c : 1 > 2 * c ? b : 2 > 3 * c ? a + ( b - a ) * ( 2 / 3 - c ) * 6 : a } ;
goog . color . hslToRgb = function ( a , b , c ) { a /= 360 ; if ( 0 == b ) c = b = a = 255 * c ; else { var d = . 5 > c ? c * ( 1 + b ) : c + b - b * c ; var e = 2 * c - d ; c = 255 * goog . color . hueToRgb _ ( e , d , a + 1 / 3 ) ; b = 255 * goog . color . hueToRgb _ ( e , d , a ) ; a = 255 * goog . color . hueToRgb _ ( e , d , a - 1 / 3 ) } return [ Math . round ( c ) , Math . round ( b ) , Math . round ( a ) ] } ; goog . color . hslArrayToRgb = function ( a ) { return goog . color . hslToRgb ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ; goog . color . validHexColorRe _ = /^#(?:[0-9a-f]{3}){1,2}$/i ; goog . color . isValidHexColor _ = function ( a ) { return goog . color . validHexColorRe _ . test ( a ) } ;
goog . color . normalizedHexColorRe _ = /^#[0-9a-f]{6}$/ ; goog . color . isNormalizedHexColor _ = function ( a ) { return goog . color . normalizedHexColorRe _ . test ( a ) } ; goog . color . rgbColorRe _ = /^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i ; goog . color . isValidRgbColor _ = function ( a ) { var b = a . match ( goog . color . rgbColorRe _ ) ; if ( b ) { a = Number ( b [ 1 ] ) ; var c = Number ( b [ 2 ] ) ; b = Number ( b [ 3 ] ) ; if ( 0 <= a && 255 >= a && 0 <= c && 255 >= c && 0 <= b && 255 >= b ) return [ a , c , b ] } return [ ] } ;
goog . color . prependZeroIfNecessaryHelper = function ( a ) { return 1 == a . length ? "0" + a : a } ; goog . color . prependHashIfNecessaryHelper = function ( a ) { return "#" == a . charAt ( 0 ) ? a : "#" + a } ; goog . color . rgbStyle _ = function ( a ) { return "rgb(" + a . join ( "," ) + ")" } ;
goog . color . hsvToRgb = function ( a , b , c ) { var d = 0 , e = 0 , f = 0 ; if ( 0 == b ) f = e = d = c ; else { var g = Math . floor ( a / 60 ) , h = a / 60 - g ; a = c * ( 1 - b ) ; var k = c * ( 1 - b * h ) ; b = c * ( 1 - b * ( 1 - h ) ) ; switch ( g ) { case 1 : d = k ; e = c ; f = a ; break ; case 2 : d = a ; e = c ; f = b ; break ; case 3 : d = a ; e = k ; f = c ; break ; case 4 : d = b ; e = a ; f = c ; break ; case 5 : d = c ; e = a ; f = k ; break ; case 6 : case 0 : d = c , e = b , f = a } } return [ Math . floor ( d ) , Math . floor ( e ) , Math . floor ( f ) ] } ;
goog . color . rgbToHsv = function ( a , b , c ) { var d = Math . max ( Math . max ( a , b ) , c ) , e = Math . min ( Math . min ( a , b ) , c ) ; if ( e == d ) e = a = 0 ; else { var f = d - e ; e = f / d ; a = 60 * ( a == d ? ( b - c ) / f : b == d ? 2 + ( c - a ) / f : 4 + ( a - b ) / f ) ; 0 > a && ( a += 360 ) ; 360 < a && ( a -= 360 ) } return [ a , e , d ] } ; goog . color . rgbArrayToHsv = function ( a ) { return goog . color . rgbToHsv ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ; goog . color . hsvArrayToRgb = function ( a ) { return goog . color . hsvToRgb ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ; goog . color . hexToHsl = function ( a ) { a = goog . color . hexToRgb ( a ) ; return goog . color . rgbToHsl ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ;
goog . color . hslToHex = function ( a , b , c ) { return goog . color . rgbArrayToHex ( goog . color . hslToRgb ( a , b , c ) ) } ; goog . color . hslArrayToHex = function ( a ) { return goog . color . rgbArrayToHex ( goog . color . hslToRgb ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) ) } ; goog . color . hexToHsv = function ( a ) { return goog . color . rgbArrayToHsv ( goog . color . hexToRgb ( a ) ) } ; goog . color . hsvToHex = function ( a , b , c ) { return goog . color . rgbArrayToHex ( goog . color . hsvToRgb ( a , b , c ) ) } ; goog . color . hsvArrayToHex = function ( a ) { return goog . color . hsvToHex ( a [ 0 ] , a [ 1 ] , a [ 2 ] ) } ;
goog . color . hslDistance = function ( a , b ) { var c = . 5 >= a [ 2 ] ? a [ 1 ] * a [ 2 ] : a [ 1 ] * ( 1 - a [ 2 ] ) ; var d = . 5 >= b [ 2 ] ? b [ 1 ] * b [ 2 ] : b [ 1 ] * ( 1 - b [ 2 ] ) ; return ( a [ 2 ] - b [ 2 ] ) * ( a [ 2 ] - b [ 2 ] ) + c * c + d * d - 2 * c * d * Math . cos ( 2 * ( a [ 0 ] / 360 - b [ 0 ] / 360 ) * Math . PI ) } ; goog . color . blend = function ( a , b , c ) { c = goog . math . clamp ( c , 0 , 1 ) ; return [ Math . round ( c * a [ 0 ] + ( 1 - c ) * b [ 0 ] ) , Math . round ( c * a [ 1 ] + ( 1 - c ) * b [ 1 ] ) , Math . round ( c * a [ 2 ] + ( 1 - c ) * b [ 2 ] ) ] } ; goog . color . darken = function ( a , b ) { return goog . color . blend ( [ 0 , 0 , 0 ] , a , b ) } ; goog . color . lighten = function ( a , b ) { return goog . color . blend ( [ 255 , 255 , 255 ] , a , b ) } ;
goog . color . highContrast = function ( a , b ) { for ( var c = [ ] , d = 0 ; d < b . length ; d ++ ) c . push ( { color : b [ d ] , diff : goog . color . yiqBrightnessDiff _ ( b [ d ] , a ) + goog . color . colorDiff _ ( b [ d ] , a ) } ) ; c . sort ( function ( a , b ) { return b . diff - a . diff } ) ; return c [ 0 ] . color } ; goog . color . yiqBrightness _ = function ( a ) { return Math . round ( ( 299 * a [ 0 ] + 587 * a [ 1 ] + 114 * a [ 2 ] ) / 1E3 ) } ; goog . color . yiqBrightnessDiff _ = function ( a , b ) { return Math . abs ( goog . color . yiqBrightness _ ( a ) - goog . color . yiqBrightness _ ( b ) ) } ;
2018-08-17 13:32:56 +00:00
goog . color . colorDiff _ = function ( a , b ) { return Math . abs ( a [ 0 ] - b [ 0 ] ) + Math . abs ( a [ 1 ] - b [ 1 ] ) + Math . abs ( a [ 2 ] - b [ 2 ] ) } ; goog . debug . entryPointRegistry = { } ; goog . debug . EntryPointMonitor = function ( ) { } ; goog . debug . entryPointRegistry . refList _ = [ ] ; goog . debug . entryPointRegistry . monitors _ = [ ] ; goog . debug . entryPointRegistry . monitorsMayExist _ = ! 1 ; goog . debug . entryPointRegistry . register = function ( a ) { goog . debug . entryPointRegistry . refList _ [ goog . debug . entryPointRegistry . refList _ . length ] = a ; if ( goog . debug . entryPointRegistry . monitorsMayExist _ ) for ( var b = goog . debug . entryPointRegistry . monitors _ , c = 0 ; c < b . length ; c ++ ) a ( goog . bind ( b [ c ] . wrap , b [ c ] ) ) } ;
goog . debug . entryPointRegistry . monitorAll = function ( a ) { goog . debug . entryPointRegistry . monitorsMayExist _ = ! 0 ; for ( var b = goog . bind ( a . wrap , a ) , c = 0 ; c < goog . debug . entryPointRegistry . refList _ . length ; c ++ ) goog . debug . entryPointRegistry . refList _ [ c ] ( b ) ; goog . debug . entryPointRegistry . monitors _ . push ( a ) } ;
goog . debug . entryPointRegistry . unmonitorAllIfPossible = function ( a ) { var b = goog . debug . entryPointRegistry . monitors _ ; goog . asserts . assert ( a == b [ b . length - 1 ] , "Only the most recent monitor can be unwrapped." ) ; a = goog . bind ( a . unwrap , a ) ; for ( var c = 0 ; c < goog . debug . entryPointRegistry . refList _ . length ; c ++ ) goog . debug . entryPointRegistry . refList _ [ c ] ( a ) ; b . length -- } ; goog . debug . errorcontext = { } ; goog . debug . errorcontext . addErrorContext = function ( a , b , c ) { a [ goog . debug . errorcontext . CONTEXT _KEY _ ] || ( a [ goog . debug . errorcontext . CONTEXT _KEY _ ] = { } ) ; a [ goog . debug . errorcontext . CONTEXT _KEY _ ] [ b ] = c } ; goog . debug . errorcontext . getErrorContext = function ( a ) { return a [ goog . debug . errorcontext . CONTEXT _KEY _ ] || { } } ; goog . debug . errorcontext . CONTEXT _KEY _ = "__closure__error__context__984382" ; goog . debug . LOGGING _ENABLED = goog . DEBUG ; goog . debug . FORCE _SLOPPY _STACKS = ! 1 ; goog . debug . catchErrors = function ( a , b , c ) { c = c || goog . global ; var d = c . onerror , e = ! ! b ; goog . userAgent . WEBKIT && ! goog . userAgent . isVersionOrHigher ( "535.3" ) && ( e = ! e ) ; c . onerror = function ( b , c , h , k , l ) { d && d ( b , c , h , k , l ) ; a ( { message : b , fileName : c , line : h , lineNumber : h , col : k , error : l } ) ; return e } } ;
goog . debug . expose = function ( a , b ) { if ( "undefined" == typeof a ) return "undefined" ; if ( null == a ) return "NULL" ; var c = [ ] , d ; for ( d in a ) if ( b || ! goog . isFunction ( a [ d ] ) ) { var e = d + " = " ; try { e += a [ d ] } catch ( f ) { e += "*** " + f + " ***" } c . push ( e ) } return c . join ( "\n" ) } ;
goog . debug . deepExpose = function ( a , b ) { var c = [ ] , d = [ ] , e = { } , f = function ( a , g ) { var h = g + " " ; try { if ( goog . isDef ( a ) ) if ( goog . isNull ( a ) ) c . push ( "NULL" ) ; else if ( goog . isString ( a ) ) c . push ( '"' + a . replace ( /\n/g , "\n" + g ) + '"' ) ; else if ( goog . isFunction ( a ) ) c . push ( String ( a ) . replace ( /\n/g , "\n" + g ) ) ; else if ( goog . isObject ( a ) ) { goog . hasUid ( a ) || d . push ( a ) ; var k = goog . getUid ( a ) ; if ( e [ k ] ) c . push ( "*** reference loop detected (id=" + k + ") ***" ) ; else { e [ k ] = ! 0 ; c . push ( "{" ) ; for ( var m in a ) if ( b || ! goog . isFunction ( a [ m ] ) ) c . push ( "\n" ) , c . push ( h ) , c . push ( m +
" = " ) , f ( a [ m ] , h ) ; c . push ( "\n" + g + "}" ) ; delete e [ k ] } } else c . push ( a ) ; else c . push ( "undefined" ) } catch ( p ) { c . push ( "*** " + p + " ***" ) } } ; f ( a , "" ) ; for ( var g = 0 ; g < d . length ; g ++ ) goog . removeUid ( d [ g ] ) ; return c . join ( "" ) } ; goog . debug . exposeArray = function ( a ) { for ( var b = [ ] , c = 0 ; c < a . length ; c ++ ) goog . isArray ( a [ c ] ) ? b . push ( goog . debug . exposeArray ( a [ c ] ) ) : b . push ( a [ c ] ) ; return "[ " + b . join ( ", " ) + " ]" } ;
goog . debug . normalizeErrorObject = function ( a ) { var b = goog . getObjectByName ( "window.location.href" ) ; if ( goog . isString ( a ) ) return { message : a , name : "Unknown error" , lineNumber : "Not available" , fileName : b , stack : "Not available" } ; var c = ! 1 ; try { var d = a . lineNumber || a . line || "Not available" } catch ( f ) { d = "Not available" , c = ! 0 } try { var e = a . fileName || a . filename || a . sourceURL || goog . global . $googDebugFname || b } catch ( f ) { e = "Not available" , c = ! 0 } return ! c && a . lineNumber && a . fileName && a . stack && a . message && a . name ? a : { message : a . message || "Not available" ,
name : a . name || "UnknownError" , lineNumber : d , fileName : e , stack : a . stack || "Not available" } } ; goog . debug . enhanceError = function ( a , b ) { if ( a instanceof Error ) var c = a ; else c = Error ( a ) , Error . captureStackTrace && Error . captureStackTrace ( c , goog . debug . enhanceError ) ; c . stack || ( c . stack = goog . debug . getStacktrace ( goog . debug . enhanceError ) ) ; if ( b ) { for ( var d = 0 ; c [ "message" + d ] ; ) ++ d ; c [ "message" + d ] = String ( b ) } return c } ;
goog . debug . enhanceErrorWithContext = function ( a , b ) { var c = goog . debug . enhanceError ( a ) ; if ( b ) for ( var d in b ) goog . debug . errorcontext . addErrorContext ( c , d , b [ d ] ) ; return c } ;
goog . debug . getStacktraceSimple = function ( a ) { if ( ! goog . debug . FORCE _SLOPPY _STACKS ) { var b = goog . debug . getNativeStackTrace _ ( goog . debug . getStacktraceSimple ) ; if ( b ) return b } b = [ ] ; for ( var c = arguments . callee . caller , d = 0 ; c && ( ! a || d < a ) ; ) { b . push ( goog . debug . getFunctionName ( c ) ) ; b . push ( "()\n" ) ; try { c = c . caller } catch ( e ) { b . push ( "[exception trying to get caller]\n" ) ; break } d ++ ; if ( d >= goog . debug . MAX _STACK _DEPTH ) { b . push ( "[...long stack...]" ) ; break } } a && d >= a ? b . push ( "[...reached max depth limit...]" ) : b . push ( "[end]" ) ; return b . join ( "" ) } ;
goog . debug . MAX _STACK _DEPTH = 50 ; goog . debug . getNativeStackTrace _ = function ( a ) { var b = Error ( ) ; if ( Error . captureStackTrace ) return Error . captureStackTrace ( b , a ) , String ( b . stack ) ; try { throw b ; } catch ( c ) { b = c } return ( a = b . stack ) ? String ( a ) : null } ; goog . debug . getStacktrace = function ( a ) { var b ; goog . debug . FORCE _SLOPPY _STACKS || ( b = goog . debug . getNativeStackTrace _ ( a || goog . debug . getStacktrace ) ) ; b || ( b = goog . debug . getStacktraceHelper _ ( a || arguments . callee . caller , [ ] ) ) ; return b } ;
goog . debug . getStacktraceHelper _ = function ( a , b ) { var c = [ ] ; if ( goog . array . contains ( b , a ) ) c . push ( "[...circular reference...]" ) ; else if ( a && b . length < goog . debug . MAX _STACK _DEPTH ) { c . push ( goog . debug . getFunctionName ( a ) + "(" ) ; for ( var d = a . arguments , e = 0 ; d && e < d . length ; e ++ ) { 0 < e && c . push ( ", " ) ; var f = d [ e ] ; switch ( typeof f ) { case "object" : f = f ? "object" : "null" ; break ; case "string" : break ; case "number" : f = String ( f ) ; break ; case "boolean" : f = f ? "true" : "false" ; break ; case "function" : f = ( f = goog . debug . getFunctionName ( f ) ) ? f : "[fn]" ; break ; default : f =
typeof f } 40 < f . length && ( f = f . substr ( 0 , 40 ) + "..." ) ; c . push ( f ) } b . push ( a ) ; c . push ( ")\n" ) ; try { c . push ( goog . debug . getStacktraceHelper _ ( a . caller , b ) ) } catch ( g ) { c . push ( "[exception trying to get caller]\n" ) } } else a ? c . push ( "[...long stack...]" ) : c . push ( "[end]" ) ; return c . join ( "" ) } ; goog . debug . setFunctionResolver = function ( a ) { goog . debug . fnNameResolver _ = a } ;
goog . debug . getFunctionName = function ( a ) { if ( goog . debug . fnNameCache _ [ a ] ) return goog . debug . fnNameCache _ [ a ] ; if ( goog . debug . fnNameResolver _ ) { var b = goog . debug . fnNameResolver _ ( a ) ; if ( b ) return goog . debug . fnNameCache _ [ a ] = b } a = String ( a ) ; goog . debug . fnNameCache _ [ a ] || ( b = /function ([^\(]+)/ . exec ( a ) , goog . debug . fnNameCache _ [ a ] = b ? b [ 1 ] : "[Anonymous]" ) ; return goog . debug . fnNameCache _ [ a ] } ;
goog . debug . makeWhitespaceVisible = function ( a ) { return a . replace ( / /g , "[_]" ) . replace ( /\f/g , "[f]" ) . replace ( /\n/g , "[n]\n" ) . replace ( /\r/g , "[r]" ) . replace ( /\t/g , "[t]" ) } ; goog . debug . runtimeType = function ( a ) { return a instanceof Function ? a . displayName || a . name || "unknown type name" : a instanceof Object ? a . constructor . displayName || a . constructor . name || Object . prototype . toString . call ( a ) : null === a ? "null" : typeof a } ; goog . debug . fnNameCache _ = { } ; goog . debug . freezeInternal _ = goog . DEBUG && Object . freeze || function ( a ) { return a } ;
goog . debug . freeze = function ( a ) { return goog . debug . freezeInternal _ ( a ) } ; goog . events = { } ; $jscomp . scope . purify = function ( a ) { return { valueOf : a } . valueOf ( ) } ;
goog . events . BrowserFeature = { HAS _W3C _BUTTON : ! goog . userAgent . IE || goog . userAgent . isDocumentModeOrHigher ( 9 ) , HAS _W3C _EVENT _SUPPORT : ! goog . userAgent . IE || goog . userAgent . isDocumentModeOrHigher ( 9 ) , SET _KEY _CODE _TO _PREVENT _DEFAULT : goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "9" ) , HAS _NAVIGATOR _ONLINE _PROPERTY : ! goog . userAgent . WEBKIT || goog . userAgent . isVersionOrHigher ( "528" ) , HAS _HTML5 _NETWORK _EVENT _SUPPORT : goog . userAgent . GECKO && goog . userAgent . isVersionOrHigher ( "1.9b" ) || goog . userAgent . IE && goog . userAgent . isVersionOrHigher ( "8" ) ||
goog . userAgent . OPERA && goog . userAgent . isVersionOrHigher ( "9.5" ) || goog . userAgent . WEBKIT && goog . userAgent . isVersionOrHigher ( "528" ) , HTML5 _NETWORK _EVENTS _FIRE _ON _BODY : goog . userAgent . GECKO && ! goog . userAgent . isVersionOrHigher ( "8" ) || goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "9" ) , TOUCH _ENABLED : "ontouchstart" in goog . global || ! ! ( goog . global . document && document . documentElement && "ontouchstart" in document . documentElement ) || ! ( ! goog . global . navigator || ! goog . global . navigator . maxTouchPoints && ! goog . global . navigator . msMaxTouchPoints ) ,
POINTER _EVENTS : "PointerEvent" in goog . global , MSPOINTER _EVENTS : "MSPointerEvent" in goog . global && ! ( ! goog . global . navigator || ! goog . global . navigator . msPointerEnabled ) , PASSIVE _EVENTS : ( 0 , $jscomp . scope . purify ) ( function ( ) { if ( ! goog . global . addEventListener || ! Object . defineProperty ) return ! 1 ; var a = ! 1 , b = Object . defineProperty ( { } , "passive" , { get : function ( ) { a = ! 0 } } ) ; goog . global . addEventListener ( "test" , goog . nullFunction , b ) ; goog . global . removeEventListener ( "test" , goog . nullFunction , b ) ; return a } ) } ; goog . disposable = { } ; goog . disposable . IDisposable = function ( ) { } ; goog . disposable . IDisposable . prototype . dispose = goog . abstractMethod ; goog . disposable . IDisposable . prototype . isDisposed = goog . abstractMethod ; goog . Disposable = function ( ) { goog . Disposable . MONITORING _MODE != goog . Disposable . MonitoringMode . OFF && ( goog . Disposable . INCLUDE _STACK _ON _CREATION && ( this . creationStack = Error ( ) . stack ) , goog . Disposable . instances _ [ goog . getUid ( this ) ] = this ) ; this . disposed _ = this . disposed _ ; this . onDisposeCallbacks _ = this . onDisposeCallbacks _ } ; goog . Disposable . MonitoringMode = { OFF : 0 , PERMANENT : 1 , INTERACTIVE : 2 } ; goog . Disposable . MONITORING _MODE = 0 ; goog . Disposable . INCLUDE _STACK _ON _CREATION = ! 0 ; goog . Disposable . instances _ = { } ;
goog . Disposable . getUndisposedObjects = function ( ) { var a = [ ] , b ; for ( b in goog . Disposable . instances _ ) goog . Disposable . instances _ . hasOwnProperty ( b ) && a . push ( goog . Disposable . instances _ [ Number ( b ) ] ) ; return a } ; goog . Disposable . clearUndisposedObjects = function ( ) { goog . Disposable . instances _ = { } } ; goog . Disposable . prototype . disposed _ = ! 1 ; goog . Disposable . prototype . isDisposed = function ( ) { return this . disposed _ } ; goog . Disposable . prototype . getDisposed = goog . Disposable . prototype . isDisposed ;
goog . Disposable . prototype . dispose = function ( ) { if ( ! this . disposed _ && ( this . disposed _ = ! 0 , this . disposeInternal ( ) , goog . Disposable . MONITORING _MODE != goog . Disposable . MonitoringMode . OFF ) ) { var a = goog . getUid ( this ) ; if ( goog . Disposable . MONITORING _MODE == goog . Disposable . MonitoringMode . PERMANENT && ! goog . Disposable . instances _ . hasOwnProperty ( a ) ) throw Error ( this + " did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call" ) ; if ( goog . Disposable . MONITORING _MODE != goog . Disposable . MonitoringMode . OFF &&
this . onDisposeCallbacks _ && 0 < this . onDisposeCallbacks _ . length ) throw Error ( this + " did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method." ) ; delete goog . Disposable . instances _ [ a ] } } ; goog . Disposable . prototype . registerDisposable = function ( a ) { this . addOnDisposeCallback ( goog . partial ( goog . dispose , a ) ) } ;
goog . Disposable . prototype . addOnDisposeCallback = function ( a , b ) { this . disposed _ ? goog . isDef ( b ) ? a . call ( b ) : a ( ) : ( this . onDisposeCallbacks _ || ( this . onDisposeCallbacks _ = [ ] ) , this . onDisposeCallbacks _ . push ( goog . isDef ( b ) ? goog . bind ( a , b ) : a ) ) } ; goog . Disposable . prototype . disposeInternal = function ( ) { if ( this . onDisposeCallbacks _ ) for ( ; this . onDisposeCallbacks _ . length ; ) this . onDisposeCallbacks _ . shift ( ) ( ) } ; goog . Disposable . isDisposed = function ( a ) { return a && "function" == typeof a . isDisposed ? a . isDisposed ( ) : ! 1 } ;
goog . dispose = function ( a ) { a && "function" == typeof a . dispose && a . dispose ( ) } ; goog . disposeAll = function ( a ) { for ( var b = 0 , c = arguments . length ; b < c ; ++ b ) { var d = arguments [ b ] ; goog . isArrayLike ( d ) ? goog . disposeAll . apply ( null , d ) : goog . dispose ( d ) } } ; goog . events . EventId = function ( a ) { this . id = a } ; goog . events . EventId . prototype . toString = function ( ) { return this . id } ; goog . events . Event = function ( a , b ) { this . type = a instanceof goog . events . EventId ? String ( a ) : a ; this . currentTarget = this . target = b ; this . defaultPrevented = this . propagationStopped _ = ! 1 ; this . returnValue _ = ! 0 } ; goog . events . Event . prototype . stopPropagation = function ( ) { this . propagationStopped _ = ! 0 } ; goog . events . Event . prototype . preventDefault = function ( ) { this . defaultPrevented = ! 0 ; this . returnValue _ = ! 1 } ; goog . events . Event . stopPropagation = function ( a ) { a . stopPropagation ( ) } ; goog . events . Event . preventDefault = function ( a ) { a . preventDefault ( ) } ; goog . events . getVendorPrefixedName _ = function ( a ) { return goog . userAgent . WEBKIT ? "webkit" + a : goog . userAgent . OPERA ? "o" + a . toLowerCase ( ) : a . toLowerCase ( ) } ;
goog . events . EventType = { CLICK : "click" , RIGHTCLICK : "rightclick" , DBLCLICK : "dblclick" , MOUSEDOWN : "mousedown" , MOUSEUP : "mouseup" , MOUSEOVER : "mouseover" , MOUSEOUT : "mouseout" , MOUSEMOVE : "mousemove" , MOUSEENTER : "mouseenter" , MOUSELEAVE : "mouseleave" , MOUSECANCEL : "mousecancel" , SELECTIONCHANGE : "selectionchange" , SELECTSTART : "selectstart" , WHEEL : "wheel" , KEYPRESS : "keypress" , KEYDOWN : "keydown" , KEYUP : "keyup" , BLUR : "blur" , FOCUS : "focus" , DEACTIVATE : "deactivate" , FOCUSIN : "focusin" , FOCUSOUT : "focusout" , CHANGE : "change" , RESET : "reset" ,
SELECT : "select" , SUBMIT : "submit" , INPUT : "input" , PROPERTYCHANGE : "propertychange" , DRAGSTART : "dragstart" , DRAG : "drag" , DRAGENTER : "dragenter" , DRAGOVER : "dragover" , DRAGLEAVE : "dragleave" , DROP : "drop" , DRAGEND : "dragend" , TOUCHSTART : "touchstart" , TOUCHMOVE : "touchmove" , TOUCHEND : "touchend" , TOUCHCANCEL : "touchcancel" , BEFOREUNLOAD : "beforeunload" , CONSOLEMESSAGE : "consolemessage" , CONTEXTMENU : "contextmenu" , DEVICECHANGE : "devicechange" , DEVICEMOTION : "devicemotion" , DEVICEORIENTATION : "deviceorientation" , DOMCONTENTLOADED : "DOMContentLoaded" ,
ERROR : "error" , HELP : "help" , LOAD : "load" , LOSECAPTURE : "losecapture" , ORIENTATIONCHANGE : "orientationchange" , READYSTATECHANGE : "readystatechange" , RESIZE : "resize" , SCROLL : "scroll" , UNLOAD : "unload" , CANPLAY : "canplay" , CANPLAYTHROUGH : "canplaythrough" , DURATIONCHANGE : "durationchange" , EMPTIED : "emptied" , ENDED : "ended" , LOADEDDATA : "loadeddata" , LOADEDMETADATA : "loadedmetadata" , PAUSE : "pause" , PLAY : "play" , PLAYING : "playing" , RATECHANGE : "ratechange" , SEEKED : "seeked" , SEEKING : "seeking" , STALLED : "stalled" , SUSPEND : "suspend" , TIMEUPDATE : "timeupdate" ,
VOLUMECHANGE : "volumechange" , WAITING : "waiting" , SOURCEOPEN : "sourceopen" , SOURCEENDED : "sourceended" , SOURCECLOSED : "sourceclosed" , ABORT : "abort" , UPDATE : "update" , UPDATESTART : "updatestart" , UPDATEEND : "updateend" , HASHCHANGE : "hashchange" , PAGEHIDE : "pagehide" , PAGESHOW : "pageshow" , POPSTATE : "popstate" , COPY : "copy" , PASTE : "paste" , CUT : "cut" , BEFORECOPY : "beforecopy" , BEFORECUT : "beforecut" , BEFOREPASTE : "beforepaste" , ONLINE : "online" , OFFLINE : "offline" , MESSAGE : "message" , CONNECT : "connect" , INSTALL : "install" , ACTIVATE : "activate" ,
FETCH : "fetch" , FOREIGNFETCH : "foreignfetch" , MESSAGEERROR : "messageerror" , STATECHANGE : "statechange" , UPDATEFOUND : "updatefound" , CONTROLLERCHANGE : "controllerchange" , ANIMATIONSTART : goog . events . getVendorPrefixedName _ ( "AnimationStart" ) , ANIMATIONEND : goog . events . getVendorPrefixedName _ ( "AnimationEnd" ) , ANIMATIONITERATION : goog . events . getVendorPrefixedName _ ( "AnimationIteration" ) , TRANSITIONEND : goog . events . getVendorPrefixedName _ ( "TransitionEnd" ) , POINTERDOWN : "pointerdown" , POINTERUP : "pointerup" , POINTERCANCEL : "pointercancel" ,
POINTERMOVE : "pointermove" , POINTEROVER : "pointerover" , POINTEROUT : "pointerout" , POINTERENTER : "pointerenter" , POINTERLEAVE : "pointerleave" , GOTPOINTERCAPTURE : "gotpointercapture" , LOSTPOINTERCAPTURE : "lostpointercapture" , MSGESTURECHANGE : "MSGestureChange" , MSGESTUREEND : "MSGestureEnd" , MSGESTUREHOLD : "MSGestureHold" , MSGESTURESTART : "MSGestureStart" , MSGESTURETAP : "MSGestureTap" , MSGOTPOINTERCAPTURE : "MSGotPointerCapture" , MSINERTIASTART : "MSInertiaStart" , MSLOSTPOINTERCAPTURE : "MSLostPointerCapture" , MSPOINTERCANCEL : "MSPointerCancel" ,
MSPOINTERDOWN : "MSPointerDown" , MSPOINTERENTER : "MSPointerEnter" , MSPOINTERHOVER : "MSPointerHover" , MSPOINTERLEAVE : "MSPointerLeave" , MSPOINTERMOVE : "MSPointerMove" , MSPOINTEROUT : "MSPointerOut" , MSPOINTEROVER : "MSPointerOver" , MSPOINTERUP : "MSPointerUp" , TEXT : "text" , TEXTINPUT : goog . userAgent . IE ? "textinput" : "textInput" , COMPOSITIONSTART : "compositionstart" , COMPOSITIONUPDATE : "compositionupdate" , COMPOSITIONEND : "compositionend" , BEFOREINPUT : "beforeinput" , EXIT : "exit" , LOADABORT : "loadabort" , LOADCOMMIT : "loadcommit" , LOADREDIRECT : "loadredirect" ,
LOADSTART : "loadstart" , LOADSTOP : "loadstop" , RESPONSIVE : "responsive" , SIZECHANGED : "sizechanged" , UNRESPONSIVE : "unresponsive" , VISIBILITYCHANGE : "visibilitychange" , STORAGE : "storage" , DOMSUBTREEMODIFIED : "DOMSubtreeModified" , DOMNODEINSERTED : "DOMNodeInserted" , DOMNODEREMOVED : "DOMNodeRemoved" , DOMNODEREMOVEDFROMDOCUMENT : "DOMNodeRemovedFromDocument" , DOMNODEINSERTEDINTODOCUMENT : "DOMNodeInsertedIntoDocument" , DOMATTRMODIFIED : "DOMAttrModified" , DOMCHARACTERDATAMODIFIED : "DOMCharacterDataModified" , BEFOREPRINT : "beforeprint" ,
AFTERPRINT : "afterprint" , BEFOREINSTALLPROMPT : "beforeinstallprompt" , APPINSTALLED : "appinstalled" } ; goog . events . getPointerFallbackEventName _ = function ( a , b , c ) { return goog . events . BrowserFeature . POINTER _EVENTS ? a : goog . events . BrowserFeature . MSPOINTER _EVENTS ? b : c } ;
goog . events . PointerFallbackEventType = { POINTERDOWN : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTERDOWN , goog . events . EventType . MSPOINTERDOWN , goog . events . EventType . MOUSEDOWN ) , POINTERUP : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTERUP , goog . events . EventType . MSPOINTERUP , goog . events . EventType . MOUSEUP ) , POINTERCANCEL : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTERCANCEL , goog . events . EventType . MSPOINTERCANCEL , goog . events . EventType . MOUSECANCEL ) ,
POINTERMOVE : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTERMOVE , goog . events . EventType . MSPOINTERMOVE , goog . events . EventType . MOUSEMOVE ) , POINTEROVER : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTEROVER , goog . events . EventType . MSPOINTEROVER , goog . events . EventType . MOUSEOVER ) , POINTEROUT : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTEROUT , goog . events . EventType . MSPOINTEROUT , goog . events . EventType . MOUSEOUT ) , POINTERENTER : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTERENTER ,
goog . events . EventType . MSPOINTERENTER , goog . events . EventType . MOUSEENTER ) , POINTERLEAVE : goog . events . getPointerFallbackEventName _ ( goog . events . EventType . POINTERLEAVE , goog . events . EventType . MSPOINTERLEAVE , goog . events . EventType . MOUSELEAVE ) } ;
goog . events . PointerAsMouseEventType = { MOUSEDOWN : goog . events . PointerFallbackEventType . POINTERDOWN , MOUSEUP : goog . events . PointerFallbackEventType . POINTERUP , MOUSECANCEL : goog . events . PointerFallbackEventType . POINTERCANCEL , MOUSEMOVE : goog . events . PointerFallbackEventType . POINTERMOVE , MOUSEOVER : goog . events . PointerFallbackEventType . POINTEROVER , MOUSEOUT : goog . events . PointerFallbackEventType . POINTEROUT , MOUSEENTER : goog . events . PointerFallbackEventType . POINTERENTER , MOUSELEAVE : goog . events . PointerFallbackEventType . POINTERLEAVE } ; goog . events . BrowserEvent = function ( a , b ) { goog . events . Event . call ( this , a ? a . type : "" ) ; this . relatedTarget = this . currentTarget = this . target = null ; this . button = this . screenY = this . screenX = this . clientY = this . clientX = this . offsetY = this . offsetX = 0 ; this . key = "" ; this . charCode = this . keyCode = 0 ; this . metaKey = this . shiftKey = this . altKey = this . ctrlKey = ! 1 ; this . state = null ; this . platformModifierKey = ! 1 ; this . pointerId = 0 ; this . pointerType = "" ; this . event _ = null ; a && this . init ( a , b ) } ; goog . inherits ( goog . events . BrowserEvent , goog . events . Event ) ;
goog . events . BrowserEvent . MouseButton = { LEFT : 0 , MIDDLE : 1 , RIGHT : 2 } ; goog . events . BrowserEvent . PointerType = { MOUSE : "mouse" , PEN : "pen" , TOUCH : "touch" } ; goog . events . BrowserEvent . IEButtonMap = goog . debug . freeze ( [ 1 , 4 , 2 ] ) ; goog . events . BrowserEvent . IE _BUTTON _MAP = goog . events . BrowserEvent . IEButtonMap ; goog . events . BrowserEvent . IE _POINTER _TYPE _MAP = goog . debug . freeze ( { 2 : goog . events . BrowserEvent . PointerType . TOUCH , 3 : goog . events . BrowserEvent . PointerType . PEN , 4 : goog . events . BrowserEvent . PointerType . MOUSE } ) ;
goog . events . BrowserEvent . prototype . init = function ( a , b ) { var c = this . type = a . type , d = a . changedTouches ? a . changedTouches [ 0 ] : null ; this . target = a . target || a . srcElement ; this . currentTarget = b ; var e = a . relatedTarget ; e ? goog . userAgent . GECKO && ( goog . reflect . canAccessProperty ( e , "nodeName" ) || ( e = null ) ) : c == goog . events . EventType . MOUSEOVER ? e = a . fromElement : c == goog . events . EventType . MOUSEOUT && ( e = a . toElement ) ; this . relatedTarget = e ; goog . isNull ( d ) ? ( this . offsetX = goog . userAgent . WEBKIT || void 0 !== a . offsetX ? a . offsetX : a . layerX , this . offsetY =
goog . userAgent . WEBKIT || void 0 !== a . offsetY ? a . offsetY : a . layerY , this . clientX = void 0 !== a . clientX ? a . clientX : a . pageX , this . clientY = void 0 !== a . clientY ? a . clientY : a . pageY , this . screenX = a . screenX || 0 , this . screenY = a . screenY || 0 ) : ( this . clientX = void 0 !== d . clientX ? d . clientX : d . pageX , this . clientY = void 0 !== d . clientY ? d . clientY : d . pageY , this . screenX = d . screenX || 0 , this . screenY = d . screenY || 0 ) ; this . button = a . button ; this . keyCode = a . keyCode || 0 ; this . key = a . key || "" ; this . charCode = a . charCode || ( "keypress" == c ? a . keyCode : 0 ) ; this . ctrlKey =
a . ctrlKey ; this . altKey = a . altKey ; this . shiftKey = a . shiftKey ; this . metaKey = a . metaKey ; this . platformModifierKey = goog . userAgent . MAC ? a . metaKey : a . ctrlKey ; this . pointerId = a . pointerId || 0 ; this . pointerType = goog . events . BrowserEvent . getPointerType _ ( a ) ; this . state = a . state ; this . event _ = a ; a . defaultPrevented && this . preventDefault ( ) } ;
goog . events . BrowserEvent . prototype . isButton = function ( a ) { return goog . events . BrowserFeature . HAS _W3C _BUTTON ? this . event _ . button == a : "click" == this . type ? a == goog . events . BrowserEvent . MouseButton . LEFT : ! ! ( this . event _ . button & goog . events . BrowserEvent . IE _BUTTON _MAP [ a ] ) } ; goog . events . BrowserEvent . prototype . isMouseActionButton = function ( ) { return this . isButton ( goog . events . BrowserEvent . MouseButton . LEFT ) && ! ( goog . userAgent . WEBKIT && goog . userAgent . MAC && this . ctrlKey ) } ;
goog . events . BrowserEvent . prototype . stopPropagation = function ( ) { goog . events . BrowserEvent . superClass _ . stopPropagation . call ( this ) ; this . event _ . stopPropagation ? this . event _ . stopPropagation ( ) : this . event _ . cancelBubble = ! 0 } ;
goog . events . BrowserEvent . prototype . preventDefault = function ( ) { goog . events . BrowserEvent . superClass _ . preventDefault . call ( this ) ; var a = this . event _ ; if ( a . preventDefault ) a . preventDefault ( ) ; else if ( a . returnValue = ! 1 , goog . events . BrowserFeature . SET _KEY _CODE _TO _PREVENT _DEFAULT ) try { if ( a . ctrlKey || 112 <= a . keyCode && 123 >= a . keyCode ) a . keyCode = - 1 } catch ( b ) { } } ; goog . events . BrowserEvent . prototype . getBrowserEvent = function ( ) { return this . event _ } ;
goog . events . BrowserEvent . getPointerType _ = function ( a ) { return goog . isString ( a . pointerType ) ? a . pointerType : goog . events . BrowserEvent . IE _POINTER _TYPE _MAP [ a . pointerType ] || "" } ; goog . events . Listenable = function ( ) { } ; goog . events . Listenable . IMPLEMENTED _BY _PROP = "closure_listenable_" + ( 1E6 * Math . random ( ) | 0 ) ; goog . events . Listenable . addImplementation = function ( a ) { a . prototype [ goog . events . Listenable . IMPLEMENTED _BY _PROP ] = ! 0 } ; goog . events . Listenable . isImplementedBy = function ( a ) { return ! ( ! a || ! a [ goog . events . Listenable . IMPLEMENTED _BY _PROP ] ) } ; goog . events . ListenableKey = function ( ) { } ; goog . events . ListenableKey . counter _ = 0 ; goog . events . ListenableKey . reserveKey = function ( ) { return ++ goog . events . ListenableKey . counter _ } ; goog . events . Listener = function ( a , b , c , d , e , f ) { goog . events . Listener . ENABLE _MONITORING && ( this . creationStack = Error ( ) . stack ) ; this . listener = a ; this . proxy = b ; this . src = c ; this . type = d ; this . capture = ! ! e ; this . handler = f ; this . key = goog . events . ListenableKey . reserveKey ( ) ; this . removed = this . callOnce = ! 1 } ; goog . events . Listener . ENABLE _MONITORING = ! 1 ; goog . events . Listener . prototype . markAsRemoved = function ( ) { this . removed = ! 0 ; this . handler = this . src = this . proxy = this . listener = null } ; goog . events . ListenerMap = function ( a ) { this . src = a ; this . listeners = { } ; this . typeCount _ = 0 } ; goog . events . ListenerMap . prototype . getTypeCount = function ( ) { return this . typeCount _ } ; goog . events . ListenerMap . prototype . getListenerCount = function ( ) { var a = 0 , b ; for ( b in this . listeners ) a += this . listeners [ b ] . length ; return a } ;
goog . events . ListenerMap . prototype . add = function ( a , b , c , d , e ) { var f = a . toString ( ) ; a = this . listeners [ f ] ; a || ( a = this . listeners [ f ] = [ ] , this . typeCount _ ++ ) ; var g = goog . events . ListenerMap . findListenerIndex _ ( a , b , d , e ) ; - 1 < g ? ( b = a [ g ] , c || ( b . callOnce = ! 1 ) ) : ( b = new goog . events . Listener ( b , null , this . src , f , ! ! d , e ) , b . callOnce = c , a . push ( b ) ) ; return b } ;
goog . events . ListenerMap . prototype . remove = function ( a , b , c , d ) { a = a . toString ( ) ; if ( ! ( a in this . listeners ) ) return ! 1 ; var e = this . listeners [ a ] ; b = goog . events . ListenerMap . findListenerIndex _ ( e , b , c , d ) ; return - 1 < b ? ( e [ b ] . markAsRemoved ( ) , goog . array . removeAt ( e , b ) , 0 == e . length && ( delete this . listeners [ a ] , this . typeCount _ -- ) , ! 0 ) : ! 1 } ;
goog . events . ListenerMap . prototype . removeByKey = function ( a ) { var b = a . type ; if ( ! ( b in this . listeners ) ) return ! 1 ; var c = goog . array . remove ( this . listeners [ b ] , a ) ; c && ( a . markAsRemoved ( ) , 0 == this . listeners [ b ] . length && ( delete this . listeners [ b ] , this . typeCount _ -- ) ) ; return c } ; goog . events . ListenerMap . prototype . removeAll = function ( a ) { a = a && a . toString ( ) ; var b = 0 , c ; for ( c in this . listeners ) if ( ! a || c == a ) { for ( var d = this . listeners [ c ] , e = 0 ; e < d . length ; e ++ ) ++ b , d [ e ] . markAsRemoved ( ) ; delete this . listeners [ c ] ; this . typeCount _ -- } return b } ;
goog . events . ListenerMap . prototype . getListeners = function ( a , b ) { var c = this . listeners [ a . toString ( ) ] , d = [ ] ; if ( c ) for ( var e = 0 ; e < c . length ; ++ e ) { var f = c [ e ] ; f . capture == b && d . push ( f ) } return d } ; goog . events . ListenerMap . prototype . getListener = function ( a , b , c , d ) { a = this . listeners [ a . toString ( ) ] ; var e = - 1 ; a && ( e = goog . events . ListenerMap . findListenerIndex _ ( a , b , c , d ) ) ; return - 1 < e ? a [ e ] : null } ;
goog . events . ListenerMap . prototype . hasListener = function ( a , b ) { var c = goog . isDef ( a ) , d = c ? a . toString ( ) : "" , e = goog . isDef ( b ) ; return goog . object . some ( this . listeners , function ( a , g ) { for ( var f = 0 ; f < a . length ; ++ f ) if ( ! ( c && a [ f ] . type != d || e && a [ f ] . capture != b ) ) return ! 0 ; return ! 1 } ) } ; goog . events . ListenerMap . findListenerIndex _ = function ( a , b , c , d ) { for ( var e = 0 ; e < a . length ; ++ e ) { var f = a [ e ] ; if ( ! f . removed && f . listener == b && f . capture == ! ! c && f . handler == d ) return e } return - 1 } ; goog . events . LISTENER _MAP _PROP _ = "closure_lm_" + ( 1E6 * Math . random ( ) | 0 ) ; goog . events . onString _ = "on" ; goog . events . onStringMap _ = { } ; goog . events . CaptureSimulationMode = { OFF _AND _FAIL : 0 , OFF _AND _SILENT : 1 , ON : 2 } ; goog . events . CAPTURE _SIMULATION _MODE = 2 ; goog . events . listenerCountEstimate _ = 0 ;
goog . events . listen = function ( a , b , c , d , e ) { if ( d && d . once ) return goog . events . listenOnce ( a , b , c , d , e ) ; if ( goog . isArray ( b ) ) { for ( var f = 0 ; f < b . length ; f ++ ) goog . events . listen ( a , b [ f ] , c , d , e ) ; return null } c = goog . events . wrapListener ( c ) ; return goog . events . Listenable . isImplementedBy ( a ) ? ( d = goog . isObject ( d ) ? ! ! d . capture : ! ! d , a . listen ( b , c , d , e ) ) : goog . events . listen _ ( a , b , c , ! 1 , d , e ) } ;
goog . events . listen _ = function ( a , b , c , d , e , f ) { if ( ! b ) throw Error ( "Invalid event type" ) ; var g = goog . isObject ( e ) ? ! ! e . capture : ! ! e ; if ( g && ! goog . events . BrowserFeature . HAS _W3C _EVENT _SUPPORT ) { if ( goog . events . CAPTURE _SIMULATION _MODE == goog . events . CaptureSimulationMode . OFF _AND _FAIL ) return goog . asserts . fail ( "Can not register capture listener in IE8-." ) , null ; if ( goog . events . CAPTURE _SIMULATION _MODE == goog . events . CaptureSimulationMode . OFF _AND _SILENT ) return null } var h = goog . events . getListenerMap _ ( a ) ; h || ( a [ goog . events . LISTENER _MAP _PROP _ ] =
h = new goog . events . ListenerMap ( a ) ) ; c = h . add ( b , c , d , g , f ) ; if ( c . proxy ) return c ; d = goog . events . getProxy ( ) ; c . proxy = d ; d . src = a ; d . listener = c ; if ( a . addEventListener ) goog . events . BrowserFeature . PASSIVE _EVENTS || ( e = g ) , void 0 === e && ( e = ! 1 ) , a . addEventListener ( b . toString ( ) , d , e ) ; else if ( a . attachEvent ) a . attachEvent ( goog . events . getOnString _ ( b . toString ( ) ) , d ) ; else if ( a . addListener && a . removeListener ) goog . asserts . assert ( "change" === b , "MediaQueryList only has a change event" ) , a . addListener ( d ) ; else throw Error ( "addEventListener and attachEvent are unavailable." ) ;
goog . events . listenerCountEstimate _ ++ ; return c } ; goog . events . getProxy = function ( ) { var a = goog . events . handleBrowserEvent _ , b = goog . events . BrowserFeature . HAS _W3C _EVENT _SUPPORT ? function ( c ) { return a . call ( b . src , b . listener , c ) } : function ( c ) { c = a . call ( b . src , b . listener , c ) ; if ( ! c ) return c } ; return b } ;
goog . events . listenOnce = function ( a , b , c , d , e ) { if ( goog . isArray ( b ) ) { for ( var f = 0 ; f < b . length ; f ++ ) goog . events . listenOnce ( a , b [ f ] , c , d , e ) ; return null } c = goog . events . wrapListener ( c ) ; return goog . events . Listenable . isImplementedBy ( a ) ? ( d = goog . isObject ( d ) ? ! ! d . capture : ! ! d , a . listenOnce ( b , c , d , e ) ) : goog . events . listen _ ( a , b , c , ! 0 , d , e ) } ; goog . events . listenWithWrapper = function ( a , b , c , d , e ) { b . listen ( a , c , d , e ) } ;
goog . events . unlisten = function ( a , b , c , d , e ) { if ( goog . isArray ( b ) ) { for ( var f = 0 ; f < b . length ; f ++ ) goog . events . unlisten ( a , b [ f ] , c , d , e ) ; return null } d = goog . isObject ( d ) ? ! ! d . capture : ! ! d ; c = goog . events . wrapListener ( c ) ; if ( goog . events . Listenable . isImplementedBy ( a ) ) return a . unlisten ( b , c , d , e ) ; if ( ! a ) return ! 1 ; if ( a = goog . events . getListenerMap _ ( a ) ) if ( b = a . getListener ( b , c , d , e ) ) return goog . events . unlistenByKey ( b ) ; return ! 1 } ;
goog . events . unlistenByKey = function ( a ) { if ( goog . isNumber ( a ) || ! a || a . removed ) return ! 1 ; var b = a . src ; if ( goog . events . Listenable . isImplementedBy ( b ) ) return b . unlistenByKey ( a ) ; var c = a . type , d = a . proxy ; b . removeEventListener ? b . removeEventListener ( c , d , a . capture ) : b . detachEvent ? b . detachEvent ( goog . events . getOnString _ ( c ) , d ) : b . addListener && b . removeListener && b . removeListener ( d ) ; goog . events . listenerCountEstimate _ -- ; ( c = goog . events . getListenerMap _ ( b ) ) ? ( c . removeByKey ( a ) , 0 == c . getTypeCount ( ) && ( c . src = null , b [ goog . events . LISTENER _MAP _PROP _ ] =
null ) ) : a . markAsRemoved ( ) ; return ! 0 } ; goog . events . unlistenWithWrapper = function ( a , b , c , d , e ) { b . unlisten ( a , c , d , e ) } ; goog . events . removeAll = function ( a , b ) { if ( ! a ) return 0 ; if ( goog . events . Listenable . isImplementedBy ( a ) ) return a . removeAllListeners ( b ) ; var c = goog . events . getListenerMap _ ( a ) ; if ( ! c ) return 0 ; var d = 0 , e = b && b . toString ( ) , f ; for ( f in c . listeners ) if ( ! e || f == e ) for ( var g = c . listeners [ f ] . concat ( ) , h = 0 ; h < g . length ; ++ h ) goog . events . unlistenByKey ( g [ h ] ) && ++ d ; return d } ;
goog . events . getListeners = function ( a , b , c ) { return goog . events . Listenable . isImplementedBy ( a ) ? a . getListeners ( b , c ) : a ? ( a = goog . events . getListenerMap _ ( a ) ) ? a . getListeners ( b , c ) : [ ] : [ ] } ; goog . events . getListener = function ( a , b , c , d , e ) { c = goog . events . wrapListener ( c ) ; d = ! ! d ; return goog . events . Listenable . isImplementedBy ( a ) ? a . getListener ( b , c , d , e ) : a ? ( a = goog . events . getListenerMap _ ( a ) ) ? a . getListener ( b , c , d , e ) : null : null } ;
goog . events . hasListener = function ( a , b , c ) { if ( goog . events . Listenable . isImplementedBy ( a ) ) return a . hasListener ( b , c ) ; a = goog . events . getListenerMap _ ( a ) ; return ! ! a && a . hasListener ( b , c ) } ; goog . events . expose = function ( a ) { var b = [ ] , c ; for ( c in a ) a [ c ] && a [ c ] . id ? b . push ( c + " = " + a [ c ] + " (" + a [ c ] . id + ")" ) : b . push ( c + " = " + a [ c ] ) ; return b . join ( "\n" ) } ; goog . events . getOnString _ = function ( a ) { return a in goog . events . onStringMap _ ? goog . events . onStringMap _ [ a ] : goog . events . onStringMap _ [ a ] = goog . events . onString _ + a } ;
goog . events . fireListeners = function ( a , b , c , d ) { return goog . events . Listenable . isImplementedBy ( a ) ? a . fireListeners ( b , c , d ) : goog . events . fireListeners _ ( a , b , c , d ) } ; goog . events . fireListeners _ = function ( a , b , c , d ) { var e = ! 0 ; if ( a = goog . events . getListenerMap _ ( a ) ) if ( b = a . listeners [ b . toString ( ) ] ) for ( b = b . concat ( ) , a = 0 ; a < b . length ; a ++ ) { var f = b [ a ] ; f && f . capture == c && ! f . removed && ( f = goog . events . fireListener ( f , d ) , e = e && ! 1 !== f ) } return e } ;
goog . events . fireListener = function ( a , b ) { var c = a . listener , d = a . handler || a . src ; a . callOnce && goog . events . unlistenByKey ( a ) ; return c . call ( d , b ) } ; goog . events . getTotalListenerCount = function ( ) { return goog . events . listenerCountEstimate _ } ; goog . events . dispatchEvent = function ( a , b ) { goog . asserts . assert ( goog . events . Listenable . isImplementedBy ( a ) , "Can not use goog.events.dispatchEvent with non-goog.events.Listenable instance." ) ; return a . dispatchEvent ( b ) } ;
goog . events . protectBrowserEventEntryPoint = function ( a ) { goog . events . handleBrowserEvent _ = a . protectEntryPoint ( goog . events . handleBrowserEvent _ ) } ;
goog . events . handleBrowserEvent _ = function ( a , b ) { if ( a . removed ) return ! 0 ; if ( ! goog . events . BrowserFeature . HAS _W3C _EVENT _SUPPORT ) { var c = b || goog . getObjectByName ( "window.event" ) , d = new goog . events . BrowserEvent ( c , this ) , e = ! 0 ; if ( goog . events . CAPTURE _SIMULATION _MODE == goog . events . CaptureSimulationMode . ON ) { if ( ! goog . events . isMarkedIeEvent _ ( c ) ) { goog . events . markIeEvent _ ( c ) ; c = [ ] ; for ( var f = d . currentTarget ; f ; f = f . parentNode ) c . push ( f ) ; f = a . type ; for ( var g = c . length - 1 ; ! d . propagationStopped _ && 0 <= g ; g -- ) { d . currentTarget = c [ g ] ; var h =
goog . events . fireListeners _ ( c [ g ] , f , ! 0 , d ) ; e = e && h } for ( g = 0 ; ! d . propagationStopped _ && g < c . length ; g ++ ) d . currentTarget = c [ g ] , h = goog . events . fireListeners _ ( c [ g ] , f , ! 1 , d ) , e = e && h } } else e = goog . events . fireListener ( a , d ) ; return e } return goog . events . fireListener ( a , new goog . events . BrowserEvent ( b , this ) ) } ; goog . events . markIeEvent _ = function ( a ) { var b = ! 1 ; if ( 0 == a . keyCode ) try { a . keyCode = - 1 ; return } catch ( c ) { b = ! 0 } if ( b || void 0 == a . returnValue ) a . returnValue = ! 0 } ; goog . events . isMarkedIeEvent _ = function ( a ) { return 0 > a . keyCode || void 0 != a . returnValue } ;
goog . events . uniqueIdCounter _ = 0 ; goog . events . getUniqueId = function ( a ) { return a + "_" + goog . events . uniqueIdCounter _ ++ } ; goog . events . getListenerMap _ = function ( a ) { a = a [ goog . events . LISTENER _MAP _PROP _ ] ; return a instanceof goog . events . ListenerMap ? a : null } ; goog . events . LISTENER _WRAPPER _PROP _ = "__closure_events_fn_" + ( 1E9 * Math . random ( ) >>> 0 ) ;
goog . events . wrapListener = function ( a ) { goog . asserts . assert ( a , "Listener can not be null." ) ; if ( goog . isFunction ( a ) ) return a ; goog . asserts . assert ( a . handleEvent , "An object listener must have handleEvent method." ) ; a [ goog . events . LISTENER _WRAPPER _PROP _ ] || ( a [ goog . events . LISTENER _WRAPPER _PROP _ ] = function ( b ) { return a . handleEvent ( b ) } ) ; return a [ goog . events . LISTENER _WRAPPER _PROP _ ] } ; goog . debug . entryPointRegistry . register ( function ( a ) { goog . events . handleBrowserEvent _ = a ( goog . events . handleBrowserEvent _ ) } ) ; goog . dom . vendor = { } ; goog . dom . vendor . getVendorJsPrefix = function ( ) { return goog . userAgent . WEBKIT ? "Webkit" : goog . userAgent . GECKO ? "Moz" : goog . userAgent . IE ? "ms" : goog . userAgent . OPERA ? "O" : null } ; goog . dom . vendor . getVendorPrefix = function ( ) { return goog . userAgent . WEBKIT ? "-webkit" : goog . userAgent . GECKO ? "-moz" : goog . userAgent . IE ? "-ms" : goog . userAgent . OPERA ? "-o" : null } ;
2018-01-16 21:13:23 +00:00
goog . dom . vendor . getPrefixedPropertyName = function ( a , b ) { if ( b && a in b ) return a ; var c = goog . dom . vendor . getVendorJsPrefix ( ) ; return c ? ( c = c . toLowerCase ( ) , c += goog . string . toTitleCase ( a ) , ! goog . isDef ( b ) || c in b ? c : null ) : null } ; goog . dom . vendor . getPrefixedEventType = function ( a ) { return ( ( goog . dom . vendor . getVendorJsPrefix ( ) || "" ) + a ) . toLowerCase ( ) } ; goog . math . Box = function ( a , b , c , d ) { this . top = a ; this . right = b ; this . bottom = c ; this . left = d } ; goog . math . Box . boundingBox = function ( a ) { for ( var b = new goog . math . Box ( arguments [ 0 ] . y , arguments [ 0 ] . x , arguments [ 0 ] . y , arguments [ 0 ] . x ) , c = 1 ; c < arguments . length ; c ++ ) b . expandToIncludeCoordinate ( arguments [ c ] ) ; return b } ; goog . math . Box . prototype . getWidth = function ( ) { return this . right - this . left } ; goog . math . Box . prototype . getHeight = function ( ) { return this . bottom - this . top } ;
2017-09-25 09:37:41 +00:00
goog . math . Box . prototype . clone = function ( ) { return new goog . math . Box ( this . top , this . right , this . bottom , this . left ) } ; goog . DEBUG && ( goog . math . Box . prototype . toString = function ( ) { return "(" + this . top + "t, " + this . right + "r, " + this . bottom + "b, " + this . left + "l)" } ) ; goog . math . Box . prototype . contains = function ( a ) { return goog . math . Box . contains ( this , a ) } ;
goog . math . Box . prototype . expand = function ( a , b , c , d ) { goog . isObject ( a ) ? ( this . top -= a . top , this . right += a . right , this . bottom += a . bottom , this . left -= a . left ) : ( this . top -= a , this . right += Number ( b ) , this . bottom += Number ( c ) , this . left -= Number ( d ) ) ; return this } ; goog . math . Box . prototype . expandToInclude = function ( a ) { this . left = Math . min ( this . left , a . left ) ; this . top = Math . min ( this . top , a . top ) ; this . right = Math . max ( this . right , a . right ) ; this . bottom = Math . max ( this . bottom , a . bottom ) } ;
goog . math . Box . prototype . expandToIncludeCoordinate = function ( a ) { this . top = Math . min ( this . top , a . y ) ; this . right = Math . max ( this . right , a . x ) ; this . bottom = Math . max ( this . bottom , a . y ) ; this . left = Math . min ( this . left , a . x ) } ; goog . math . Box . equals = function ( a , b ) { return a == b ? ! 0 : a && b ? a . top == b . top && a . right == b . right && a . bottom == b . bottom && a . left == b . left : ! 1 } ;
goog . math . Box . contains = function ( a , b ) { return a && b ? b instanceof goog . math . Box ? b . left >= a . left && b . right <= a . right && b . top >= a . top && b . bottom <= a . bottom : b . x >= a . left && b . x <= a . right && b . y >= a . top && b . y <= a . bottom : ! 1 } ; goog . math . Box . relativePositionX = function ( a , b ) { return b . x < a . left ? b . x - a . left : b . x > a . right ? b . x - a . right : 0 } ; goog . math . Box . relativePositionY = function ( a , b ) { return b . y < a . top ? b . y - a . top : b . y > a . bottom ? b . y - a . bottom : 0 } ;
goog . math . Box . distance = function ( a , b ) { var c = goog . math . Box . relativePositionX ( a , b ) , d = goog . math . Box . relativePositionY ( a , b ) ; return Math . sqrt ( c * c + d * d ) } ; goog . math . Box . intersects = function ( a , b ) { return a . left <= b . right && b . left <= a . right && a . top <= b . bottom && b . top <= a . bottom } ; goog . math . Box . intersectsWithPadding = function ( a , b , c ) { return a . left <= b . right + c && b . left <= a . right + c && a . top <= b . bottom + c && b . top <= a . bottom + c } ;
goog . math . Box . prototype . ceil = function ( ) { this . top = Math . ceil ( this . top ) ; this . right = Math . ceil ( this . right ) ; this . bottom = Math . ceil ( this . bottom ) ; this . left = Math . ceil ( this . left ) ; return this } ; goog . math . Box . prototype . floor = function ( ) { this . top = Math . floor ( this . top ) ; this . right = Math . floor ( this . right ) ; this . bottom = Math . floor ( this . bottom ) ; this . left = Math . floor ( this . left ) ; return this } ;
goog . math . Box . prototype . round = function ( ) { this . top = Math . round ( this . top ) ; this . right = Math . round ( this . right ) ; this . bottom = Math . round ( this . bottom ) ; this . left = Math . round ( this . left ) ; return this } ; goog . math . Box . prototype . translate = function ( a , b ) { a instanceof goog . math . Coordinate ? ( this . left += a . x , this . right += a . x , this . top += a . y , this . bottom += a . y ) : ( goog . asserts . assertNumber ( a ) , this . left += a , this . right += a , goog . isNumber ( b ) && ( this . top += b , this . bottom += b ) ) ; return this } ;
goog . math . Box . prototype . scale = function ( a , b ) { var c = goog . isNumber ( b ) ? b : a ; this . left *= a ; this . right *= a ; this . top *= c ; this . bottom *= c ; return this } ; goog . math . IRect = function ( ) { } ; goog . math . Rect = function ( a , b , c , d ) { this . left = a ; this . top = b ; this . width = c ; this . height = d } ; goog . math . Rect . prototype . clone = function ( ) { return new goog . math . Rect ( this . left , this . top , this . width , this . height ) } ; goog . math . Rect . prototype . toBox = function ( ) { return new goog . math . Box ( this . top , this . left + this . width , this . top + this . height , this . left ) } ; goog . math . Rect . createFromPositionAndSize = function ( a , b ) { return new goog . math . Rect ( a . x , a . y , b . width , b . height ) } ;
goog . math . Rect . createFromBox = function ( a ) { return new goog . math . Rect ( a . left , a . top , a . right - a . left , a . bottom - a . top ) } ; goog . DEBUG && ( goog . math . Rect . prototype . toString = function ( ) { return "(" + this . left + ", " + this . top + " - " + this . width + "w x " + this . height + "h)" } ) ; goog . math . Rect . equals = function ( a , b ) { return a == b ? ! 0 : a && b ? a . left == b . left && a . width == b . width && a . top == b . top && a . height == b . height : ! 1 } ;
goog . math . Rect . prototype . intersection = function ( a ) { var b = Math . max ( this . left , a . left ) , c = Math . min ( this . left + this . width , a . left + a . width ) ; if ( b <= c ) { var d = Math . max ( this . top , a . top ) ; a = Math . min ( this . top + this . height , a . top + a . height ) ; if ( d <= a ) return this . left = b , this . top = d , this . width = c - b , this . height = a - d , ! 0 } return ! 1 } ;
goog . math . Rect . intersection = function ( a , b ) { var c = Math . max ( a . left , b . left ) , d = Math . min ( a . left + a . width , b . left + b . width ) ; if ( c <= d ) { var e = Math . max ( a . top , b . top ) , f = Math . min ( a . top + a . height , b . top + b . height ) ; if ( e <= f ) return new goog . math . Rect ( c , e , d - c , f - e ) } return null } ; goog . math . Rect . intersects = function ( a , b ) { return a . left <= b . left + b . width && b . left <= a . left + a . width && a . top <= b . top + b . height && b . top <= a . top + a . height } ; goog . math . Rect . prototype . intersects = function ( a ) { return goog . math . Rect . intersects ( this , a ) } ;
2018-01-16 21:13:23 +00:00
goog . math . Rect . difference = function ( a , b ) { var c = goog . math . Rect . intersection ( a , b ) ; if ( ! c || ! c . height || ! c . width ) return [ a . clone ( ) ] ; c = [ ] ; var d = a . top , e = a . height , f = a . left + a . width , g = a . top + a . height , h = b . left + b . width , k = b . top + b . height ; b . top > a . top && ( c . push ( new goog . math . Rect ( a . left , a . top , a . width , b . top - a . top ) ) , d = b . top , e -= b . top - a . top ) ; k < g && ( c . push ( new goog . math . Rect ( a . left , k , a . width , g - k ) ) , e = k - d ) ; b . left > a . left && c . push ( new goog . math . Rect ( a . left , d , b . left - a . left , e ) ) ; h < f && c . push ( new goog . math . Rect ( h , d , f - h , e ) ) ; return c } ;
2017-09-25 09:37:41 +00:00
goog . math . Rect . prototype . difference = function ( a ) { return goog . math . Rect . difference ( this , a ) } ; goog . math . Rect . prototype . boundingRect = function ( a ) { var b = Math . max ( this . left + this . width , a . left + a . width ) , c = Math . max ( this . top + this . height , a . top + a . height ) ; this . left = Math . min ( this . left , a . left ) ; this . top = Math . min ( this . top , a . top ) ; this . width = b - this . left ; this . height = c - this . top } ; goog . math . Rect . boundingRect = function ( a , b ) { if ( ! a || ! b ) return null ; var c = new goog . math . Rect ( a . left , a . top , a . width , a . height ) ; c . boundingRect ( b ) ; return c } ;
goog . math . Rect . prototype . contains = function ( a ) { return a instanceof goog . math . Coordinate ? a . x >= this . left && a . x <= this . left + this . width && a . y >= this . top && a . y <= this . top + this . height : this . left <= a . left && this . left + this . width >= a . left + a . width && this . top <= a . top && this . top + this . height >= a . top + a . height } ; goog . math . Rect . prototype . squaredDistance = function ( a ) { var b = a . x < this . left ? this . left - a . x : Math . max ( a . x - ( this . left + this . width ) , 0 ) ; a = a . y < this . top ? this . top - a . y : Math . max ( a . y - ( this . top + this . height ) , 0 ) ; return b * b + a * a } ;
goog . math . Rect . prototype . distance = function ( a ) { return Math . sqrt ( this . squaredDistance ( a ) ) } ; goog . math . Rect . prototype . getSize = function ( ) { return new goog . math . Size ( this . width , this . height ) } ; goog . math . Rect . prototype . getTopLeft = function ( ) { return new goog . math . Coordinate ( this . left , this . top ) } ; goog . math . Rect . prototype . getCenter = function ( ) { return new goog . math . Coordinate ( this . left + this . width / 2 , this . top + this . height / 2 ) } ;
goog . math . Rect . prototype . getBottomRight = function ( ) { return new goog . math . Coordinate ( this . left + this . width , this . top + this . height ) } ; goog . math . Rect . prototype . ceil = function ( ) { this . left = Math . ceil ( this . left ) ; this . top = Math . ceil ( this . top ) ; this . width = Math . ceil ( this . width ) ; this . height = Math . ceil ( this . height ) ; return this } ; goog . math . Rect . prototype . floor = function ( ) { this . left = Math . floor ( this . left ) ; this . top = Math . floor ( this . top ) ; this . width = Math . floor ( this . width ) ; this . height = Math . floor ( this . height ) ; return this } ;
goog . math . Rect . prototype . round = function ( ) { this . left = Math . round ( this . left ) ; this . top = Math . round ( this . top ) ; this . width = Math . round ( this . width ) ; this . height = Math . round ( this . height ) ; return this } ; goog . math . Rect . prototype . translate = function ( a , b ) { a instanceof goog . math . Coordinate ? ( this . left += a . x , this . top += a . y ) : ( this . left += goog . asserts . assertNumber ( a ) , goog . isNumber ( b ) && ( this . top += b ) ) ; return this } ;
goog . math . Rect . prototype . scale = function ( a , b ) { var c = goog . isNumber ( b ) ? b : a ; this . left *= a ; this . width *= a ; this . top *= c ; this . height *= c ; return this } ; goog . style = { } ; goog . style . setStyle = function ( a , b , c ) { if ( goog . isString ( b ) ) goog . style . setStyle _ ( a , c , b ) ; else for ( var d in b ) goog . style . setStyle _ ( a , b [ d ] , d ) } ; goog . style . setStyle _ = function ( a , b , c ) { ( c = goog . style . getVendorJsStyleName _ ( a , c ) ) && ( a . style [ c ] = b ) } ; goog . style . styleNameCache _ = { } ;
2018-01-16 21:13:23 +00:00
goog . style . getVendorJsStyleName _ = function ( a , b ) { var c = goog . style . styleNameCache _ [ b ] ; if ( ! c ) { var d = goog . string . toCamelCase ( b ) ; c = d ; void 0 === a . style [ d ] && ( d = goog . dom . vendor . getVendorJsPrefix ( ) + goog . string . toTitleCase ( d ) , void 0 !== a . style [ d ] && ( c = d ) ) ; goog . style . styleNameCache _ [ b ] = c } return c } ;
2017-09-25 09:37:41 +00:00
goog . style . getVendorStyleName _ = function ( a , b ) { var c = goog . string . toCamelCase ( b ) ; return void 0 === a . style [ c ] && ( c = goog . dom . vendor . getVendorJsPrefix ( ) + goog . string . toTitleCase ( c ) , void 0 !== a . style [ c ] ) ? goog . dom . vendor . getVendorPrefix ( ) + "-" + b : b } ; goog . style . getStyle = function ( a , b ) { var c = a . style [ goog . string . toCamelCase ( b ) ] ; return "undefined" !== typeof c ? c : a . style [ goog . style . getVendorJsStyleName _ ( a , b ) ] || "" } ;
goog . style . getComputedStyle = function ( a , b ) { var c = goog . dom . getOwnerDocument ( a ) ; return c . defaultView && c . defaultView . getComputedStyle && ( c = c . defaultView . getComputedStyle ( a , null ) ) ? c [ b ] || c . getPropertyValue ( b ) || "" : "" } ; goog . style . getCascadedStyle = function ( a , b ) { return a . currentStyle ? a . currentStyle [ b ] : null } ; goog . style . getStyle _ = function ( a , b ) { return goog . style . getComputedStyle ( a , b ) || goog . style . getCascadedStyle ( a , b ) || a . style && a . style [ b ] } ;
goog . style . getComputedBoxSizing = function ( a ) { return goog . style . getStyle _ ( a , "boxSizing" ) || goog . style . getStyle _ ( a , "MozBoxSizing" ) || goog . style . getStyle _ ( a , "WebkitBoxSizing" ) || null } ; goog . style . getComputedPosition = function ( a ) { return goog . style . getStyle _ ( a , "position" ) } ; goog . style . getBackgroundColor = function ( a ) { return goog . style . getStyle _ ( a , "backgroundColor" ) } ; goog . style . getComputedOverflowX = function ( a ) { return goog . style . getStyle _ ( a , "overflowX" ) } ;
goog . style . getComputedOverflowY = function ( a ) { return goog . style . getStyle _ ( a , "overflowY" ) } ; goog . style . getComputedZIndex = function ( a ) { return goog . style . getStyle _ ( a , "zIndex" ) } ; goog . style . getComputedTextAlign = function ( a ) { return goog . style . getStyle _ ( a , "textAlign" ) } ; goog . style . getComputedCursor = function ( a ) { return goog . style . getStyle _ ( a , "cursor" ) } ; goog . style . getComputedTransform = function ( a ) { var b = goog . style . getVendorStyleName _ ( a , "transform" ) ; return goog . style . getStyle _ ( a , b ) || goog . style . getStyle _ ( a , "transform" ) } ;
2018-01-16 21:13:23 +00:00
goog . style . setPosition = function ( a , b , c ) { if ( b instanceof goog . math . Coordinate ) { var d = b . x ; b = b . y } else d = b , b = c ; a . style . left = goog . style . getPixelStyleValue _ ( d , ! 1 ) ; a . style . top = goog . style . getPixelStyleValue _ ( b , ! 1 ) } ; goog . style . getPosition = function ( a ) { return new goog . math . Coordinate ( a . offsetLeft , a . offsetTop ) } ;
2017-09-25 09:37:41 +00:00
goog . style . getClientViewportElement = function ( a ) { a = a ? goog . dom . getOwnerDocument ( a ) : goog . dom . getDocument ( ) ; return ! goog . userAgent . IE || goog . userAgent . isDocumentModeOrHigher ( 9 ) || goog . dom . getDomHelper ( a ) . isCss1CompatMode ( ) ? a . documentElement : a . body } ; goog . style . getViewportPageOffset = function ( a ) { var b = a . body ; a = a . documentElement ; return new goog . math . Coordinate ( b . scrollLeft || a . scrollLeft , b . scrollTop || a . scrollTop ) } ;
2018-01-16 21:13:23 +00:00
goog . style . getBoundingClientRect _ = function ( a ) { try { var b = a . getBoundingClientRect ( ) } catch ( c ) { return { left : 0 , top : 0 , right : 0 , bottom : 0 } } goog . userAgent . IE && a . ownerDocument . body && ( a = a . ownerDocument , b . left -= a . documentElement . clientLeft + a . body . clientLeft , b . top -= a . documentElement . clientTop + a . body . clientTop ) ; return b } ;
2017-09-25 09:37:41 +00:00
goog . style . getOffsetParent = function ( a ) { if ( goog . userAgent . IE && ! goog . userAgent . isDocumentModeOrHigher ( 8 ) ) return goog . asserts . assert ( a && "offsetParent" in a ) , a . offsetParent ; var b = goog . dom . getOwnerDocument ( a ) , c = goog . style . getStyle _ ( a , "position" ) , d = "fixed" == c || "absolute" == c ; for ( a = a . parentNode ; a && a != b ; a = a . parentNode ) if ( a . nodeType == goog . dom . NodeType . DOCUMENT _FRAGMENT && a . host && ( a = a . host ) , c = goog . style . getStyle _ ( a , "position" ) , d = d && "static" == c && a != b . documentElement && a != b . body , ! d && ( a . scrollWidth > a . clientWidth ||
a . scrollHeight > a . clientHeight || "fixed" == c || "absolute" == c || "relative" == c ) ) return a ; return null } ;
goog . style . getVisibleRectForElement = function ( a ) { for ( var b = new goog . math . Box ( 0 , Infinity , Infinity , 0 ) , c = goog . dom . getDomHelper ( a ) , d = c . getDocument ( ) . body , e = c . getDocument ( ) . documentElement , f = c . getDocumentScrollElement ( ) ; a = goog . style . getOffsetParent ( a ) ; ) if ( ! ( goog . userAgent . IE && 0 == a . clientWidth || goog . userAgent . WEBKIT && 0 == a . clientHeight && a == d ) && a != d && a != e && "visible" != goog . style . getStyle _ ( a , "overflow" ) ) { var g = goog . style . getPageOffset ( a ) , h = goog . style . getClientLeftTop ( a ) ; g . x += h . x ; g . y += h . y ; b . top = Math . max ( b . top ,
g . y ) ; b . right = Math . min ( b . right , g . x + a . clientWidth ) ; b . bottom = Math . min ( b . bottom , g . y + a . clientHeight ) ; b . left = Math . max ( b . left , g . x ) } d = f . scrollLeft ; f = f . scrollTop ; b . left = Math . max ( b . left , d ) ; b . top = Math . max ( b . top , f ) ; c = c . getViewportSize ( ) ; b . right = Math . min ( b . right , d + c . width ) ; b . bottom = Math . min ( b . bottom , f + c . height ) ; return 0 <= b . top && 0 <= b . left && b . bottom > b . top && b . right > b . left ? b : null } ;
goog . style . getContainerOffsetToScrollInto = function ( a , b , c ) { var d = b || goog . dom . getDocumentScrollElement ( ) , e = goog . style . getPageOffset ( a ) , f = goog . style . getPageOffset ( d ) , g = goog . style . getBorderBox ( d ) ; d == goog . dom . getDocumentScrollElement ( ) ? ( b = e . x - d . scrollLeft , e = e . y - d . scrollTop , goog . userAgent . IE && ! goog . userAgent . isDocumentModeOrHigher ( 10 ) && ( b += g . left , e += g . top ) ) : ( b = e . x - f . x - g . left , e = e . y - f . y - g . top ) ; g = goog . style . getSizeWithDisplay _ ( a ) ; a = d . clientWidth - g . width ; g = d . clientHeight - g . height ; f = d . scrollLeft ; d = d . scrollTop ;
c ? ( f += b - a / 2 , d += e - g / 2 ) : ( f += Math . min ( b , Math . max ( b - a , 0 ) ) , d += Math . min ( e , Math . max ( e - g , 0 ) ) ) ; return new goog . math . Coordinate ( f , d ) } ; goog . style . scrollIntoContainerView = function ( a , b , c ) { b = b || goog . dom . getDocumentScrollElement ( ) ; a = goog . style . getContainerOffsetToScrollInto ( a , b , c ) ; b . scrollLeft = a . x ; b . scrollTop = a . y } ; goog . style . getClientLeftTop = function ( a ) { return new goog . math . Coordinate ( a . clientLeft , a . clientTop ) } ;
goog . style . getPageOffset = function ( a ) { var b = goog . dom . getOwnerDocument ( a ) ; goog . asserts . assertObject ( a , "Parameter is required" ) ; var c = new goog . math . Coordinate ( 0 , 0 ) , d = goog . style . getClientViewportElement ( b ) ; if ( a == d ) return c ; a = goog . style . getBoundingClientRect _ ( a ) ; b = goog . dom . getDomHelper ( b ) . getDocumentScroll ( ) ; c . x = a . left + b . x ; c . y = a . top + b . y ; return c } ; goog . style . getPageOffsetLeft = function ( a ) { return goog . style . getPageOffset ( a ) . x } ; goog . style . getPageOffsetTop = function ( a ) { return goog . style . getPageOffset ( a ) . y } ;
goog . style . getFramedPageOffset = function ( a , b ) { var c = new goog . math . Coordinate ( 0 , 0 ) , d = goog . dom . getWindow ( goog . dom . getOwnerDocument ( a ) ) ; if ( ! goog . reflect . canAccessProperty ( d , "parent" ) ) return c ; var e = a ; do { var f = d == b ? goog . style . getPageOffset ( e ) : goog . style . getClientPositionForElement _ ( goog . asserts . assert ( e ) ) ; c . x += f . x ; c . y += f . y } while ( d && d != b && d != d . parent && ( e = d . frameElement ) && ( d = d . parent ) ) ; return c } ;
goog . style . translateRectForAnotherFrame = function ( a , b , c ) { if ( b . getDocument ( ) != c . getDocument ( ) ) { var d = b . getDocument ( ) . body ; c = goog . style . getFramedPageOffset ( d , c . getWindow ( ) ) ; c = goog . math . Coordinate . difference ( c , goog . style . getPageOffset ( d ) ) ; ! goog . userAgent . IE || goog . userAgent . isDocumentModeOrHigher ( 9 ) || b . isCss1CompatMode ( ) || ( c = goog . math . Coordinate . difference ( c , b . getDocumentScroll ( ) ) ) ; a . left += c . x ; a . top += c . y } } ;
goog . style . getRelativePosition = function ( a , b ) { var c = goog . style . getClientPosition ( a ) , d = goog . style . getClientPosition ( b ) ; return new goog . math . Coordinate ( c . x - d . x , c . y - d . y ) } ; goog . style . getClientPositionForElement _ = function ( a ) { a = goog . style . getBoundingClientRect _ ( a ) ; return new goog . math . Coordinate ( a . left , a . top ) } ;
goog . style . getClientPosition = function ( a ) { goog . asserts . assert ( a ) ; if ( a . nodeType == goog . dom . NodeType . ELEMENT ) return goog . style . getClientPositionForElement _ ( a ) ; a = a . changedTouches ? a . changedTouches [ 0 ] : a ; return new goog . math . Coordinate ( a . clientX , a . clientY ) } ; goog . style . setPageOffset = function ( a , b , c ) { var d = goog . style . getPageOffset ( a ) ; b instanceof goog . math . Coordinate && ( c = b . y , b = b . x ) ; b = goog . asserts . assertNumber ( b ) - d . x ; goog . style . setPosition ( a , a . offsetLeft + b , a . offsetTop + ( Number ( c ) - d . y ) ) } ;
goog . style . setSize = function ( a , b , c ) { if ( b instanceof goog . math . Size ) c = b . height , b = b . width ; else if ( void 0 == c ) throw Error ( "missing height argument" ) ; goog . style . setWidth ( a , b ) ; goog . style . setHeight ( a , c ) } ; goog . style . getPixelStyleValue _ = function ( a , b ) { "number" == typeof a && ( a = ( b ? Math . round ( a ) : a ) + "px" ) ; return a } ; goog . style . setHeight = function ( a , b ) { a . style . height = goog . style . getPixelStyleValue _ ( b , ! 0 ) } ; goog . style . setWidth = function ( a , b ) { a . style . width = goog . style . getPixelStyleValue _ ( b , ! 0 ) } ;
goog . style . getSize = function ( a ) { return goog . style . evaluateWithTemporaryDisplay _ ( goog . style . getSizeWithDisplay _ , a ) } ; goog . style . evaluateWithTemporaryDisplay _ = function ( a , b ) { if ( "none" != goog . style . getStyle _ ( b , "display" ) ) return a ( b ) ; var c = b . style , d = c . display , e = c . visibility , f = c . position ; c . visibility = "hidden" ; c . position = "absolute" ; c . display = "inline" ; var g = a ( b ) ; c . display = d ; c . position = f ; c . visibility = e ; return g } ;
goog . style . getSizeWithDisplay _ = function ( a ) { var b = a . offsetWidth , c = a . offsetHeight , d = goog . userAgent . WEBKIT && ! b && ! c ; return goog . isDef ( b ) && ! d || ! a . getBoundingClientRect ? new goog . math . Size ( b , c ) : ( a = goog . style . getBoundingClientRect _ ( a ) , new goog . math . Size ( a . right - a . left , a . bottom - a . top ) ) } ; goog . style . getTransformedSize = function ( a ) { if ( ! a . getBoundingClientRect ) return null ; a = goog . style . evaluateWithTemporaryDisplay _ ( goog . style . getBoundingClientRect _ , a ) ; return new goog . math . Size ( a . right - a . left , a . bottom - a . top ) } ;
goog . style . getBounds = function ( a ) { var b = goog . style . getPageOffset ( a ) ; a = goog . style . getSize ( a ) ; return new goog . math . Rect ( b . x , b . y , a . width , a . height ) } ; goog . style . toCamelCase = function ( a ) { return goog . string . toCamelCase ( String ( a ) ) } ; goog . style . toSelectorCase = function ( a ) { return goog . string . toSelectorCase ( a ) } ;
goog . style . getOpacity = function ( a ) { goog . asserts . assert ( a ) ; var b = a . style ; a = "" ; "opacity" in b ? a = b . opacity : "MozOpacity" in b ? a = b . MozOpacity : "filter" in b && ( b = b . filter . match ( /alpha\(opacity=([\d.]+)\)/ ) ) && ( a = String ( b [ 1 ] / 100 ) ) ; return "" == a ? a : Number ( a ) } ; goog . style . setOpacity = function ( a , b ) { goog . asserts . assert ( a ) ; var c = a . style ; "opacity" in c ? c . opacity = b : "MozOpacity" in c ? c . MozOpacity = b : "filter" in c && ( c . filter = "" === b ? "" : "alpha(opacity=" + 100 * Number ( b ) + ")" ) } ;
goog . style . setTransparentBackgroundImage = function ( a , b ) { var c = a . style ; goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "8" ) ? c . filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + b + '", sizingMethod="crop")' : ( c . backgroundImage = "url(" + b + ")" , c . backgroundPosition = "top left" , c . backgroundRepeat = "no-repeat" ) } ; goog . style . clearTransparentBackgroundImage = function ( a ) { a = a . style ; "filter" in a ? a . filter = "" : a . backgroundImage = "none" } ;
2018-01-16 21:13:23 +00:00
goog . style . showElement = function ( a , b ) { goog . style . setElementShown ( a , b ) } ; goog . style . setElementShown = function ( a , b ) { a . style . display = b ? "" : "none" } ; goog . style . isElementShown = function ( a ) { return "none" != a . style . display } ;
goog . style . installSafeStyleSheet = function ( a , b ) { var c = goog . dom . getDomHelper ( b ) , d = c . getDocument ( ) ; if ( goog . userAgent . IE && d . createStyleSheet ) return c = d . createStyleSheet ( ) , goog . style . setSafeStyleSheet ( c , a ) , c ; d = c . getElementsByTagNameAndClass ( "HEAD" ) [ 0 ] ; if ( ! d ) { var e = c . getElementsByTagNameAndClass ( "BODY" ) [ 0 ] ; d = c . createDom ( "HEAD" ) ; e . parentNode . insertBefore ( d , e ) } e = c . createDom ( "STYLE" ) ; goog . style . setSafeStyleSheet ( e , a ) ; c . appendChild ( d , e ) ; return e } ;
goog . style . uninstallStyles = function ( a ) { goog . dom . removeNode ( a . ownerNode || a . owningElement || a ) } ; goog . style . setSafeStyleSheet = function ( a , b ) { var c = goog . html . SafeStyleSheet . unwrap ( b ) ; goog . userAgent . IE && goog . isDef ( a . cssText ) ? a . cssText = c : a . innerHTML = c } ; goog . style . setPreWrap = function ( a ) { a = a . style ; goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "8" ) ? ( a . whiteSpace = "pre" , a . wordWrap = "break-word" ) : a . whiteSpace = goog . userAgent . GECKO ? "-moz-pre-wrap" : "pre-wrap" } ;
goog . style . setInlineBlock = function ( a ) { a = a . style ; a . position = "relative" ; goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "8" ) ? ( a . zoom = "1" , a . display = "inline" ) : a . display = "inline-block" } ; goog . style . isRightToLeft = function ( a ) { return "rtl" == goog . style . getStyle _ ( a , "direction" ) } ; goog . style . unselectableStyle _ = goog . userAgent . GECKO ? "MozUserSelect" : goog . userAgent . WEBKIT || goog . userAgent . EDGE ? "WebkitUserSelect" : null ;
goog . style . isUnselectable = function ( a ) { return goog . style . unselectableStyle _ ? "none" == a . style [ goog . style . unselectableStyle _ ] . toLowerCase ( ) : goog . userAgent . IE || goog . userAgent . OPERA ? "on" == a . getAttribute ( "unselectable" ) : ! 1 } ;
2017-09-25 09:37:41 +00:00
goog . style . setUnselectable = function ( a , b , c ) { c = c ? null : a . getElementsByTagName ( "*" ) ; var d = goog . style . unselectableStyle _ ; if ( d ) { if ( b = b ? "none" : "" , a . style && ( a . style [ d ] = b ) , c ) { a = 0 ; for ( var e ; e = c [ a ] ; a ++ ) e . style && ( e . style [ d ] = b ) } } else if ( goog . userAgent . IE || goog . userAgent . OPERA ) if ( b = b ? "on" : "" , a . setAttribute ( "unselectable" , b ) , c ) for ( a = 0 ; e = c [ a ] ; a ++ ) e . setAttribute ( "unselectable" , b ) } ; goog . style . getBorderBoxSize = function ( a ) { return new goog . math . Size ( a . offsetWidth , a . offsetHeight ) } ;
2018-01-16 21:13:23 +00:00
goog . style . setBorderBoxSize = function ( a , b ) { var c = goog . dom . getOwnerDocument ( a ) , d = goog . dom . getDomHelper ( c ) . isCss1CompatMode ( ) ; if ( ! goog . userAgent . IE || goog . userAgent . isVersionOrHigher ( "10" ) || d && goog . userAgent . isVersionOrHigher ( "8" ) ) goog . style . setBoxSizingSize _ ( a , b , "border-box" ) ; else if ( c = a . style , d ) { d = goog . style . getPaddingBox ( a ) ; var e = goog . style . getBorderBox ( a ) ; c . pixelWidth = b . width - e . left - d . left - d . right - e . right ; c . pixelHeight = b . height - e . top - d . top - d . bottom - e . bottom } else c . pixelWidth = b . width , c . pixelHeight =
2017-09-25 09:37:41 +00:00
b . height } ;
goog . style . getContentBoxSize = function ( a ) { var b = goog . dom . getOwnerDocument ( a ) , c = goog . userAgent . IE && a . currentStyle ; if ( c && goog . dom . getDomHelper ( b ) . isCss1CompatMode ( ) && "auto" != c . width && "auto" != c . height && ! c . boxSizing ) return b = goog . style . getIePixelValue _ ( a , c . width , "width" , "pixelWidth" ) , a = goog . style . getIePixelValue _ ( a , c . height , "height" , "pixelHeight" ) , new goog . math . Size ( b , a ) ; c = goog . style . getBorderBoxSize ( a ) ; b = goog . style . getPaddingBox ( a ) ; a = goog . style . getBorderBox ( a ) ; return new goog . math . Size ( c . width - a . left -
b . left - b . right - a . right , c . height - a . top - b . top - b . bottom - a . bottom ) } ;
2018-01-16 21:13:23 +00:00
goog . style . setContentBoxSize = function ( a , b ) { var c = goog . dom . getOwnerDocument ( a ) , d = goog . dom . getDomHelper ( c ) . isCss1CompatMode ( ) ; if ( ! goog . userAgent . IE || goog . userAgent . isVersionOrHigher ( "10" ) || d && goog . userAgent . isVersionOrHigher ( "8" ) ) goog . style . setBoxSizingSize _ ( a , b , "content-box" ) ; else if ( c = a . style , d ) c . pixelWidth = b . width , c . pixelHeight = b . height ; else { d = goog . style . getPaddingBox ( a ) ; var e = goog . style . getBorderBox ( a ) ; c . pixelWidth = b . width + e . left + d . left + d . right + e . right ; c . pixelHeight = b . height + e . top + d . top + d . bottom +
2017-09-25 09:37:41 +00:00
e . bottom } } ; goog . style . setBoxSizingSize _ = function ( a , b , c ) { a = a . style ; goog . userAgent . GECKO ? a . MozBoxSizing = c : goog . userAgent . WEBKIT ? a . WebkitBoxSizing = c : a . boxSizing = c ; a . width = Math . max ( b . width , 0 ) + "px" ; a . height = Math . max ( b . height , 0 ) + "px" } ; goog . style . getIePixelValue _ = function ( a , b , c , d ) { if ( /^\d+px?$/ . test ( b ) ) return parseInt ( b , 10 ) ; var e = a . style [ c ] , f = a . runtimeStyle [ c ] ; a . runtimeStyle [ c ] = a . currentStyle [ c ] ; a . style [ c ] = b ; b = a . style [ d ] ; a . style [ c ] = e ; a . runtimeStyle [ c ] = f ; return + b } ;
goog . style . getIePixelDistance _ = function ( a , b ) { var c = goog . style . getCascadedStyle ( a , b ) ; return c ? goog . style . getIePixelValue _ ( a , c , "left" , "pixelLeft" ) : 0 } ;
goog . style . getBox _ = function ( a , b ) { if ( goog . userAgent . IE ) { var c = goog . style . getIePixelDistance _ ( a , b + "Left" ) , d = goog . style . getIePixelDistance _ ( a , b + "Right" ) , e = goog . style . getIePixelDistance _ ( a , b + "Top" ) , f = goog . style . getIePixelDistance _ ( a , b + "Bottom" ) ; return new goog . math . Box ( e , d , f , c ) } c = goog . style . getComputedStyle ( a , b + "Left" ) ; d = goog . style . getComputedStyle ( a , b + "Right" ) ; e = goog . style . getComputedStyle ( a , b + "Top" ) ; f = goog . style . getComputedStyle ( a , b + "Bottom" ) ; return new goog . math . Box ( parseFloat ( e ) , parseFloat ( d ) , parseFloat ( f ) ,
parseFloat ( c ) ) } ; goog . style . getPaddingBox = function ( a ) { return goog . style . getBox _ ( a , "padding" ) } ; goog . style . getMarginBox = function ( a ) { return goog . style . getBox _ ( a , "margin" ) } ; goog . style . ieBorderWidthKeywords _ = { thin : 2 , medium : 4 , thick : 6 } ;
goog . style . getIePixelBorder _ = function ( a , b ) { if ( "none" == goog . style . getCascadedStyle ( a , b + "Style" ) ) return 0 ; var c = goog . style . getCascadedStyle ( a , b + "Width" ) ; return c in goog . style . ieBorderWidthKeywords _ ? goog . style . ieBorderWidthKeywords _ [ c ] : goog . style . getIePixelValue _ ( a , c , "left" , "pixelLeft" ) } ;
goog . style . getBorderBox = function ( a ) { if ( goog . userAgent . IE && ! goog . userAgent . isDocumentModeOrHigher ( 9 ) ) { var b = goog . style . getIePixelBorder _ ( a , "borderLeft" ) , c = goog . style . getIePixelBorder _ ( a , "borderRight" ) , d = goog . style . getIePixelBorder _ ( a , "borderTop" ) ; a = goog . style . getIePixelBorder _ ( a , "borderBottom" ) ; return new goog . math . Box ( d , c , a , b ) } b = goog . style . getComputedStyle ( a , "borderLeftWidth" ) ; c = goog . style . getComputedStyle ( a , "borderRightWidth" ) ; d = goog . style . getComputedStyle ( a , "borderTopWidth" ) ; a = goog . style . getComputedStyle ( a ,
"borderBottomWidth" ) ; return new goog . math . Box ( parseFloat ( d ) , parseFloat ( c ) , parseFloat ( a ) , parseFloat ( b ) ) } ; goog . style . getFontFamily = function ( a ) { var b = goog . dom . getOwnerDocument ( a ) , c = "" ; if ( b . body . createTextRange && goog . dom . contains ( b , a ) ) { b = b . body . createTextRange ( ) ; b . moveToElementText ( a ) ; try { c = b . queryCommandValue ( "FontName" ) } catch ( d ) { c = "" } } c || ( c = goog . style . getStyle _ ( a , "fontFamily" ) ) ; a = c . split ( "," ) ; 1 < a . length && ( c = a [ 0 ] ) ; return goog . string . stripQuotes ( c , "\"'" ) } ; goog . style . lengthUnitRegex _ = /[^\d]+$/ ;
goog . style . getLengthUnits = function ( a ) { return ( a = a . match ( goog . style . lengthUnitRegex _ ) ) && a [ 0 ] || null } ; goog . style . ABSOLUTE _CSS _LENGTH _UNITS _ = { cm : 1 , "in" : 1 , mm : 1 , pc : 1 , pt : 1 } ; goog . style . CONVERTIBLE _RELATIVE _CSS _UNITS _ = { em : 1 , ex : 1 } ;
goog . style . getFontSize = function ( a ) { var b = goog . style . getStyle _ ( a , "fontSize" ) , c = goog . style . getLengthUnits ( b ) ; if ( b && "px" == c ) return parseInt ( b , 10 ) ; if ( goog . userAgent . IE ) { if ( String ( c ) in goog . style . ABSOLUTE _CSS _LENGTH _UNITS _ ) return goog . style . getIePixelValue _ ( a , b , "left" , "pixelLeft" ) ; if ( a . parentNode && a . parentNode . nodeType == goog . dom . NodeType . ELEMENT && String ( c ) in goog . style . CONVERTIBLE _RELATIVE _CSS _UNITS _ ) return a = a . parentNode , c = goog . style . getStyle _ ( a , "fontSize" ) , goog . style . getIePixelValue _ ( a , b == c ? "1em" : b ,
2018-01-16 21:13:23 +00:00
"left" , "pixelLeft" ) } c = goog . dom . createDom ( "SPAN" , { style : "visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;" } ) ; goog . dom . appendChild ( a , c ) ; b = c . offsetHeight ; goog . dom . removeNode ( c ) ; return b } ; goog . style . parseStyleAttribute = function ( a ) { var b = { } ; goog . array . forEach ( a . split ( /\s*;\s*/ ) , function ( a ) { var c = a . match ( /\s*([\w-]+)\s*:(.+)/ ) ; c && ( a = c [ 1 ] , c = goog . string . trim ( c [ 2 ] ) , b [ goog . string . toCamelCase ( a . toLowerCase ( ) ) ] = c ) } ) ; return b } ;
2017-09-25 09:37:41 +00:00
goog . style . toStyleAttribute = function ( a ) { var b = [ ] ; goog . object . forEach ( a , function ( a , d ) { b . push ( goog . string . toSelectorCase ( d ) , ":" , a , ";" ) } ) ; return b . join ( "" ) } ; goog . style . setFloat = function ( a , b ) { a . style [ goog . userAgent . IE ? "styleFloat" : "cssFloat" ] = b } ; goog . style . getFloat = function ( a ) { return a . style [ goog . userAgent . IE ? "styleFloat" : "cssFloat" ] || "" } ;
goog . style . getScrollbarWidth = function ( a ) { var b = goog . dom . createElement ( "DIV" ) ; a && ( b . className = a ) ; b . style . cssText = "overflow:auto;position:absolute;top:0;width:100px;height:100px" ; a = goog . dom . createElement ( "DIV" ) ; goog . style . setSize ( a , "200px" , "200px" ) ; b . appendChild ( a ) ; goog . dom . appendChild ( goog . dom . getDocument ( ) . body , b ) ; a = b . offsetWidth - b . clientWidth ; goog . dom . removeNode ( b ) ; return a } ; goog . style . MATRIX _TRANSLATION _REGEX _ = /matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/ ;
2018-01-16 21:13:23 +00:00
goog . style . getCssTranslation = function ( a ) { a = goog . style . getComputedTransform ( a ) ; return a ? ( a = a . match ( goog . style . MATRIX _TRANSLATION _REGEX _ ) ) ? new goog . math . Coordinate ( parseFloat ( a [ 1 ] ) , parseFloat ( a [ 2 ] ) ) : new goog . math . Coordinate ( 0 , 0 ) : new goog . math . Coordinate ( 0 , 0 ) } ; goog . events . EventHandler = function ( a ) { goog . Disposable . call ( this ) ; this . handler _ = a ; this . keys _ = { } } ; goog . inherits ( goog . events . EventHandler , goog . Disposable ) ; goog . events . EventHandler . typeArray _ = [ ] ; goog . events . EventHandler . prototype . listen = function ( a , b , c , d ) { return this . listen _ ( a , b , c , d ) } ; goog . events . EventHandler . prototype . listenWithScope = function ( a , b , c , d , e ) { return this . listen _ ( a , b , c , d , e ) } ;
2017-09-25 09:37:41 +00:00
goog . events . EventHandler . prototype . listen _ = function ( a , b , c , d , e ) { goog . isArray ( b ) || ( b && ( goog . events . EventHandler . typeArray _ [ 0 ] = b . toString ( ) ) , b = goog . events . EventHandler . typeArray _ ) ; for ( var f = 0 ; f < b . length ; f ++ ) { var g = goog . events . listen ( a , b [ f ] , c || this . handleEvent , d || ! 1 , e || this . handler _ || this ) ; if ( ! g ) break ; this . keys _ [ g . key ] = g } return this } ; goog . events . EventHandler . prototype . listenOnce = function ( a , b , c , d ) { return this . listenOnce _ ( a , b , c , d ) } ;
goog . events . EventHandler . prototype . listenOnceWithScope = function ( a , b , c , d , e ) { return this . listenOnce _ ( a , b , c , d , e ) } ; goog . events . EventHandler . prototype . listenOnce _ = function ( a , b , c , d , e ) { if ( goog . isArray ( b ) ) for ( var f = 0 ; f < b . length ; f ++ ) this . listenOnce _ ( a , b [ f ] , c , d , e ) ; else { a = goog . events . listenOnce ( a , b , c || this . handleEvent , d , e || this . handler _ || this ) ; if ( ! a ) return this ; this . keys _ [ a . key ] = a } return this } ; goog . events . EventHandler . prototype . listenWithWrapper = function ( a , b , c , d ) { return this . listenWithWrapper _ ( a , b , c , d ) } ;
goog . events . EventHandler . prototype . listenWithWrapperAndScope = function ( a , b , c , d , e ) { return this . listenWithWrapper _ ( a , b , c , d , e ) } ; goog . events . EventHandler . prototype . listenWithWrapper _ = function ( a , b , c , d , e ) { b . listen ( a , c , d , e || this . handler _ || this , this ) ; return this } ; goog . events . EventHandler . prototype . getListenerCount = function ( ) { var a = 0 , b ; for ( b in this . keys _ ) Object . prototype . hasOwnProperty . call ( this . keys _ , b ) && a ++ ; return a } ;
2018-01-16 21:13:23 +00:00
goog . events . EventHandler . prototype . unlisten = function ( a , b , c , d , e ) { if ( goog . isArray ( b ) ) for ( var f = 0 ; f < b . length ; f ++ ) this . unlisten ( a , b [ f ] , c , d , e ) ; else if ( d = goog . isObject ( d ) ? ! ! d . capture : ! ! d , a = goog . events . getListener ( a , b , c || this . handleEvent , d , e || this . handler _ || this ) ) goog . events . unlistenByKey ( a ) , delete this . keys _ [ a . key ] ; return this } ; goog . events . EventHandler . prototype . unlistenWithWrapper = function ( a , b , c , d , e ) { b . unlisten ( a , c , d , e || this . handler _ || this , this ) ; return this } ;
2018-08-17 13:32:56 +00:00
goog . events . EventHandler . prototype . removeAll = function ( ) { goog . object . forEach ( this . keys _ , function ( a , b ) { this . keys _ . hasOwnProperty ( b ) && goog . events . unlistenByKey ( a ) } , this ) ; this . keys _ = { } } ; goog . events . EventHandler . prototype . disposeInternal = function ( ) { goog . events . EventHandler . superClass _ . disposeInternal . call ( this ) ; this . removeAll ( ) } ; goog . events . EventHandler . prototype . handleEvent = function ( a ) { throw Error ( "EventHandler.handleEvent not implemented" ) ; } ; goog . events . EventTarget = function ( ) { goog . Disposable . call ( this ) ; this . eventTargetListeners _ = new goog . events . ListenerMap ( this ) ; this . actualEventTarget _ = this ; this . parentEventTarget _ = null } ; goog . inherits ( goog . events . EventTarget , goog . Disposable ) ; goog . events . Listenable . addImplementation ( goog . events . EventTarget ) ; goog . events . EventTarget . MAX _ANCESTORS _ = 1E3 ; goog . events . EventTarget . prototype . getParentEventTarget = function ( ) { return this . parentEventTarget _ } ;
goog . events . EventTarget . prototype . setParentEventTarget = function ( a ) { this . parentEventTarget _ = a } ; goog . events . EventTarget . prototype . addEventListener = function ( a , b , c , d ) { goog . events . listen ( this , a , b , c , d ) } ; goog . events . EventTarget . prototype . removeEventListener = function ( a , b , c , d ) { goog . events . unlisten ( this , a , b , c , d ) } ;
goog . events . EventTarget . prototype . dispatchEvent = function ( a ) { this . assertInitialized _ ( ) ; var b = this . getParentEventTarget ( ) ; if ( b ) { var c = [ ] ; for ( var d = 1 ; b ; b = b . getParentEventTarget ( ) ) c . push ( b ) , goog . asserts . assert ( ++ d < goog . events . EventTarget . MAX _ANCESTORS _ , "infinite loop" ) } return goog . events . EventTarget . dispatchEventInternal _ ( this . actualEventTarget _ , a , c ) } ;
goog . events . EventTarget . prototype . disposeInternal = function ( ) { goog . events . EventTarget . superClass _ . disposeInternal . call ( this ) ; this . removeAllListeners ( ) ; this . parentEventTarget _ = null } ; goog . events . EventTarget . prototype . listen = function ( a , b , c , d ) { this . assertInitialized _ ( ) ; return this . eventTargetListeners _ . add ( String ( a ) , b , ! 1 , c , d ) } ; goog . events . EventTarget . prototype . listenOnce = function ( a , b , c , d ) { return this . eventTargetListeners _ . add ( String ( a ) , b , ! 0 , c , d ) } ;
goog . events . EventTarget . prototype . unlisten = function ( a , b , c , d ) { return this . eventTargetListeners _ . remove ( String ( a ) , b , c , d ) } ; goog . events . EventTarget . prototype . unlistenByKey = function ( a ) { return this . eventTargetListeners _ . removeByKey ( a ) } ; goog . events . EventTarget . prototype . removeAllListeners = function ( a ) { return this . eventTargetListeners _ ? this . eventTargetListeners _ . removeAll ( a ) : 0 } ;
goog . events . EventTarget . prototype . fireListeners = function ( a , b , c ) { a = this . eventTargetListeners _ . listeners [ String ( a ) ] ; if ( ! a ) return ! 0 ; a = a . concat ( ) ; for ( var d = ! 0 , e = 0 ; e < a . length ; ++ e ) { var f = a [ e ] ; if ( f && ! f . removed && f . capture == b ) { var g = f . listener , h = f . handler || f . src ; f . callOnce && this . unlistenByKey ( f ) ; d = ! 1 !== g . call ( h , c ) && d } } return d && 0 != c . returnValue _ } ; goog . events . EventTarget . prototype . getListeners = function ( a , b ) { return this . eventTargetListeners _ . getListeners ( String ( a ) , b ) } ;
goog . events . EventTarget . prototype . getListener = function ( a , b , c , d ) { return this . eventTargetListeners _ . getListener ( String ( a ) , b , c , d ) } ; goog . events . EventTarget . prototype . hasListener = function ( a , b ) { var c = goog . isDef ( a ) ? String ( a ) : void 0 ; return this . eventTargetListeners _ . hasListener ( c , b ) } ; goog . events . EventTarget . prototype . setTargetForTesting = function ( a ) { this . actualEventTarget _ = a } ; goog . events . EventTarget . prototype . assertInitialized _ = function ( ) { goog . asserts . assert ( this . eventTargetListeners _ , "Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?" ) } ;
goog . events . EventTarget . dispatchEventInternal _ = function ( a , b , c ) { var d = b . type || b ; if ( goog . isString ( b ) ) b = new goog . events . Event ( b , a ) ; else if ( b instanceof goog . events . Event ) b . target = b . target || a ; else { var e = b ; b = new goog . events . Event ( d , a ) ; goog . object . extend ( b , e ) } e = ! 0 ; if ( c ) for ( var f = c . length - 1 ; ! b . propagationStopped _ && 0 <= f ; f -- ) { var g = b . currentTarget = c [ f ] ; e = g . fireListeners ( d , ! 0 , b ) && e } b . propagationStopped _ || ( g = b . currentTarget = a , e = g . fireListeners ( d , ! 0 , b ) && e , b . propagationStopped _ || ( e = g . fireListeners ( d , ! 1 , b ) && e ) ) ;
if ( c ) for ( f = 0 ; ! b . propagationStopped _ && f < c . length ; f ++ ) g = b . currentTarget = c [ f ] , e = g . fireListeners ( d , ! 1 , b ) && e ; return e } ; goog . ui = { } ; goog . ui . IdGenerator = function ( ) { } ; goog . addSingletonGetter ( goog . ui . IdGenerator ) ; goog . ui . IdGenerator . prototype . nextId _ = 0 ; goog . ui . IdGenerator . prototype . getNextUniqueId = function ( ) { return ":" + ( this . nextId _ ++ ) . toString ( 36 ) } ; goog . ui . Component = function ( a ) { goog . events . EventTarget . call ( this ) ; this . dom _ = a || goog . dom . getDomHelper ( ) ; this . rightToLeft _ = goog . ui . Component . defaultRightToLeft _ ; this . id _ = null ; this . inDocument _ = ! 1 ; this . element _ = null ; this . googUiComponentHandler _ = void 0 ; this . childIndex _ = this . children _ = this . parent _ = this . model _ = null ; this . pointerEventsEnabled _ = this . wasDecorated _ = ! 1 } ; goog . inherits ( goog . ui . Component , goog . events . EventTarget ) ; goog . ui . Component . ALLOW _DETACHED _DECORATION = ! 1 ;
goog . ui . Component . prototype . idGenerator _ = goog . ui . IdGenerator . getInstance ( ) ; goog . ui . Component . DEFAULT _BIDI _DIR = 0 ; goog . ui . Component . defaultRightToLeft _ = 1 == goog . ui . Component . DEFAULT _BIDI _DIR ? ! 1 : - 1 == goog . ui . Component . DEFAULT _BIDI _DIR ? ! 0 : null ;
2017-09-25 09:37:41 +00:00
goog . ui . Component . EventType = { BEFORE _SHOW : "beforeshow" , SHOW : "show" , HIDE : "hide" , DISABLE : "disable" , ENABLE : "enable" , HIGHLIGHT : "highlight" , UNHIGHLIGHT : "unhighlight" , ACTIVATE : "activate" , DEACTIVATE : "deactivate" , SELECT : "select" , UNSELECT : "unselect" , CHECK : "check" , UNCHECK : "uncheck" , FOCUS : "focus" , BLUR : "blur" , OPEN : "open" , CLOSE : "close" , ENTER : "enter" , LEAVE : "leave" , ACTION : "action" , CHANGE : "change" } ;
goog . ui . Component . Error = { NOT _SUPPORTED : "Method not supported" , DECORATE _INVALID : "Invalid element to decorate" , ALREADY _RENDERED : "Component already rendered" , PARENT _UNABLE _TO _BE _SET : "Unable to set parent component" , CHILD _INDEX _OUT _OF _BOUNDS : "Child component index out of bounds" , NOT _OUR _CHILD : "Child is not in parent component" , NOT _IN _DOCUMENT : "Operation not supported while component is not in document" , STATE _INVALID : "Invalid component state" } ;
goog . ui . Component . State = { ALL : 255 , DISABLED : 1 , HOVER : 2 , ACTIVE : 4 , SELECTED : 8 , CHECKED : 16 , FOCUSED : 32 , OPENED : 64 } ;
goog . ui . Component . getStateTransitionEvent = function ( a , b ) { switch ( a ) { case goog . ui . Component . State . DISABLED : return b ? goog . ui . Component . EventType . DISABLE : goog . ui . Component . EventType . ENABLE ; case goog . ui . Component . State . HOVER : return b ? goog . ui . Component . EventType . HIGHLIGHT : goog . ui . Component . EventType . UNHIGHLIGHT ; case goog . ui . Component . State . ACTIVE : return b ? goog . ui . Component . EventType . ACTIVATE : goog . ui . Component . EventType . DEACTIVATE ; case goog . ui . Component . State . SELECTED : return b ? goog . ui . Component . EventType . SELECT :
goog . ui . Component . EventType . UNSELECT ; case goog . ui . Component . State . CHECKED : return b ? goog . ui . Component . EventType . CHECK : goog . ui . Component . EventType . UNCHECK ; case goog . ui . Component . State . FOCUSED : return b ? goog . ui . Component . EventType . FOCUS : goog . ui . Component . EventType . BLUR ; case goog . ui . Component . State . OPENED : return b ? goog . ui . Component . EventType . OPEN : goog . ui . Component . EventType . CLOSE } throw Error ( goog . ui . Component . Error . STATE _INVALID ) ; } ;
goog . ui . Component . setDefaultRightToLeft = function ( a ) { goog . ui . Component . defaultRightToLeft _ = a } ; goog . ui . Component . prototype . getId = function ( ) { return this . id _ || ( this . id _ = this . idGenerator _ . getNextUniqueId ( ) ) } ; goog . ui . Component . prototype . setId = function ( a ) { this . parent _ && this . parent _ . childIndex _ && ( goog . object . remove ( this . parent _ . childIndex _ , this . id _ ) , goog . object . add ( this . parent _ . childIndex _ , a , this ) ) ; this . id _ = a } ; goog . ui . Component . prototype . getElement = function ( ) { return this . element _ } ;
goog . ui . Component . prototype . getElementStrict = function ( ) { var a = this . element _ ; goog . asserts . assert ( a , "Can not call getElementStrict before rendering/decorating." ) ; return a } ; goog . ui . Component . prototype . setElementInternal = function ( a ) { this . element _ = a } ; goog . ui . Component . prototype . getElementsByClass = function ( a ) { return this . element _ ? this . dom _ . getElementsByClass ( a , this . element _ ) : [ ] } ; goog . ui . Component . prototype . getElementByClass = function ( a ) { return this . element _ ? this . dom _ . getElementByClass ( a , this . element _ ) : null } ;
2018-01-16 21:13:23 +00:00
goog . ui . Component . prototype . getRequiredElementByClass = function ( a ) { var b = this . getElementByClass ( a ) ; goog . asserts . assert ( b , "Expected element in component with class: %s" , a ) ; return b } ; goog . ui . Component . prototype . getHandler = function ( ) { this . googUiComponentHandler _ || ( this . googUiComponentHandler _ = new goog . events . EventHandler ( this ) ) ; return goog . asserts . assert ( this . googUiComponentHandler _ ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . Component . prototype . setParent = function ( a ) { if ( this == a ) throw Error ( goog . ui . Component . Error . PARENT _UNABLE _TO _BE _SET ) ; if ( a && this . parent _ && this . id _ && this . parent _ . getChild ( this . id _ ) && this . parent _ != a ) throw Error ( goog . ui . Component . Error . PARENT _UNABLE _TO _BE _SET ) ; this . parent _ = a ; goog . ui . Component . superClass _ . setParentEventTarget . call ( this , a ) } ; goog . ui . Component . prototype . getParent = function ( ) { return this . parent _ } ;
goog . ui . Component . prototype . setParentEventTarget = function ( a ) { if ( this . parent _ && this . parent _ != a ) throw Error ( goog . ui . Component . Error . NOT _SUPPORTED ) ; goog . ui . Component . superClass _ . setParentEventTarget . call ( this , a ) } ; goog . ui . Component . prototype . getDomHelper = function ( ) { return this . dom _ } ; goog . ui . Component . prototype . isInDocument = function ( ) { return this . inDocument _ } ; goog . ui . Component . prototype . createDom = function ( ) { this . element _ = this . dom _ . createElement ( "DIV" ) } ; goog . ui . Component . prototype . render = function ( a ) { this . render _ ( a ) } ;
goog . ui . Component . prototype . renderBefore = function ( a ) { this . render _ ( a . parentNode , a ) } ; goog . ui . Component . prototype . render _ = function ( a , b ) { if ( this . inDocument _ ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . element _ || this . createDom ( ) ; a ? a . insertBefore ( this . element _ , b || null ) : this . dom _ . getDocument ( ) . body . appendChild ( this . element _ ) ; this . parent _ && ! this . parent _ . isInDocument ( ) || this . enterDocument ( ) } ;
goog . ui . Component . prototype . decorate = function ( a ) { if ( this . inDocument _ ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; if ( a && this . canDecorate ( a ) ) { this . wasDecorated _ = ! 0 ; var b = goog . dom . getOwnerDocument ( a ) ; this . dom _ && this . dom _ . getDocument ( ) == b || ( this . dom _ = goog . dom . getDomHelper ( a ) ) ; this . decorateInternal ( a ) ; goog . ui . Component . ALLOW _DETACHED _DECORATION && ! goog . dom . contains ( b , a ) || this . enterDocument ( ) } else throw Error ( goog . ui . Component . Error . DECORATE _INVALID ) ; } ; goog . ui . Component . prototype . canDecorate = function ( a ) { return ! 0 } ;
goog . ui . Component . prototype . wasDecorated = function ( ) { return this . wasDecorated _ } ; goog . ui . Component . prototype . decorateInternal = function ( a ) { this . element _ = a } ; goog . ui . Component . prototype . enterDocument = function ( ) { this . inDocument _ = ! 0 ; this . forEachChild ( function ( a ) { ! a . isInDocument ( ) && a . getElement ( ) && a . enterDocument ( ) } ) } ;
goog . ui . Component . prototype . exitDocument = function ( ) { this . forEachChild ( function ( a ) { a . isInDocument ( ) && a . exitDocument ( ) } ) ; this . googUiComponentHandler _ && this . googUiComponentHandler _ . removeAll ( ) ; this . inDocument _ = ! 1 } ;
goog . ui . Component . prototype . disposeInternal = function ( ) { this . inDocument _ && this . exitDocument ( ) ; this . googUiComponentHandler _ && ( this . googUiComponentHandler _ . dispose ( ) , delete this . googUiComponentHandler _ ) ; this . forEachChild ( function ( a ) { a . dispose ( ) } ) ; ! this . wasDecorated _ && this . element _ && goog . dom . removeNode ( this . element _ ) ; this . parent _ = this . model _ = this . element _ = this . childIndex _ = this . children _ = null ; goog . ui . Component . superClass _ . disposeInternal . call ( this ) } ;
goog . ui . Component . prototype . makeId = function ( a ) { return this . getId ( ) + "." + a } ; goog . ui . Component . prototype . makeIds = function ( a ) { var b = { } , c ; for ( c in a ) b [ c ] = this . makeId ( a [ c ] ) ; return b } ; goog . ui . Component . prototype . getModel = function ( ) { return this . model _ } ; goog . ui . Component . prototype . setModel = function ( a ) { this . model _ = a } ; goog . ui . Component . prototype . getFragmentFromId = function ( a ) { return a . substring ( this . getId ( ) . length + 1 ) } ;
goog . ui . Component . prototype . getElementByFragment = function ( a ) { if ( ! this . inDocument _ ) throw Error ( goog . ui . Component . Error . NOT _IN _DOCUMENT ) ; return this . dom _ . getElement ( this . makeId ( a ) ) } ; goog . ui . Component . prototype . addChild = function ( a , b ) { this . addChildAt ( a , this . getChildCount ( ) , b ) } ;
goog . ui . Component . prototype . addChildAt = function ( a , b , c ) { goog . asserts . assert ( ! ! a , "Provided element must not be null." ) ; if ( a . inDocument _ && ( c || ! this . inDocument _ ) ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; if ( 0 > b || b > this . getChildCount ( ) ) throw Error ( goog . ui . Component . Error . CHILD _INDEX _OUT _OF _BOUNDS ) ; this . childIndex _ && this . children _ || ( this . childIndex _ = { } , this . children _ = [ ] ) ; a . getParent ( ) == this ? ( goog . object . set ( this . childIndex _ , a . getId ( ) , a ) , goog . array . remove ( this . children _ , a ) ) : goog . object . add ( this . childIndex _ ,
a . getId ( ) , a ) ; a . setParent ( this ) ; goog . array . insertAt ( this . children _ , a , b ) ; a . inDocument _ && this . inDocument _ && a . getParent ( ) == this ? ( c = this . getContentElement ( ) , b = c . childNodes [ b ] || null , b != a . getElement ( ) && c . insertBefore ( a . getElement ( ) , b ) ) : c ? ( this . element _ || this . createDom ( ) , b = this . getChildAt ( b + 1 ) , a . render _ ( this . getContentElement ( ) , b ? b . element _ : null ) ) : this . inDocument _ && ! a . inDocument _ && a . element _ && a . element _ . parentNode && a . element _ . parentNode . nodeType == goog . dom . NodeType . ELEMENT && a . enterDocument ( ) } ;
goog . ui . Component . prototype . getContentElement = function ( ) { return this . element _ } ; goog . ui . Component . prototype . isRightToLeft = function ( ) { null == this . rightToLeft _ && ( this . rightToLeft _ = goog . style . isRightToLeft ( this . inDocument _ ? this . element _ : this . dom _ . getDocument ( ) . body ) ) ; return this . rightToLeft _ } ; goog . ui . Component . prototype . setRightToLeft = function ( a ) { if ( this . inDocument _ ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . rightToLeft _ = a } ;
goog . ui . Component . prototype . hasChildren = function ( ) { return ! ! this . children _ && 0 != this . children _ . length } ; goog . ui . Component . prototype . getChildCount = function ( ) { return this . children _ ? this . children _ . length : 0 } ; goog . ui . Component . prototype . getChildIds = function ( ) { var a = [ ] ; this . forEachChild ( function ( b ) { a . push ( b . getId ( ) ) } ) ; return a } ; goog . ui . Component . prototype . getChild = function ( a ) { return this . childIndex _ && a ? goog . object . get ( this . childIndex _ , a ) || null : null } ;
goog . ui . Component . prototype . getChildAt = function ( a ) { return this . children _ ? this . children _ [ a ] || null : null } ; goog . ui . Component . prototype . forEachChild = function ( a , b ) { this . children _ && goog . array . forEach ( this . children _ , a , b ) } ; goog . ui . Component . prototype . indexOfChild = function ( a ) { return this . children _ && a ? goog . array . indexOf ( this . children _ , a ) : - 1 } ;
goog . ui . Component . prototype . removeChild = function ( a , b ) { if ( a ) { var c = goog . isString ( a ) ? a : a . getId ( ) ; a = this . getChild ( c ) ; c && a && ( goog . object . remove ( this . childIndex _ , c ) , goog . array . remove ( this . children _ , a ) , b && ( a . exitDocument ( ) , a . element _ && goog . dom . removeNode ( a . element _ ) ) , a . setParent ( null ) ) } if ( ! a ) throw Error ( goog . ui . Component . Error . NOT _OUR _CHILD ) ; return a } ; goog . ui . Component . prototype . removeChildAt = function ( a , b ) { return this . removeChild ( this . getChildAt ( a ) , b ) } ;
2018-08-17 13:32:56 +00:00
goog . ui . Component . prototype . removeChildren = function ( a ) { for ( var b = [ ] ; this . hasChildren ( ) ; ) b . push ( this . removeChildAt ( 0 , a ) ) ; return b } ; goog . ui . Component . prototype . pointerEventsEnabled = function ( ) { return this . pointerEventsEnabled _ } ; goog . ui . Component . prototype . setPointerEventsEnabled = function ( a ) { if ( this . inDocument _ ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . pointerEventsEnabled _ = a } ; goog . a11y = { } ; goog . a11y . aria = { } ;
2017-09-25 09:37:41 +00:00
goog . a11y . aria . Role = { ALERT : "alert" , ALERTDIALOG : "alertdialog" , APPLICATION : "application" , ARTICLE : "article" , BANNER : "banner" , BUTTON : "button" , CHECKBOX : "checkbox" , COLUMNHEADER : "columnheader" , COMBOBOX : "combobox" , COMPLEMENTARY : "complementary" , CONTENTINFO : "contentinfo" , DEFINITION : "definition" , DIALOG : "dialog" , DIRECTORY : "directory" , DOCUMENT : "document" , FORM : "form" , GRID : "grid" , GRIDCELL : "gridcell" , GROUP : "group" , HEADING : "heading" , IMG : "img" , LINK : "link" , LIST : "list" , LISTBOX : "listbox" , LISTITEM : "listitem" , LOG : "log" ,
MAIN : "main" , MARQUEE : "marquee" , MATH : "math" , MENU : "menu" , MENUBAR : "menubar" , MENU _ITEM : "menuitem" , MENU _ITEM _CHECKBOX : "menuitemcheckbox" , MENU _ITEM _RADIO : "menuitemradio" , NAVIGATION : "navigation" , NOTE : "note" , OPTION : "option" , PRESENTATION : "presentation" , PROGRESSBAR : "progressbar" , RADIO : "radio" , RADIOGROUP : "radiogroup" , REGION : "region" , ROW : "row" , ROWGROUP : "rowgroup" , ROWHEADER : "rowheader" , SCROLLBAR : "scrollbar" , SEARCH : "search" , SEPARATOR : "separator" , SLIDER : "slider" , SPINBUTTON : "spinbutton" , STATUS : "status" , TAB : "tab" ,
2018-01-16 21:13:23 +00:00
TAB _LIST : "tablist" , TAB _PANEL : "tabpanel" , TEXTBOX : "textbox" , TEXTINFO : "textinfo" , TIMER : "timer" , TOOLBAR : "toolbar" , TOOLTIP : "tooltip" , TREE : "tree" , TREEGRID : "treegrid" , TREEITEM : "treeitem" } ; goog . a11y . aria . State = { ACTIVEDESCENDANT : "activedescendant" , ATOMIC : "atomic" , AUTOCOMPLETE : "autocomplete" , BUSY : "busy" , CHECKED : "checked" , COLINDEX : "colindex" , CONTROLS : "controls" , DESCRIBEDBY : "describedby" , DISABLED : "disabled" , DROPEFFECT : "dropeffect" , EXPANDED : "expanded" , FLOWTO : "flowto" , GRABBED : "grabbed" , HASPOPUP : "haspopup" , HIDDEN : "hidden" , INVALID : "invalid" , LABEL : "label" , LABELLEDBY : "labelledby" , LEVEL : "level" , LIVE : "live" , MULTILINE : "multiline" , MULTISELECTABLE : "multiselectable" , ORIENTATION : "orientation" , OWNS : "owns" ,
POSINSET : "posinset" , PRESSED : "pressed" , READONLY : "readonly" , RELEVANT : "relevant" , REQUIRED : "required" , ROWINDEX : "rowindex" , SELECTED : "selected" , SETSIZE : "setsize" , SORT : "sort" , VALUEMAX : "valuemax" , VALUEMIN : "valuemin" , VALUENOW : "valuenow" , VALUETEXT : "valuetext" } ; goog . a11y . aria . AutoCompleteValues = { INLINE : "inline" , LIST : "list" , BOTH : "both" , NONE : "none" } ; goog . a11y . aria . DropEffectValues = { COPY : "copy" , MOVE : "move" , LINK : "link" , EXECUTE : "execute" , POPUP : "popup" , NONE : "none" } ;
goog . a11y . aria . LivePriority = { OFF : "off" , POLITE : "polite" , ASSERTIVE : "assertive" } ; goog . a11y . aria . OrientationValues = { VERTICAL : "vertical" , HORIZONTAL : "horizontal" } ; goog . a11y . aria . RelevantValues = { ADDITIONS : "additions" , REMOVALS : "removals" , TEXT : "text" , ALL : "all" } ; goog . a11y . aria . SortValues = { ASCENDING : "ascending" , DESCENDING : "descending" , NONE : "none" , OTHER : "other" } ; goog . a11y . aria . CheckedValues = { TRUE : "true" , FALSE : "false" , MIXED : "mixed" , UNDEFINED : "undefined" } ;
goog . a11y . aria . ExpandedValues = { TRUE : "true" , FALSE : "false" , UNDEFINED : "undefined" } ; goog . a11y . aria . GrabbedValues = { TRUE : "true" , FALSE : "false" , UNDEFINED : "undefined" } ; goog . a11y . aria . InvalidValues = { FALSE : "false" , TRUE : "true" , GRAMMAR : "grammar" , SPELLING : "spelling" } ; goog . a11y . aria . PressedValues = { TRUE : "true" , FALSE : "false" , MIXED : "mixed" , UNDEFINED : "undefined" } ; goog . a11y . aria . SelectedValues = { TRUE : "true" , FALSE : "false" , UNDEFINED : "undefined" } ; goog . a11y . aria . datatables = { } ;
2017-09-25 09:37:41 +00:00
goog . a11y . aria . datatables . getDefaultValuesMap = function ( ) { goog . a11y . aria . DefaultStateValueMap _ || ( goog . a11y . aria . DefaultStateValueMap _ = goog . object . create ( goog . a11y . aria . State . ATOMIC , ! 1 , goog . a11y . aria . State . AUTOCOMPLETE , "none" , goog . a11y . aria . State . DROPEFFECT , "none" , goog . a11y . aria . State . HASPOPUP , ! 1 , goog . a11y . aria . State . LIVE , "off" , goog . a11y . aria . State . MULTILINE , ! 1 , goog . a11y . aria . State . MULTISELECTABLE , ! 1 , goog . a11y . aria . State . ORIENTATION , "vertical" , goog . a11y . aria . State . READONLY , ! 1 , goog . a11y . aria . State . RELEVANT ,
"additions text" , goog . a11y . aria . State . REQUIRED , ! 1 , goog . a11y . aria . State . SORT , "none" , goog . a11y . aria . State . BUSY , ! 1 , goog . a11y . aria . State . DISABLED , ! 1 , goog . a11y . aria . State . HIDDEN , ! 1 , goog . a11y . aria . State . INVALID , "false" ) ) ; return goog . a11y . aria . DefaultStateValueMap _ } ; goog . a11y . aria . ARIA _PREFIX _ = "aria-" ; goog . a11y . aria . ROLE _ATTRIBUTE _ = "role" ; goog . a11y . aria . TAGS _WITH _ASSUMED _ROLES _ = goog . object . createSet ( "A AREA BUTTON HEAD INPUT LINK MENU META OPTGROUP OPTION PROGRESS STYLE SELECT SOURCE TEXTAREA TITLE TRACK" . split ( " " ) ) ;
goog . a11y . aria . CONTAINER _ROLES _ = [ goog . a11y . aria . Role . COMBOBOX , goog . a11y . aria . Role . GRID , goog . a11y . aria . Role . GROUP , goog . a11y . aria . Role . LISTBOX , goog . a11y . aria . Role . MENU , goog . a11y . aria . Role . MENUBAR , goog . a11y . aria . Role . RADIOGROUP , goog . a11y . aria . Role . ROW , goog . a11y . aria . Role . ROWGROUP , goog . a11y . aria . Role . TAB _LIST , goog . a11y . aria . Role . TEXTBOX , goog . a11y . aria . Role . TOOLBAR , goog . a11y . aria . Role . TREE , goog . a11y . aria . Role . TREEGRID ] ;
goog . a11y . aria . setRole = function ( a , b ) { b ? ( goog . asserts . ENABLE _ASSERTS && goog . asserts . assert ( goog . object . containsValue ( goog . a11y . aria . Role , b ) , "No such ARIA role " + b ) , a . setAttribute ( goog . a11y . aria . ROLE _ATTRIBUTE _ , b ) ) : goog . a11y . aria . removeRole ( a ) } ; goog . a11y . aria . getRole = function ( a ) { return a . getAttribute ( goog . a11y . aria . ROLE _ATTRIBUTE _ ) || null } ; goog . a11y . aria . removeRole = function ( a ) { a . removeAttribute ( goog . a11y . aria . ROLE _ATTRIBUTE _ ) } ;
goog . a11y . aria . setState = function ( a , b , c ) { goog . isArray ( c ) && ( c = c . join ( " " ) ) ; var d = goog . a11y . aria . getAriaAttributeName _ ( b ) ; "" === c || void 0 == c ? ( c = goog . a11y . aria . datatables . getDefaultValuesMap ( ) , b in c ? a . setAttribute ( d , c [ b ] ) : a . removeAttribute ( d ) ) : a . setAttribute ( d , c ) } ; goog . a11y . aria . toggleState = function ( a , b ) { var c = goog . a11y . aria . getState ( a , b ) ; goog . string . isEmptyOrWhitespace ( goog . string . makeSafe ( c ) ) || "true" == c || "false" == c ? goog . a11y . aria . setState ( a , b , "true" == c ? "false" : "true" ) : goog . a11y . aria . removeState ( a , b ) } ;
goog . a11y . aria . removeState = function ( a , b ) { a . removeAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) } ; goog . a11y . aria . getState = function ( a , b ) { var c = a . getAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) ; return null == c || void 0 == c ? "" : String ( c ) } ; goog . a11y . aria . getActiveDescendant = function ( a ) { var b = goog . a11y . aria . getState ( a , goog . a11y . aria . State . ACTIVEDESCENDANT ) ; return goog . dom . getOwnerDocument ( a ) . getElementById ( b ) } ;
goog . a11y . aria . setActiveDescendant = function ( a , b ) { var c = "" ; b && ( c = b . id , goog . asserts . assert ( c , "The active element should have an id." ) ) ; goog . a11y . aria . setState ( a , goog . a11y . aria . State . ACTIVEDESCENDANT , c ) } ; goog . a11y . aria . getLabel = function ( a ) { return goog . a11y . aria . getState ( a , goog . a11y . aria . State . LABEL ) } ; goog . a11y . aria . setLabel = function ( a , b ) { goog . a11y . aria . setState ( a , goog . a11y . aria . State . LABEL , b ) } ;
goog . a11y . aria . assertRoleIsSetInternalUtil = function ( a , b ) { if ( ! goog . a11y . aria . TAGS _WITH _ASSUMED _ROLES _ [ a . tagName ] ) { var c = goog . a11y . aria . getRole ( a ) ; goog . asserts . assert ( null != c , "The element ARIA role cannot be null." ) ; goog . asserts . assert ( goog . array . contains ( b , c ) , 'Non existing or incorrect role set for element.The role set is "' + c + '". The role should be any of "' + b + '". Check the ARIA specification for more details http://www.w3.org/TR/wai-aria/roles.' ) } } ;
goog . a11y . aria . getStateBoolean = function ( a , b ) { var c = a . getAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) ; goog . asserts . assert ( goog . isBoolean ( c ) || null == c || "true" == c || "false" == c ) ; return null == c ? c : goog . isBoolean ( c ) ? c : "true" == c } ; goog . a11y . aria . getStateNumber = function ( a , b ) { var c = a . getAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) ; goog . asserts . assert ( ( null == c || ! isNaN ( Number ( c ) ) ) && ! goog . isBoolean ( c ) ) ; return null == c ? null : Number ( c ) } ;
goog . a11y . aria . getStateString = function ( a , b ) { var c = a . getAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) ; goog . asserts . assert ( ( null == c || goog . isString ( c ) ) && ( "" == c || isNaN ( Number ( c ) ) ) && "true" != c && "false" != c ) ; return null == c || "" == c ? null : c } ; goog . a11y . aria . getStringArrayStateInternalUtil = function ( a , b ) { var c = a . getAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) ; return goog . a11y . aria . splitStringOnWhitespace _ ( c ) } ; goog . a11y . aria . hasState = function ( a , b ) { return a . hasAttribute ( goog . a11y . aria . getAriaAttributeName _ ( b ) ) } ;
goog . a11y . aria . isContainerRole = function ( a ) { a = goog . a11y . aria . getRole ( a ) ; return goog . array . contains ( goog . a11y . aria . CONTAINER _ROLES _ , a ) } ; goog . a11y . aria . splitStringOnWhitespace _ = function ( a ) { return a ? a . split ( /\s+/ ) : [ ] } ; goog . a11y . aria . getAriaAttributeName _ = function ( a ) { goog . asserts . ENABLE _ASSERTS && ( goog . asserts . assert ( a , "ARIA attribute cannot be empty." ) , goog . asserts . assert ( goog . object . containsValue ( goog . a11y . aria . State , a ) , "No such ARIA attribute " + a ) ) ; return goog . a11y . aria . ARIA _PREFIX _ + a } ; goog . events . KeyCodes = { WIN _KEY _FF _LINUX : 0 , MAC _ENTER : 3 , BACKSPACE : 8 , TAB : 9 , NUM _CENTER : 12 , ENTER : 13 , SHIFT : 16 , CTRL : 17 , ALT : 18 , PAUSE : 19 , CAPS _LOCK : 20 , ESC : 27 , SPACE : 32 , PAGE _UP : 33 , PAGE _DOWN : 34 , END : 35 , HOME : 36 , LEFT : 37 , UP : 38 , RIGHT : 39 , DOWN : 40 , PLUS _SIGN : 43 , PRINT _SCREEN : 44 , INSERT : 45 , DELETE : 46 , ZERO : 48 , ONE : 49 , TWO : 50 , THREE : 51 , FOUR : 52 , FIVE : 53 , SIX : 54 , SEVEN : 55 , EIGHT : 56 , NINE : 57 , FF _SEMICOLON : 59 , FF _EQUALS : 61 , FF _DASH : 173 , QUESTION _MARK : 63 , AT _SIGN : 64 , A : 65 , B : 66 , C : 67 , D : 68 , E : 69 , F : 70 , G : 71 , H : 72 , I : 73 , J : 74 , K : 75 , L : 76 , M : 77 , N : 78 , O : 79 , P : 80 ,
Q : 81 , R : 82 , S : 83 , T : 84 , U : 85 , V : 86 , W : 87 , X : 88 , Y : 89 , Z : 90 , META : 91 , WIN _KEY _RIGHT : 92 , CONTEXT _MENU : 93 , NUM _ZERO : 96 , NUM _ONE : 97 , NUM _TWO : 98 , NUM _THREE : 99 , NUM _FOUR : 100 , NUM _FIVE : 101 , NUM _SIX : 102 , NUM _SEVEN : 103 , NUM _EIGHT : 104 , NUM _NINE : 105 , NUM _MULTIPLY : 106 , NUM _PLUS : 107 , NUM _MINUS : 109 , NUM _PERIOD : 110 , NUM _DIVISION : 111 , F1 : 112 , F2 : 113 , F3 : 114 , F4 : 115 , F5 : 116 , F6 : 117 , F7 : 118 , F8 : 119 , F9 : 120 , F10 : 121 , F11 : 122 , F12 : 123 , NUMLOCK : 144 , SCROLL _LOCK : 145 , FIRST _MEDIA _KEY : 166 , LAST _MEDIA _KEY : 183 , SEMICOLON : 186 , DASH : 189 , EQUALS : 187 , COMMA : 188 , PERIOD : 190 ,
SLASH : 191 , APOSTROPHE : 192 , TILDE : 192 , SINGLE _QUOTE : 222 , OPEN _SQUARE _BRACKET : 219 , BACKSLASH : 220 , CLOSE _SQUARE _BRACKET : 221 , WIN _KEY : 224 , MAC _FF _META : 224 , MAC _WK _CMD _LEFT : 91 , MAC _WK _CMD _RIGHT : 93 , WIN _IME : 229 , VK _NONAME : 252 , PHANTOM : 255 } ;
goog . events . KeyCodes . isTextModifyingKeyEvent = function ( a ) { if ( a . altKey && ! a . ctrlKey || a . metaKey || a . keyCode >= goog . events . KeyCodes . F1 && a . keyCode <= goog . events . KeyCodes . F12 ) return ! 1 ; switch ( a . keyCode ) { case goog . events . KeyCodes . ALT : case goog . events . KeyCodes . CAPS _LOCK : case goog . events . KeyCodes . CONTEXT _MENU : case goog . events . KeyCodes . CTRL : case goog . events . KeyCodes . DOWN : case goog . events . KeyCodes . END : case goog . events . KeyCodes . ESC : case goog . events . KeyCodes . HOME : case goog . events . KeyCodes . INSERT : case goog . events . KeyCodes . LEFT : case goog . events . KeyCodes . MAC _FF _META : case goog . events . KeyCodes . META : case goog . events . KeyCodes . NUMLOCK : case goog . events . KeyCodes . NUM _CENTER : case goog . events . KeyCodes . PAGE _DOWN : case goog . events . KeyCodes . PAGE _UP : case goog . events . KeyCodes . PAUSE : case goog . events . KeyCodes . PHANTOM : case goog . events . KeyCodes . PRINT _SCREEN : case goog . events . KeyCodes . RIGHT : case goog . events . KeyCodes . SCROLL _LOCK : case goog . events . KeyCodes . SHIFT : case goog . events . KeyCodes . UP : case goog . events . KeyCodes . VK _NONAME : case goog . events . KeyCodes . WIN _KEY : case goog . events . KeyCodes . WIN _KEY _RIGHT : return ! 1 ; case goog . events . KeyCodes . WIN _KEY _FF _LINUX : return ! goog . userAgent . GECKO ;
default : return a . keyCode < goog . events . KeyCodes . FIRST _MEDIA _KEY || a . keyCode > goog . events . KeyCodes . LAST _MEDIA _KEY } } ;
goog . events . KeyCodes . firesKeyPressEvent = function ( a , b , c , d , e , f ) { if ( ! ( goog . userAgent . IE || goog . userAgent . EDGE || goog . userAgent . WEBKIT && goog . userAgent . isVersionOrHigher ( "525" ) ) ) return ! 0 ; if ( goog . userAgent . MAC && e ) return goog . events . KeyCodes . isCharacterKey ( a ) ; if ( e && ! d ) return ! 1 ; goog . isNumber ( b ) && ( b = goog . events . KeyCodes . normalizeKeyCode ( b ) ) ; e = b == goog . events . KeyCodes . CTRL || b == goog . events . KeyCodes . ALT || goog . userAgent . MAC && b == goog . events . KeyCodes . META ; f = b == goog . events . KeyCodes . SHIFT && ( d || f ) ; if ( ( ! c || goog . userAgent . MAC ) &&
e || goog . userAgent . MAC && f ) return ! 1 ; if ( ( goog . userAgent . WEBKIT || goog . userAgent . EDGE ) && d && c ) switch ( a ) { case goog . events . KeyCodes . BACKSLASH : case goog . events . KeyCodes . OPEN _SQUARE _BRACKET : case goog . events . KeyCodes . CLOSE _SQUARE _BRACKET : case goog . events . KeyCodes . TILDE : case goog . events . KeyCodes . SEMICOLON : case goog . events . KeyCodes . DASH : case goog . events . KeyCodes . EQUALS : case goog . events . KeyCodes . COMMA : case goog . events . KeyCodes . PERIOD : case goog . events . KeyCodes . SLASH : case goog . events . KeyCodes . APOSTROPHE : case goog . events . KeyCodes . SINGLE _QUOTE : return ! 1 } if ( goog . userAgent . IE &&
d && b == a ) return ! 1 ; switch ( a ) { case goog . events . KeyCodes . ENTER : return ! 0 ; case goog . events . KeyCodes . ESC : return ! ( goog . userAgent . WEBKIT || goog . userAgent . EDGE ) } return goog . events . KeyCodes . isCharacterKey ( a ) } ;
goog . events . KeyCodes . isCharacterKey = function ( a ) { if ( a >= goog . events . KeyCodes . ZERO && a <= goog . events . KeyCodes . NINE || a >= goog . events . KeyCodes . NUM _ZERO && a <= goog . events . KeyCodes . NUM _MULTIPLY || a >= goog . events . KeyCodes . A && a <= goog . events . KeyCodes . Z || ( goog . userAgent . WEBKIT || goog . userAgent . EDGE ) && 0 == a ) return ! 0 ; switch ( a ) { case goog . events . KeyCodes . SPACE : case goog . events . KeyCodes . PLUS _SIGN : case goog . events . KeyCodes . QUESTION _MARK : case goog . events . KeyCodes . AT _SIGN : case goog . events . KeyCodes . NUM _PLUS : case goog . events . KeyCodes . NUM _MINUS : case goog . events . KeyCodes . NUM _PERIOD : case goog . events . KeyCodes . NUM _DIVISION : case goog . events . KeyCodes . SEMICOLON : case goog . events . KeyCodes . FF _SEMICOLON : case goog . events . KeyCodes . DASH : case goog . events . KeyCodes . EQUALS : case goog . events . KeyCodes . FF _EQUALS : case goog . events . KeyCodes . COMMA : case goog . events . KeyCodes . PERIOD : case goog . events . KeyCodes . SLASH : case goog . events . KeyCodes . APOSTROPHE : case goog . events . KeyCodes . SINGLE _QUOTE : case goog . events . KeyCodes . OPEN _SQUARE _BRACKET : case goog . events . KeyCodes . BACKSLASH : case goog . events . KeyCodes . CLOSE _SQUARE _BRACKET : return ! 0 ; default : return ! 1 } } ;
goog . events . KeyCodes . normalizeKeyCode = function ( a ) { return goog . userAgent . GECKO ? goog . events . KeyCodes . normalizeGeckoKeyCode ( a ) : goog . userAgent . MAC && goog . userAgent . WEBKIT ? goog . events . KeyCodes . normalizeMacWebKitKeyCode ( a ) : a } ;
goog . events . KeyCodes . normalizeGeckoKeyCode = function ( a ) { switch ( a ) { case goog . events . KeyCodes . FF _EQUALS : return goog . events . KeyCodes . EQUALS ; case goog . events . KeyCodes . FF _SEMICOLON : return goog . events . KeyCodes . SEMICOLON ; case goog . events . KeyCodes . FF _DASH : return goog . events . KeyCodes . DASH ; case goog . events . KeyCodes . MAC _FF _META : return goog . events . KeyCodes . META ; case goog . events . KeyCodes . WIN _KEY _FF _LINUX : return goog . events . KeyCodes . WIN _KEY ; default : return a } } ;
goog . events . KeyCodes . normalizeMacWebKitKeyCode = function ( a ) { switch ( a ) { case goog . events . KeyCodes . MAC _WK _CMD _RIGHT : return goog . events . KeyCodes . META ; default : return a } } ; goog . events . KeyHandler = function ( a , b ) { goog . events . EventTarget . call ( this ) ; a && this . attach ( a , b ) } ; goog . inherits ( goog . events . KeyHandler , goog . events . EventTarget ) ; goog . events . KeyHandler . prototype . element _ = null ; goog . events . KeyHandler . prototype . keyPressKey _ = null ; goog . events . KeyHandler . prototype . keyDownKey _ = null ; goog . events . KeyHandler . prototype . keyUpKey _ = null ; goog . events . KeyHandler . prototype . lastKey _ = - 1 ; goog . events . KeyHandler . prototype . keyCode _ = - 1 ; goog . events . KeyHandler . prototype . altKey _ = ! 1 ;
goog . events . KeyHandler . EventType = { KEY : "key" } ;
goog . events . KeyHandler . safariKey _ = { 3 : goog . events . KeyCodes . ENTER , 12 : goog . events . KeyCodes . NUMLOCK , 63232 : goog . events . KeyCodes . UP , 63233 : goog . events . KeyCodes . DOWN , 63234 : goog . events . KeyCodes . LEFT , 63235 : goog . events . KeyCodes . RIGHT , 63236 : goog . events . KeyCodes . F1 , 63237 : goog . events . KeyCodes . F2 , 63238 : goog . events . KeyCodes . F3 , 63239 : goog . events . KeyCodes . F4 , 63240 : goog . events . KeyCodes . F5 , 63241 : goog . events . KeyCodes . F6 , 63242 : goog . events . KeyCodes . F7 , 63243 : goog . events . KeyCodes . F8 , 63244 : goog . events . KeyCodes . F9 , 63245 : goog . events . KeyCodes . F10 ,
63246 : goog . events . KeyCodes . F11 , 63247 : goog . events . KeyCodes . F12 , 63248 : goog . events . KeyCodes . PRINT _SCREEN , 63272 : goog . events . KeyCodes . DELETE , 63273 : goog . events . KeyCodes . HOME , 63275 : goog . events . KeyCodes . END , 63276 : goog . events . KeyCodes . PAGE _UP , 63277 : goog . events . KeyCodes . PAGE _DOWN , 63289 : goog . events . KeyCodes . NUMLOCK , 63302 : goog . events . KeyCodes . INSERT } ;
goog . events . KeyHandler . keyIdentifier _ = { Up : goog . events . KeyCodes . UP , Down : goog . events . KeyCodes . DOWN , Left : goog . events . KeyCodes . LEFT , Right : goog . events . KeyCodes . RIGHT , Enter : goog . events . KeyCodes . ENTER , F1 : goog . events . KeyCodes . F1 , F2 : goog . events . KeyCodes . F2 , F3 : goog . events . KeyCodes . F3 , F4 : goog . events . KeyCodes . F4 , F5 : goog . events . KeyCodes . F5 , F6 : goog . events . KeyCodes . F6 , F7 : goog . events . KeyCodes . F7 , F8 : goog . events . KeyCodes . F8 , F9 : goog . events . KeyCodes . F9 , F10 : goog . events . KeyCodes . F10 , F11 : goog . events . KeyCodes . F11 , F12 : goog . events . KeyCodes . F12 ,
"U+007F" : goog . events . KeyCodes . DELETE , Home : goog . events . KeyCodes . HOME , End : goog . events . KeyCodes . END , PageUp : goog . events . KeyCodes . PAGE _UP , PageDown : goog . events . KeyCodes . PAGE _DOWN , Insert : goog . events . KeyCodes . INSERT } ; goog . events . KeyHandler . USES _KEYDOWN _ = goog . userAgent . IE || goog . userAgent . EDGE || goog . userAgent . WEBKIT && goog . userAgent . isVersionOrHigher ( "525" ) ; goog . events . KeyHandler . SAVE _ALT _FOR _KEYPRESS _ = goog . userAgent . MAC && goog . userAgent . GECKO ;
goog . events . KeyHandler . prototype . handleKeyDown _ = function ( a ) { ( goog . userAgent . WEBKIT || goog . userAgent . EDGE ) && ( this . lastKey _ == goog . events . KeyCodes . CTRL && ! a . ctrlKey || this . lastKey _ == goog . events . KeyCodes . ALT && ! a . altKey || goog . userAgent . MAC && this . lastKey _ == goog . events . KeyCodes . META && ! a . metaKey ) && this . resetState ( ) ; - 1 == this . lastKey _ && ( a . ctrlKey && a . keyCode != goog . events . KeyCodes . CTRL ? this . lastKey _ = goog . events . KeyCodes . CTRL : a . altKey && a . keyCode != goog . events . KeyCodes . ALT ? this . lastKey _ = goog . events . KeyCodes . ALT : a . metaKey &&
a . keyCode != goog . events . KeyCodes . META && ( this . lastKey _ = goog . events . KeyCodes . META ) ) ; goog . events . KeyHandler . USES _KEYDOWN _ && ! goog . events . KeyCodes . firesKeyPressEvent ( a . keyCode , this . lastKey _ , a . shiftKey , a . ctrlKey , a . altKey , a . metaKey ) ? this . handleEvent ( a ) : ( this . keyCode _ = goog . events . KeyCodes . normalizeKeyCode ( a . keyCode ) , goog . events . KeyHandler . SAVE _ALT _FOR _KEYPRESS _ && ( this . altKey _ = a . altKey ) ) } ; goog . events . KeyHandler . prototype . resetState = function ( ) { this . keyCode _ = this . lastKey _ = - 1 } ;
goog . events . KeyHandler . prototype . handleKeyup _ = function ( a ) { this . resetState ( ) ; this . altKey _ = a . altKey } ;
2018-01-16 21:13:23 +00:00
goog . events . KeyHandler . prototype . handleEvent = function ( a ) { var b = a . getBrowserEvent ( ) , c = b . altKey ; if ( goog . userAgent . IE && a . type == goog . events . EventType . KEYPRESS ) { var d = this . keyCode _ ; var e = d != goog . events . KeyCodes . ENTER && d != goog . events . KeyCodes . ESC ? b . keyCode : 0 } else ( goog . userAgent . WEBKIT || goog . userAgent . EDGE ) && a . type == goog . events . EventType . KEYPRESS ? ( d = this . keyCode _ , e = 0 <= b . charCode && 63232 > b . charCode && goog . events . KeyCodes . isCharacterKey ( d ) ? b . charCode : 0 ) : goog . userAgent . OPERA && ! goog . userAgent . WEBKIT ? ( d = this . keyCode _ ,
e = goog . events . KeyCodes . isCharacterKey ( d ) ? b . keyCode : 0 ) : ( d = b . keyCode || this . keyCode _ , e = b . charCode || 0 , goog . events . KeyHandler . SAVE _ALT _FOR _KEYPRESS _ && ( c = this . altKey _ ) , goog . userAgent . MAC && e == goog . events . KeyCodes . QUESTION _MARK && d == goog . events . KeyCodes . WIN _KEY && ( d = goog . events . KeyCodes . SLASH ) ) ; var f = d = goog . events . KeyCodes . normalizeKeyCode ( d ) ; d ? 63232 <= d && d in goog . events . KeyHandler . safariKey _ ? f = goog . events . KeyHandler . safariKey _ [ d ] : 25 == d && a . shiftKey && ( f = 9 ) : b . keyIdentifier && b . keyIdentifier in goog . events . KeyHandler . keyIdentifier _ &&
( f = goog . events . KeyHandler . keyIdentifier _ [ b . keyIdentifier ] ) ; a = f == this . lastKey _ ; this . lastKey _ = f ; b = new goog . events . KeyEvent ( f , e , a , b ) ; b . altKey = c ; this . dispatchEvent ( b ) } ; goog . events . KeyHandler . prototype . getElement = function ( ) { return this . element _ } ;
2017-09-25 09:37:41 +00:00
goog . events . KeyHandler . prototype . attach = function ( a , b ) { this . keyUpKey _ && this . detach ( ) ; this . element _ = a ; this . keyPressKey _ = goog . events . listen ( this . element _ , goog . events . EventType . KEYPRESS , this , b ) ; this . keyDownKey _ = goog . events . listen ( this . element _ , goog . events . EventType . KEYDOWN , this . handleKeyDown _ , b , this ) ; this . keyUpKey _ = goog . events . listen ( this . element _ , goog . events . EventType . KEYUP , this . handleKeyup _ , b , this ) } ;
goog . events . KeyHandler . prototype . detach = function ( ) { this . keyPressKey _ && ( goog . events . unlistenByKey ( this . keyPressKey _ ) , goog . events . unlistenByKey ( this . keyDownKey _ ) , goog . events . unlistenByKey ( this . keyUpKey _ ) , this . keyUpKey _ = this . keyDownKey _ = this . keyPressKey _ = null ) ; this . element _ = null ; this . keyCode _ = this . lastKey _ = - 1 } ; goog . events . KeyHandler . prototype . disposeInternal = function ( ) { goog . events . KeyHandler . superClass _ . disposeInternal . call ( this ) ; this . detach ( ) } ;
2018-08-17 13:32:56 +00:00
goog . events . KeyEvent = function ( a , b , c , d ) { goog . events . BrowserEvent . call ( this , d ) ; this . type = goog . events . KeyHandler . EventType . KEY ; this . keyCode = a ; this . charCode = b ; this . repeat = c } ; goog . inherits ( goog . events . KeyEvent , goog . events . BrowserEvent ) ; goog . ui . ComponentUtil = { } ; goog . ui . ComponentUtil . getMouseEventType = function ( a ) { return a . pointerEventsEnabled ( ) ? goog . events . PointerAsMouseEventType : goog . events . EventType } ; goog . dom . classlist = { } ; goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST = ! 1 ; goog . dom . classlist . get = function ( a ) { if ( goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST || a . classList ) return a . classList ; a = a . className ; return goog . isString ( a ) && a . match ( /\S+/g ) || [ ] } ; goog . dom . classlist . set = function ( a , b ) { a . className = b } ; goog . dom . classlist . contains = function ( a , b ) { return goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST || a . classList ? a . classList . contains ( b ) : goog . array . contains ( goog . dom . classlist . get ( a ) , b ) } ;
2017-09-25 09:37:41 +00:00
goog . dom . classlist . add = function ( a , b ) { goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST || a . classList ? a . classList . add ( b ) : goog . dom . classlist . contains ( a , b ) || ( a . className += 0 < a . className . length ? " " + b : b ) } ;
goog . dom . classlist . addAll = function ( a , b ) { if ( goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST || a . classList ) goog . array . forEach ( b , function ( b ) { goog . dom . classlist . add ( a , b ) } ) ; else { var c = { } ; goog . array . forEach ( goog . dom . classlist . get ( a ) , function ( a ) { c [ a ] = ! 0 } ) ; goog . array . forEach ( b , function ( a ) { c [ a ] = ! 0 } ) ; a . className = "" ; for ( var d in c ) a . className += 0 < a . className . length ? " " + d : d } } ;
goog . dom . classlist . remove = function ( a , b ) { goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST || a . classList ? a . classList . remove ( b ) : goog . dom . classlist . contains ( a , b ) && ( a . className = goog . array . filter ( goog . dom . classlist . get ( a ) , function ( a ) { return a != b } ) . join ( " " ) ) } ;
goog . dom . classlist . removeAll = function ( a , b ) { goog . dom . classlist . ALWAYS _USE _DOM _TOKEN _LIST || a . classList ? goog . array . forEach ( b , function ( b ) { goog . dom . classlist . remove ( a , b ) } ) : a . className = goog . array . filter ( goog . dom . classlist . get ( a ) , function ( a ) { return ! goog . array . contains ( b , a ) } ) . join ( " " ) } ; goog . dom . classlist . enable = function ( a , b , c ) { c ? goog . dom . classlist . add ( a , b ) : goog . dom . classlist . remove ( a , b ) } ; goog . dom . classlist . enableAll = function ( a , b , c ) { ( c ? goog . dom . classlist . addAll : goog . dom . classlist . removeAll ) ( a , b ) } ;
goog . dom . classlist . swap = function ( a , b , c ) { return goog . dom . classlist . contains ( a , b ) ? ( goog . dom . classlist . remove ( a , b ) , goog . dom . classlist . add ( a , c ) , ! 0 ) : ! 1 } ; goog . dom . classlist . toggle = function ( a , b ) { var c = ! goog . dom . classlist . contains ( a , b ) ; goog . dom . classlist . enable ( a , b , c ) ; return c } ; goog . dom . classlist . addRemove = function ( a , b , c ) { goog . dom . classlist . remove ( a , b ) ; goog . dom . classlist . add ( a , c ) } ; goog . ui . registry = { } ; goog . ui . registry . getDefaultRenderer = function ( a ) { for ( var b ; a ; ) { b = goog . getUid ( a ) ; if ( b = goog . ui . registry . defaultRenderers _ [ b ] ) break ; a = a . superClass _ ? a . superClass _ . constructor : null } return b ? goog . isFunction ( b . getInstance ) ? b . getInstance ( ) : new b : null } ;
goog . ui . registry . setDefaultRenderer = function ( a , b ) { if ( ! goog . isFunction ( a ) ) throw Error ( "Invalid component class " + a ) ; if ( ! goog . isFunction ( b ) ) throw Error ( "Invalid renderer class " + b ) ; var c = goog . getUid ( a ) ; goog . ui . registry . defaultRenderers _ [ c ] = b } ; goog . ui . registry . getDecoratorByClassName = function ( a ) { return a in goog . ui . registry . decoratorFunctions _ ? goog . ui . registry . decoratorFunctions _ [ a ] ( ) : null } ;
goog . ui . registry . setDecoratorByClassName = function ( a , b ) { if ( ! a ) throw Error ( "Invalid class name " + a ) ; if ( ! goog . isFunction ( b ) ) throw Error ( "Invalid decorator function " + b ) ; goog . ui . registry . decoratorFunctions _ [ a ] = b } ; goog . ui . registry . getDecorator = function ( a ) { goog . asserts . assert ( a ) ; for ( var b = goog . dom . classlist . get ( a ) , c = 0 , d = b . length ; c < d ; c ++ ) if ( a = goog . ui . registry . getDecoratorByClassName ( b [ c ] ) ) return a ; return null } ;
goog . ui . registry . reset = function ( ) { goog . ui . registry . defaultRenderers _ = { } ; goog . ui . registry . decoratorFunctions _ = { } } ; goog . ui . registry . defaultRenderers _ = { } ; goog . ui . registry . decoratorFunctions _ = { } ; goog . ui . ContainerRenderer = function ( a ) { this . ariaRole _ = a } ; goog . addSingletonGetter ( goog . ui . ContainerRenderer ) ; goog . ui . ContainerRenderer . getCustomRenderer = function ( a , b ) { var c = new a ; c . getCssClass = function ( ) { return b } ; return c } ; goog . ui . ContainerRenderer . CSS _CLASS = "goog-container" ; goog . ui . ContainerRenderer . prototype . getAriaRole = function ( ) { return this . ariaRole _ } ; goog . ui . ContainerRenderer . prototype . enableTabIndex = function ( a , b ) { a && ( a . tabIndex = b ? 0 : - 1 ) } ;
goog . ui . ContainerRenderer . prototype . createDom = function ( a ) { return a . getDomHelper ( ) . createDom ( "DIV" , this . getClassNames ( a ) . join ( " " ) ) } ; goog . ui . ContainerRenderer . prototype . getContentElement = function ( a ) { return a } ; goog . ui . ContainerRenderer . prototype . canDecorate = function ( a ) { return "DIV" == a . tagName } ;
goog . ui . ContainerRenderer . prototype . decorate = function ( a , b ) { b . id && a . setId ( b . id ) ; var c = this . getCssClass ( ) , d = ! 1 , e = goog . dom . classlist . get ( b ) ; e && goog . array . forEach ( e , function ( b ) { b == c ? d = ! 0 : b && this . setStateFromClassName ( a , b , c ) } , this ) ; d || goog . dom . classlist . add ( b , c ) ; this . decorateChildren ( a , this . getContentElement ( b ) ) ; return b } ;
goog . ui . ContainerRenderer . prototype . setStateFromClassName = function ( a , b , c ) { b == c + "-disabled" ? a . setEnabled ( ! 1 ) : b == c + "-horizontal" ? a . setOrientation ( goog . ui . Container . Orientation . HORIZONTAL ) : b == c + "-vertical" && a . setOrientation ( goog . ui . Container . Orientation . VERTICAL ) } ;
goog . ui . ContainerRenderer . prototype . decorateChildren = function ( a , b , c ) { if ( b ) { c = c || b . firstChild ; for ( var d ; c && c . parentNode == b ; ) { d = c . nextSibling ; if ( c . nodeType == goog . dom . NodeType . ELEMENT ) { var e = this . getDecoratorForChild ( c ) ; e && ( e . setElementInternal ( c ) , a . isEnabled ( ) || e . setEnabled ( ! 1 ) , a . addChild ( e ) , e . decorate ( c ) ) } else c . nodeValue && "" != goog . string . trim ( c . nodeValue ) || b . removeChild ( c ) ; c = d } } } ; goog . ui . ContainerRenderer . prototype . getDecoratorForChild = function ( a ) { return goog . ui . registry . getDecorator ( a ) } ;
goog . ui . ContainerRenderer . prototype . initializeDom = function ( a ) { a = a . getElement ( ) ; goog . asserts . assert ( a , "The container DOM element cannot be null." ) ; goog . style . setUnselectable ( a , ! 0 , goog . userAgent . GECKO ) ; goog . userAgent . IE && ( a . hideFocus = ! 0 ) ; var b = this . getAriaRole ( ) ; b && goog . a11y . aria . setRole ( a , b ) } ; goog . ui . ContainerRenderer . prototype . getKeyEventTarget = function ( a ) { return a . getElement ( ) } ; goog . ui . ContainerRenderer . prototype . getCssClass = function ( ) { return goog . ui . ContainerRenderer . CSS _CLASS } ;
2018-01-16 21:13:23 +00:00
goog . ui . ContainerRenderer . prototype . getClassNames = function ( a ) { var b = this . getCssClass ( ) , c = a . getOrientation ( ) == goog . ui . Container . Orientation . HORIZONTAL ; c = [ b , c ? b + "-horizontal" : b + "-vertical" ] ; a . isEnabled ( ) || c . push ( b + "-disabled" ) ; return c } ; goog . ui . ContainerRenderer . prototype . getDefaultOrientation = function ( ) { return goog . ui . Container . Orientation . VERTICAL } ; goog . ui . ControlRenderer = function ( ) { } ; goog . addSingletonGetter ( goog . ui . ControlRenderer ) ; goog . tagUnsealableClass ( goog . ui . ControlRenderer ) ; goog . ui . ControlRenderer . getCustomRenderer = function ( a , b ) { var c = new a ; c . getCssClass = function ( ) { return b } ; return c } ; goog . ui . ControlRenderer . CSS _CLASS = "goog-control" ; goog . ui . ControlRenderer . IE6 _CLASS _COMBINATIONS = [ ] ;
2017-09-25 09:37:41 +00:00
goog . ui . ControlRenderer . TOGGLE _ARIA _STATE _MAP _ = goog . object . create ( goog . a11y . aria . Role . BUTTON , goog . a11y . aria . State . PRESSED , goog . a11y . aria . Role . CHECKBOX , goog . a11y . aria . State . CHECKED , goog . a11y . aria . Role . MENU _ITEM , goog . a11y . aria . State . SELECTED , goog . a11y . aria . Role . MENU _ITEM _CHECKBOX , goog . a11y . aria . State . CHECKED , goog . a11y . aria . Role . MENU _ITEM _RADIO , goog . a11y . aria . State . CHECKED , goog . a11y . aria . Role . RADIO , goog . a11y . aria . State . CHECKED , goog . a11y . aria . Role . TAB , goog . a11y . aria . State . SELECTED , goog . a11y . aria . Role . TREEITEM ,
goog . a11y . aria . State . SELECTED ) ; goog . ui . ControlRenderer . prototype . getAriaRole = function ( ) { } ; goog . ui . ControlRenderer . prototype . createDom = function ( a ) { return a . getDomHelper ( ) . createDom ( "DIV" , this . getClassNames ( a ) . join ( " " ) , a . getContent ( ) ) } ; goog . ui . ControlRenderer . prototype . getContentElement = function ( a ) { return a } ;
goog . ui . ControlRenderer . prototype . enableClassName = function ( a , b , c ) { if ( a = a . getElement ? a . getElement ( ) : a ) { var d = [ b ] ; goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "7" ) && ( d = this . getAppliedCombinedClassNames _ ( goog . dom . classlist . get ( a ) , b ) , d . push ( b ) ) ; goog . dom . classlist . enableAll ( a , d , c ) } } ; goog . ui . ControlRenderer . prototype . enableExtraClassName = function ( a , b , c ) { this . enableClassName ( a , b , c ) } ; goog . ui . ControlRenderer . prototype . canDecorate = function ( a ) { return ! 0 } ;
2018-08-17 13:32:56 +00:00
goog . ui . ControlRenderer . prototype . decorate = function ( a , b ) { b . id && a . setId ( b . id ) ; var c = this . getContentElement ( b ) ; c && c . firstChild ? a . setContentInternal ( c . firstChild . nextSibling ? goog . array . clone ( c . childNodes ) : c . firstChild ) : a . setContentInternal ( null ) ; var d = 0 , e = this . getCssClass ( ) , f = this . getStructuralCssClass ( ) , g = ! 1 , h = ! 1 , k = ! 1 , l = goog . array . toArray ( goog . dom . classlist . get ( b ) ) ; goog . array . forEach ( l , function ( a ) { g || a != e ? h || a != f ? d |= this . getStateFromClass ( a ) : h = ! 0 : ( g = ! 0 , f == e && ( h = ! 0 ) ) ; this . getStateFromClass ( a ) == goog . ui . Component . State . DISABLED &&
( goog . asserts . assertElement ( c ) , goog . dom . isFocusableTabIndex ( c ) && goog . dom . setFocusableTabIndex ( c , ! 1 ) ) } , this ) ; a . setStateInternal ( d ) ; g || ( l . push ( e ) , f == e && ( h = ! 0 ) ) ; h || l . push ( f ) ; var n = a . getExtraClassNames ( ) ; n && l . push . apply ( l , n ) ; if ( goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "7" ) ) { var m = this . getAppliedCombinedClassNames _ ( l ) ; 0 < m . length && ( l . push . apply ( l , m ) , k = ! 0 ) } g && h && ! n && ! k || goog . dom . classlist . set ( b , l . join ( " " ) ) ; return b } ;
2017-09-25 09:37:41 +00:00
goog . ui . ControlRenderer . prototype . initializeDom = function ( a ) { a . isRightToLeft ( ) && this . setRightToLeft ( a . getElement ( ) , ! 0 ) ; a . isEnabled ( ) && this . setFocusable ( a , a . isVisible ( ) ) } ; goog . ui . ControlRenderer . prototype . setAriaRole = function ( a , b ) { var c = b || this . getAriaRole ( ) ; if ( c ) { goog . asserts . assert ( a , "The element passed as a first parameter cannot be null." ) ; var d = goog . a11y . aria . getRole ( a ) ; c != d && goog . a11y . aria . setRole ( a , c ) } } ;
goog . ui . ControlRenderer . prototype . setAriaStates = function ( a , b ) { goog . asserts . assert ( a ) ; goog . asserts . assert ( b ) ; var c = a . getAriaLabel ( ) ; goog . isDefAndNotNull ( c ) && this . setAriaLabel ( b , c ) ; a . isVisible ( ) || goog . a11y . aria . setState ( b , goog . a11y . aria . State . HIDDEN , ! a . isVisible ( ) ) ; a . isEnabled ( ) || this . updateAriaState ( b , goog . ui . Component . State . DISABLED , ! a . isEnabled ( ) ) ; a . isSupportedState ( goog . ui . Component . State . SELECTED ) && this . updateAriaState ( b , goog . ui . Component . State . SELECTED , a . isSelected ( ) ) ; a . isSupportedState ( goog . ui . Component . State . CHECKED ) &&
this . updateAriaState ( b , goog . ui . Component . State . CHECKED , a . isChecked ( ) ) ; a . isSupportedState ( goog . ui . Component . State . OPENED ) && this . updateAriaState ( b , goog . ui . Component . State . OPENED , a . isOpen ( ) ) } ; goog . ui . ControlRenderer . prototype . setAriaLabel = function ( a , b ) { goog . a11y . aria . setLabel ( a , b ) } ; goog . ui . ControlRenderer . prototype . setAllowTextSelection = function ( a , b ) { goog . style . setUnselectable ( a , ! b , ! goog . userAgent . IE && ! goog . userAgent . OPERA ) } ;
goog . ui . ControlRenderer . prototype . setRightToLeft = function ( a , b ) { this . enableClassName ( a , this . getStructuralCssClass ( ) + "-rtl" , b ) } ; goog . ui . ControlRenderer . prototype . isFocusable = function ( a ) { var b ; return a . isSupportedState ( goog . ui . Component . State . FOCUSED ) && ( b = a . getKeyEventTarget ( ) ) ? goog . dom . isFocusableTabIndex ( b ) : ! 1 } ;
goog . ui . ControlRenderer . prototype . setFocusable = function ( a , b ) { var c ; if ( a . isSupportedState ( goog . ui . Component . State . FOCUSED ) && ( c = a . getKeyEventTarget ( ) ) ) { if ( ! b && a . isFocused ( ) ) { try { c . blur ( ) } catch ( d ) { } a . isFocused ( ) && a . handleBlur ( null ) } goog . dom . isFocusableTabIndex ( c ) != b && goog . dom . setFocusableTabIndex ( c , b ) } } ; goog . ui . ControlRenderer . prototype . setVisible = function ( a , b ) { goog . style . setElementShown ( a , b ) ; a && goog . a11y . aria . setState ( a , goog . a11y . aria . State . HIDDEN , ! b ) } ;
goog . ui . ControlRenderer . prototype . setState = function ( a , b , c ) { var d = a . getElement ( ) ; if ( d ) { var e = this . getClassForState ( b ) ; e && this . enableClassName ( a , e , c ) ; this . updateAriaState ( d , b , c ) } } ;
goog . ui . ControlRenderer . prototype . updateAriaState = function ( a , b , c ) { goog . ui . ControlRenderer . ariaAttributeMap _ || ( goog . ui . ControlRenderer . ariaAttributeMap _ = goog . object . create ( goog . ui . Component . State . DISABLED , goog . a11y . aria . State . DISABLED , goog . ui . Component . State . SELECTED , goog . a11y . aria . State . SELECTED , goog . ui . Component . State . CHECKED , goog . a11y . aria . State . CHECKED , goog . ui . Component . State . OPENED , goog . a11y . aria . State . EXPANDED ) ) ; goog . asserts . assert ( a , "The element passed as a first parameter cannot be null." ) ;
( b = goog . ui . ControlRenderer . getAriaStateForAriaRole _ ( a , goog . ui . ControlRenderer . ariaAttributeMap _ [ b ] ) ) && goog . a11y . aria . setState ( a , b , c ) } ; goog . ui . ControlRenderer . getAriaStateForAriaRole _ = function ( a , b ) { var c = goog . a11y . aria . getRole ( a ) ; if ( ! c ) return b ; c = goog . ui . ControlRenderer . TOGGLE _ARIA _STATE _MAP _ [ c ] || b ; return goog . ui . ControlRenderer . isAriaState _ ( b ) ? c : b } ; goog . ui . ControlRenderer . isAriaState _ = function ( a ) { return a == goog . a11y . aria . State . CHECKED || a == goog . a11y . aria . State . SELECTED } ;
goog . ui . ControlRenderer . prototype . setContent = function ( a , b ) { var c = this . getContentElement ( a ) ; if ( c && ( goog . dom . removeChildren ( c ) , b ) ) if ( goog . isString ( b ) ) goog . dom . setTextContent ( c , b ) ; else { var d = function ( a ) { if ( a ) { var b = goog . dom . getOwnerDocument ( c ) ; c . appendChild ( goog . isString ( a ) ? b . createTextNode ( a ) : a ) } } ; goog . isArray ( b ) ? goog . array . forEach ( b , d ) : ! goog . isArrayLike ( b ) || "nodeType" in b ? d ( b ) : goog . array . forEach ( goog . array . clone ( b ) , d ) } } ; goog . ui . ControlRenderer . prototype . getKeyEventTarget = function ( a ) { return a . getElement ( ) } ;
goog . ui . ControlRenderer . prototype . getCssClass = function ( ) { return goog . ui . ControlRenderer . CSS _CLASS } ; goog . ui . ControlRenderer . prototype . getIe6ClassCombinations = function ( ) { return [ ] } ; goog . ui . ControlRenderer . prototype . getStructuralCssClass = function ( ) { return this . getCssClass ( ) } ;
goog . ui . ControlRenderer . prototype . getClassNames = function ( a ) { var b = this . getCssClass ( ) , c = [ b ] , d = this . getStructuralCssClass ( ) ; d != b && c . push ( d ) ; b = this . getClassNamesForState ( a . getState ( ) ) ; c . push . apply ( c , b ) ; ( a = a . getExtraClassNames ( ) ) && c . push . apply ( c , a ) ; goog . userAgent . IE && ! goog . userAgent . isVersionOrHigher ( "7" ) && c . push . apply ( c , this . getAppliedCombinedClassNames _ ( c ) ) ; return c } ;
goog . ui . ControlRenderer . prototype . getAppliedCombinedClassNames _ = function ( a , b ) { var c = [ ] ; b && ( a = goog . array . concat ( a , [ b ] ) ) ; goog . array . forEach ( this . getIe6ClassCombinations ( ) , function ( d ) { ! goog . array . every ( d , goog . partial ( goog . array . contains , a ) ) || b && ! goog . array . contains ( d , b ) || c . push ( d . join ( "_" ) ) } ) ; return c } ; goog . ui . ControlRenderer . prototype . getClassNamesForState = function ( a ) { for ( var b = [ ] ; a ; ) { var c = a & - a ; b . push ( this . getClassForState ( c ) ) ; a &= ~ c } return b } ;
goog . ui . ControlRenderer . prototype . getClassForState = function ( a ) { this . classByState _ || this . createClassByStateMap _ ( ) ; return this . classByState _ [ a ] } ; goog . ui . ControlRenderer . prototype . getStateFromClass = function ( a ) { this . stateByClass _ || this . createStateByClassMap _ ( ) ; a = parseInt ( this . stateByClass _ [ a ] , 10 ) ; return isNaN ( a ) ? 0 : a } ;
goog . ui . ControlRenderer . prototype . createClassByStateMap _ = function ( ) { var a = this . getStructuralCssClass ( ) , b = ! goog . string . contains ( goog . string . normalizeWhitespace ( a ) , " " ) ; goog . asserts . assert ( b , "ControlRenderer has an invalid css class: '" + a + "'" ) ; this . classByState _ = goog . object . create ( goog . ui . Component . State . DISABLED , a + "-disabled" , goog . ui . Component . State . HOVER , a + "-hover" , goog . ui . Component . State . ACTIVE , a + "-active" , goog . ui . Component . State . SELECTED , a + "-selected" , goog . ui . Component . State . CHECKED , a + "-checked" ,
goog . ui . Component . State . FOCUSED , a + "-focused" , goog . ui . Component . State . OPENED , a + "-open" ) } ; goog . ui . ControlRenderer . prototype . createStateByClassMap _ = function ( ) { this . classByState _ || this . createClassByStateMap _ ( ) ; this . stateByClass _ = goog . object . transpose ( this . classByState _ ) } ; goog . ui . Control = function ( a , b , c ) { goog . ui . Component . call ( this , c ) ; this . renderer _ = b || goog . ui . registry . getDefaultRenderer ( this . constructor ) ; this . setContentInternal ( goog . isDef ( a ) ? a : null ) ; this . ariaLabel _ = null } ; goog . inherits ( goog . ui . Control , goog . ui . Component ) ; goog . tagUnsealableClass ( goog . ui . Control ) ; goog . ui . Control . registerDecorator = goog . ui . registry . setDecoratorByClassName ; goog . ui . Control . getDecorator = goog . ui . registry . getDecorator ; goog . ui . Control . prototype . content _ = null ; goog . ui . Control . prototype . state _ = 0 ;
goog . ui . Control . prototype . supportedStates _ = goog . ui . Component . State . DISABLED | goog . ui . Component . State . HOVER | goog . ui . Component . State . ACTIVE | goog . ui . Component . State . FOCUSED ; goog . ui . Control . prototype . autoStates _ = goog . ui . Component . State . ALL ; goog . ui . Control . prototype . statesWithTransitionEvents _ = 0 ; goog . ui . Control . prototype . visible _ = ! 0 ; goog . ui . Control . prototype . extraClassNames _ = null ; goog . ui . Control . prototype . handleMouseEvents _ = ! 0 ; goog . ui . Control . prototype . allowTextSelection _ = ! 1 ;
goog . ui . Control . prototype . preferredAriaRole _ = null ; goog . ui . Control . prototype . isHandleMouseEvents = function ( ) { return this . handleMouseEvents _ } ; goog . ui . Control . prototype . setHandleMouseEvents = function ( a ) { this . isInDocument ( ) && a != this . handleMouseEvents _ && this . enableMouseEventHandling _ ( a ) ; this . handleMouseEvents _ = a } ; goog . ui . Control . prototype . getKeyEventTarget = function ( ) { return this . renderer _ . getKeyEventTarget ( this ) } ;
goog . ui . Control . prototype . getKeyHandler = function ( ) { return this . keyHandler _ || ( this . keyHandler _ = new goog . events . KeyHandler ) } ; goog . ui . Control . prototype . getRenderer = function ( ) { return this . renderer _ } ; goog . ui . Control . prototype . setRenderer = function ( a ) { if ( this . isInDocument ( ) ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . getElement ( ) && this . setElementInternal ( null ) ; this . renderer _ = a } ; goog . ui . Control . prototype . getExtraClassNames = function ( ) { return this . extraClassNames _ } ;
goog . ui . Control . prototype . addClassName = function ( a ) { a && ( this . extraClassNames _ ? goog . array . contains ( this . extraClassNames _ , a ) || this . extraClassNames _ . push ( a ) : this . extraClassNames _ = [ a ] , this . renderer _ . enableExtraClassName ( this , a , ! 0 ) ) } ; goog . ui . Control . prototype . removeClassName = function ( a ) { a && this . extraClassNames _ && goog . array . remove ( this . extraClassNames _ , a ) && ( 0 == this . extraClassNames _ . length && ( this . extraClassNames _ = null ) , this . renderer _ . enableExtraClassName ( this , a , ! 1 ) ) } ;
goog . ui . Control . prototype . enableClassName = function ( a , b ) { b ? this . addClassName ( a ) : this . removeClassName ( a ) } ; goog . ui . Control . prototype . createDom = function ( ) { var a = this . renderer _ . createDom ( this ) ; this . setElementInternal ( a ) ; this . renderer _ . setAriaRole ( a , this . getPreferredAriaRole ( ) ) ; this . isAllowTextSelection ( ) || this . renderer _ . setAllowTextSelection ( a , ! 1 ) ; this . isVisible ( ) || this . renderer _ . setVisible ( a , ! 1 ) } ; goog . ui . Control . prototype . getPreferredAriaRole = function ( ) { return this . preferredAriaRole _ } ;
goog . ui . Control . prototype . setPreferredAriaRole = function ( a ) { this . preferredAriaRole _ = a } ; goog . ui . Control . prototype . getAriaLabel = function ( ) { return this . ariaLabel _ } ; goog . ui . Control . prototype . setAriaLabel = function ( a ) { this . ariaLabel _ = a ; var b = this . getElement ( ) ; b && this . renderer _ . setAriaLabel ( b , a ) } ; goog . ui . Control . prototype . getContentElement = function ( ) { return this . renderer _ . getContentElement ( this . getElement ( ) ) } ; goog . ui . Control . prototype . canDecorate = function ( a ) { return this . renderer _ . canDecorate ( a ) } ;
goog . ui . Control . prototype . decorateInternal = function ( a ) { a = this . renderer _ . decorate ( this , a ) ; this . setElementInternal ( a ) ; this . renderer _ . setAriaRole ( a , this . getPreferredAriaRole ( ) ) ; this . isAllowTextSelection ( ) || this . renderer _ . setAllowTextSelection ( a , ! 1 ) ; this . visible _ = "none" != a . style . display } ;
goog . ui . Control . prototype . enterDocument = function ( ) { goog . ui . Control . superClass _ . enterDocument . call ( this ) ; this . renderer _ . setAriaStates ( this , this . getElementStrict ( ) ) ; this . renderer _ . initializeDom ( this ) ; if ( this . supportedStates _ & ~ goog . ui . Component . State . DISABLED && ( this . isHandleMouseEvents ( ) && this . enableMouseEventHandling _ ( ! 0 ) , this . isSupportedState ( goog . ui . Component . State . FOCUSED ) ) ) { var a = this . getKeyEventTarget ( ) ; if ( a ) { var b = this . getKeyHandler ( ) ; b . attach ( a ) ; this . getHandler ( ) . listen ( b , goog . events . KeyHandler . EventType . KEY ,
this . handleKeyEvent ) . listen ( a , goog . events . EventType . FOCUS , this . handleFocus ) . listen ( a , goog . events . EventType . BLUR , this . handleBlur ) } } } ;
2018-08-17 13:32:56 +00:00
goog . ui . Control . prototype . enableMouseEventHandling _ = function ( a ) { var b = goog . ui . ComponentUtil . getMouseEventType ( this ) , c = this . getHandler ( ) , d = this . getElement ( ) ; a ? ( c . listen ( d , b . MOUSEDOWN , this . handleMouseDown ) . listen ( d , [ b . MOUSEUP , b . MOUSECANCEL ] , this . handleMouseUp ) . listen ( d , goog . events . EventType . MOUSEOVER , this . handleMouseOver ) . listen ( d , goog . events . EventType . MOUSEOUT , this . handleMouseOut ) , this . pointerEventsEnabled ( ) && c . listen ( d , goog . events . EventType . GOTPOINTERCAPTURE , this . preventPointerCapture _ ) , this . handleContextMenu !=
goog . nullFunction && c . listen ( d , goog . events . EventType . CONTEXTMENU , this . handleContextMenu ) , goog . userAgent . IE && ( goog . userAgent . isVersionOrHigher ( 9 ) || c . listen ( d , goog . events . EventType . DBLCLICK , this . handleDblClick ) , this . ieMouseEventSequenceSimulator _ || ( this . ieMouseEventSequenceSimulator _ = new goog . ui . Control . IeMouseEventSequenceSimulator _ ( this ) , this . registerDisposable ( this . ieMouseEventSequenceSimulator _ ) ) ) ) : ( c . unlisten ( d , b . MOUSEDOWN , this . handleMouseDown ) . unlisten ( d , [ b . MOUSEUP , b . MOUSECANCEL ] , this . handleMouseUp ) . unlisten ( d ,
goog . events . EventType . MOUSEOVER , this . handleMouseOver ) . unlisten ( d , goog . events . EventType . MOUSEOUT , this . handleMouseOut ) , this . pointerEventsEnabled ( ) && c . unlisten ( d , goog . events . EventType . GOTPOINTERCAPTURE , this . preventPointerCapture _ ) , this . handleContextMenu != goog . nullFunction && c . unlisten ( d , goog . events . EventType . CONTEXTMENU , this . handleContextMenu ) , goog . userAgent . IE && ( goog . userAgent . isVersionOrHigher ( 9 ) || c . unlisten ( d , goog . events . EventType . DBLCLICK , this . handleDblClick ) , goog . dispose ( this . ieMouseEventSequenceSimulator _ ) ,
this . ieMouseEventSequenceSimulator _ = null ) ) } ; goog . ui . Control . prototype . exitDocument = function ( ) { goog . ui . Control . superClass _ . exitDocument . call ( this ) ; this . keyHandler _ && this . keyHandler _ . detach ( ) ; this . isVisible ( ) && this . isEnabled ( ) && this . renderer _ . setFocusable ( this , ! 1 ) } ;
goog . ui . Control . prototype . disposeInternal = function ( ) { goog . ui . Control . superClass _ . disposeInternal . call ( this ) ; this . keyHandler _ && ( this . keyHandler _ . dispose ( ) , delete this . keyHandler _ ) ; delete this . renderer _ ; this . ieMouseEventSequenceSimulator _ = this . extraClassNames _ = this . content _ = null } ; goog . ui . Control . prototype . getContent = function ( ) { return this . content _ } ; goog . ui . Control . prototype . setContent = function ( a ) { this . renderer _ . setContent ( this . getElement ( ) , a ) ; this . setContentInternal ( a ) } ;
goog . ui . Control . prototype . setContentInternal = function ( a ) { this . content _ = a } ; goog . ui . Control . prototype . getCaption = function ( ) { var a = this . getContent ( ) ; if ( ! a ) return "" ; a = goog . isString ( a ) ? a : goog . isArray ( a ) ? goog . array . map ( a , goog . dom . getRawTextContent ) . join ( "" ) : goog . dom . getTextContent ( a ) ; return goog . string . collapseBreakingSpaces ( a ) } ; goog . ui . Control . prototype . setCaption = function ( a ) { this . setContent ( a ) } ;
goog . ui . Control . prototype . setRightToLeft = function ( a ) { goog . ui . Control . superClass _ . setRightToLeft . call ( this , a ) ; var b = this . getElement ( ) ; b && this . renderer _ . setRightToLeft ( b , a ) } ; goog . ui . Control . prototype . isAllowTextSelection = function ( ) { return this . allowTextSelection _ } ; goog . ui . Control . prototype . setAllowTextSelection = function ( a ) { this . allowTextSelection _ = a ; var b = this . getElement ( ) ; b && this . renderer _ . setAllowTextSelection ( b , a ) } ; goog . ui . Control . prototype . isVisible = function ( ) { return this . visible _ } ;
goog . ui . Control . prototype . setVisible = function ( a , b ) { if ( b || this . visible _ != a && this . dispatchEvent ( a ? goog . ui . Component . EventType . SHOW : goog . ui . Component . EventType . HIDE ) ) { var c = this . getElement ( ) ; c && this . renderer _ . setVisible ( c , a ) ; this . isEnabled ( ) && this . renderer _ . setFocusable ( this , a ) ; this . visible _ = a ; return ! 0 } return ! 1 } ; goog . ui . Control . prototype . isEnabled = function ( ) { return ! this . hasState ( goog . ui . Component . State . DISABLED ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . Control . prototype . isParentDisabled _ = function ( ) { var a = this . getParent ( ) ; return ! ! a && "function" == typeof a . isEnabled && ! a . isEnabled ( ) } ; goog . ui . Control . prototype . setEnabled = function ( a ) { ! this . isParentDisabled _ ( ) && this . isTransitionAllowed ( goog . ui . Component . State . DISABLED , ! a ) && ( a || ( this . setActive ( ! 1 ) , this . setHighlighted ( ! 1 ) ) , this . isVisible ( ) && this . renderer _ . setFocusable ( this , a ) , this . setState ( goog . ui . Component . State . DISABLED , ! a , ! 0 ) ) } ; goog . ui . Control . prototype . isHighlighted = function ( ) { return this . hasState ( goog . ui . Component . State . HOVER ) } ;
goog . ui . Control . prototype . setHighlighted = function ( a ) { this . isTransitionAllowed ( goog . ui . Component . State . HOVER , a ) && this . setState ( goog . ui . Component . State . HOVER , a ) } ; goog . ui . Control . prototype . isActive = function ( ) { return this . hasState ( goog . ui . Component . State . ACTIVE ) } ; goog . ui . Control . prototype . setActive = function ( a ) { this . isTransitionAllowed ( goog . ui . Component . State . ACTIVE , a ) && this . setState ( goog . ui . Component . State . ACTIVE , a ) } ; goog . ui . Control . prototype . isSelected = function ( ) { return this . hasState ( goog . ui . Component . State . SELECTED ) } ;
goog . ui . Control . prototype . setSelected = function ( a ) { this . isTransitionAllowed ( goog . ui . Component . State . SELECTED , a ) && this . setState ( goog . ui . Component . State . SELECTED , a ) } ; goog . ui . Control . prototype . isChecked = function ( ) { return this . hasState ( goog . ui . Component . State . CHECKED ) } ; goog . ui . Control . prototype . setChecked = function ( a ) { this . isTransitionAllowed ( goog . ui . Component . State . CHECKED , a ) && this . setState ( goog . ui . Component . State . CHECKED , a ) } ; goog . ui . Control . prototype . isFocused = function ( ) { return this . hasState ( goog . ui . Component . State . FOCUSED ) } ;
goog . ui . Control . prototype . setFocused = function ( a ) { this . isTransitionAllowed ( goog . ui . Component . State . FOCUSED , a ) && this . setState ( goog . ui . Component . State . FOCUSED , a ) } ; goog . ui . Control . prototype . isOpen = function ( ) { return this . hasState ( goog . ui . Component . State . OPENED ) } ; goog . ui . Control . prototype . setOpen = function ( a ) { this . isTransitionAllowed ( goog . ui . Component . State . OPENED , a ) && this . setState ( goog . ui . Component . State . OPENED , a ) } ; goog . ui . Control . prototype . getState = function ( ) { return this . state _ } ;
goog . ui . Control . prototype . hasState = function ( a ) { return ! ! ( this . state _ & a ) } ; goog . ui . Control . prototype . setState = function ( a , b , c ) { c || a != goog . ui . Component . State . DISABLED ? this . isSupportedState ( a ) && b != this . hasState ( a ) && ( this . renderer _ . setState ( this , a , b ) , this . state _ = b ? this . state _ | a : this . state _ & ~ a ) : this . setEnabled ( ! b ) } ; goog . ui . Control . prototype . setStateInternal = function ( a ) { this . state _ = a } ; goog . ui . Control . prototype . isSupportedState = function ( a ) { return ! ! ( this . supportedStates _ & a ) } ;
goog . ui . Control . prototype . setSupportedState = function ( a , b ) { if ( this . isInDocument ( ) && this . hasState ( a ) && ! b ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; ! b && this . hasState ( a ) && this . setState ( a , ! 1 ) ; this . supportedStates _ = b ? this . supportedStates _ | a : this . supportedStates _ & ~ a } ; goog . ui . Control . prototype . isAutoState = function ( a ) { return ! ! ( this . autoStates _ & a ) && this . isSupportedState ( a ) } ; goog . ui . Control . prototype . setAutoStates = function ( a , b ) { this . autoStates _ = b ? this . autoStates _ | a : this . autoStates _ & ~ a } ;
goog . ui . Control . prototype . isDispatchTransitionEvents = function ( a ) { return ! ! ( this . statesWithTransitionEvents _ & a ) && this . isSupportedState ( a ) } ; goog . ui . Control . prototype . setDispatchTransitionEvents = function ( a , b ) { this . statesWithTransitionEvents _ = b ? this . statesWithTransitionEvents _ | a : this . statesWithTransitionEvents _ & ~ a } ;
goog . ui . Control . prototype . isTransitionAllowed = function ( a , b ) { return this . isSupportedState ( a ) && this . hasState ( a ) != b && ( ! ( this . statesWithTransitionEvents _ & a ) || this . dispatchEvent ( goog . ui . Component . getStateTransitionEvent ( a , b ) ) ) && ! this . isDisposed ( ) } ; goog . ui . Control . prototype . handleMouseOver = function ( a ) { ! goog . ui . Control . isMouseEventWithinElement _ ( a , this . getElement ( ) ) && this . dispatchEvent ( goog . ui . Component . EventType . ENTER ) && this . isEnabled ( ) && this . isAutoState ( goog . ui . Component . State . HOVER ) && this . setHighlighted ( ! 0 ) } ;
2018-08-17 13:32:56 +00:00
goog . ui . Control . prototype . handleMouseOut = function ( a ) { ! goog . ui . Control . isMouseEventWithinElement _ ( a , this . getElement ( ) ) && this . dispatchEvent ( goog . ui . Component . EventType . LEAVE ) && ( this . isAutoState ( goog . ui . Component . State . ACTIVE ) && this . setActive ( ! 1 ) , this . isAutoState ( goog . ui . Component . State . HOVER ) && this . setHighlighted ( ! 1 ) ) } ; goog . ui . Control . prototype . preventPointerCapture _ = function ( a ) { var b = a . target ; b . releasePointerCapture && b . releasePointerCapture ( a . pointerId ) } ;
goog . ui . Control . prototype . handleContextMenu = goog . nullFunction ; goog . ui . Control . isMouseEventWithinElement _ = function ( a , b ) { return ! ! a . relatedTarget && goog . dom . contains ( b , a . relatedTarget ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . Control . prototype . handleMouseDown = function ( a ) { this . isEnabled ( ) && ( this . isAutoState ( goog . ui . Component . State . HOVER ) && this . setHighlighted ( ! 0 ) , a . isMouseActionButton ( ) && ( this . isAutoState ( goog . ui . Component . State . ACTIVE ) && this . setActive ( ! 0 ) , this . renderer _ && this . renderer _ . isFocusable ( this ) && this . getKeyEventTarget ( ) . focus ( ) ) ) ; ! this . isAllowTextSelection ( ) && a . isMouseActionButton ( ) && a . preventDefault ( ) } ;
goog . ui . Control . prototype . handleMouseUp = function ( a ) { this . isEnabled ( ) && ( this . isAutoState ( goog . ui . Component . State . HOVER ) && this . setHighlighted ( ! 0 ) , this . isActive ( ) && this . performActionInternal ( a ) && this . isAutoState ( goog . ui . Component . State . ACTIVE ) && this . setActive ( ! 1 ) ) } ; goog . ui . Control . prototype . handleDblClick = function ( a ) { this . isEnabled ( ) && this . performActionInternal ( a ) } ;
goog . ui . Control . prototype . performActionInternal = function ( a ) { this . isAutoState ( goog . ui . Component . State . CHECKED ) && this . setChecked ( ! this . isChecked ( ) ) ; this . isAutoState ( goog . ui . Component . State . SELECTED ) && this . setSelected ( ! 0 ) ; this . isAutoState ( goog . ui . Component . State . OPENED ) && this . setOpen ( ! this . isOpen ( ) ) ; var b = new goog . events . Event ( goog . ui . Component . EventType . ACTION , this ) ; a && ( b . altKey = a . altKey , b . ctrlKey = a . ctrlKey , b . metaKey = a . metaKey , b . shiftKey = a . shiftKey , b . platformModifierKey = a . platformModifierKey ) ; return this . dispatchEvent ( b ) } ;
goog . ui . Control . prototype . handleFocus = function ( a ) { this . isAutoState ( goog . ui . Component . State . FOCUSED ) && this . setFocused ( ! 0 ) } ; goog . ui . Control . prototype . handleBlur = function ( a ) { this . isAutoState ( goog . ui . Component . State . ACTIVE ) && this . setActive ( ! 1 ) ; this . isAutoState ( goog . ui . Component . State . FOCUSED ) && this . setFocused ( ! 1 ) } ; goog . ui . Control . prototype . handleKeyEvent = function ( a ) { return this . isVisible ( ) && this . isEnabled ( ) && this . handleKeyEventInternal ( a ) ? ( a . preventDefault ( ) , a . stopPropagation ( ) , ! 0 ) : ! 1 } ;
goog . ui . Control . prototype . handleKeyEventInternal = function ( a ) { return a . keyCode == goog . events . KeyCodes . ENTER && this . performActionInternal ( a ) } ; goog . ui . registry . setDefaultRenderer ( goog . ui . Control , goog . ui . ControlRenderer ) ; goog . ui . registry . setDecoratorByClassName ( goog . ui . ControlRenderer . CSS _CLASS , function ( ) { return new goog . ui . Control ( null ) } ) ;
goog . ui . Control . IeMouseEventSequenceSimulator _ = function ( a ) { goog . Disposable . call ( this ) ; this . control _ = a ; this . clickExpected _ = ! 1 ; this . handler _ = new goog . events . EventHandler ( this ) ; this . registerDisposable ( this . handler _ ) ; a = this . control _ . getElementStrict ( ) ; this . handler _ . listen ( a , goog . events . EventType . MOUSEDOWN , this . handleMouseDown _ ) . listen ( a , goog . events . EventType . MOUSEUP , this . handleMouseUp _ ) . listen ( a , goog . events . EventType . CLICK , this . handleClick _ ) } ;
goog . inherits ( goog . ui . Control . IeMouseEventSequenceSimulator _ , goog . Disposable ) ; goog . ui . Control . IeMouseEventSequenceSimulator _ . SYNTHETIC _EVENTS _ = ! goog . userAgent . IE || goog . userAgent . isDocumentModeOrHigher ( 9 ) ; goog . ui . Control . IeMouseEventSequenceSimulator _ . prototype . handleMouseDown _ = function ( ) { this . clickExpected _ = ! 1 } ; goog . ui . Control . IeMouseEventSequenceSimulator _ . prototype . handleMouseUp _ = function ( ) { this . clickExpected _ = ! 0 } ;
goog . ui . Control . IeMouseEventSequenceSimulator _ . makeLeftMouseEvent _ = function ( a , b ) { if ( ! goog . ui . Control . IeMouseEventSequenceSimulator _ . SYNTHETIC _EVENTS _ ) return a . button = goog . events . BrowserEvent . MouseButton . LEFT , a . type = b , a ; var c = document . createEvent ( "MouseEvents" ) ; c . initMouseEvent ( b , a . bubbles , a . cancelable , a . view || null , a . detail , a . screenX , a . screenY , a . clientX , a . clientY , a . ctrlKey , a . altKey , a . shiftKey , a . metaKey , goog . events . BrowserEvent . MouseButton . LEFT , a . relatedTarget || null ) ; return c } ;
goog . ui . Control . IeMouseEventSequenceSimulator _ . prototype . handleClick _ = function ( a ) { if ( this . clickExpected _ ) this . clickExpected _ = ! 1 ; else { var b = a . getBrowserEvent ( ) , c = b . button , d = b . type , e = goog . ui . Control . IeMouseEventSequenceSimulator _ . makeLeftMouseEvent _ ( b , goog . events . EventType . MOUSEDOWN ) ; this . control _ . handleMouseDown ( new goog . events . BrowserEvent ( e , a . currentTarget ) ) ; e = goog . ui . Control . IeMouseEventSequenceSimulator _ . makeLeftMouseEvent _ ( b , goog . events . EventType . MOUSEUP ) ; this . control _ . handleMouseUp ( new goog . events . BrowserEvent ( e ,
a . currentTarget ) ) ; goog . ui . Control . IeMouseEventSequenceSimulator _ . SYNTHETIC _EVENTS _ || ( b . button = c , b . type = d ) } } ; goog . ui . Control . IeMouseEventSequenceSimulator _ . prototype . disposeInternal = function ( ) { this . control _ = null ; goog . ui . Control . IeMouseEventSequenceSimulator _ . superClass _ . disposeInternal . call ( this ) } ; goog . ui . Container = function ( a , b , c ) { goog . ui . Component . call ( this , c ) ; this . renderer _ = b || goog . ui . ContainerRenderer . getInstance ( ) ; this . orientation _ = a || this . renderer _ . getDefaultOrientation ( ) } ; goog . inherits ( goog . ui . Container , goog . ui . Component ) ; goog . tagUnsealableClass ( goog . ui . Container ) ; goog . ui . Container . EventType = { AFTER _SHOW : "aftershow" , AFTER _HIDE : "afterhide" } ; goog . ui . Container . Orientation = { HORIZONTAL : "horizontal" , VERTICAL : "vertical" } ; goog . ui . Container . prototype . keyEventTarget _ = null ;
goog . ui . Container . prototype . keyHandler _ = null ; goog . ui . Container . prototype . renderer _ = null ; goog . ui . Container . prototype . orientation _ = null ; goog . ui . Container . prototype . visible _ = ! 0 ; goog . ui . Container . prototype . enabled _ = ! 0 ; goog . ui . Container . prototype . focusable _ = ! 0 ; goog . ui . Container . prototype . highlightedIndex _ = - 1 ; goog . ui . Container . prototype . openItem _ = null ; goog . ui . Container . prototype . mouseButtonPressed _ = ! 1 ; goog . ui . Container . prototype . allowFocusableChildren _ = ! 1 ;
goog . ui . Container . prototype . openFollowsHighlight _ = ! 0 ; goog . ui . Container . prototype . childElementIdMap _ = null ; goog . ui . Container . prototype . getKeyEventTarget = function ( ) { return this . keyEventTarget _ || this . renderer _ . getKeyEventTarget ( this ) } ;
goog . ui . Container . prototype . setKeyEventTarget = function ( a ) { if ( this . focusable _ ) { var b = this . getKeyEventTarget ( ) , c = this . isInDocument ( ) ; this . keyEventTarget _ = a ; var d = this . getKeyEventTarget ( ) ; c && ( this . keyEventTarget _ = b , this . enableFocusHandling _ ( ! 1 ) , this . keyEventTarget _ = a , this . getKeyHandler ( ) . attach ( d ) , this . enableFocusHandling _ ( ! 0 ) ) } else throw Error ( "Can't set key event target for container that doesn't support keyboard focus!" ) ; } ;
goog . ui . Container . prototype . getKeyHandler = function ( ) { return this . keyHandler _ || ( this . keyHandler _ = new goog . events . KeyHandler ( this . getKeyEventTarget ( ) ) ) } ; goog . ui . Container . prototype . getRenderer = function ( ) { return this . renderer _ } ; goog . ui . Container . prototype . setRenderer = function ( a ) { if ( this . getElement ( ) ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . renderer _ = a } ; goog . ui . Container . prototype . createDom = function ( ) { this . setElementInternal ( this . renderer _ . createDom ( this ) ) } ;
goog . ui . Container . prototype . getContentElement = function ( ) { return this . renderer _ . getContentElement ( this . getElement ( ) ) } ; goog . ui . Container . prototype . canDecorate = function ( a ) { return this . renderer _ . canDecorate ( a ) } ; goog . ui . Container . prototype . decorateInternal = function ( a ) { this . setElementInternal ( this . renderer _ . decorate ( this , a ) ) ; "none" == a . style . display && ( this . visible _ = ! 1 ) } ;
2018-08-17 13:32:56 +00:00
goog . ui . Container . prototype . enterDocument = function ( ) { goog . ui . Container . superClass _ . enterDocument . call ( this ) ; this . forEachChild ( function ( a ) { a . isInDocument ( ) && this . registerChildId _ ( a ) } , this ) ; var a = this . getElement ( ) ; this . renderer _ . initializeDom ( this ) ; this . setVisible ( this . visible _ , ! 0 ) ; var b = goog . ui . ComponentUtil . getMouseEventType ( this ) ; this . getHandler ( ) . listen ( this , goog . ui . Component . EventType . ENTER , this . handleEnterItem ) . listen ( this , goog . ui . Component . EventType . HIGHLIGHT , this . handleHighlightItem ) . listen ( this ,
goog . ui . Component . EventType . UNHIGHLIGHT , this . handleUnHighlightItem ) . listen ( this , goog . ui . Component . EventType . OPEN , this . handleOpenItem ) . listen ( this , goog . ui . Component . EventType . CLOSE , this . handleCloseItem ) . listen ( a , b . MOUSEDOWN , this . handleMouseDown ) . listen ( goog . dom . getOwnerDocument ( a ) , [ b . MOUSEUP , b . MOUSECANCEL ] , this . handleDocumentMouseUp ) . listen ( a , [ b . MOUSEDOWN , b . MOUSEUP , b . MOUSECANCEL , goog . events . EventType . MOUSEOVER , goog . events . EventType . MOUSEOUT , goog . events . EventType . CONTEXTMENU ] , this . handleChildMouseEvents ) ;
this . pointerEventsEnabled ( ) && this . getHandler ( ) . listen ( a , goog . events . EventType . GOTPOINTERCAPTURE , this . preventPointerCapture _ ) ; this . isFocusable ( ) && this . enableFocusHandling _ ( ! 0 ) } ; goog . ui . Container . prototype . preventPointerCapture _ = function ( a ) { var b = a . target ; b . releasePointerCapture && b . releasePointerCapture ( a . pointerId ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . Container . prototype . enableFocusHandling _ = function ( a ) { var b = this . getHandler ( ) , c = this . getKeyEventTarget ( ) ; a ? b . listen ( c , goog . events . EventType . FOCUS , this . handleFocus ) . listen ( c , goog . events . EventType . BLUR , this . handleBlur ) . listen ( this . getKeyHandler ( ) , goog . events . KeyHandler . EventType . KEY , this . handleKeyEvent ) : b . unlisten ( c , goog . events . EventType . FOCUS , this . handleFocus ) . unlisten ( c , goog . events . EventType . BLUR , this . handleBlur ) . unlisten ( this . getKeyHandler ( ) , goog . events . KeyHandler . EventType . KEY , this . handleKeyEvent ) } ;
goog . ui . Container . prototype . exitDocument = function ( ) { this . setHighlightedIndex ( - 1 ) ; this . openItem _ && this . openItem _ . setOpen ( ! 1 ) ; this . mouseButtonPressed _ = ! 1 ; goog . ui . Container . superClass _ . exitDocument . call ( this ) } ; goog . ui . Container . prototype . disposeInternal = function ( ) { goog . ui . Container . superClass _ . disposeInternal . call ( this ) ; this . keyHandler _ && ( this . keyHandler _ . dispose ( ) , this . keyHandler _ = null ) ; this . renderer _ = this . openItem _ = this . childElementIdMap _ = this . keyEventTarget _ = null } ;
goog . ui . Container . prototype . handleEnterItem = function ( a ) { return ! 0 } ;
goog . ui . Container . prototype . handleHighlightItem = function ( a ) { var b = this . indexOfChild ( a . target ) ; if ( - 1 < b && b != this . highlightedIndex _ ) { var c = this . getHighlighted ( ) ; c && c . setHighlighted ( ! 1 ) ; this . highlightedIndex _ = b ; c = this . getHighlighted ( ) ; this . isMouseButtonPressed ( ) && c . setActive ( ! 0 ) ; this . openFollowsHighlight _ && this . openItem _ && c != this . openItem _ && ( c . isSupportedState ( goog . ui . Component . State . OPENED ) ? c . setOpen ( ! 0 ) : this . openItem _ . setOpen ( ! 1 ) ) } b = this . getElement ( ) ; goog . asserts . assert ( b , "The DOM element for the container cannot be null." ) ;
null != a . target . getElement ( ) && goog . a11y . aria . setState ( b , goog . a11y . aria . State . ACTIVEDESCENDANT , a . target . getElement ( ) . id ) } ; goog . ui . Container . prototype . handleUnHighlightItem = function ( a ) { a . target == this . getHighlighted ( ) && ( this . highlightedIndex _ = - 1 ) ; a = this . getElement ( ) ; goog . asserts . assert ( a , "The DOM element for the container cannot be null." ) ; goog . a11y . aria . removeState ( a , goog . a11y . aria . State . ACTIVEDESCENDANT ) } ;
goog . ui . Container . prototype . handleOpenItem = function ( a ) { ( a = a . target ) && a != this . openItem _ && a . getParent ( ) == this && ( this . openItem _ && this . openItem _ . setOpen ( ! 1 ) , this . openItem _ = a ) } ; goog . ui . Container . prototype . handleCloseItem = function ( a ) { a . target == this . openItem _ && ( this . openItem _ = null ) ; var b = this . getElement ( ) , c = a . target . getElement ( ) ; b && a . target . isHighlighted ( ) && c && goog . a11y . aria . setActiveDescendant ( b , c ) } ;
goog . ui . Container . prototype . handleMouseDown = function ( a ) { this . enabled _ && this . setMouseButtonPressed ( ! 0 ) ; var b = this . getKeyEventTarget ( ) ; b && goog . dom . isFocusableTabIndex ( b ) ? b . focus ( ) : a . preventDefault ( ) } ; goog . ui . Container . prototype . handleDocumentMouseUp = function ( a ) { this . setMouseButtonPressed ( ! 1 ) } ;
2018-08-17 13:32:56 +00:00
goog . ui . Container . prototype . handleChildMouseEvents = function ( a ) { var b = goog . ui . ComponentUtil . getMouseEventType ( this ) , c = this . getOwnerControl ( a . target ) ; if ( c ) switch ( a . type ) { case b . MOUSEDOWN : c . handleMouseDown ( a ) ; break ; case b . MOUSEUP : case b . MOUSECANCEL : c . handleMouseUp ( a ) ; break ; case goog . events . EventType . MOUSEOVER : c . handleMouseOver ( a ) ; break ; case goog . events . EventType . MOUSEOUT : c . handleMouseOut ( a ) ; break ; case goog . events . EventType . CONTEXTMENU : c . handleContextMenu ( a ) } } ;
2017-09-25 09:37:41 +00:00
goog . ui . Container . prototype . getOwnerControl = function ( a ) { if ( this . childElementIdMap _ ) for ( var b = this . getElement ( ) ; a && a !== b ; ) { var c = a . id ; if ( c in this . childElementIdMap _ ) return this . childElementIdMap _ [ c ] ; a = a . parentNode } return null } ; goog . ui . Container . prototype . handleFocus = function ( a ) { } ; goog . ui . Container . prototype . handleBlur = function ( a ) { this . setHighlightedIndex ( - 1 ) ; this . setMouseButtonPressed ( ! 1 ) ; this . openItem _ && this . openItem _ . setOpen ( ! 1 ) } ;
goog . ui . Container . prototype . handleKeyEvent = function ( a ) { return this . isEnabled ( ) && this . isVisible ( ) && ( 0 != this . getChildCount ( ) || this . keyEventTarget _ ) && this . handleKeyEventInternal ( a ) ? ( a . preventDefault ( ) , a . stopPropagation ( ) , ! 0 ) : ! 1 } ;
goog . ui . Container . prototype . handleKeyEventInternal = function ( a ) { var b = this . getHighlighted ( ) ; if ( b && "function" == typeof b . handleKeyEvent && b . handleKeyEvent ( a ) || this . openItem _ && this . openItem _ != b && "function" == typeof this . openItem _ . handleKeyEvent && this . openItem _ . handleKeyEvent ( a ) ) return ! 0 ; if ( a . shiftKey || a . ctrlKey || a . metaKey || a . altKey ) return ! 1 ; switch ( a . keyCode ) { case goog . events . KeyCodes . ESC : if ( this . isFocusable ( ) ) this . getKeyEventTarget ( ) . blur ( ) ; else return ! 1 ; break ; case goog . events . KeyCodes . HOME : this . highlightFirst ( ) ;
break ; case goog . events . KeyCodes . END : this . highlightLast ( ) ; break ; case goog . events . KeyCodes . UP : if ( this . orientation _ == goog . ui . Container . Orientation . VERTICAL ) this . highlightPrevious ( ) ; else return ! 1 ; break ; case goog . events . KeyCodes . LEFT : if ( this . orientation _ == goog . ui . Container . Orientation . HORIZONTAL ) this . isRightToLeft ( ) ? this . highlightNext ( ) : this . highlightPrevious ( ) ; else return ! 1 ; break ; case goog . events . KeyCodes . DOWN : if ( this . orientation _ == goog . ui . Container . Orientation . VERTICAL ) this . highlightNext ( ) ; else return ! 1 ;
2018-01-16 21:13:23 +00:00
break ; case goog . events . KeyCodes . RIGHT : if ( this . orientation _ == goog . ui . Container . Orientation . HORIZONTAL ) this . isRightToLeft ( ) ? this . highlightPrevious ( ) : this . highlightNext ( ) ; else return ! 1 ; break ; default : return ! 1 } return ! 0 } ; goog . ui . Container . prototype . registerChildId _ = function ( a ) { var b = a . getElement ( ) ; b = b . id || ( b . id = a . getId ( ) ) ; this . childElementIdMap _ || ( this . childElementIdMap _ = { } ) ; this . childElementIdMap _ [ b ] = a } ;
2017-09-25 09:37:41 +00:00
goog . ui . Container . prototype . addChild = function ( a , b ) { goog . asserts . assertInstanceof ( a , goog . ui . Control , "The child of a container must be a control" ) ; goog . ui . Container . superClass _ . addChild . call ( this , a , b ) } ;
goog . ui . Container . prototype . addChildAt = function ( a , b , c ) { goog . asserts . assertInstanceof ( a , goog . ui . Control ) ; a . setDispatchTransitionEvents ( goog . ui . Component . State . HOVER , ! 0 ) ; a . setDispatchTransitionEvents ( goog . ui . Component . State . OPENED , ! 0 ) ; ! this . isFocusable ( ) && this . isFocusableChildrenAllowed ( ) || a . setSupportedState ( goog . ui . Component . State . FOCUSED , ! 1 ) ; a . setHandleMouseEvents ( ! 1 ) ; var d = a . getParent ( ) == this ? this . indexOfChild ( a ) : - 1 ; goog . ui . Container . superClass _ . addChildAt . call ( this , a , b , c ) ; a . isInDocument ( ) && this . isInDocument ( ) &&
this . registerChildId _ ( a ) ; this . updateHighlightedIndex _ ( d , b ) } ; goog . ui . Container . prototype . updateHighlightedIndex _ = function ( a , b ) { - 1 == a && ( a = this . getChildCount ( ) ) ; a == this . highlightedIndex _ ? this . highlightedIndex _ = Math . min ( this . getChildCount ( ) - 1 , b ) : a > this . highlightedIndex _ && b <= this . highlightedIndex _ ? this . highlightedIndex _ ++ : a < this . highlightedIndex _ && b > this . highlightedIndex _ && this . highlightedIndex _ -- } ;
goog . ui . Container . prototype . removeChild = function ( a , b ) { a = goog . isString ( a ) ? this . getChild ( a ) : a ; goog . asserts . assertInstanceof ( a , goog . ui . Control ) ; if ( a ) { var c = this . indexOfChild ( a ) ; - 1 != c && ( c == this . highlightedIndex _ ? ( a . setHighlighted ( ! 1 ) , this . highlightedIndex _ = - 1 ) : c < this . highlightedIndex _ && this . highlightedIndex _ -- ) ; ( c = a . getElement ( ) ) && c . id && this . childElementIdMap _ && goog . object . remove ( this . childElementIdMap _ , c . id ) } a = goog . ui . Container . superClass _ . removeChild . call ( this , a , b ) ; a . setHandleMouseEvents ( ! 0 ) ; return a } ;
goog . ui . Container . prototype . getOrientation = function ( ) { return this . orientation _ } ; goog . ui . Container . prototype . setOrientation = function ( a ) { if ( this . getElement ( ) ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . orientation _ = a } ; goog . ui . Container . prototype . isVisible = function ( ) { return this . visible _ } ;
goog . ui . Container . prototype . setVisible = function ( a , b ) { if ( b || this . visible _ != a && this . dispatchEvent ( a ? goog . ui . Component . EventType . SHOW : goog . ui . Component . EventType . HIDE ) ) { this . visible _ = a ; var c = this . getElement ( ) ; c && ( goog . style . setElementShown ( c , a ) , this . isFocusable ( ) && this . renderer _ . enableTabIndex ( this . getKeyEventTarget ( ) , this . enabled _ && this . visible _ ) , b || this . dispatchEvent ( this . visible _ ? goog . ui . Container . EventType . AFTER _SHOW : goog . ui . Container . EventType . AFTER _HIDE ) ) ; return ! 0 } return ! 1 } ;
goog . ui . Container . prototype . isEnabled = function ( ) { return this . enabled _ } ;
goog . ui . Container . prototype . setEnabled = function ( a ) { this . enabled _ != a && this . dispatchEvent ( a ? goog . ui . Component . EventType . ENABLE : goog . ui . Component . EventType . DISABLE ) && ( a ? ( this . enabled _ = ! 0 , this . forEachChild ( function ( a ) { a . wasDisabled ? delete a . wasDisabled : a . setEnabled ( ! 0 ) } ) ) : ( this . forEachChild ( function ( a ) { a . isEnabled ( ) ? a . setEnabled ( ! 1 ) : a . wasDisabled = ! 0 } ) , this . enabled _ = ! 1 , this . setMouseButtonPressed ( ! 1 ) ) , this . isFocusable ( ) && this . renderer _ . enableTabIndex ( this . getKeyEventTarget ( ) , a && this . visible _ ) ) } ;
goog . ui . Container . prototype . isFocusable = function ( ) { return this . focusable _ } ; goog . ui . Container . prototype . setFocusable = function ( a ) { a != this . focusable _ && this . isInDocument ( ) && this . enableFocusHandling _ ( a ) ; this . focusable _ = a ; this . enabled _ && this . visible _ && this . renderer _ . enableTabIndex ( this . getKeyEventTarget ( ) , a ) } ; goog . ui . Container . prototype . isFocusableChildrenAllowed = function ( ) { return this . allowFocusableChildren _ } ;
goog . ui . Container . prototype . setFocusableChildrenAllowed = function ( a ) { this . allowFocusableChildren _ = a } ; goog . ui . Container . prototype . isOpenFollowsHighlight = function ( ) { return this . openFollowsHighlight _ } ; goog . ui . Container . prototype . setOpenFollowsHighlight = function ( a ) { this . openFollowsHighlight _ = a } ; goog . ui . Container . prototype . getHighlightedIndex = function ( ) { return this . highlightedIndex _ } ;
goog . ui . Container . prototype . setHighlightedIndex = function ( a ) { ( a = this . getChildAt ( a ) ) ? a . setHighlighted ( ! 0 ) : - 1 < this . highlightedIndex _ && this . getHighlighted ( ) . setHighlighted ( ! 1 ) } ; goog . ui . Container . prototype . setHighlighted = function ( a ) { this . setHighlightedIndex ( this . indexOfChild ( a ) ) } ; goog . ui . Container . prototype . getHighlighted = function ( ) { return this . getChildAt ( this . highlightedIndex _ ) } ;
goog . ui . Container . prototype . highlightFirst = function ( ) { this . highlightHelper ( function ( a , b ) { return ( a + 1 ) % b } , this . getChildCount ( ) - 1 ) } ; goog . ui . Container . prototype . highlightLast = function ( ) { this . highlightHelper ( function ( a , b ) { a -- ; return 0 > a ? b - 1 : a } , 0 ) } ; goog . ui . Container . prototype . highlightNext = function ( ) { this . highlightHelper ( function ( a , b ) { return ( a + 1 ) % b } , this . highlightedIndex _ ) } ; goog . ui . Container . prototype . highlightPrevious = function ( ) { this . highlightHelper ( function ( a , b ) { a -- ; return 0 > a ? b - 1 : a } , this . highlightedIndex _ ) } ;
2018-01-16 21:13:23 +00:00
goog . ui . Container . prototype . highlightHelper = function ( a , b ) { var c = 0 > b ? this . indexOfChild ( this . openItem _ ) : b , d = this . getChildCount ( ) ; c = a . call ( this , c , d ) ; for ( var e = 0 ; e <= d ; ) { var f = this . getChildAt ( c ) ; if ( f && this . canHighlightItem ( f ) ) return this . setHighlightedIndexFromKeyEvent ( c ) , ! 0 ; e ++ ; c = a . call ( this , c , d ) } return ! 1 } ; goog . ui . Container . prototype . canHighlightItem = function ( a ) { return a . isVisible ( ) && a . isEnabled ( ) && a . isSupportedState ( goog . ui . Component . State . HOVER ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . Container . prototype . setHighlightedIndexFromKeyEvent = function ( a ) { this . setHighlightedIndex ( a ) } ; goog . ui . Container . prototype . getOpenItem = function ( ) { return this . openItem _ } ; goog . ui . Container . prototype . isMouseButtonPressed = function ( ) { return this . mouseButtonPressed _ } ; goog . ui . Container . prototype . setMouseButtonPressed = function ( a ) { this . mouseButtonPressed _ = a } ; goog . ui . MenuHeaderRenderer = function ( ) { goog . ui . ControlRenderer . call ( this ) } ; goog . inherits ( goog . ui . MenuHeaderRenderer , goog . ui . ControlRenderer ) ; goog . addSingletonGetter ( goog . ui . MenuHeaderRenderer ) ; goog . ui . MenuHeaderRenderer . CSS _CLASS = "goog-menuheader" ; goog . ui . MenuHeaderRenderer . prototype . getCssClass = function ( ) { return goog . ui . MenuHeaderRenderer . CSS _CLASS } ; goog . ui . MenuHeader = function ( a , b , c ) { goog . ui . Control . call ( this , a , c || goog . ui . MenuHeaderRenderer . getInstance ( ) , b ) ; this . setSupportedState ( goog . ui . Component . State . DISABLED , ! 1 ) ; this . setSupportedState ( goog . ui . Component . State . HOVER , ! 1 ) ; this . setSupportedState ( goog . ui . Component . State . ACTIVE , ! 1 ) ; this . setSupportedState ( goog . ui . Component . State . FOCUSED , ! 1 ) ; this . setStateInternal ( goog . ui . Component . State . DISABLED ) } ; goog . inherits ( goog . ui . MenuHeader , goog . ui . Control ) ;
goog . ui . registry . setDecoratorByClassName ( goog . ui . MenuHeaderRenderer . CSS _CLASS , function ( ) { return new goog . ui . MenuHeader ( null ) } ) ; goog . ui . MenuItemRenderer = function ( ) { goog . ui . ControlRenderer . call ( this ) ; this . classNameCache _ = [ ] } ; goog . inherits ( goog . ui . MenuItemRenderer , goog . ui . ControlRenderer ) ; goog . addSingletonGetter ( goog . ui . MenuItemRenderer ) ; goog . ui . MenuItemRenderer . CSS _CLASS = "goog-menuitem" ; goog . ui . MenuItemRenderer . CompositeCssClassIndex _ = { HOVER : 0 , CHECKBOX : 1 , CONTENT : 2 } ;
goog . ui . MenuItemRenderer . prototype . getCompositeCssClass _ = function ( a ) { var b = this . classNameCache _ [ a ] ; if ( ! b ) { switch ( a ) { case goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . HOVER : b = this . getStructuralCssClass ( ) + "-highlight" ; break ; case goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . CHECKBOX : b = this . getStructuralCssClass ( ) + "-checkbox" ; break ; case goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . CONTENT : b = this . getStructuralCssClass ( ) + "-content" } this . classNameCache _ [ a ] = b } return b } ;
goog . ui . MenuItemRenderer . prototype . getAriaRole = function ( ) { return goog . a11y . aria . Role . MENU _ITEM } ; goog . ui . MenuItemRenderer . prototype . createDom = function ( a ) { var b = a . getDomHelper ( ) . createDom ( "DIV" , this . getClassNames ( a ) . join ( " " ) , this . createContent ( a . getContent ( ) , a . getDomHelper ( ) ) ) ; this . setEnableCheckBoxStructure ( a , b , a . isSupportedState ( goog . ui . Component . State . SELECTED ) || a . isSupportedState ( goog . ui . Component . State . CHECKED ) ) ; return b } ;
goog . ui . MenuItemRenderer . prototype . getContentElement = function ( a ) { return a && a . firstChild } ; goog . ui . MenuItemRenderer . prototype . decorate = function ( a , b ) { goog . asserts . assert ( b ) ; this . hasContentStructure ( b ) || b . appendChild ( this . createContent ( b . childNodes , a . getDomHelper ( ) ) ) ; goog . dom . classlist . contains ( b , "goog-option" ) && ( a . setCheckable ( ! 0 ) , this . setCheckable ( a , b , ! 0 ) ) ; return goog . ui . MenuItemRenderer . superClass _ . decorate . call ( this , a , b ) } ;
goog . ui . MenuItemRenderer . prototype . setContent = function ( a , b ) { var c = this . getContentElement ( a ) , d = this . hasCheckBoxStructure ( a ) ? c . firstChild : null ; goog . ui . MenuItemRenderer . superClass _ . setContent . call ( this , a , b ) ; d && ! this . hasCheckBoxStructure ( a ) && c . insertBefore ( d , c . firstChild || null ) } ;
goog . ui . MenuItemRenderer . prototype . hasContentStructure = function ( a ) { a = goog . dom . getFirstElementChild ( a ) ; var b = this . getCompositeCssClass _ ( goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . CONTENT ) ; return ! ! a && goog . dom . classlist . contains ( a , b ) } ; goog . ui . MenuItemRenderer . prototype . createContent = function ( a , b ) { var c = this . getCompositeCssClass _ ( goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . CONTENT ) ; return b . createDom ( "DIV" , c , a ) } ;
goog . ui . MenuItemRenderer . prototype . setSelectable = function ( a , b , c ) { a && b && this . setEnableCheckBoxStructure ( a , b , c ) } ; goog . ui . MenuItemRenderer . prototype . setCheckable = function ( a , b , c ) { a && b && this . setEnableCheckBoxStructure ( a , b , c ) } ; goog . ui . MenuItemRenderer . prototype . hasCheckBoxStructure = function ( a ) { if ( a = this . getContentElement ( a ) ) { a = a . firstChild ; var b = this . getCompositeCssClass _ ( goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . CHECKBOX ) ; return ! ! a && goog . dom . isElement ( a ) && goog . dom . classlist . contains ( a , b ) } return ! 1 } ;
goog . ui . MenuItemRenderer . prototype . setEnableCheckBoxStructure = function ( a , b , c ) { this . setAriaRole ( b , a . getPreferredAriaRole ( ) ) ; this . setAriaStates ( a , b ) ; c != this . hasCheckBoxStructure ( b ) && ( goog . dom . classlist . enable ( b , "goog-option" , c ) , b = this . getContentElement ( b ) , c ? ( c = this . getCompositeCssClass _ ( goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . CHECKBOX ) , b . insertBefore ( a . getDomHelper ( ) . createDom ( "DIV" , c ) , b . firstChild || null ) ) : b . removeChild ( b . firstChild ) ) } ;
goog . ui . MenuItemRenderer . prototype . getClassForState = function ( a ) { switch ( a ) { case goog . ui . Component . State . HOVER : return this . getCompositeCssClass _ ( goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . HOVER ) ; case goog . ui . Component . State . CHECKED : case goog . ui . Component . State . SELECTED : return "goog-option-selected" ; default : return goog . ui . MenuItemRenderer . superClass _ . getClassForState . call ( this , a ) } } ;
goog . ui . MenuItemRenderer . prototype . getStateFromClass = function ( a ) { var b = this . getCompositeCssClass _ ( goog . ui . MenuItemRenderer . CompositeCssClassIndex _ . HOVER ) ; switch ( a ) { case "goog-option-selected" : return goog . ui . Component . State . CHECKED ; case b : return goog . ui . Component . State . HOVER ; default : return goog . ui . MenuItemRenderer . superClass _ . getStateFromClass . call ( this , a ) } } ; goog . ui . MenuItemRenderer . prototype . getCssClass = function ( ) { return goog . ui . MenuItemRenderer . CSS _CLASS } ; goog . ui . MenuItem = function ( a , b , c , d ) { goog . ui . Control . call ( this , a , d || goog . ui . MenuItemRenderer . getInstance ( ) , c ) ; this . setValue ( b ) } ; goog . inherits ( goog . ui . MenuItem , goog . ui . Control ) ; goog . tagUnsealableClass ( goog . ui . MenuItem ) ; goog . ui . MenuItem . MNEMONIC _WRAPPER _CLASS _ = "goog-menuitem-mnemonic-separator" ; goog . ui . MenuItem . ACCELERATOR _CLASS = "goog-menuitem-accel" ; goog . ui . MenuItem . prototype . getValue = function ( ) { var a = this . getModel ( ) ; return null != a ? a : this . getCaption ( ) } ; goog . ui . MenuItem . prototype . setValue = function ( a ) { this . setModel ( a ) } ;
goog . ui . MenuItem . prototype . setSupportedState = function ( a , b ) { goog . ui . MenuItem . superClass _ . setSupportedState . call ( this , a , b ) ; switch ( a ) { case goog . ui . Component . State . SELECTED : this . setSelectableInternal _ ( b ) ; break ; case goog . ui . Component . State . CHECKED : this . setCheckableInternal _ ( b ) } } ; goog . ui . MenuItem . prototype . setSelectable = function ( a ) { this . setSupportedState ( goog . ui . Component . State . SELECTED , a ) } ;
goog . ui . MenuItem . prototype . setSelectableInternal _ = function ( a ) { this . isChecked ( ) && ! a && this . setChecked ( ! 1 ) ; var b = this . getElement ( ) ; b && this . getRenderer ( ) . setSelectable ( this , b , a ) } ; goog . ui . MenuItem . prototype . setCheckable = function ( a ) { this . setSupportedState ( goog . ui . Component . State . CHECKED , a ) } ; goog . ui . MenuItem . prototype . setCheckableInternal _ = function ( a ) { var b = this . getElement ( ) ; b && this . getRenderer ( ) . setCheckable ( this , b , a ) } ;
2018-01-16 21:13:23 +00:00
goog . ui . MenuItem . prototype . getCaption = function ( ) { var a = this . getContent ( ) ; if ( goog . isArray ( a ) ) { var b = goog . ui . MenuItem . ACCELERATOR _CLASS , c = goog . ui . MenuItem . MNEMONIC _WRAPPER _CLASS _ ; a = goog . array . map ( a , function ( a ) { return goog . dom . isElement ( a ) && ( goog . dom . classlist . contains ( a , b ) || goog . dom . classlist . contains ( a , c ) ) ? "" : goog . dom . getRawTextContent ( a ) } ) . join ( "" ) ; return goog . string . collapseBreakingSpaces ( a ) } return goog . ui . MenuItem . superClass _ . getCaption . call ( this ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . MenuItem . prototype . getAccelerator = function ( ) { var a = this . getDomHelper ( ) , b = this . getContent ( ) ; return goog . isArray ( b ) && ( b = goog . array . find ( b , function ( a ) { return goog . dom . classlist . contains ( a , goog . ui . MenuItem . ACCELERATOR _CLASS ) } ) ) ? a . getTextContent ( b ) : null } ;
goog . ui . MenuItem . prototype . handleMouseUp = function ( a ) { var b = this . getParent ( ) ; if ( b ) { var c = b . openingCoords ; b . openingCoords = null ; if ( c && goog . isNumber ( a . clientX ) && ( b = new goog . math . Coordinate ( a . clientX , a . clientY ) , goog . math . Coordinate . equals ( c , b ) ) ) return } goog . ui . MenuItem . superClass _ . handleMouseUp . call ( this , a ) } ; goog . ui . MenuItem . prototype . handleKeyEventInternal = function ( a ) { return a . keyCode == this . getMnemonic ( ) && this . performActionInternal ( a ) ? ! 0 : goog . ui . MenuItem . superClass _ . handleKeyEventInternal . call ( this , a ) } ;
goog . ui . MenuItem . prototype . setMnemonic = function ( a ) { this . mnemonicKey _ = a } ; goog . ui . MenuItem . prototype . getMnemonic = function ( ) { return this . mnemonicKey _ } ; goog . ui . registry . setDecoratorByClassName ( goog . ui . MenuItemRenderer . CSS _CLASS , function ( ) { return new goog . ui . MenuItem ( null ) } ) ;
goog . ui . MenuItem . prototype . getPreferredAriaRole = function ( ) { return this . isSupportedState ( goog . ui . Component . State . CHECKED ) ? goog . a11y . aria . Role . MENU _ITEM _CHECKBOX : this . isSupportedState ( goog . ui . Component . State . SELECTED ) ? goog . a11y . aria . Role . MENU _ITEM _RADIO : goog . ui . MenuItem . superClass _ . getPreferredAriaRole . call ( this ) } ; goog . ui . MenuItem . prototype . getParent = function ( ) { return goog . ui . Control . prototype . getParent . call ( this ) } ; goog . ui . MenuItem . prototype . getParentEventTarget = function ( ) { return goog . ui . Control . prototype . getParentEventTarget . call ( this ) } ; goog . ui . MenuSeparatorRenderer = function ( ) { goog . ui . ControlRenderer . call ( this ) } ; goog . inherits ( goog . ui . MenuSeparatorRenderer , goog . ui . ControlRenderer ) ; goog . addSingletonGetter ( goog . ui . MenuSeparatorRenderer ) ; goog . ui . MenuSeparatorRenderer . CSS _CLASS = "goog-menuseparator" ; goog . ui . MenuSeparatorRenderer . prototype . createDom = function ( a ) { return a . getDomHelper ( ) . createDom ( "DIV" , this . getCssClass ( ) ) } ;
goog . ui . MenuSeparatorRenderer . prototype . decorate = function ( a , b ) { b . id && a . setId ( b . id ) ; if ( "HR" == b . tagName ) { var c = b ; b = this . createDom ( a ) ; goog . dom . insertSiblingBefore ( b , c ) ; goog . dom . removeNode ( c ) } else goog . dom . classlist . add ( b , this . getCssClass ( ) ) ; return b } ; goog . ui . MenuSeparatorRenderer . prototype . setContent = function ( a , b ) { } ; goog . ui . MenuSeparatorRenderer . prototype . getCssClass = function ( ) { return goog . ui . MenuSeparatorRenderer . CSS _CLASS } ; goog . ui . Separator = function ( a , b ) { goog . ui . Control . call ( this , null , a || goog . ui . MenuSeparatorRenderer . getInstance ( ) , b ) ; this . setSupportedState ( goog . ui . Component . State . DISABLED , ! 1 ) ; this . setSupportedState ( goog . ui . Component . State . HOVER , ! 1 ) ; this . setSupportedState ( goog . ui . Component . State . ACTIVE , ! 1 ) ; this . setSupportedState ( goog . ui . Component . State . FOCUSED , ! 1 ) ; this . setStateInternal ( goog . ui . Component . State . DISABLED ) } ; goog . inherits ( goog . ui . Separator , goog . ui . Control ) ;
goog . ui . Separator . prototype . enterDocument = function ( ) { goog . ui . Separator . superClass _ . enterDocument . call ( this ) ; var a = this . getElement ( ) ; goog . asserts . assert ( a , "The DOM element for the separator cannot be null." ) ; goog . a11y . aria . setRole ( a , "separator" ) } ; goog . ui . registry . setDecoratorByClassName ( goog . ui . MenuSeparatorRenderer . CSS _CLASS , function ( ) { return new goog . ui . Separator } ) ; goog . ui . MenuRenderer = function ( a ) { goog . ui . ContainerRenderer . call ( this , a || goog . a11y . aria . Role . MENU ) } ; goog . inherits ( goog . ui . MenuRenderer , goog . ui . ContainerRenderer ) ; goog . addSingletonGetter ( goog . ui . MenuRenderer ) ; goog . ui . MenuRenderer . CSS _CLASS = "goog-menu" ; goog . ui . MenuRenderer . prototype . canDecorate = function ( a ) { return "UL" == a . tagName || goog . ui . MenuRenderer . superClass _ . canDecorate . call ( this , a ) } ;
goog . ui . MenuRenderer . prototype . getDecoratorForChild = function ( a ) { return "HR" == a . tagName ? new goog . ui . Separator : goog . ui . MenuRenderer . superClass _ . getDecoratorForChild . call ( this , a ) } ; goog . ui . MenuRenderer . prototype . containsElement = function ( a , b ) { return goog . dom . contains ( a . getElement ( ) , b ) } ; goog . ui . MenuRenderer . prototype . getCssClass = function ( ) { return goog . ui . MenuRenderer . CSS _CLASS } ;
goog . ui . MenuRenderer . prototype . initializeDom = function ( a ) { goog . ui . MenuRenderer . superClass _ . initializeDom . call ( this , a ) ; a = a . getElement ( ) ; goog . asserts . assert ( a , "The menu DOM element cannot be null." ) ; goog . a11y . aria . setState ( a , goog . a11y . aria . State . HASPOPUP , "true" ) } ; goog . ui . MenuSeparator = function ( a ) { goog . ui . Separator . call ( this , goog . ui . MenuSeparatorRenderer . getInstance ( ) , a ) } ; goog . inherits ( goog . ui . MenuSeparator , goog . ui . Separator ) ; goog . ui . registry . setDecoratorByClassName ( goog . ui . MenuSeparatorRenderer . CSS _CLASS , function ( ) { return new goog . ui . Separator } ) ; goog . ui . Menu = function ( a , b ) { goog . ui . Container . call ( this , goog . ui . Container . Orientation . VERTICAL , b || goog . ui . MenuRenderer . getInstance ( ) , a ) ; this . setFocusable ( ! 1 ) } ; goog . inherits ( goog . ui . Menu , goog . ui . Container ) ; goog . tagUnsealableClass ( goog . ui . Menu ) ; goog . ui . Menu . EventType = { BEFORE _SHOW : goog . ui . Component . EventType . BEFORE _SHOW , SHOW : goog . ui . Component . EventType . SHOW , BEFORE _HIDE : goog . ui . Component . EventType . HIDE , HIDE : goog . ui . Component . EventType . HIDE } ; goog . ui . Menu . CSS _CLASS = goog . ui . MenuRenderer . CSS _CLASS ;
goog . ui . Menu . prototype . allowAutoFocus _ = ! 0 ; goog . ui . Menu . prototype . allowHighlightDisabled _ = ! 1 ; goog . ui . Menu . prototype . getCssClass = function ( ) { return this . getRenderer ( ) . getCssClass ( ) } ; goog . ui . Menu . prototype . containsElement = function ( a ) { if ( this . getRenderer ( ) . containsElement ( this , a ) ) return ! 0 ; for ( var b = 0 , c = this . getChildCount ( ) ; b < c ; b ++ ) { var d = this . getChildAt ( b ) ; if ( "function" == typeof d . containsElement && d . containsElement ( a ) ) return ! 0 } return ! 1 } ; goog . ui . Menu . prototype . addItem = function ( a ) { this . addChild ( a , ! 0 ) } ;
goog . ui . Menu . prototype . addItemAt = function ( a , b ) { this . addChildAt ( a , b , ! 0 ) } ; goog . ui . Menu . prototype . removeItem = function ( a ) { ( a = this . removeChild ( a , ! 0 ) ) && a . dispose ( ) } ; goog . ui . Menu . prototype . removeItemAt = function ( a ) { ( a = this . removeChildAt ( a , ! 0 ) ) && a . dispose ( ) } ; goog . ui . Menu . prototype . getItemAt = function ( a ) { return this . getChildAt ( a ) } ; goog . ui . Menu . prototype . getItemCount = function ( ) { return this . getChildCount ( ) } ; goog . ui . Menu . prototype . getItems = function ( ) { var a = [ ] ; this . forEachChild ( function ( b ) { a . push ( b ) } ) ; return a } ;
goog . ui . Menu . prototype . setPosition = function ( a , b ) { var c = this . isVisible ( ) ; c || goog . style . setElementShown ( this . getElement ( ) , ! 0 ) ; goog . style . setPageOffset ( this . getElement ( ) , a , b ) ; c || goog . style . setElementShown ( this . getElement ( ) , ! 1 ) } ; goog . ui . Menu . prototype . getPosition = function ( ) { return this . isVisible ( ) ? goog . style . getPageOffset ( this . getElement ( ) ) : null } ; goog . ui . Menu . prototype . setAllowAutoFocus = function ( a ) { ( this . allowAutoFocus _ = a ) && this . setFocusable ( ! 0 ) } ; goog . ui . Menu . prototype . getAllowAutoFocus = function ( ) { return this . allowAutoFocus _ } ;
goog . ui . Menu . prototype . setAllowHighlightDisabled = function ( a ) { this . allowHighlightDisabled _ = a } ; goog . ui . Menu . prototype . getAllowHighlightDisabled = function ( ) { return this . allowHighlightDisabled _ } ; goog . ui . Menu . prototype . setVisible = function ( a , b , c ) { ( b = goog . ui . Menu . superClass _ . setVisible . call ( this , a , b ) ) && a && this . isInDocument ( ) && this . allowAutoFocus _ && this . getKeyEventTarget ( ) . focus ( ) ; a && c && goog . isNumber ( c . clientX ) ? this . openingCoords = new goog . math . Coordinate ( c . clientX , c . clientY ) : this . openingCoords = null ; return b } ;
goog . ui . Menu . prototype . handleEnterItem = function ( a ) { this . allowAutoFocus _ && this . getKeyEventTarget ( ) . focus ( ) ; return goog . ui . Menu . superClass _ . handleEnterItem . call ( this , a ) } ; goog . ui . Menu . prototype . highlightNextPrefix = function ( a ) { var b = new RegExp ( "^" + goog . string . regExpEscape ( a ) , "i" ) ; return this . highlightHelper ( function ( a , d ) { var c = 0 > a ? 0 : a , f = ! 1 ; do { ++ a ; a == d && ( a = 0 , f = ! 0 ) ; var g = this . getChildAt ( a ) . getCaption ( ) ; if ( g && g . match ( b ) ) return a } while ( ! f || a != c ) ; return this . getHighlightedIndex ( ) } , this . getHighlightedIndex ( ) ) } ;
goog . ui . Menu . prototype . canHighlightItem = function ( a ) { return ( this . allowHighlightDisabled _ || a . isEnabled ( ) ) && a . isVisible ( ) && a . isSupportedState ( goog . ui . Component . State . HOVER ) } ; goog . ui . Menu . prototype . decorateInternal = function ( a ) { this . decorateContent ( a ) ; goog . ui . Menu . superClass _ . decorateInternal . call ( this , a ) } ;
goog . ui . Menu . prototype . handleKeyEventInternal = function ( a ) { var b = goog . ui . Menu . superClass _ . handleKeyEventInternal . call ( this , a ) ; b || this . forEachChild ( function ( c ) { ! b && c . getMnemonic && c . getMnemonic ( ) == a . keyCode && ( this . isEnabled ( ) && this . setHighlighted ( c ) , b = c . handleKeyEvent ( a ) ) } , this ) ; return b } ; goog . ui . Menu . prototype . setHighlightedIndex = function ( a ) { goog . ui . Menu . superClass _ . setHighlightedIndex . call ( this , a ) ; ( a = this . getChildAt ( a ) ) && goog . style . scrollIntoContainerView ( a . getElement ( ) , this . getElement ( ) ) } ;
2018-08-17 13:32:56 +00:00
goog . ui . Menu . prototype . decorateContent = function ( a ) { var b = this . getRenderer ( ) ; a = this . getDomHelper ( ) . getElementsByTagNameAndClass ( "DIV" , b . getCssClass ( ) + "-content" , a ) ; for ( var c = a . length , d = 0 ; d < c ; d ++ ) b . decorateChildren ( this , a [ d ] ) } ; goog . functions = { } ; goog . functions . constant = function ( a ) { return function ( ) { return a } } ; goog . functions . FALSE = goog . functions . constant ( ! 1 ) ; goog . functions . TRUE = goog . functions . constant ( ! 0 ) ; goog . functions . NULL = goog . functions . constant ( null ) ; goog . functions . identity = function ( a , b ) { return a } ; goog . functions . error = function ( a ) { return function ( ) { throw Error ( a ) ; } } ; goog . functions . fail = function ( a ) { return function ( ) { throw a ; } } ;
goog . functions . lock = function ( a , b ) { b = b || 0 ; return function ( ) { return a . apply ( this , Array . prototype . slice . call ( arguments , 0 , b ) ) } } ; goog . functions . nth = function ( a ) { return function ( ) { return arguments [ a ] } } ; goog . functions . partialRight = function ( a , b ) { var c = Array . prototype . slice . call ( arguments , 1 ) ; return function ( ) { var b = Array . prototype . slice . call ( arguments ) ; b . push . apply ( b , c ) ; return a . apply ( this , b ) } } ; goog . functions . withReturnValue = function ( a , b ) { return goog . functions . sequence ( a , goog . functions . constant ( b ) ) } ;
goog . functions . equalTo = function ( a , b ) { return function ( c ) { return b ? a == c : a === c } } ; goog . functions . compose = function ( a , b ) { var c = arguments , d = c . length ; return function ( ) { var a ; d && ( a = c [ d - 1 ] . apply ( this , arguments ) ) ; for ( var b = d - 2 ; 0 <= b ; b -- ) a = c [ b ] . call ( this , a ) ; return a } } ; goog . functions . sequence = function ( a ) { var b = arguments , c = b . length ; return function ( ) { for ( var a , e = 0 ; e < c ; e ++ ) a = b [ e ] . apply ( this , arguments ) ; return a } } ;
goog . functions . and = function ( a ) { var b = arguments , c = b . length ; return function ( ) { for ( var a = 0 ; a < c ; a ++ ) if ( ! b [ a ] . apply ( this , arguments ) ) return ! 1 ; return ! 0 } } ; goog . functions . or = function ( a ) { var b = arguments , c = b . length ; return function ( ) { for ( var a = 0 ; a < c ; a ++ ) if ( b [ a ] . apply ( this , arguments ) ) return ! 0 ; return ! 1 } } ; goog . functions . not = function ( a ) { return function ( ) { return ! a . apply ( this , arguments ) } } ;
goog . functions . create = function ( a , b ) { var c = function ( ) { } ; c . prototype = a . prototype ; c = new c ; a . apply ( c , Array . prototype . slice . call ( arguments , 1 ) ) ; return c } ; goog . functions . CACHE _RETURN _VALUE = ! 0 ; goog . functions . cacheReturnValue = function ( a ) { var b = ! 1 , c ; return function ( ) { if ( ! goog . functions . CACHE _RETURN _VALUE ) return a ( ) ; b || ( c = a ( ) , b = ! 0 ) ; return c } } ; goog . functions . once = function ( a ) { var b = a ; return function ( ) { if ( b ) { var a = b ; b = null ; a ( ) } } } ;
goog . functions . debounce = function ( a , b , c ) { var d = 0 ; return function ( e ) { goog . global . clearTimeout ( d ) ; var f = arguments ; d = goog . global . setTimeout ( function ( ) { a . apply ( c , f ) } , b ) } } ; goog . functions . throttle = function ( a , b , c ) { var d = 0 , e = ! 1 , f = [ ] , g = function ( ) { d = 0 ; e && ( e = ! 1 , h ( ) ) } , h = function ( ) { d = goog . global . setTimeout ( g , b ) ; a . apply ( c , f ) } ; return function ( a ) { f = arguments ; d ? e = ! 0 : h ( ) } } ; goog . functions . rateLimit = function ( a , b , c ) { var d = 0 , e = function ( ) { d = 0 } ; return function ( f ) { d || ( d = goog . global . setTimeout ( e , b ) , a . apply ( c , arguments ) ) } } ; goog . iter = { } ; goog . iter . StopIteration = "StopIteration" in goog . global ? goog . global . StopIteration : { message : "StopIteration" , stack : "" } ; goog . iter . Iterator = function ( ) { } ; goog . iter . Iterator . prototype . next = function ( ) { throw goog . iter . StopIteration ; } ; goog . iter . Iterator . prototype . _ _iterator _ _ = function ( a ) { return this } ;
2017-09-25 09:37:41 +00:00
goog . iter . toIterator = function ( a ) { if ( a instanceof goog . iter . Iterator ) return a ; if ( "function" == typeof a . _ _iterator _ _ ) return a . _ _iterator _ _ ( ! 1 ) ; if ( goog . isArrayLike ( a ) ) { var b = 0 , c = new goog . iter . Iterator ; c . next = function ( ) { for ( ; ; ) { if ( b >= a . length ) throw goog . iter . StopIteration ; if ( b in a ) return a [ b ++ ] ; b ++ } } ; return c } throw Error ( "Not implemented" ) ; } ;
goog . iter . forEach = function ( a , b , c ) { if ( goog . isArrayLike ( a ) ) try { goog . array . forEach ( a , b , c ) } catch ( d ) { if ( d !== goog . iter . StopIteration ) throw d ; } else { a = goog . iter . toIterator ( a ) ; try { for ( ; ; ) b . call ( c , a . next ( ) , void 0 , a ) } catch ( d ) { if ( d !== goog . iter . StopIteration ) throw d ; } } } ; goog . iter . filter = function ( a , b , c ) { var d = goog . iter . toIterator ( a ) ; a = new goog . iter . Iterator ; a . next = function ( ) { for ( ; ; ) { var a = d . next ( ) ; if ( b . call ( c , a , void 0 , d ) ) return a } } ; return a } ;
2018-08-17 13:32:56 +00:00
goog . iter . filterFalse = function ( a , b , c ) { return goog . iter . filter ( a , goog . functions . not ( b ) , c ) } ; goog . iter . range = function ( a , b , c ) { var d = 0 , e = a , f = c || 1 ; 1 < arguments . length && ( d = a , e = + b ) ; if ( 0 == f ) throw Error ( "Range step argument must not be zero" ) ; var g = new goog . iter . Iterator ; g . next = function ( ) { if ( 0 < f && d >= e || 0 > f && d <= e ) throw goog . iter . StopIteration ; var a = d ; d += f ; return a } ; return g } ; goog . iter . join = function ( a , b ) { return goog . iter . toArray ( a ) . join ( b ) } ;
2017-09-25 09:37:41 +00:00
goog . iter . map = function ( a , b , c ) { var d = goog . iter . toIterator ( a ) ; a = new goog . iter . Iterator ; a . next = function ( ) { var a = d . next ( ) ; return b . call ( c , a , void 0 , d ) } ; return a } ; goog . iter . reduce = function ( a , b , c , d ) { var e = c ; goog . iter . forEach ( a , function ( a ) { e = b . call ( d , e , a ) } ) ; return e } ; goog . iter . some = function ( a , b , c ) { a = goog . iter . toIterator ( a ) ; try { for ( ; ; ) if ( b . call ( c , a . next ( ) , void 0 , a ) ) return ! 0 } catch ( d ) { if ( d !== goog . iter . StopIteration ) throw d ; } return ! 1 } ;
goog . iter . every = function ( a , b , c ) { a = goog . iter . toIterator ( a ) ; try { for ( ; ; ) if ( ! b . call ( c , a . next ( ) , void 0 , a ) ) return ! 1 } catch ( d ) { if ( d !== goog . iter . StopIteration ) throw d ; } return ! 0 } ; goog . iter . chain = function ( a ) { return goog . iter . chainFromIterable ( arguments ) } ;
goog . iter . chainFromIterable = function ( a ) { var b = goog . iter . toIterator ( a ) ; a = new goog . iter . Iterator ; var c = null ; a . next = function ( ) { for ( ; ; ) { if ( null == c ) { var a = b . next ( ) ; c = goog . iter . toIterator ( a ) } try { return c . next ( ) } catch ( e ) { if ( e !== goog . iter . StopIteration ) throw e ; c = null } } } ; return a } ; goog . iter . dropWhile = function ( a , b , c ) { var d = goog . iter . toIterator ( a ) ; a = new goog . iter . Iterator ; var e = ! 0 ; a . next = function ( ) { for ( ; ; ) { var a = d . next ( ) ; if ( ! e || ! b . call ( c , a , void 0 , d ) ) return e = ! 1 , a } } ; return a } ;
goog . iter . takeWhile = function ( a , b , c ) { var d = goog . iter . toIterator ( a ) ; a = new goog . iter . Iterator ; a . next = function ( ) { var a = d . next ( ) ; if ( b . call ( c , a , void 0 , d ) ) return a ; throw goog . iter . StopIteration ; } ; return a } ; goog . iter . toArray = function ( a ) { if ( goog . isArrayLike ( a ) ) return goog . array . toArray ( a ) ; a = goog . iter . toIterator ( a ) ; var b = [ ] ; goog . iter . forEach ( a , function ( a ) { b . push ( a ) } ) ; return b } ;
goog . iter . equals = function ( a , b , c ) { a = goog . iter . zipLongest ( { } , a , b ) ; var d = c || goog . array . defaultCompareEquality ; return goog . iter . every ( a , function ( a ) { return d ( a [ 0 ] , a [ 1 ] ) } ) } ; goog . iter . nextOrValue = function ( a , b ) { try { return goog . iter . toIterator ( a ) . next ( ) } catch ( c ) { if ( c != goog . iter . StopIteration ) throw c ; return b } } ;
goog . iter . product = function ( a ) { if ( goog . array . some ( arguments , function ( a ) { return ! a . length } ) || ! arguments . length ) return new goog . iter . Iterator ; var b = new goog . iter . Iterator , c = arguments , d = goog . array . repeat ( 0 , c . length ) ; b . next = function ( ) { if ( d ) { for ( var a = goog . array . map ( d , function ( a , b ) { return c [ b ] [ a ] } ) , b = d . length - 1 ; 0 <= b ; b -- ) { goog . asserts . assert ( d ) ; if ( d [ b ] < c [ b ] . length - 1 ) { d [ b ] ++ ; break } if ( 0 == b ) { d = null ; break } d [ b ] = 0 } return a } throw goog . iter . StopIteration ; } ; return b } ;
goog . iter . cycle = function ( a ) { var b = goog . iter . toIterator ( a ) , c = [ ] , d = 0 ; a = new goog . iter . Iterator ; var e = ! 1 ; a . next = function ( ) { var a = null ; if ( ! e ) try { return a = b . next ( ) , c . push ( a ) , a } catch ( g ) { if ( g != goog . iter . StopIteration || goog . array . isEmpty ( c ) ) throw g ; e = ! 0 } a = c [ d ] ; d = ( d + 1 ) % c . length ; return a } ; return a } ; goog . iter . count = function ( a , b ) { var c = a || 0 , d = goog . isDef ( b ) ? b : 1 , e = new goog . iter . Iterator ; e . next = function ( ) { var a = c ; c += d ; return a } ; return e } ;
goog . iter . repeat = function ( a ) { var b = new goog . iter . Iterator ; b . next = goog . functions . constant ( a ) ; return b } ; goog . iter . accumulate = function ( a ) { var b = goog . iter . toIterator ( a ) , c = 0 ; a = new goog . iter . Iterator ; a . next = function ( ) { return c += b . next ( ) } ; return a } ; goog . iter . zip = function ( a ) { var b = arguments , c = new goog . iter . Iterator ; if ( 0 < b . length ) { var d = goog . array . map ( b , goog . iter . toIterator ) ; c . next = function ( ) { return goog . array . map ( d , function ( a ) { return a . next ( ) } ) } } return c } ;
2018-08-17 13:32:56 +00:00
goog . iter . zipLongest = function ( a , b ) { var c = goog . array . slice ( arguments , 1 ) , d = new goog . iter . Iterator ; if ( 0 < c . length ) { var e = goog . array . map ( c , goog . iter . toIterator ) ; d . next = function ( ) { var b = ! 1 , c = goog . array . map ( e , function ( c ) { try { var d = c . next ( ) ; b = ! 0 } catch ( l ) { if ( l !== goog . iter . StopIteration ) throw l ; d = a } return d } ) ; if ( ! b ) throw goog . iter . StopIteration ; return c } } return d } ; goog . iter . compress = function ( a , b ) { var c = goog . iter . toIterator ( b ) ; return goog . iter . filter ( a , function ( ) { return ! ! c . next ( ) } ) } ;
2017-09-25 09:37:41 +00:00
goog . iter . GroupByIterator _ = function ( a , b ) { this . iterator = goog . iter . toIterator ( a ) ; this . keyFunc = b || goog . functions . identity } ; goog . inherits ( goog . iter . GroupByIterator _ , goog . iter . Iterator ) ; goog . iter . GroupByIterator _ . prototype . next = function ( ) { for ( ; this . currentKey == this . targetKey ; ) this . currentValue = this . iterator . next ( ) , this . currentKey = this . keyFunc ( this . currentValue ) ; this . targetKey = this . currentKey ; return [ this . currentKey , this . groupItems _ ( this . targetKey ) ] } ;
goog . iter . GroupByIterator _ . prototype . groupItems _ = function ( a ) { for ( var b = [ ] ; this . currentKey == a ; ) { b . push ( this . currentValue ) ; try { this . currentValue = this . iterator . next ( ) } catch ( c ) { if ( c !== goog . iter . StopIteration ) throw c ; break } this . currentKey = this . keyFunc ( this . currentValue ) } return b } ; goog . iter . groupBy = function ( a , b ) { return new goog . iter . GroupByIterator _ ( a , b ) } ;
goog . iter . starMap = function ( a , b , c ) { var d = goog . iter . toIterator ( a ) ; a = new goog . iter . Iterator ; a . next = function ( ) { var a = goog . iter . toArray ( d . next ( ) ) ; return b . apply ( c , goog . array . concat ( a , void 0 , d ) ) } ; return a } ;
goog . iter . tee = function ( a , b ) { var c = goog . iter . toIterator ( a ) , d = goog . isNumber ( b ) ? b : 2 , e = goog . array . map ( goog . array . range ( d ) , function ( ) { return [ ] } ) , f = function ( ) { var a = c . next ( ) ; goog . array . forEach ( e , function ( b ) { b . push ( a ) } ) } ; return goog . array . map ( e , function ( a ) { var b = new goog . iter . Iterator ; b . next = function ( ) { goog . array . isEmpty ( a ) && f ( ) ; goog . asserts . assert ( ! goog . array . isEmpty ( a ) ) ; return a . shift ( ) } ; return b } ) } ; goog . iter . enumerate = function ( a , b ) { return goog . iter . zip ( goog . iter . count ( b ) , a ) } ;
goog . iter . limit = function ( a , b ) { goog . asserts . assert ( goog . math . isInt ( b ) && 0 <= b ) ; var c = goog . iter . toIterator ( a ) , d = new goog . iter . Iterator , e = b ; d . next = function ( ) { if ( 0 < e -- ) return c . next ( ) ; throw goog . iter . StopIteration ; } ; return d } ; goog . iter . consume = function ( a , b ) { goog . asserts . assert ( goog . math . isInt ( b ) && 0 <= b ) ; for ( var c = goog . iter . toIterator ( a ) ; 0 < b -- ; ) goog . iter . nextOrValue ( c , null ) ; return c } ;
2018-01-16 21:13:23 +00:00
goog . iter . slice = function ( a , b , c ) { goog . asserts . assert ( goog . math . isInt ( b ) && 0 <= b ) ; a = goog . iter . consume ( a , b ) ; goog . isNumber ( c ) && ( goog . asserts . assert ( goog . math . isInt ( c ) && c >= b ) , a = goog . iter . limit ( a , c - b ) ) ; return a } ; goog . iter . hasDuplicates _ = function ( a ) { var b = [ ] ; goog . array . removeDuplicates ( a , b ) ; return a . length != b . length } ; goog . iter . permutations = function ( a , b ) { var c = goog . iter . toArray ( a ) , d = goog . isNumber ( b ) ? b : c . length ; c = goog . array . repeat ( c , d ) ; c = goog . iter . product . apply ( void 0 , c ) ; return goog . iter . filter ( c , function ( a ) { return ! goog . iter . hasDuplicates _ ( a ) } ) } ;
goog . iter . combinations = function ( a , b ) { function c ( a ) { return d [ a ] } var d = goog . iter . toArray ( a ) , e = goog . iter . range ( d . length ) ; e = goog . iter . permutations ( e , b ) ; var f = goog . iter . filter ( e , function ( a ) { return goog . array . isSorted ( a ) } ) ; e = new goog . iter . Iterator ; e . next = function ( ) { return goog . array . map ( f . next ( ) , c ) } ; return e } ;
goog . iter . combinationsWithReplacement = function ( a , b ) { function c ( a ) { return d [ a ] } var d = goog . iter . toArray ( a ) , e = goog . array . range ( d . length ) ; e = goog . array . repeat ( e , b ) ; e = goog . iter . product . apply ( void 0 , e ) ; var f = goog . iter . filter ( e , function ( a ) { return goog . array . isSorted ( a ) } ) ; e = new goog . iter . Iterator ; e . next = function ( ) { return goog . array . map ( f . next ( ) , c ) } ; return e } ; goog . dom . TagWalkType = { START _TAG : 1 , OTHER : 0 , END _TAG : - 1 } ; goog . dom . TagIterator = function ( a , b , c , d , e ) { this . reversed = ! ! b ; this . node = null ; this . tagType = goog . dom . TagWalkType . OTHER ; this . started _ = ! 1 ; this . constrained = ! c ; a && this . setPosition ( a , d ) ; this . depth = void 0 != e ? e : this . tagType || 0 ; this . reversed && ( this . depth *= - 1 ) } ; goog . inherits ( goog . dom . TagIterator , goog . iter . Iterator ) ;
2017-09-25 09:37:41 +00:00
goog . dom . TagIterator . prototype . setPosition = function ( a , b , c ) { if ( this . node = a ) goog . isNumber ( b ) ? this . tagType = b : this . tagType = this . node . nodeType != goog . dom . NodeType . ELEMENT ? goog . dom . TagWalkType . OTHER : this . reversed ? goog . dom . TagWalkType . END _TAG : goog . dom . TagWalkType . START _TAG ; goog . isNumber ( c ) && ( this . depth = c ) } ; goog . dom . TagIterator . prototype . copyFrom = function ( a ) { this . node = a . node ; this . tagType = a . tagType ; this . depth = a . depth ; this . reversed = a . reversed ; this . constrained = a . constrained } ;
goog . dom . TagIterator . prototype . clone = function ( ) { return new goog . dom . TagIterator ( this . node , this . reversed , ! this . constrained , this . tagType , this . depth ) } ; goog . dom . TagIterator . prototype . skipTag = function ( ) { var a = this . reversed ? goog . dom . TagWalkType . END _TAG : goog . dom . TagWalkType . START _TAG ; this . tagType == a && ( this . tagType = - 1 * a , this . depth += this . tagType * ( this . reversed ? - 1 : 1 ) ) } ;
goog . dom . TagIterator . prototype . restartTag = function ( ) { var a = this . reversed ? goog . dom . TagWalkType . START _TAG : goog . dom . TagWalkType . END _TAG ; this . tagType == a && ( this . tagType = - 1 * a , this . depth += this . tagType * ( this . reversed ? - 1 : 1 ) ) } ;
2018-01-16 21:13:23 +00:00
goog . dom . TagIterator . prototype . next = function ( ) { if ( this . started _ ) { if ( ! this . node || this . constrained && 0 == this . depth ) throw goog . iter . StopIteration ; var a = this . node ; var b = this . reversed ? goog . dom . TagWalkType . END _TAG : goog . dom . TagWalkType . START _TAG ; if ( this . tagType == b ) { var c = this . reversed ? a . lastChild : a . firstChild ; c ? this . setPosition ( c ) : this . setPosition ( a , - 1 * b ) } else ( c = this . reversed ? a . previousSibling : a . nextSibling ) ? this . setPosition ( c ) : this . setPosition ( a . parentNode , - 1 * b ) ; this . depth += this . tagType * ( this . reversed ? - 1 :
1 ) } else this . started _ = ! 0 ; a = this . node ; if ( ! this . node ) throw goog . iter . StopIteration ; return a } ; goog . dom . TagIterator . prototype . isStarted = function ( ) { return this . started _ } ; goog . dom . TagIterator . prototype . isStartTag = function ( ) { return this . tagType == goog . dom . TagWalkType . START _TAG } ; goog . dom . TagIterator . prototype . isEndTag = function ( ) { return this . tagType == goog . dom . TagWalkType . END _TAG } ; goog . dom . TagIterator . prototype . isNonElement = function ( ) { return this . tagType == goog . dom . TagWalkType . OTHER } ;
goog . dom . TagIterator . prototype . equals = function ( a ) { return a . node == this . node && ( ! this . node || a . tagType == this . tagType ) } ; goog . dom . TagIterator . prototype . splice = function ( a ) { var b = this . node ; this . restartTag ( ) ; this . reversed = ! this . reversed ; goog . dom . TagIterator . prototype . next . call ( this ) ; this . reversed = ! this . reversed ; for ( var c = goog . isArrayLike ( arguments [ 0 ] ) ? arguments [ 0 ] : arguments , d = c . length - 1 ; 0 <= d ; d -- ) goog . dom . insertSiblingAfter ( c [ d ] , b ) ; goog . dom . removeNode ( b ) } ; goog . dom . NodeIterator = function ( a , b , c , d ) { goog . dom . TagIterator . call ( this , a , b , c , null , d ) } ; goog . inherits ( goog . dom . NodeIterator , goog . dom . TagIterator ) ; goog . dom . NodeIterator . prototype . next = function ( ) { do goog . dom . NodeIterator . superClass _ . next . call ( this ) ; while ( this . isEndTag ( ) ) ; return this . node } ; goog . ui . PaletteRenderer = function ( ) { goog . ui . ControlRenderer . call ( this ) } ; goog . inherits ( goog . ui . PaletteRenderer , goog . ui . ControlRenderer ) ; goog . addSingletonGetter ( goog . ui . PaletteRenderer ) ; goog . ui . PaletteRenderer . cellId _ = 0 ; goog . ui . PaletteRenderer . CSS _CLASS = "goog-palette" ; goog . ui . PaletteRenderer . prototype . createDom = function ( a ) { var b = this . getClassNames ( a ) ; a = a . getDomHelper ( ) . createDom ( "DIV" , b , this . createGrid ( a . getContent ( ) , a . getSize ( ) , a . getDomHelper ( ) ) ) ; goog . a11y . aria . setRole ( a , goog . a11y . aria . Role . GRID ) ; return a } ;
goog . ui . PaletteRenderer . prototype . createGrid = function ( a , b , c ) { for ( var d = [ ] , e = 0 , f = 0 ; e < b . height ; e ++ ) { for ( var g = [ ] , h = 0 ; h < b . width ; h ++ ) { var k = a && a [ f ++ ] ; g . push ( this . createCell ( k , c ) ) } d . push ( this . createRow ( g , c ) ) } return this . createTable ( d , c ) } ; goog . ui . PaletteRenderer . prototype . createTable = function ( a , b ) { var c = b . createDom ( "TABLE" , this . getCssClass ( ) + "-table" , b . createDom ( "TBODY" , this . getCssClass ( ) + "-body" , a ) ) ; c . cellSpacing = "0" ; c . cellPadding = "0" ; return c } ;
goog . ui . PaletteRenderer . prototype . createRow = function ( a , b ) { var c = b . createDom ( "TR" , this . getCssClass ( ) + "-row" , a ) ; goog . a11y . aria . setRole ( c , goog . a11y . aria . Role . ROW ) ; return c } ;
2017-09-25 09:37:41 +00:00
goog . ui . PaletteRenderer . prototype . createCell = function ( a , b ) { var c = b . createDom ( "TD" , { "class" : this . getCssClass ( ) + "-cell" , id : this . getCssClass ( ) + "-cell-" + goog . ui . PaletteRenderer . cellId _ ++ } , a ) ; goog . a11y . aria . setRole ( c , goog . a11y . aria . Role . GRIDCELL ) ; goog . a11y . aria . setState ( c , goog . a11y . aria . State . SELECTED , ! 1 ) ; if ( ! goog . dom . getTextContent ( c ) && ! goog . a11y . aria . getLabel ( c ) ) { var d = this . findAriaLabelForCell _ ( c ) ; d && goog . a11y . aria . setLabel ( c , d ) } return c } ;
goog . ui . PaletteRenderer . prototype . findAriaLabelForCell _ = function ( a ) { a = new goog . dom . NodeIterator ( a ) ; for ( var b = "" , c ; ! b && ( c = goog . iter . nextOrValue ( a , null ) ) ; ) c . nodeType == goog . dom . NodeType . ELEMENT && ( b = goog . a11y . aria . getLabel ( c ) || c . title ) ; return b } ; goog . ui . PaletteRenderer . prototype . canDecorate = function ( a ) { return ! 1 } ; goog . ui . PaletteRenderer . prototype . decorate = function ( a , b ) { return null } ;
goog . ui . PaletteRenderer . prototype . setContent = function ( a , b ) { if ( a ) { var c = goog . dom . getElementsByTagNameAndClass ( "TBODY" , this . getCssClass ( ) + "-body" , a ) [ 0 ] ; if ( c ) { var d = 0 ; goog . array . forEach ( c . rows , function ( a ) { goog . array . forEach ( a . cells , function ( a ) { goog . dom . removeChildren ( a ) ; if ( b ) { var c = b [ d ++ ] ; c && goog . dom . appendChild ( a , c ) } } ) } ) ; if ( d < b . length ) { for ( var e = [ ] , f = goog . dom . getDomHelper ( a ) , g = c . rows [ 0 ] . cells . length ; d < b . length ; ) { var h = b [ d ++ ] ; e . push ( this . createCell ( h , f ) ) ; e . length == g && ( h = this . createRow ( e , f ) , goog . dom . appendChild ( c ,
h ) , e . length = 0 ) } if ( 0 < e . length ) { for ( ; e . length < g ; ) e . push ( this . createCell ( "" , f ) ) ; h = this . createRow ( e , f ) ; goog . dom . appendChild ( c , h ) } } } goog . style . setUnselectable ( a , ! 0 , goog . userAgent . GECKO ) } } ; goog . ui . PaletteRenderer . prototype . getContainingItem = function ( a , b ) { for ( var c = a . getElement ( ) ; b && b . nodeType == goog . dom . NodeType . ELEMENT && b != c ; ) { if ( "TD" == b . tagName && goog . dom . classlist . contains ( b , this . getCssClass ( ) + "-cell" ) ) return b . firstChild ; b = b . parentNode } return null } ;
goog . ui . PaletteRenderer . prototype . highlightCell = function ( a , b , c ) { b && ( b = this . getCellForItem ( b ) , goog . asserts . assert ( b ) , goog . dom . classlist . enable ( b , this . getCssClass ( ) + "-cell-hover" , c ) , c ? goog . a11y . aria . setState ( a . getElementStrict ( ) , goog . a11y . aria . State . ACTIVEDESCENDANT , b . id ) : b . id == goog . a11y . aria . getState ( a . getElementStrict ( ) , goog . a11y . aria . State . ACTIVEDESCENDANT ) && goog . a11y . aria . removeState ( a . getElementStrict ( ) , goog . a11y . aria . State . ACTIVEDESCENDANT ) ) } ;
goog . ui . PaletteRenderer . prototype . getCellForItem = function ( a ) { return a ? a . parentNode : null } ; goog . ui . PaletteRenderer . prototype . selectCell = function ( a , b , c ) { b && ( a = b . parentNode , goog . dom . classlist . enable ( a , this . getCssClass ( ) + "-cell-selected" , c ) , goog . a11y . aria . setState ( a , goog . a11y . aria . State . SELECTED , c ) ) } ; goog . ui . PaletteRenderer . prototype . getCssClass = function ( ) { return goog . ui . PaletteRenderer . CSS _CLASS } ; goog . ui . SelectionModel = function ( a ) { goog . events . EventTarget . call ( this ) ; this . items _ = [ ] ; this . addItems ( a ) } ; goog . inherits ( goog . ui . SelectionModel , goog . events . EventTarget ) ; goog . tagUnsealableClass ( goog . ui . SelectionModel ) ; goog . ui . SelectionModel . prototype . selectedItem _ = null ; goog . ui . SelectionModel . prototype . selectionHandler _ = null ; goog . ui . SelectionModel . prototype . getSelectionHandler = function ( ) { return this . selectionHandler _ } ;
goog . ui . SelectionModel . prototype . setSelectionHandler = function ( a ) { this . selectionHandler _ = a } ; goog . ui . SelectionModel . prototype . getItemCount = function ( ) { return this . items _ . length } ; goog . ui . SelectionModel . prototype . indexOfItem = function ( a ) { return a ? goog . array . indexOf ( this . items _ , a ) : - 1 } ; goog . ui . SelectionModel . prototype . getFirst = function ( ) { return this . items _ [ 0 ] } ; goog . ui . SelectionModel . prototype . getLast = function ( ) { return this . items _ [ this . items _ . length - 1 ] } ;
goog . ui . SelectionModel . prototype . getItemAt = function ( a ) { return this . items _ [ a ] || null } ; goog . ui . SelectionModel . prototype . addItems = function ( a ) { a && ( goog . array . forEach ( a , function ( a ) { this . selectItem _ ( a , ! 1 ) } , this ) , goog . array . extend ( this . items _ , a ) ) } ; goog . ui . SelectionModel . prototype . addItem = function ( a ) { this . addItemAt ( a , this . getItemCount ( ) ) } ; goog . ui . SelectionModel . prototype . addItemAt = function ( a , b ) { a && ( this . selectItem _ ( a , ! 1 ) , goog . array . insertAt ( this . items _ , a , b ) ) } ;
goog . ui . SelectionModel . prototype . removeItem = function ( a ) { a && goog . array . remove ( this . items _ , a ) && a == this . selectedItem _ && ( this . selectedItem _ = null , this . dispatchEvent ( goog . events . EventType . SELECT ) ) } ; goog . ui . SelectionModel . prototype . removeItemAt = function ( a ) { this . removeItem ( this . getItemAt ( a ) ) } ; goog . ui . SelectionModel . prototype . getSelectedItem = function ( ) { return this . selectedItem _ } ; goog . ui . SelectionModel . prototype . getItems = function ( ) { return goog . array . clone ( this . items _ ) } ;
goog . ui . SelectionModel . prototype . setSelectedItem = function ( a ) { a != this . selectedItem _ && ( this . selectItem _ ( this . selectedItem _ , ! 1 ) , this . selectedItem _ = a , this . selectItem _ ( a , ! 0 ) ) ; this . dispatchEvent ( goog . events . EventType . SELECT ) } ; goog . ui . SelectionModel . prototype . getSelectedIndex = function ( ) { return this . indexOfItem ( this . selectedItem _ ) } ; goog . ui . SelectionModel . prototype . setSelectedIndex = function ( a ) { this . setSelectedItem ( this . getItemAt ( a ) ) } ;
goog . ui . SelectionModel . prototype . clear = function ( ) { goog . array . clear ( this . items _ ) ; this . selectedItem _ = null } ; goog . ui . SelectionModel . prototype . disposeInternal = function ( ) { goog . ui . SelectionModel . superClass _ . disposeInternal . call ( this ) ; delete this . items _ ; this . selectedItem _ = null } ; goog . ui . SelectionModel . prototype . selectItem _ = function ( a , b ) { a && ( "function" == typeof this . selectionHandler _ ? this . selectionHandler _ ( a , b ) : "function" == typeof a . setSelected && a . setSelected ( b ) ) } ; goog . ui . Palette = function ( a , b , c ) { goog . ui . Control . call ( this , a , b || goog . ui . PaletteRenderer . getInstance ( ) , c ) ; this . setAutoStates ( goog . ui . Component . State . CHECKED | goog . ui . Component . State . SELECTED | goog . ui . Component . State . OPENED , ! 1 ) ; this . currentCellControl _ = new goog . ui . Palette . CurrentCell _ ; this . currentCellControl _ . setParentEventTarget ( this ) ; this . lastHighlightedIndex _ = - 1 } ; goog . inherits ( goog . ui . Palette , goog . ui . Control ) ; goog . tagUnsealableClass ( goog . ui . Palette ) ; goog . ui . Palette . EventType = { AFTER _HIGHLIGHT : goog . events . getUniqueId ( "afterhighlight" ) } ;
goog . ui . Palette . prototype . size _ = null ; goog . ui . Palette . prototype . highlightedIndex _ = - 1 ; goog . ui . Palette . prototype . selectionModel _ = null ; goog . ui . Palette . prototype . disposeInternal = function ( ) { goog . ui . Palette . superClass _ . disposeInternal . call ( this ) ; this . selectionModel _ && ( this . selectionModel _ . dispose ( ) , this . selectionModel _ = null ) ; this . size _ = null ; this . currentCellControl _ . dispose ( ) } ;
goog . ui . Palette . prototype . setContentInternal = function ( a ) { goog . ui . Palette . superClass _ . setContentInternal . call ( this , a ) ; this . adjustSize _ ( ) ; this . selectionModel _ ? ( this . selectionModel _ . clear ( ) , this . selectionModel _ . addItems ( a ) ) : ( this . selectionModel _ = new goog . ui . SelectionModel ( a ) , this . selectionModel _ . setSelectionHandler ( goog . bind ( this . selectItem _ , this ) ) , this . getHandler ( ) . listen ( this . selectionModel _ , goog . events . EventType . SELECT , this . handleSelectionChange ) ) ; this . highlightedIndex _ = - 1 } ;
goog . ui . Palette . prototype . getCaption = function ( ) { return "" } ; goog . ui . Palette . prototype . setCaption = function ( a ) { } ; goog . ui . Palette . prototype . handleMouseOver = function ( a ) { goog . ui . Palette . superClass _ . handleMouseOver . call ( this , a ) ; var b = this . getRenderer ( ) . getContainingItem ( this , a . target ) ; b && a . relatedTarget && goog . dom . contains ( b , a . relatedTarget ) || b != this . getHighlightedItem ( ) && this . setHighlightedItem ( b ) } ;
goog . ui . Palette . prototype . handleMouseDown = function ( a ) { goog . ui . Palette . superClass _ . handleMouseDown . call ( this , a ) ; this . isActive ( ) && ( a = this . getRenderer ( ) . getContainingItem ( this , a . target ) , a != this . getHighlightedItem ( ) && this . setHighlightedItem ( a ) ) } ; goog . ui . Palette . prototype . performActionInternal = function ( a ) { var b = this . getHighlightedItem ( ) ; return b ? ( a && this . shouldSelectHighlightedItem _ ( a ) && this . setSelectedItem ( b ) , goog . ui . Palette . superClass _ . performActionInternal . call ( this , a ) ) : ! 1 } ;
goog . ui . Palette . prototype . shouldSelectHighlightedItem _ = function ( a ) { return this . getSelectedItem ( ) ? "mouseup" != a . type ? ! 0 : ! ! this . getRenderer ( ) . getContainingItem ( this , a . target ) : ! 0 } ;
2018-01-16 21:13:23 +00:00
goog . ui . Palette . prototype . handleKeyEvent = function ( a ) { var b = this . getContent ( ) ; b = b ? b . length : 0 ; var c = this . size _ . width ; if ( 0 == b || ! this . isEnabled ( ) ) return ! 1 ; if ( a . keyCode == goog . events . KeyCodes . ENTER || a . keyCode == goog . events . KeyCodes . SPACE ) return this . performActionInternal ( a ) ; if ( a . keyCode == goog . events . KeyCodes . HOME ) return this . setHighlightedIndex ( 0 ) , ! 0 ; if ( a . keyCode == goog . events . KeyCodes . END ) return this . setHighlightedIndex ( b - 1 ) , ! 0 ; var d = 0 > this . highlightedIndex _ ? this . getSelectedIndex ( ) : this . highlightedIndex _ ;
switch ( a . keyCode ) { case goog . events . KeyCodes . LEFT : if ( - 1 == d || 0 == d ) d = b ; this . setHighlightedIndex ( d - 1 ) ; a . preventDefault ( ) ; return ! 0 ; case goog . events . KeyCodes . RIGHT : return d == b - 1 && ( d = - 1 ) , this . setHighlightedIndex ( d + 1 ) , a . preventDefault ( ) , ! 0 ; case goog . events . KeyCodes . UP : - 1 == d && ( d = b + c - 1 ) ; if ( d >= c ) return this . setHighlightedIndex ( d - c ) , a . preventDefault ( ) , ! 0 ; break ; case goog . events . KeyCodes . DOWN : if ( - 1 == d && ( d = - c ) , d < b - c ) return this . setHighlightedIndex ( d + c ) , a . preventDefault ( ) , ! 0 } return ! 1 } ;
goog . ui . Palette . prototype . handleSelectionChange = function ( a ) { } ; goog . ui . Palette . prototype . getSize = function ( ) { return this . size _ } ; goog . ui . Palette . prototype . setSize = function ( a , b ) { if ( this . getElement ( ) ) throw Error ( goog . ui . Component . Error . ALREADY _RENDERED ) ; this . size _ = goog . isNumber ( a ) ? new goog . math . Size ( a , b ) : a ; this . adjustSize _ ( ) } ; goog . ui . Palette . prototype . getHighlightedIndex = function ( ) { return this . highlightedIndex _ } ;
goog . ui . Palette . prototype . getHighlightedItem = function ( ) { var a = this . getContent ( ) ; return a && a [ this . highlightedIndex _ ] } ; goog . ui . Palette . prototype . getHighlightedCellElement _ = function ( ) { return this . getRenderer ( ) . getCellForItem ( this . getHighlightedItem ( ) ) } ; goog . ui . Palette . prototype . setHighlightedIndex = function ( a ) { a != this . highlightedIndex _ && ( this . highlightIndex _ ( this . highlightedIndex _ , ! 1 ) , this . lastHighlightedIndex _ = this . highlightedIndex _ , this . highlightedIndex _ = a , this . highlightIndex _ ( a , ! 0 ) , this . dispatchEvent ( goog . ui . Palette . EventType . AFTER _HIGHLIGHT ) ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . Palette . prototype . setHighlightedItem = function ( a ) { var b = this . getContent ( ) ; this . setHighlightedIndex ( b && a ? goog . array . indexOf ( b , a ) : - 1 ) } ; goog . ui . Palette . prototype . getSelectedIndex = function ( ) { return this . selectionModel _ ? this . selectionModel _ . getSelectedIndex ( ) : - 1 } ; goog . ui . Palette . prototype . getSelectedItem = function ( ) { return this . selectionModel _ ? this . selectionModel _ . getSelectedItem ( ) : null } ; goog . ui . Palette . prototype . setSelectedIndex = function ( a ) { this . selectionModel _ && this . selectionModel _ . setSelectedIndex ( a ) } ;
goog . ui . Palette . prototype . setSelectedItem = function ( a ) { this . selectionModel _ && this . selectionModel _ . setSelectedItem ( a ) } ; goog . ui . Palette . prototype . highlightIndex _ = function ( a , b ) { if ( this . getElement ( ) ) { var c = this . getContent ( ) ; if ( c && 0 <= a && a < c . length ) { var d = this . getHighlightedCellElement _ ( ) ; this . currentCellControl _ . getElement ( ) != d && this . currentCellControl _ . setElementInternal ( d ) ; this . currentCellControl _ . tryHighlight ( b ) && this . getRenderer ( ) . highlightCell ( this , c [ a ] , b ) } } } ;
goog . ui . Palette . prototype . setHighlighted = function ( a ) { a && - 1 == this . highlightedIndex _ ? this . setHighlightedIndex ( - 1 < this . lastHighlightedIndex _ ? this . lastHighlightedIndex _ : 0 ) : a || this . setHighlightedIndex ( - 1 ) ; goog . ui . Palette . superClass _ . setHighlighted . call ( this , a ) } ; goog . ui . Palette . prototype . selectItem _ = function ( a , b ) { this . getElement ( ) && this . getRenderer ( ) . selectCell ( this , a , b ) } ;
goog . ui . Palette . prototype . adjustSize _ = function ( ) { var a = this . getContent ( ) ; if ( a ) if ( this . size _ && this . size _ . width ) { if ( a = Math . ceil ( a . length / this . size _ . width ) , ! goog . isNumber ( this . size _ . height ) || this . size _ . height < a ) this . size _ . height = a } else a = Math . ceil ( Math . sqrt ( a . length ) ) , this . size _ = new goog . math . Size ( a , a ) ; else this . size _ = new goog . math . Size ( 0 , 0 ) } ; goog . ui . Palette . CurrentCell _ = function ( ) { goog . ui . Control . call ( this , null ) ; this . setDispatchTransitionEvents ( goog . ui . Component . State . HOVER , ! 0 ) } ;
goog . inherits ( goog . ui . Palette . CurrentCell _ , goog . ui . Control ) ; goog . ui . Palette . CurrentCell _ . prototype . tryHighlight = function ( a ) { this . setHighlighted ( a ) ; return this . isHighlighted ( ) == a } ; goog . ui . ColorPalette = function ( a , b , c ) { this . colors _ = a || [ ] ; goog . ui . Palette . call ( this , null , b || goog . ui . PaletteRenderer . getInstance ( ) , c ) ; this . setColors ( this . colors _ ) } ; goog . inherits ( goog . ui . ColorPalette , goog . ui . Palette ) ; goog . tagUnsealableClass ( goog . ui . ColorPalette ) ; goog . ui . ColorPalette . prototype . normalizedColors _ = null ; goog . ui . ColorPalette . prototype . labels _ = null ; goog . ui . ColorPalette . prototype . getColors = function ( ) { return this . colors _ } ;
goog . ui . ColorPalette . prototype . setColors = function ( a , b ) { this . colors _ = a ; this . labels _ = b || null ; this . normalizedColors _ = null ; this . setContent ( this . createColorNodes ( ) ) } ; goog . ui . ColorPalette . prototype . getSelectedColor = function ( ) { var a = this . getSelectedItem ( ) ; return a ? ( a = goog . style . getStyle ( a , "background-color" ) , goog . ui . ColorPalette . parseColor _ ( a ) ) : null } ;
goog . ui . ColorPalette . prototype . setSelectedColor = function ( a ) { a = goog . ui . ColorPalette . parseColor _ ( a ) ; this . normalizedColors _ || ( this . normalizedColors _ = goog . array . map ( this . colors _ , function ( a ) { return goog . ui . ColorPalette . parseColor _ ( a ) } ) ) ; this . setSelectedIndex ( a ? goog . array . indexOf ( this . normalizedColors _ , a ) : - 1 ) } ;
goog . ui . ColorPalette . prototype . createColorNodes = function ( ) { return goog . array . map ( this . colors _ , function ( a , b ) { var c = this . getDomHelper ( ) . createDom ( "DIV" , { "class" : this . getRenderer ( ) . getCssClass ( ) + "-colorswatch" , style : "background-color:" + a } ) ; c . title = this . labels _ && this . labels _ [ b ] ? this . labels _ [ b ] : "#" == a . charAt ( 0 ) ? "RGB (" + goog . color . hexToRgb ( a ) . join ( ", " ) + ")" : a ; return c } , this ) } ; goog . ui . ColorPalette . parseColor _ = function ( a ) { if ( a ) try { return goog . color . parse ( a ) . hex } catch ( b ) { } return null } ; goog . ui . ColorPicker = function ( a , b ) { goog . ui . Component . call ( this , a ) ; this . colorPalette _ = b || null ; this . getHandler ( ) . listen ( this , goog . ui . Component . EventType . ACTION , this . onColorPaletteAction _ ) } ; goog . inherits ( goog . ui . ColorPicker , goog . ui . Component ) ; goog . ui . ColorPicker . DEFAULT _NUM _COLS = 5 ; goog . ui . ColorPicker . EventType = { CHANGE : "change" } ; goog . ui . ColorPicker . prototype . focusable _ = ! 0 ; goog . ui . ColorPicker . prototype . getColors = function ( ) { return this . colorPalette _ ? this . colorPalette _ . getColors ( ) : null } ;
goog . ui . ColorPicker . prototype . setColors = function ( a ) { this . colorPalette _ ? this . colorPalette _ . setColors ( a ) : this . createColorPalette _ ( a ) } ; goog . ui . ColorPicker . prototype . addColors = function ( a ) { this . setColors ( a ) } ; goog . ui . ColorPicker . prototype . setSize = function ( a ) { this . colorPalette _ || this . createColorPalette _ ( [ ] ) ; this . colorPalette _ . setSize ( a ) } ; goog . ui . ColorPicker . prototype . getSize = function ( ) { return this . colorPalette _ ? this . colorPalette _ . getSize ( ) : null } ; goog . ui . ColorPicker . prototype . setColumnCount = function ( a ) { this . setSize ( a ) } ;
goog . ui . ColorPicker . prototype . getSelectedIndex = function ( ) { return this . colorPalette _ ? this . colorPalette _ . getSelectedIndex ( ) : - 1 } ; goog . ui . ColorPicker . prototype . setSelectedIndex = function ( a ) { this . colorPalette _ && this . colorPalette _ . setSelectedIndex ( a ) } ; goog . ui . ColorPicker . prototype . getSelectedColor = function ( ) { return this . colorPalette _ ? this . colorPalette _ . getSelectedColor ( ) : null } ; goog . ui . ColorPicker . prototype . setSelectedColor = function ( a ) { this . colorPalette _ && this . colorPalette _ . setSelectedColor ( a ) } ;
goog . ui . ColorPicker . prototype . isFocusable = function ( ) { return this . focusable _ } ; goog . ui . ColorPicker . prototype . setFocusable = function ( a ) { this . focusable _ = a ; this . colorPalette _ && this . colorPalette _ . setSupportedState ( goog . ui . Component . State . FOCUSED , a ) } ; goog . ui . ColorPicker . prototype . canDecorate = function ( a ) { return ! 1 } ;
goog . ui . ColorPicker . prototype . enterDocument = function ( ) { goog . ui . ColorPicker . superClass _ . enterDocument . call ( this ) ; this . colorPalette _ && this . colorPalette _ . render ( this . getElement ( ) ) ; this . getElement ( ) . unselectable = "on" } ; goog . ui . ColorPicker . prototype . disposeInternal = function ( ) { goog . ui . ColorPicker . superClass _ . disposeInternal . call ( this ) ; this . colorPalette _ && ( this . colorPalette _ . dispose ( ) , this . colorPalette _ = null ) } ; goog . ui . ColorPicker . prototype . focus = function ( ) { this . colorPalette _ && this . colorPalette _ . getElement ( ) . focus ( ) } ;
goog . ui . ColorPicker . prototype . onColorPaletteAction _ = function ( a ) { a . stopPropagation ( ) ; this . dispatchEvent ( goog . ui . ColorPicker . EventType . CHANGE ) } ; goog . ui . ColorPicker . prototype . createColorPalette _ = function ( a ) { a = new goog . ui . ColorPalette ( a , null , this . getDomHelper ( ) ) ; a . setSize ( goog . ui . ColorPicker . DEFAULT _NUM _COLS ) ; a . setSupportedState ( goog . ui . Component . State . FOCUSED , this . focusable _ ) ; this . addChild ( a ) ; this . colorPalette _ = a ; this . isInDocument ( ) && this . colorPalette _ . render ( this . getElement ( ) ) } ;
goog . ui . ColorPicker . createSimpleColorGrid = function ( a ) { a = new goog . ui . ColorPicker ( a ) ; a . setSize ( 7 ) ; a . setColors ( goog . ui . ColorPicker . SIMPLE _GRID _COLORS ) ; return a } ; goog . ui . ColorPicker . SIMPLE _GRID _COLORS = "#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033" . split ( " " ) ; goog . events . FocusHandler = function ( a ) { goog . events . EventTarget . call ( this ) ; this . element _ = a ; a = goog . userAgent . IE ? "focusout" : "blur" ; this . listenKeyIn _ = goog . events . listen ( this . element _ , goog . userAgent . IE ? "focusin" : "focus" , this , ! goog . userAgent . IE ) ; this . listenKeyOut _ = goog . events . listen ( this . element _ , a , this , ! goog . userAgent . IE ) } ; goog . inherits ( goog . events . FocusHandler , goog . events . EventTarget ) ; goog . events . FocusHandler . EventType = { FOCUSIN : "focusin" , FOCUSOUT : "focusout" } ;
2018-01-16 21:13:23 +00:00
goog . events . FocusHandler . prototype . handleEvent = function ( a ) { var b = a . getBrowserEvent ( ) ; b = new goog . events . BrowserEvent ( b ) ; b . type = "focusin" == a . type || "focus" == a . type ? goog . events . FocusHandler . EventType . FOCUSIN : goog . events . FocusHandler . EventType . FOCUSOUT ; this . dispatchEvent ( b ) } ; goog . events . FocusHandler . prototype . disposeInternal = function ( ) { goog . events . FocusHandler . superClass _ . disposeInternal . call ( this ) ; goog . events . unlistenByKey ( this . listenKeyIn _ ) ; goog . events . unlistenByKey ( this . listenKeyOut _ ) ; delete this . element _ } ; goog . debug . LogRecord = function ( a , b , c , d , e ) { this . reset ( a , b , c , d , e ) } ; goog . debug . LogRecord . prototype . sequenceNumber _ = 0 ; goog . debug . LogRecord . prototype . exception _ = null ; goog . debug . LogRecord . ENABLE _SEQUENCE _NUMBERS = ! 0 ; goog . debug . LogRecord . nextSequenceNumber _ = 0 ;
2017-09-25 09:37:41 +00:00
goog . debug . LogRecord . prototype . reset = function ( a , b , c , d , e ) { goog . debug . LogRecord . ENABLE _SEQUENCE _NUMBERS && ( this . sequenceNumber _ = "number" == typeof e ? e : goog . debug . LogRecord . nextSequenceNumber _ ++ ) ; this . time _ = d || goog . now ( ) ; this . level _ = a ; this . msg _ = b ; this . loggerName _ = c ; delete this . exception _ } ; goog . debug . LogRecord . prototype . getLoggerName = function ( ) { return this . loggerName _ } ; goog . debug . LogRecord . prototype . getException = function ( ) { return this . exception _ } ;
goog . debug . LogRecord . prototype . setException = function ( a ) { this . exception _ = a } ; goog . debug . LogRecord . prototype . setLoggerName = function ( a ) { this . loggerName _ = a } ; goog . debug . LogRecord . prototype . getLevel = function ( ) { return this . level _ } ; goog . debug . LogRecord . prototype . setLevel = function ( a ) { this . level _ = a } ; goog . debug . LogRecord . prototype . getMessage = function ( ) { return this . msg _ } ; goog . debug . LogRecord . prototype . setMessage = function ( a ) { this . msg _ = a } ; goog . debug . LogRecord . prototype . getMillis = function ( ) { return this . time _ } ;
goog . debug . LogRecord . prototype . setMillis = function ( a ) { this . time _ = a } ; goog . debug . LogRecord . prototype . getSequenceNumber = function ( ) { return this . sequenceNumber _ } ; goog . debug . LogBuffer = function ( ) { goog . asserts . assert ( goog . debug . LogBuffer . isBufferingEnabled ( ) , "Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY." ) ; this . clear ( ) } ; goog . debug . LogBuffer . getInstance = function ( ) { goog . debug . LogBuffer . instance _ || ( goog . debug . LogBuffer . instance _ = new goog . debug . LogBuffer ) ; return goog . debug . LogBuffer . instance _ } ; goog . debug . LogBuffer . CAPACITY = 0 ;
goog . debug . LogBuffer . prototype . addRecord = function ( a , b , c ) { var d = ( this . curIndex _ + 1 ) % goog . debug . LogBuffer . CAPACITY ; this . curIndex _ = d ; if ( this . isFull _ ) return d = this . buffer _ [ d ] , d . reset ( a , b , c ) , d ; this . isFull _ = d == goog . debug . LogBuffer . CAPACITY - 1 ; return this . buffer _ [ d ] = new goog . debug . LogRecord ( a , b , c ) } ; goog . debug . LogBuffer . isBufferingEnabled = function ( ) { return 0 < goog . debug . LogBuffer . CAPACITY } ;
2018-01-16 21:13:23 +00:00
goog . debug . LogBuffer . prototype . clear = function ( ) { this . buffer _ = Array ( goog . debug . LogBuffer . CAPACITY ) ; this . curIndex _ = - 1 ; this . isFull _ = ! 1 } ; goog . debug . LogBuffer . prototype . forEachRecord = function ( a ) { var b = this . buffer _ ; if ( b [ 0 ] ) { var c = this . curIndex _ , d = this . isFull _ ? c : - 1 ; do d = ( d + 1 ) % goog . debug . LogBuffer . CAPACITY , a ( b [ d ] ) ; while ( d != c ) } } ; goog . debug . Logger = function ( a ) { this . name _ = a ; this . handlers _ = this . children _ = this . level _ = this . parent _ = null } ; goog . debug . Logger . ROOT _LOGGER _NAME = "" ; goog . debug . Logger . ENABLE _HIERARCHY = ! 0 ; goog . debug . Logger . ENABLE _PROFILER _LOGGING = ! 1 ; goog . debug . Logger . ENABLE _HIERARCHY || ( goog . debug . Logger . rootHandlers _ = [ ] ) ; goog . debug . Logger . Level = function ( a , b ) { this . name = a ; this . value = b } ; goog . debug . Logger . Level . prototype . toString = function ( ) { return this . name } ; goog . debug . Logger . Level . OFF = new goog . debug . Logger . Level ( "OFF" , Infinity ) ;
2017-09-25 09:37:41 +00:00
goog . debug . Logger . Level . SHOUT = new goog . debug . Logger . Level ( "SHOUT" , 1200 ) ; goog . debug . Logger . Level . SEVERE = new goog . debug . Logger . Level ( "SEVERE" , 1E3 ) ; goog . debug . Logger . Level . WARNING = new goog . debug . Logger . Level ( "WARNING" , 900 ) ; goog . debug . Logger . Level . INFO = new goog . debug . Logger . Level ( "INFO" , 800 ) ; goog . debug . Logger . Level . CONFIG = new goog . debug . Logger . Level ( "CONFIG" , 700 ) ; goog . debug . Logger . Level . FINE = new goog . debug . Logger . Level ( "FINE" , 500 ) ; goog . debug . Logger . Level . FINER = new goog . debug . Logger . Level ( "FINER" , 400 ) ;
goog . debug . Logger . Level . FINEST = new goog . debug . Logger . Level ( "FINEST" , 300 ) ; goog . debug . Logger . Level . ALL = new goog . debug . Logger . Level ( "ALL" , 0 ) ; goog . debug . Logger . Level . PREDEFINED _LEVELS = [ goog . debug . Logger . Level . OFF , goog . debug . Logger . Level . SHOUT , goog . debug . Logger . Level . SEVERE , goog . debug . Logger . Level . WARNING , goog . debug . Logger . Level . INFO , goog . debug . Logger . Level . CONFIG , goog . debug . Logger . Level . FINE , goog . debug . Logger . Level . FINER , goog . debug . Logger . Level . FINEST , goog . debug . Logger . Level . ALL ] ;
goog . debug . Logger . Level . predefinedLevelsCache _ = null ; goog . debug . Logger . Level . createPredefinedLevelsCache _ = function ( ) { goog . debug . Logger . Level . predefinedLevelsCache _ = { } ; for ( var a = 0 , b ; b = goog . debug . Logger . Level . PREDEFINED _LEVELS [ a ] ; a ++ ) goog . debug . Logger . Level . predefinedLevelsCache _ [ b . value ] = b , goog . debug . Logger . Level . predefinedLevelsCache _ [ b . name ] = b } ;
goog . debug . Logger . Level . getPredefinedLevel = function ( a ) { goog . debug . Logger . Level . predefinedLevelsCache _ || goog . debug . Logger . Level . createPredefinedLevelsCache _ ( ) ; return goog . debug . Logger . Level . predefinedLevelsCache _ [ a ] || null } ;
goog . debug . Logger . Level . getPredefinedLevelByValue = function ( a ) { goog . debug . Logger . Level . predefinedLevelsCache _ || goog . debug . Logger . Level . createPredefinedLevelsCache _ ( ) ; if ( a in goog . debug . Logger . Level . predefinedLevelsCache _ ) return goog . debug . Logger . Level . predefinedLevelsCache _ [ a ] ; for ( var b = 0 ; b < goog . debug . Logger . Level . PREDEFINED _LEVELS . length ; ++ b ) { var c = goog . debug . Logger . Level . PREDEFINED _LEVELS [ b ] ; if ( c . value <= a ) return c } return null } ; goog . debug . Logger . getLogger = function ( a ) { return goog . debug . LogManager . getLogger ( a ) } ;
2018-01-16 21:13:23 +00:00
goog . debug . Logger . logToProfilers = function ( a ) { if ( goog . debug . Logger . ENABLE _PROFILER _LOGGING ) { var b = goog . global . msWriteProfilerMark ; b ? b ( a ) : ( b = goog . global . console ) && b . timeStamp && b . timeStamp ( a ) } } ; goog . debug . Logger . prototype . getName = function ( ) { return this . name _ } ;
2017-09-25 09:37:41 +00:00
goog . debug . Logger . prototype . addHandler = function ( a ) { goog . debug . LOGGING _ENABLED && ( goog . debug . Logger . ENABLE _HIERARCHY ? ( this . handlers _ || ( this . handlers _ = [ ] ) , this . handlers _ . push ( a ) ) : ( goog . asserts . assert ( ! this . name _ , "Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false." ) , goog . debug . Logger . rootHandlers _ . push ( a ) ) ) } ;
goog . debug . Logger . prototype . removeHandler = function ( a ) { if ( goog . debug . LOGGING _ENABLED ) { var b = goog . debug . Logger . ENABLE _HIERARCHY ? this . handlers _ : goog . debug . Logger . rootHandlers _ ; return ! ! b && goog . array . remove ( b , a ) } return ! 1 } ; goog . debug . Logger . prototype . getParent = function ( ) { return this . parent _ } ; goog . debug . Logger . prototype . getChildren = function ( ) { this . children _ || ( this . children _ = { } ) ; return this . children _ } ;
goog . debug . Logger . prototype . setLevel = function ( a ) { goog . debug . LOGGING _ENABLED && ( goog . debug . Logger . ENABLE _HIERARCHY ? this . level _ = a : ( goog . asserts . assert ( ! this . name _ , "Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false." ) , goog . debug . Logger . rootLevel _ = a ) ) } ; goog . debug . Logger . prototype . getLevel = function ( ) { return goog . debug . LOGGING _ENABLED ? this . level _ : goog . debug . Logger . Level . OFF } ;
goog . debug . Logger . prototype . getEffectiveLevel = function ( ) { if ( ! goog . debug . LOGGING _ENABLED ) return goog . debug . Logger . Level . OFF ; if ( ! goog . debug . Logger . ENABLE _HIERARCHY ) return goog . debug . Logger . rootLevel _ ; if ( this . level _ ) return this . level _ ; if ( this . parent _ ) return this . parent _ . getEffectiveLevel ( ) ; goog . asserts . fail ( "Root logger has no level set." ) ; return null } ; goog . debug . Logger . prototype . isLoggable = function ( a ) { return goog . debug . LOGGING _ENABLED && a . value >= this . getEffectiveLevel ( ) . value } ;
goog . debug . Logger . prototype . log = function ( a , b , c ) { goog . debug . LOGGING _ENABLED && this . isLoggable ( a ) && ( goog . isFunction ( b ) && ( b = b ( ) ) , this . doLogRecord _ ( this . getLogRecord ( a , b , c ) ) ) } ; goog . debug . Logger . prototype . getLogRecord = function ( a , b , c ) { a = goog . debug . LogBuffer . isBufferingEnabled ( ) ? goog . debug . LogBuffer . getInstance ( ) . addRecord ( a , b , this . name _ ) : new goog . debug . LogRecord ( a , String ( b ) , this . name _ ) ; c && a . setException ( c ) ; return a } ;
goog . debug . Logger . prototype . shout = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . SHOUT , a , b ) } ; goog . debug . Logger . prototype . severe = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . SEVERE , a , b ) } ; goog . debug . Logger . prototype . warning = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . WARNING , a , b ) } ; goog . debug . Logger . prototype . info = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . INFO , a , b ) } ;
goog . debug . Logger . prototype . config = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . CONFIG , a , b ) } ; goog . debug . Logger . prototype . fine = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . FINE , a , b ) } ; goog . debug . Logger . prototype . finer = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . FINER , a , b ) } ; goog . debug . Logger . prototype . finest = function ( a , b ) { goog . debug . LOGGING _ENABLED && this . log ( goog . debug . Logger . Level . FINEST , a , b ) } ;
2018-01-16 21:13:23 +00:00
goog . debug . Logger . prototype . logRecord = function ( a ) { goog . debug . LOGGING _ENABLED && this . isLoggable ( a . getLevel ( ) ) && this . doLogRecord _ ( a ) } ; goog . debug . Logger . prototype . doLogRecord _ = function ( a ) { goog . debug . Logger . ENABLE _PROFILER _LOGGING && goog . debug . Logger . logToProfilers ( "log:" + a . getMessage ( ) ) ; if ( goog . debug . Logger . ENABLE _HIERARCHY ) for ( var b = this ; b ; ) b . callPublish _ ( a ) , b = b . getParent ( ) ; else { b = 0 ; for ( var c ; c = goog . debug . Logger . rootHandlers _ [ b ++ ] ; ) c ( a ) } } ;
goog . debug . Logger . prototype . callPublish _ = function ( a ) { if ( this . handlers _ ) for ( var b = 0 , c ; c = this . handlers _ [ b ] ; b ++ ) c ( a ) } ; goog . debug . Logger . prototype . setParent _ = function ( a ) { this . parent _ = a } ; goog . debug . Logger . prototype . addChild _ = function ( a , b ) { this . getChildren ( ) [ a ] = b } ; goog . debug . LogManager = { } ; goog . debug . LogManager . loggers _ = { } ; goog . debug . LogManager . rootLogger _ = null ;
2017-09-25 09:37:41 +00:00
goog . debug . LogManager . initialize = function ( ) { goog . debug . LogManager . rootLogger _ || ( goog . debug . LogManager . rootLogger _ = new goog . debug . Logger ( goog . debug . Logger . ROOT _LOGGER _NAME ) , goog . debug . LogManager . loggers _ [ goog . debug . Logger . ROOT _LOGGER _NAME ] = goog . debug . LogManager . rootLogger _ , goog . debug . LogManager . rootLogger _ . setLevel ( goog . debug . Logger . Level . CONFIG ) ) } ; goog . debug . LogManager . getLoggers = function ( ) { return goog . debug . LogManager . loggers _ } ;
goog . debug . LogManager . getRoot = function ( ) { goog . debug . LogManager . initialize ( ) ; return goog . debug . LogManager . rootLogger _ } ; goog . debug . LogManager . getLogger = function ( a ) { goog . debug . LogManager . initialize ( ) ; return goog . debug . LogManager . loggers _ [ a ] || goog . debug . LogManager . createLogger _ ( a ) } ; goog . debug . LogManager . createFunctionForCatchErrors = function ( a ) { return function ( b ) { ( a || goog . debug . LogManager . getRoot ( ) ) . severe ( "Error: " + b . message + " (" + b . fileName + " @ Line: " + b . line + ")" ) } } ;
2018-01-16 21:13:23 +00:00
goog . debug . LogManager . createLogger _ = function ( a ) { var b = new goog . debug . Logger ( a ) ; if ( goog . debug . Logger . ENABLE _HIERARCHY ) { var c = a . lastIndexOf ( "." ) , d = a . substr ( 0 , c ) ; c = a . substr ( c + 1 ) ; d = goog . debug . LogManager . getLogger ( d ) ; d . addChild _ ( c , b ) ; b . setParent _ ( d ) } return goog . debug . LogManager . loggers _ [ a ] = b } ; goog . log = { } ; goog . log . ENABLED = goog . debug . LOGGING _ENABLED ; goog . log . ROOT _LOGGER _NAME = goog . debug . Logger . ROOT _LOGGER _NAME ; goog . log . Logger = goog . debug . Logger ; goog . log . Level = goog . debug . Logger . Level ; goog . log . LogRecord = goog . debug . LogRecord ; goog . log . getLogger = function ( a , b ) { if ( goog . log . ENABLED ) { var c = goog . debug . LogManager . getLogger ( a ) ; b && c && c . setLevel ( b ) ; return c } return null } ; goog . log . addHandler = function ( a , b ) { goog . log . ENABLED && a && a . addHandler ( b ) } ;
2018-08-17 13:32:56 +00:00
goog . log . removeHandler = function ( a , b ) { return goog . log . ENABLED && a ? a . removeHandler ( b ) : ! 1 } ; goog . log . log = function ( a , b , c , d ) { goog . log . ENABLED && a && a . log ( b , c , d ) } ; goog . log . error = function ( a , b , c ) { goog . log . ENABLED && a && a . severe ( b , c ) } ; goog . log . warning = function ( a , b , c ) { goog . log . ENABLED && a && a . warning ( b , c ) } ; goog . log . info = function ( a , b , c ) { goog . log . ENABLED && a && a . info ( b , c ) } ; goog . log . fine = function ( a , b , c ) { goog . log . ENABLED && a && a . fine ( b , c ) } ; goog . Thenable = function ( ) { } ; goog . Thenable . prototype . then = function ( a , b , c ) { } ; goog . Thenable . IMPLEMENTED _BY _PROP = "$goog_Thenable" ; goog . Thenable . addImplementation = function ( a ) { a . prototype . then = a . prototype . then ; COMPILED ? a . prototype [ goog . Thenable . IMPLEMENTED _BY _PROP ] = ! 0 : a . prototype . $goog _Thenable = ! 0 } ; goog . Thenable . isImplementedBy = function ( a ) { if ( ! a ) return ! 1 ; try { return COMPILED ? ! ! a [ goog . Thenable . IMPLEMENTED _BY _PROP ] : ! ! a . $goog _Thenable } catch ( b ) { return ! 1 } } ; goog . async = { } ; goog . async . FreeList = function ( a , b , c ) { this . limit _ = c ; this . create _ = a ; this . reset _ = b ; this . occupants _ = 0 ; this . head _ = null } ; goog . async . FreeList . prototype . get = function ( ) { if ( 0 < this . occupants _ ) { this . occupants _ -- ; var a = this . head _ ; this . head _ = a . next ; a . next = null } else a = this . create _ ( ) ; return a } ; goog . async . FreeList . prototype . put = function ( a ) { this . reset _ ( a ) ; this . occupants _ < this . limit _ && ( this . occupants _ ++ , a . next = this . head _ , this . head _ = a ) } ; goog . async . FreeList . prototype . occupants = function ( ) { return this . occupants _ } ; goog . async . WorkQueue = function ( ) { this . workTail _ = this . workHead _ = null } ; goog . async . WorkQueue . DEFAULT _MAX _UNUSED = 100 ; goog . async . WorkQueue . freelist _ = new goog . async . FreeList ( function ( ) { return new goog . async . WorkItem } , function ( a ) { a . reset ( ) } , goog . async . WorkQueue . DEFAULT _MAX _UNUSED ) ; goog . async . WorkQueue . prototype . add = function ( a , b ) { var c = this . getUnusedItem _ ( ) ; c . set ( a , b ) ; this . workTail _ ? this . workTail _ . next = c : ( goog . asserts . assert ( ! this . workHead _ ) , this . workHead _ = c ) ; this . workTail _ = c } ;
goog . async . WorkQueue . prototype . remove = function ( ) { var a = null ; this . workHead _ && ( a = this . workHead _ , this . workHead _ = this . workHead _ . next , this . workHead _ || ( this . workTail _ = null ) , a . next = null ) ; return a } ; goog . async . WorkQueue . prototype . returnUnused = function ( a ) { goog . async . WorkQueue . freelist _ . put ( a ) } ; goog . async . WorkQueue . prototype . getUnusedItem _ = function ( ) { return goog . async . WorkQueue . freelist _ . get ( ) } ; goog . async . WorkItem = function ( ) { this . next = this . scope = this . fn = null } ;
goog . async . WorkItem . prototype . set = function ( a , b ) { this . fn = a ; this . scope = b ; this . next = null } ; goog . async . WorkItem . prototype . reset = function ( ) { this . next = this . scope = this . fn = null } ; goog . async . throwException = function ( a ) { goog . global . setTimeout ( function ( ) { throw a ; } , 0 ) } ; goog . async . nextTick = function ( a , b , c ) { var d = a ; b && ( d = goog . bind ( a , b ) ) ; d = goog . async . nextTick . wrapCallback _ ( d ) ; goog . isFunction ( goog . global . setImmediate ) && ( c || goog . async . nextTick . useSetImmediate _ ( ) ) ? goog . global . setImmediate ( d ) : ( goog . async . nextTick . setImmediate _ || ( goog . async . nextTick . setImmediate _ = goog . async . nextTick . getSetImmediateEmulator _ ( ) ) , goog . async . nextTick . setImmediate _ ( d ) ) } ;
goog . async . nextTick . useSetImmediate _ = function ( ) { return goog . global . Window && goog . global . Window . prototype && ! goog . labs . userAgent . browser . isEdge ( ) && goog . global . Window . prototype . setImmediate == goog . global . setImmediate ? ! 1 : ! 0 } ;
goog . async . nextTick . getSetImmediateEmulator _ = function ( ) { var a = goog . global . MessageChannel ; "undefined" === typeof a && "undefined" !== typeof window && window . postMessage && window . addEventListener && ! goog . labs . userAgent . engine . isPresto ( ) && ( a = function ( ) { var a = document . createElement ( "IFRAME" ) ; a . style . display = "none" ; a . src = "" ; document . documentElement . appendChild ( a ) ; var b = a . contentWindow ; a = b . document ; a . open ( ) ; a . write ( "" ) ; a . close ( ) ; var c = "callImmediate" + Math . random ( ) , d = "file:" == b . location . protocol ? "*" : b . location . protocol +
"//" + b . location . host ; a = goog . bind ( function ( a ) { if ( ( "*" == d || a . origin == d ) && a . data == c ) this . port1 . onmessage ( ) } , this ) ; b . addEventListener ( "message" , a , ! 1 ) ; this . port1 = { } ; this . port2 = { postMessage : function ( ) { b . postMessage ( c , d ) } } } ) ; if ( "undefined" !== typeof a && ! goog . labs . userAgent . browser . isIE ( ) ) { var b = new a , c = { } , d = c ; b . port1 . onmessage = function ( ) { if ( goog . isDef ( c . next ) ) { c = c . next ; var a = c . cb ; c . cb = null ; a ( ) } } ; return function ( a ) { d . next = { cb : a } ; d = d . next ; b . port2 . postMessage ( 0 ) } } return "undefined" !== typeof document && "onreadystatechange" in
document . createElement ( "SCRIPT" ) ? function ( a ) { var b = document . createElement ( "SCRIPT" ) ; b . onreadystatechange = function ( ) { b . onreadystatechange = null ; b . parentNode . removeChild ( b ) ; b = null ; a ( ) ; a = null } ; document . documentElement . appendChild ( b ) } : function ( a ) { goog . global . setTimeout ( a , 0 ) } } ; goog . async . nextTick . wrapCallback _ = goog . functions . identity ; goog . debug . entryPointRegistry . register ( function ( a ) { goog . async . nextTick . wrapCallback _ = a } ) ; goog . async . run = function ( a , b ) { goog . async . run . schedule _ || goog . async . run . initializeRunner _ ( ) ; goog . async . run . workQueueScheduled _ || ( goog . async . run . schedule _ ( ) , goog . async . run . workQueueScheduled _ = ! 0 ) ; goog . async . run . workQueue _ . add ( a , b ) } ; goog . async . run . initializeRunner _ = function ( ) { if ( goog . global . Promise && goog . global . Promise . resolve ) { var a = goog . global . Promise . resolve ( void 0 ) ; goog . async . run . schedule _ = function ( ) { a . then ( goog . async . run . processWorkQueue ) } } else goog . async . run . schedule _ = function ( ) { goog . async . nextTick ( goog . async . run . processWorkQueue ) } } ;
goog . async . run . forceNextTick = function ( a ) { goog . async . run . schedule _ = function ( ) { goog . async . nextTick ( goog . async . run . processWorkQueue ) ; a && a ( goog . async . run . processWorkQueue ) } } ; goog . async . run . workQueueScheduled _ = ! 1 ; goog . async . run . workQueue _ = new goog . async . WorkQueue ; goog . DEBUG && ( goog . async . run . resetQueue = function ( ) { goog . async . run . workQueueScheduled _ = ! 1 ; goog . async . run . workQueue _ = new goog . async . WorkQueue } ) ;
goog . async . run . processWorkQueue = function ( ) { for ( var a ; a = goog . async . run . workQueue _ . remove ( ) ; ) { try { a . fn . call ( a . scope ) } catch ( b ) { goog . async . throwException ( b ) } goog . async . run . workQueue _ . returnUnused ( a ) } goog . async . run . workQueueScheduled _ = ! 1 } ; goog . promise = { } ; goog . promise . Resolver = function ( ) { } ; goog . Promise = function ( a , b ) { this . state _ = goog . Promise . State _ . PENDING ; this . result _ = void 0 ; this . callbackEntriesTail _ = this . callbackEntries _ = this . parent _ = null ; this . executing _ = ! 1 ; 0 < goog . Promise . UNHANDLED _REJECTION _DELAY ? this . unhandledRejectionId _ = 0 : 0 == goog . Promise . UNHANDLED _REJECTION _DELAY && ( this . hadUnhandledRejection _ = ! 1 ) ; goog . Promise . LONG _STACK _TRACES && ( this . stack _ = [ ] , this . addStackTrace _ ( Error ( "created" ) ) , this . currentStep _ = 0 ) ; if ( a != goog . nullFunction ) try { var c = this ; a . call ( b , function ( a ) { c . resolve _ ( goog . Promise . State _ . FULFILLED ,
a ) } , function ( a ) { if ( goog . DEBUG && ! ( a instanceof goog . Promise . CancellationError ) ) try { if ( a instanceof Error ) throw a ; throw Error ( "Promise rejected." ) ; } catch ( e ) { } c . resolve _ ( goog . Promise . State _ . REJECTED , a ) } ) } catch ( d ) { this . resolve _ ( goog . Promise . State _ . REJECTED , d ) } } ; goog . Promise . LONG _STACK _TRACES = ! 1 ; goog . Promise . UNHANDLED _REJECTION _DELAY = 0 ; goog . Promise . State _ = { PENDING : 0 , BLOCKED : 1 , FULFILLED : 2 , REJECTED : 3 } ;
goog . Promise . CallbackEntry _ = function ( ) { this . next = this . context = this . onRejected = this . onFulfilled = this . child = null ; this . always = ! 1 } ; goog . Promise . CallbackEntry _ . prototype . reset = function ( ) { this . context = this . onRejected = this . onFulfilled = this . child = null ; this . always = ! 1 } ; goog . Promise . DEFAULT _MAX _UNUSED = 100 ; goog . Promise . freelist _ = new goog . async . FreeList ( function ( ) { return new goog . Promise . CallbackEntry _ } , function ( a ) { a . reset ( ) } , goog . Promise . DEFAULT _MAX _UNUSED ) ;
goog . Promise . getCallbackEntry _ = function ( a , b , c ) { var d = goog . Promise . freelist _ . get ( ) ; d . onFulfilled = a ; d . onRejected = b ; d . context = c ; return d } ; goog . Promise . returnEntry _ = function ( a ) { goog . Promise . freelist _ . put ( a ) } ; goog . Promise . resolve = function ( a ) { if ( a instanceof goog . Promise ) return a ; var b = new goog . Promise ( goog . nullFunction ) ; b . resolve _ ( goog . Promise . State _ . FULFILLED , a ) ; return b } ; goog . Promise . reject = function ( a ) { return new goog . Promise ( function ( b , c ) { c ( a ) } ) } ;
goog . Promise . resolveThen _ = function ( a , b , c ) { goog . Promise . maybeThen _ ( a , b , c , null ) || goog . async . run ( goog . partial ( b , a ) ) } ; goog . Promise . race = function ( a ) { return new goog . Promise ( function ( b , c ) { a . length || b ( void 0 ) ; for ( var d = 0 , e ; d < a . length ; d ++ ) e = a [ d ] , goog . Promise . resolveThen _ ( e , b , c ) } ) } ;
goog . Promise . all = function ( a ) { return new goog . Promise ( function ( b , c ) { var d = a . length , e = [ ] ; if ( d ) for ( var f = function ( a , c ) { d -- ; e [ a ] = c ; 0 == d && b ( e ) } , g = function ( a ) { c ( a ) } , h = 0 , k ; h < a . length ; h ++ ) k = a [ h ] , goog . Promise . resolveThen _ ( k , goog . partial ( f , h ) , g ) ; else b ( e ) } ) } ;
goog . Promise . allSettled = function ( a ) { return new goog . Promise ( function ( b , c ) { var d = a . length , e = [ ] ; if ( d ) for ( var f = function ( a , c , f ) { d -- ; e [ a ] = c ? { fulfilled : ! 0 , value : f } : { fulfilled : ! 1 , reason : f } ; 0 == d && b ( e ) } , g = 0 , h ; g < a . length ; g ++ ) h = a [ g ] , goog . Promise . resolveThen _ ( h , goog . partial ( f , g , ! 0 ) , goog . partial ( f , g , ! 1 ) ) ; else b ( e ) } ) } ;
goog . Promise . firstFulfilled = function ( a ) { return new goog . Promise ( function ( b , c ) { var d = a . length , e = [ ] ; if ( d ) for ( var f = function ( a ) { b ( a ) } , g = function ( a , b ) { d -- ; e [ a ] = b ; 0 == d && c ( e ) } , h = 0 , k ; h < a . length ; h ++ ) k = a [ h ] , goog . Promise . resolveThen _ ( k , f , goog . partial ( g , h ) ) ; else b ( void 0 ) } ) } ; goog . Promise . withResolver = function ( ) { var a , b , c = new goog . Promise ( function ( c , e ) { a = c ; b = e } ) ; return new goog . Promise . Resolver _ ( c , a , b ) } ;
goog . Promise . prototype . then = function ( a , b , c ) { null != a && goog . asserts . assertFunction ( a , "opt_onFulfilled should be a function." ) ; null != b && goog . asserts . assertFunction ( b , "opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?" ) ; goog . Promise . LONG _STACK _TRACES && this . addStackTrace _ ( Error ( "then" ) ) ; return this . addChildPromise _ ( goog . isFunction ( a ) ? a : null , goog . isFunction ( b ) ? b : null , c ) } ; goog . Thenable . addImplementation ( goog . Promise ) ;
goog . Promise . prototype . thenVoid = function ( a , b , c ) { null != a && goog . asserts . assertFunction ( a , "opt_onFulfilled should be a function." ) ; null != b && goog . asserts . assertFunction ( b , "opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?" ) ; goog . Promise . LONG _STACK _TRACES && this . addStackTrace _ ( Error ( "then" ) ) ; this . addCallbackEntry _ ( goog . Promise . getCallbackEntry _ ( a || goog . nullFunction , b || null , c ) ) } ;
goog . Promise . prototype . thenAlways = function ( a , b ) { goog . Promise . LONG _STACK _TRACES && this . addStackTrace _ ( Error ( "thenAlways" ) ) ; var c = goog . Promise . getCallbackEntry _ ( a , a , b ) ; c . always = ! 0 ; this . addCallbackEntry _ ( c ) ; return this } ; goog . Promise . prototype . thenCatch = function ( a , b ) { goog . Promise . LONG _STACK _TRACES && this . addStackTrace _ ( Error ( "thenCatch" ) ) ; return this . addChildPromise _ ( null , a , b ) } ;
goog . Promise . prototype . cancel = function ( a ) { this . state _ == goog . Promise . State _ . PENDING && goog . async . run ( function ( ) { var b = new goog . Promise . CancellationError ( a ) ; this . cancelInternal _ ( b ) } , this ) } ; goog . Promise . prototype . cancelInternal _ = function ( a ) { this . state _ == goog . Promise . State _ . PENDING && ( this . parent _ ? ( this . parent _ . cancelChild _ ( this , a ) , this . parent _ = null ) : this . resolve _ ( goog . Promise . State _ . REJECTED , a ) ) } ;
goog . Promise . prototype . cancelChild _ = function ( a , b ) { if ( this . callbackEntries _ ) { for ( var c = 0 , d = null , e = null , f = this . callbackEntries _ ; f && ( f . always || ( c ++ , f . child == a && ( d = f ) , ! ( d && 1 < c ) ) ) ; f = f . next ) d || ( e = f ) ; d && ( this . state _ == goog . Promise . State _ . PENDING && 1 == c ? this . cancelInternal _ ( b ) : ( e ? this . removeEntryAfter _ ( e ) : this . popEntry _ ( ) , this . executeCallback _ ( d , goog . Promise . State _ . REJECTED , b ) ) ) } } ;
goog . Promise . prototype . addCallbackEntry _ = function ( a ) { this . hasEntry _ ( ) || this . state _ != goog . Promise . State _ . FULFILLED && this . state _ != goog . Promise . State _ . REJECTED || this . scheduleCallbacks _ ( ) ; this . queueEntry _ ( a ) } ;
goog . Promise . prototype . addChildPromise _ = function ( a , b , c ) { var d = goog . Promise . getCallbackEntry _ ( null , null , null ) ; d . child = new goog . Promise ( function ( e , f ) { d . onFulfilled = a ? function ( b ) { try { var d = a . call ( c , b ) ; e ( d ) } catch ( k ) { f ( k ) } } : e ; d . onRejected = b ? function ( a ) { try { var d = b . call ( c , a ) ; ! goog . isDef ( d ) && a instanceof goog . Promise . CancellationError ? f ( a ) : e ( d ) } catch ( k ) { f ( k ) } } : f } ) ; d . child . parent _ = this ; this . addCallbackEntry _ ( d ) ; return d . child } ;
goog . Promise . prototype . unblockAndFulfill _ = function ( a ) { goog . asserts . assert ( this . state _ == goog . Promise . State _ . BLOCKED ) ; this . state _ = goog . Promise . State _ . PENDING ; this . resolve _ ( goog . Promise . State _ . FULFILLED , a ) } ; goog . Promise . prototype . unblockAndReject _ = function ( a ) { goog . asserts . assert ( this . state _ == goog . Promise . State _ . BLOCKED ) ; this . state _ = goog . Promise . State _ . PENDING ; this . resolve _ ( goog . Promise . State _ . REJECTED , a ) } ;
goog . Promise . prototype . resolve _ = function ( a , b ) { this . state _ == goog . Promise . State _ . PENDING && ( this === b && ( a = goog . Promise . State _ . REJECTED , b = new TypeError ( "Promise cannot resolve to itself" ) ) , this . state _ = goog . Promise . State _ . BLOCKED , goog . Promise . maybeThen _ ( b , this . unblockAndFulfill _ , this . unblockAndReject _ , this ) || ( this . result _ = b , this . state _ = a , this . parent _ = null , this . scheduleCallbacks _ ( ) , a != goog . Promise . State _ . REJECTED || b instanceof goog . Promise . CancellationError || goog . Promise . addUnhandledRejection _ ( this , b ) ) ) } ;
goog . Promise . maybeThen _ = function ( a , b , c , d ) { if ( a instanceof goog . Promise ) return a . thenVoid ( b , c , d ) , ! 0 ; if ( goog . Thenable . isImplementedBy ( a ) ) return a . then ( b , c , d ) , ! 0 ; if ( goog . isObject ( a ) ) try { var e = a . then ; if ( goog . isFunction ( e ) ) return goog . Promise . tryThen _ ( a , e , b , c , d ) , ! 0 } catch ( f ) { return c . call ( d , f ) , ! 0 } return ! 1 } ; goog . Promise . tryThen _ = function ( a , b , c , d , e ) { var f = ! 1 , g = function ( a ) { f || ( f = ! 0 , c . call ( e , a ) ) } , h = function ( a ) { f || ( f = ! 0 , d . call ( e , a ) ) } ; try { b . call ( a , g , h ) } catch ( k ) { h ( k ) } } ;
goog . Promise . prototype . scheduleCallbacks _ = function ( ) { this . executing _ || ( this . executing _ = ! 0 , goog . async . run ( this . executeCallbacks _ , this ) ) } ; goog . Promise . prototype . hasEntry _ = function ( ) { return ! ! this . callbackEntries _ } ; goog . Promise . prototype . queueEntry _ = function ( a ) { goog . asserts . assert ( null != a . onFulfilled ) ; this . callbackEntriesTail _ ? this . callbackEntriesTail _ . next = a : this . callbackEntries _ = a ; this . callbackEntriesTail _ = a } ;
goog . Promise . prototype . popEntry _ = function ( ) { var a = null ; this . callbackEntries _ && ( a = this . callbackEntries _ , this . callbackEntries _ = a . next , a . next = null ) ; this . callbackEntries _ || ( this . callbackEntriesTail _ = null ) ; null != a && goog . asserts . assert ( null != a . onFulfilled ) ; return a } ; goog . Promise . prototype . removeEntryAfter _ = function ( a ) { goog . asserts . assert ( this . callbackEntries _ ) ; goog . asserts . assert ( null != a ) ; a . next == this . callbackEntriesTail _ && ( this . callbackEntriesTail _ = a ) ; a . next = a . next . next } ;
goog . Promise . prototype . executeCallbacks _ = function ( ) { for ( var a ; a = this . popEntry _ ( ) ; ) goog . Promise . LONG _STACK _TRACES && this . currentStep _ ++ , this . executeCallback _ ( a , this . state _ , this . result _ ) ; this . executing _ = ! 1 } ;
goog . Promise . prototype . executeCallback _ = function ( a , b , c ) { b == goog . Promise . State _ . REJECTED && a . onRejected && ! a . always && this . removeUnhandledRejection _ ( ) ; if ( a . child ) a . child . parent _ = null , goog . Promise . invokeCallback _ ( a , b , c ) ; else try { a . always ? a . onFulfilled . call ( a . context ) : goog . Promise . invokeCallback _ ( a , b , c ) } catch ( d ) { goog . Promise . handleRejection _ . call ( null , d ) } goog . Promise . returnEntry _ ( a ) } ;
goog . Promise . invokeCallback _ = function ( a , b , c ) { b == goog . Promise . State _ . FULFILLED ? a . onFulfilled . call ( a . context , c ) : a . onRejected && a . onRejected . call ( a . context , c ) } ; goog . Promise . prototype . addStackTrace _ = function ( a ) { if ( goog . Promise . LONG _STACK _TRACES && goog . isString ( a . stack ) ) { var b = a . stack . split ( "\n" , 4 ) [ 3 ] ; a = a . message ; a += Array ( 11 - a . length ) . join ( " " ) ; this . stack _ . push ( a + b ) } } ;
goog . Promise . prototype . appendLongStack _ = function ( a ) { if ( goog . Promise . LONG _STACK _TRACES && a && goog . isString ( a . stack ) && this . stack _ . length ) { for ( var b = [ "Promise trace:" ] , c = this ; c ; c = c . parent _ ) { for ( var d = this . currentStep _ ; 0 <= d ; d -- ) b . push ( c . stack _ [ d ] ) ; b . push ( "Value: [" + ( c . state _ == goog . Promise . State _ . REJECTED ? "REJECTED" : "FULFILLED" ) + "] <" + String ( c . result _ ) + ">" ) } a . stack += "\n\n" + b . join ( "\n" ) } } ;
goog . Promise . prototype . removeUnhandledRejection _ = function ( ) { if ( 0 < goog . Promise . UNHANDLED _REJECTION _DELAY ) for ( var a = this ; a && a . unhandledRejectionId _ ; a = a . parent _ ) goog . global . clearTimeout ( a . unhandledRejectionId _ ) , a . unhandledRejectionId _ = 0 ; else if ( 0 == goog . Promise . UNHANDLED _REJECTION _DELAY ) for ( a = this ; a && a . hadUnhandledRejection _ ; a = a . parent _ ) a . hadUnhandledRejection _ = ! 1 } ;
goog . Promise . addUnhandledRejection _ = function ( a , b ) { 0 < goog . Promise . UNHANDLED _REJECTION _DELAY ? a . unhandledRejectionId _ = goog . global . setTimeout ( function ( ) { a . appendLongStack _ ( b ) ; goog . Promise . handleRejection _ . call ( null , b ) } , goog . Promise . UNHANDLED _REJECTION _DELAY ) : 0 == goog . Promise . UNHANDLED _REJECTION _DELAY && ( a . hadUnhandledRejection _ = ! 0 , goog . async . run ( function ( ) { a . hadUnhandledRejection _ && ( a . appendLongStack _ ( b ) , goog . Promise . handleRejection _ . call ( null , b ) ) } ) ) } ; goog . Promise . handleRejection _ = goog . async . throwException ;
goog . Promise . setUnhandledRejectionHandler = function ( a ) { goog . Promise . handleRejection _ = a } ; goog . Promise . CancellationError = function ( a ) { goog . debug . Error . call ( this , a ) } ; goog . inherits ( goog . Promise . CancellationError , goog . debug . Error ) ; goog . Promise . CancellationError . prototype . name = "cancel" ; goog . Promise . Resolver _ = function ( a , b , c ) { this . promise = a ; this . resolve = b ; this . reject = c } ; goog . Timer = function ( a , b ) { goog . events . EventTarget . call ( this ) ; this . interval _ = a || 1 ; this . timerObject _ = b || goog . Timer . defaultTimerObject ; this . boundTick _ = goog . bind ( this . tick _ , this ) ; this . last _ = goog . now ( ) } ; goog . inherits ( goog . Timer , goog . events . EventTarget ) ; goog . Timer . MAX _TIMEOUT _ = 2147483647 ; goog . Timer . INVALID _TIMEOUT _ID _ = - 1 ; goog . Timer . prototype . enabled = ! 1 ; goog . Timer . defaultTimerObject = goog . global ; goog . Timer . intervalScale = . 8 ; goog . Timer . prototype . timer _ = null ; goog . Timer . prototype . getInterval = function ( ) { return this . interval _ } ;
goog . Timer . prototype . setInterval = function ( a ) { this . interval _ = a ; this . timer _ && this . enabled ? ( this . stop ( ) , this . start ( ) ) : this . timer _ && this . stop ( ) } ; goog . Timer . prototype . tick _ = function ( ) { if ( this . enabled ) { var a = goog . now ( ) - this . last _ ; 0 < a && a < this . interval _ * goog . Timer . intervalScale ? this . timer _ = this . timerObject _ . setTimeout ( this . boundTick _ , this . interval _ - a ) : ( this . timer _ && ( this . timerObject _ . clearTimeout ( this . timer _ ) , this . timer _ = null ) , this . dispatchTick ( ) , this . enabled && ( this . stop ( ) , this . start ( ) ) ) } } ;
goog . Timer . prototype . dispatchTick = function ( ) { this . dispatchEvent ( goog . Timer . TICK ) } ; goog . Timer . prototype . start = function ( ) { this . enabled = ! 0 ; this . timer _ || ( this . timer _ = this . timerObject _ . setTimeout ( this . boundTick _ , this . interval _ ) , this . last _ = goog . now ( ) ) } ; goog . Timer . prototype . stop = function ( ) { this . enabled = ! 1 ; this . timer _ && ( this . timerObject _ . clearTimeout ( this . timer _ ) , this . timer _ = null ) } ; goog . Timer . prototype . disposeInternal = function ( ) { goog . Timer . superClass _ . disposeInternal . call ( this ) ; this . stop ( ) ; delete this . timerObject _ } ;
goog . Timer . TICK = "tick" ; goog . Timer . callOnce = function ( a , b , c ) { if ( goog . isFunction ( a ) ) c && ( a = goog . bind ( a , c ) ) ; else if ( a && "function" == typeof a . handleEvent ) a = goog . bind ( a . handleEvent , a ) ; else throw Error ( "Invalid listener argument" ) ; return Number ( b ) > goog . Timer . MAX _TIMEOUT _ ? goog . Timer . INVALID _TIMEOUT _ID _ : goog . Timer . defaultTimerObject . setTimeout ( a , b || 0 ) } ; goog . Timer . clear = function ( a ) { goog . Timer . defaultTimerObject . clearTimeout ( a ) } ;
goog . Timer . promise = function ( a , b ) { var c = null ; return ( new goog . Promise ( function ( d , e ) { c = goog . Timer . callOnce ( function ( ) { d ( b ) } , a ) ; c == goog . Timer . INVALID _TIMEOUT _ID _ && e ( Error ( "Failed to schedule timer." ) ) } ) ) . thenCatch ( function ( a ) { goog . Timer . clear ( c ) ; throw a ; } ) } ; goog . string . StringBuffer = function ( a , b ) { null != a && this . append . apply ( this , arguments ) } ; goog . string . StringBuffer . prototype . buffer _ = "" ; goog . string . StringBuffer . prototype . set = function ( a ) { this . buffer _ = "" + a } ; goog . string . StringBuffer . prototype . append = function ( a , b , c ) { this . buffer _ += String ( a ) ; if ( null != b ) for ( var d = 1 ; d < arguments . length ; d ++ ) this . buffer _ += arguments [ d ] ; return this } ; goog . string . StringBuffer . prototype . clear = function ( ) { this . buffer _ = "" } ; goog . string . StringBuffer . prototype . getLength = function ( ) { return this . buffer _ . length } ;
2017-09-25 09:37:41 +00:00
goog . string . StringBuffer . prototype . toString = function ( ) { return this . buffer _ } ; goog . ui . tree = { } ; goog . ui . tree . BaseNode = function ( a , b , c ) { goog . ui . Component . call ( this , c ) ; this . config _ = b || goog . ui . tree . BaseNode . defaultConfig ; this . html _ = goog . html . SafeHtml . htmlEscapePreservingNewlines ( a ) ; this . expanded _ = this . selected _ = ! 1 ; this . toolTip _ = null ; this . afterLabelHtml _ = goog . html . SafeHtml . EMPTY ; this . isUserCollapsible _ = ! 0 ; this . depth _ = - 1 } ; goog . inherits ( goog . ui . tree . BaseNode , goog . ui . Component ) ;
goog . ui . tree . BaseNode . EventType = { BEFORE _EXPAND : "beforeexpand" , EXPAND : "expand" , BEFORE _COLLAPSE : "beforecollapse" , COLLAPSE : "collapse" } ; goog . ui . tree . BaseNode . allNodes = { } ; goog . ui . tree . BaseNode . prototype . disposeInternal = function ( ) { goog . ui . tree . BaseNode . superClass _ . disposeInternal . call ( this ) ; this . tree && ( this . tree . removeNode ( this ) , this . tree = null ) ; this . setElementInternal ( null ) } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . BaseNode . prototype . initAccessibility = function ( ) { var a = this . getElement ( ) ; if ( a ) { var b = this . getLabelElement ( ) ; b && ! b . id && ( b . id = this . getId ( ) + ".label" ) ; goog . a11y . aria . setRole ( a , "treeitem" ) ; goog . a11y . aria . setState ( a , "selected" , ! 1 ) ; goog . a11y . aria . setState ( a , "level" , this . getDepth ( ) ) ; b && goog . a11y . aria . setState ( a , "labelledby" , b . id ) ; ( b = this . getIconElement ( ) ) && goog . a11y . aria . setRole ( b , "presentation" ) ; ( b = this . getExpandIconElement ( ) ) && goog . a11y . aria . setRole ( b , "presentation" ) ; if ( b = this . getChildrenElement ( ) ) if ( goog . a11y . aria . setRole ( b ,
"group" ) , b . hasChildNodes ( ) ) for ( goog . a11y . aria . setState ( a , goog . a11y . aria . State . EXPANDED , ! 1 ) , a = this . getChildCount ( ) , b = 1 ; b <= a ; b ++ ) { var c = this . getChildAt ( b - 1 ) . getElement ( ) ; goog . asserts . assert ( c , "The child element cannot be null" ) ; goog . a11y . aria . setState ( c , "setsize" , a ) ; goog . a11y . aria . setState ( c , "posinset" , b ) } } } ; goog . ui . tree . BaseNode . prototype . createDom = function ( ) { var a = this . getDomHelper ( ) . safeHtmlToNode ( this . toSafeHtml ( ) ) ; this . setElementInternal ( a ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . BaseNode . prototype . enterDocument = function ( ) { goog . ui . tree . BaseNode . superClass _ . enterDocument . call ( this ) ; goog . ui . tree . BaseNode . allNodes [ this . getId ( ) ] = this ; this . initAccessibility ( ) } ; goog . ui . tree . BaseNode . prototype . exitDocument = function ( ) { goog . ui . tree . BaseNode . superClass _ . exitDocument . call ( this ) ; delete goog . ui . tree . BaseNode . allNodes [ this . getId ( ) ] } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . BaseNode . prototype . addChildAt = function ( a , b , c ) { goog . asserts . assert ( ! a . getParent ( ) ) ; goog . asserts . assertInstanceof ( a , goog . ui . tree . BaseNode ) ; c = this . getChildAt ( b - 1 ) ; var d = this . getChildAt ( b ) ; goog . ui . tree . BaseNode . superClass _ . addChildAt . call ( this , a , b ) ; a . previousSibling _ = c ; a . nextSibling _ = d ; c ? c . nextSibling _ = a : this . firstChild _ = a ; d ? d . previousSibling _ = a : this . lastChild _ = a ; ( b = this . getTree ( ) ) && a . setTreeInternal ( b ) ; a . setDepth _ ( this . getDepth ( ) + 1 ) ; if ( b = this . getElement ( ) ) if ( this . updateExpandIcon ( ) , goog . a11y . aria . setState ( b ,
goog . a11y . aria . State . EXPANDED , this . getExpanded ( ) ) , this . getExpanded ( ) ) { b = this . getChildrenElement ( ) ; a . getElement ( ) || a . createDom ( ) ; var e = a . getElement ( ) , f = d && d . getElement ( ) ; b . insertBefore ( e , f ) ; this . isInDocument ( ) && a . enterDocument ( ) ; d || ( c ? c . updateExpandIcon ( ) : ( goog . style . setElementShown ( b , ! 0 ) , this . setExpanded ( this . getExpanded ( ) ) ) ) } } ;
goog . ui . tree . BaseNode . prototype . add = function ( a , b ) { goog . asserts . assert ( ! b || b . getParent ( ) == this , "Can only add nodes before siblings" ) ; a . getParent ( ) && a . getParent ( ) . removeChild ( a ) ; this . addChildAt ( a , b ? this . indexOfChild ( b ) : this . getChildCount ( ) ) ; return a } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . BaseNode . prototype . removeChild = function ( a , b ) { var c = this . getTree ( ) , d = c ? c . getSelectedItem ( ) : null ; if ( d == a || a . contains ( d ) ) c . hasFocus ( ) ? ( this . select ( ) , goog . Timer . callOnce ( this . onTimeoutSelect _ , 10 , this ) ) : this . select ( ) ; goog . ui . tree . BaseNode . superClass _ . removeChild . call ( this , a ) ; this . lastChild _ == a && ( this . lastChild _ = a . previousSibling _ ) ; this . firstChild _ == a && ( this . firstChild _ = a . nextSibling _ ) ; a . previousSibling _ && ( a . previousSibling _ . nextSibling _ = a . nextSibling _ ) ; a . nextSibling _ && ( a . nextSibling _ . previousSibling _ =
2018-01-16 21:13:23 +00:00
a . previousSibling _ ) ; d = a . isLastSibling ( ) ; a . tree = null ; a . depth _ = - 1 ; if ( c && ( c . removeNode ( a ) , this . isInDocument ( ) ) ) { c = this . getChildrenElement ( ) ; if ( a . isInDocument ( ) ) { var e = a . getElement ( ) ; c . removeChild ( e ) ; a . exitDocument ( ) } d && ( d = this . getLastChild ( ) ) && d . updateExpandIcon ( ) ; this . hasChildren ( ) || ( c . style . display = "none" , this . updateExpandIcon ( ) , this . updateIcon _ ( ) , ( d = this . getElement ( ) ) && goog . a11y . aria . removeState ( d , goog . a11y . aria . State . EXPANDED ) ) } return a } ; goog . ui . tree . BaseNode . prototype . remove = goog . ui . tree . BaseNode . prototype . removeChild ;
goog . ui . tree . BaseNode . prototype . onTimeoutSelect _ = function ( ) { this . select ( ) } ; goog . ui . tree . BaseNode . prototype . getTree = goog . abstractMethod ; goog . ui . tree . BaseNode . prototype . getDepth = function ( ) { var a = this . depth _ ; 0 > a && ( a = this . computeDepth _ ( ) , this . setDepth _ ( a ) ) ; return a } ; goog . ui . tree . BaseNode . prototype . computeDepth _ = function ( ) { var a = this . getParent ( ) ; return a ? a . getDepth ( ) + 1 : 0 } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . BaseNode . prototype . setDepth _ = function ( a ) { if ( a != this . depth _ ) { this . depth _ = a ; var b = this . getRowElement ( ) ; if ( b ) { var c = this . getPixelIndent _ ( ) + "px" ; this . isRightToLeft ( ) ? b . style . paddingRight = c : b . style . paddingLeft = c } this . forEachChild ( function ( b ) { b . setDepth _ ( a + 1 ) } ) } } ; goog . ui . tree . BaseNode . prototype . contains = function ( a ) { for ( ; a ; ) { if ( a == this ) return ! 0 ; a = a . getParent ( ) } return ! 1 } ; goog . ui . tree . BaseNode . EMPTY _CHILDREN _ = [ ] ;
goog . ui . tree . BaseNode . prototype . getChildren = function ( ) { var a = [ ] ; this . forEachChild ( function ( b ) { a . push ( b ) } ) ; return a } ; goog . ui . tree . BaseNode . prototype . getFirstChild = function ( ) { return this . getChildAt ( 0 ) } ; goog . ui . tree . BaseNode . prototype . getLastChild = function ( ) { return this . getChildAt ( this . getChildCount ( ) - 1 ) } ; goog . ui . tree . BaseNode . prototype . getPreviousSibling = function ( ) { return this . previousSibling _ } ; goog . ui . tree . BaseNode . prototype . getNextSibling = function ( ) { return this . nextSibling _ } ;
goog . ui . tree . BaseNode . prototype . isLastSibling = function ( ) { return ! this . nextSibling _ } ; goog . ui . tree . BaseNode . prototype . isSelected = function ( ) { return this . selected _ } ; goog . ui . tree . BaseNode . prototype . select = function ( ) { var a = this . getTree ( ) ; a && a . setSelectedItem ( this ) } ; goog . ui . tree . BaseNode . prototype . deselect = goog . nullFunction ;
goog . ui . tree . BaseNode . prototype . setSelectedInternal = function ( a ) { if ( this . selected _ != a ) { this . selected _ = a ; this . updateRow ( ) ; var b = this . getElement ( ) ; b && ( goog . a11y . aria . setState ( b , "selected" , a ) , a && ( a = this . getTree ( ) . getElement ( ) , goog . asserts . assert ( a , "The DOM element for the tree cannot be null" ) , goog . a11y . aria . setState ( a , "activedescendant" , this . getId ( ) ) ) ) } } ; goog . ui . tree . BaseNode . prototype . getExpanded = function ( ) { return this . expanded _ } ;
goog . ui . tree . BaseNode . prototype . setExpandedInternal = function ( a ) { this . expanded _ = a } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . BaseNode . prototype . setExpanded = function ( a ) { var b = a != this . expanded _ ; if ( ! b || this . dispatchEvent ( a ? goog . ui . tree . BaseNode . EventType . BEFORE _EXPAND : goog . ui . tree . BaseNode . EventType . BEFORE _COLLAPSE ) ) { this . expanded _ = a ; var c = this . getTree ( ) ; var d = this . getElement ( ) ; if ( this . hasChildren ( ) ) { if ( ! a && c && this . contains ( c . getSelectedItem ( ) ) && this . select ( ) , d ) { if ( c = this . getChildrenElement ( ) ) if ( goog . style . setElementShown ( c , a ) , goog . a11y . aria . setState ( d , goog . a11y . aria . State . EXPANDED , a ) , a && this . isInDocument ( ) &&
! c . hasChildNodes ( ) ) { var e = [ ] ; this . forEachChild ( function ( a ) { e . push ( a . toSafeHtml ( ) ) } ) ; goog . dom . safe . setInnerHtml ( c , goog . html . SafeHtml . concat ( e ) ) ; this . forEachChild ( function ( a ) { a . enterDocument ( ) } ) } this . updateExpandIcon ( ) } } else ( c = this . getChildrenElement ( ) ) && goog . style . setElementShown ( c , ! 1 ) ; d && this . updateIcon _ ( ) ; b && this . dispatchEvent ( a ? goog . ui . tree . BaseNode . EventType . EXPAND : goog . ui . tree . BaseNode . EventType . COLLAPSE ) } } ; goog . ui . tree . BaseNode . prototype . toggle = function ( ) { this . setExpanded ( ! this . getExpanded ( ) ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . BaseNode . prototype . expand = function ( ) { this . setExpanded ( ! 0 ) } ; goog . ui . tree . BaseNode . prototype . collapse = function ( ) { this . setExpanded ( ! 1 ) } ; goog . ui . tree . BaseNode . prototype . collapseChildren = function ( ) { this . forEachChild ( function ( a ) { a . collapseAll ( ) } ) } ; goog . ui . tree . BaseNode . prototype . collapseAll = function ( ) { this . collapseChildren ( ) ; this . collapse ( ) } ; goog . ui . tree . BaseNode . prototype . expandChildren = function ( ) { this . forEachChild ( function ( a ) { a . expandAll ( ) } ) } ;
goog . ui . tree . BaseNode . prototype . expandAll = function ( ) { this . expandChildren ( ) ; this . expand ( ) } ; goog . ui . tree . BaseNode . prototype . reveal = function ( ) { var a = this . getParent ( ) ; a && ( a . setExpanded ( ! 0 ) , a . reveal ( ) ) } ; goog . ui . tree . BaseNode . prototype . setIsUserCollapsible = function ( a ) { ( this . isUserCollapsible _ = a ) || this . expand ( ) ; this . getElement ( ) && this . updateExpandIcon ( ) } ; goog . ui . tree . BaseNode . prototype . isUserCollapsible = function ( ) { return this . isUserCollapsible _ } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . BaseNode . prototype . toSafeHtml = function ( ) { var a = this . getTree ( ) , b = ! a . getShowLines ( ) || a == this . getParent ( ) && ! a . getShowRootLines ( ) ? this . config _ . cssChildrenNoLines : this . config _ . cssChildren ; a = this . getExpanded ( ) && this . hasChildren ( ) ; b = { "class" : b , style : this . getLineStyle ( ) } ; var c = [ ] ; a && this . forEachChild ( function ( a ) { c . push ( a . toSafeHtml ( ) ) } ) ; a = goog . html . SafeHtml . create ( "div" , b , c ) ; return goog . html . SafeHtml . create ( "div" , { "class" : this . config _ . cssItem , id : this . getId ( ) } , [ this . getRowSafeHtml ( ) , a ] ) } ;
goog . ui . tree . BaseNode . prototype . getPixelIndent _ = function ( ) { return Math . max ( 0 , ( this . getDepth ( ) - 1 ) * this . config _ . indentWidth ) } ; goog . ui . tree . BaseNode . prototype . getRowSafeHtml = function ( ) { var a = { } ; a [ "padding-" + ( this . isRightToLeft ( ) ? "right" : "left" ) ] = this . getPixelIndent _ ( ) + "px" ; a = { "class" : this . getRowClassName ( ) , style : a } ; var b = [ this . getExpandIconSafeHtml ( ) , this . getIconSafeHtml ( ) , this . getLabelSafeHtml ( ) ] ; return goog . html . SafeHtml . create ( "div" , a , b ) } ;
goog . ui . tree . BaseNode . prototype . getRowClassName = function ( ) { var a = this . isSelected ( ) ? " " + this . config _ . cssSelectedRow : "" ; return this . config _ . cssTreeRow + a } ; goog . ui . tree . BaseNode . prototype . getLabelSafeHtml = function ( ) { var a = goog . html . SafeHtml . create ( "span" , { "class" : this . config _ . cssItemLabel , title : this . getToolTip ( ) || null } , this . getSafeHtml ( ) ) ; return goog . html . SafeHtml . concat ( a , goog . html . SafeHtml . create ( "span" , { } , this . getAfterLabelSafeHtml ( ) ) ) } ; goog . ui . tree . BaseNode . prototype . getAfterLabelHtml = function ( ) { return goog . html . SafeHtml . unwrap ( this . getAfterLabelSafeHtml ( ) ) } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . BaseNode . prototype . getAfterLabelSafeHtml = function ( ) { return this . afterLabelHtml _ } ; goog . ui . tree . BaseNode . prototype . setAfterLabelSafeHtml = function ( a ) { this . afterLabelHtml _ = a ; var b = this . getAfterLabelElement ( ) ; b && goog . dom . safe . setInnerHtml ( b , a ) } ; goog . ui . tree . BaseNode . prototype . getIconSafeHtml = function ( ) { return goog . html . SafeHtml . create ( "span" , { style : { display : "inline-block" } , "class" : this . getCalculatedIconClass ( ) } ) } ; goog . ui . tree . BaseNode . prototype . getCalculatedIconClass = goog . abstractMethod ;
goog . ui . tree . BaseNode . prototype . getExpandIconSafeHtml = function ( ) { return goog . html . SafeHtml . create ( "span" , { type : "expand" , style : { display : "inline-block" } , "class" : this . getExpandIconClass ( ) } ) } ;
goog . ui . tree . BaseNode . prototype . getExpandIconClass = function ( ) { var a = this . getTree ( ) , b = ! a . getShowLines ( ) || a == this . getParent ( ) && ! a . getShowRootLines ( ) , c = this . config _ , d = new goog . string . StringBuffer ; d . append ( c . cssTreeIcon , " " , c . cssExpandTreeIcon , " " ) ; if ( this . hasChildren ( ) ) { var e = 0 ; a . getShowExpandIcons ( ) && this . isUserCollapsible _ && ( e = this . getExpanded ( ) ? 2 : 1 ) ; b || ( e = this . isLastSibling ( ) ? e + 4 : e + 8 ) ; switch ( e ) { case 1 : d . append ( c . cssExpandTreeIconPlus ) ; break ; case 2 : d . append ( c . cssExpandTreeIconMinus ) ; break ; case 4 : d . append ( c . cssExpandTreeIconL ) ;
break ; case 5 : d . append ( c . cssExpandTreeIconLPlus ) ; break ; case 6 : d . append ( c . cssExpandTreeIconLMinus ) ; break ; case 8 : d . append ( c . cssExpandTreeIconT ) ; break ; case 9 : d . append ( c . cssExpandTreeIconTPlus ) ; break ; case 10 : d . append ( c . cssExpandTreeIconTMinus ) ; break ; default : d . append ( c . cssExpandTreeIconBlank ) } } else b ? d . append ( c . cssExpandTreeIconBlank ) : this . isLastSibling ( ) ? d . append ( c . cssExpandTreeIconL ) : d . append ( c . cssExpandTreeIconT ) ; return d . toString ( ) } ;
goog . ui . tree . BaseNode . prototype . getLineStyle = function ( ) { var a = this . getExpanded ( ) && this . hasChildren ( ) ; return goog . html . SafeStyle . create ( { "background-position" : this . getBackgroundPosition ( ) , display : a ? null : "none" } ) } ; goog . ui . tree . BaseNode . prototype . getBackgroundPosition = function ( ) { return ( this . isLastSibling ( ) ? "-100" : ( this . getDepth ( ) - 1 ) * this . config _ . indentWidth ) + "px 0" } ;
goog . ui . tree . BaseNode . prototype . getElement = function ( ) { var a = goog . ui . tree . BaseNode . superClass _ . getElement . call ( this ) ; a || ( a = this . getDomHelper ( ) . getElement ( this . getId ( ) ) , this . setElementInternal ( a ) ) ; return a } ; goog . ui . tree . BaseNode . prototype . getRowElement = function ( ) { var a = this . getElement ( ) ; return a ? a . firstChild : null } ; goog . ui . tree . BaseNode . prototype . getExpandIconElement = function ( ) { var a = this . getRowElement ( ) ; return a ? a . firstChild : null } ;
goog . ui . tree . BaseNode . prototype . getIconElement = function ( ) { var a = this . getRowElement ( ) ; return a ? a . childNodes [ 1 ] : null } ; goog . ui . tree . BaseNode . prototype . getLabelElement = function ( ) { var a = this . getRowElement ( ) ; return a && a . lastChild ? a . lastChild . previousSibling : null } ; goog . ui . tree . BaseNode . prototype . getAfterLabelElement = function ( ) { var a = this . getRowElement ( ) ; return a ? a . lastChild : null } ; goog . ui . tree . BaseNode . prototype . getChildrenElement = function ( ) { var a = this . getElement ( ) ; return a ? a . lastChild : null } ;
goog . ui . tree . BaseNode . prototype . setIconClass = function ( a ) { this . iconClass _ = a ; this . isInDocument ( ) && this . updateIcon _ ( ) } ; goog . ui . tree . BaseNode . prototype . getIconClass = function ( ) { return this . iconClass _ } ; goog . ui . tree . BaseNode . prototype . setExpandedIconClass = function ( a ) { this . expandedIconClass _ = a ; this . isInDocument ( ) && this . updateIcon _ ( ) } ; goog . ui . tree . BaseNode . prototype . getExpandedIconClass = function ( ) { return this . expandedIconClass _ } ; goog . ui . tree . BaseNode . prototype . setText = function ( a ) { this . setSafeHtml ( goog . html . SafeHtml . htmlEscape ( a ) ) } ;
goog . ui . tree . BaseNode . prototype . getText = function ( ) { return goog . string . unescapeEntities ( goog . html . SafeHtml . unwrap ( this . html _ ) ) } ; goog . ui . tree . BaseNode . prototype . setSafeHtml = function ( a ) { this . html _ = a ; var b = this . getLabelElement ( ) ; b && goog . dom . safe . setInnerHtml ( b , a ) ; ( a = this . getTree ( ) ) && a . setNode ( this ) } ; goog . ui . tree . BaseNode . prototype . getHtml = function ( ) { return goog . html . SafeHtml . unwrap ( this . getSafeHtml ( ) ) } ; goog . ui . tree . BaseNode . prototype . getSafeHtml = function ( ) { return this . html _ } ;
goog . ui . tree . BaseNode . prototype . setToolTip = function ( a ) { this . toolTip _ = a ; var b = this . getLabelElement ( ) ; b && ( b . title = a ) } ; goog . ui . tree . BaseNode . prototype . getToolTip = function ( ) { return this . toolTip _ } ; goog . ui . tree . BaseNode . prototype . updateRow = function ( ) { var a = this . getRowElement ( ) ; a && ( a . className = this . getRowClassName ( ) ) } ;
goog . ui . tree . BaseNode . prototype . updateExpandIcon = function ( ) { var a = this . getExpandIconElement ( ) ; a && ( a . className = this . getExpandIconClass ( ) ) ; if ( a = this . getChildrenElement ( ) ) a . style . backgroundPosition = this . getBackgroundPosition ( ) } ; goog . ui . tree . BaseNode . prototype . updateIcon _ = function ( ) { this . getIconElement ( ) . className = this . getCalculatedIconClass ( ) } ;
goog . ui . tree . BaseNode . prototype . onMouseDown = function ( a ) { "expand" == a . target . getAttribute ( "type" ) && this . hasChildren ( ) ? this . isUserCollapsible _ && this . toggle ( ) : ( this . select ( ) , this . updateRow ( ) ) } ; goog . ui . tree . BaseNode . prototype . onClick _ = goog . events . Event . preventDefault ; goog . ui . tree . BaseNode . prototype . onDoubleClick _ = function ( a ) { "expand" == a . target . getAttribute ( "type" ) && this . hasChildren ( ) || this . isUserCollapsible _ && this . toggle ( ) } ;
goog . ui . tree . BaseNode . prototype . onKeyDown = function ( a ) { var b = ! 0 ; switch ( a . keyCode ) { case goog . events . KeyCodes . RIGHT : if ( a . altKey ) break ; this . hasChildren ( ) && ( this . getExpanded ( ) ? this . getFirstChild ( ) . select ( ) : this . setExpanded ( ! 0 ) ) ; break ; case goog . events . KeyCodes . LEFT : if ( a . altKey ) break ; if ( this . hasChildren ( ) && this . getExpanded ( ) && this . isUserCollapsible _ ) this . setExpanded ( ! 1 ) ; else { var c = this . getParent ( ) , d = this . getTree ( ) ; c && ( d . getShowRootNode ( ) || c != d ) && c . select ( ) } break ; case goog . events . KeyCodes . DOWN : ( c = this . getNextShownNode ( ) ) &&
c . select ( ) ; break ; case goog . events . KeyCodes . UP : ( c = this . getPreviousShownNode ( ) ) && c . select ( ) ; break ; default : b = ! 1 } b && ( a . preventDefault ( ) , ( d = this . getTree ( ) ) && d . clearTypeAhead ( ) ) ; return b } ; goog . ui . tree . BaseNode . prototype . getLastShownDescendant = function ( ) { return this . getExpanded ( ) && this . hasChildren ( ) ? this . getLastChild ( ) . getLastShownDescendant ( ) : this } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . BaseNode . prototype . getNextShownNode = function ( ) { if ( this . hasChildren ( ) && this . getExpanded ( ) ) return this . getFirstChild ( ) ; for ( var a = this , b ; a != this . getTree ( ) ; ) { b = a . getNextSibling ( ) ; if ( null != b ) return b ; a = a . getParent ( ) } return null } ; goog . ui . tree . BaseNode . prototype . getPreviousShownNode = function ( ) { var a = this . getPreviousSibling ( ) ; if ( null != a ) return a . getLastShownDescendant ( ) ; a = this . getParent ( ) ; var b = this . getTree ( ) ; return ! b . getShowRootNode ( ) && a == b || this == b ? null : a } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . BaseNode . prototype . getClientData = goog . ui . tree . BaseNode . prototype . getModel ; goog . ui . tree . BaseNode . prototype . setClientData = goog . ui . tree . BaseNode . prototype . setModel ; goog . ui . tree . BaseNode . prototype . getConfig = function ( ) { return this . config _ } ; goog . ui . tree . BaseNode . prototype . setTreeInternal = function ( a ) { this . tree != a && ( this . tree = a , a . setNode ( this ) , this . forEachChild ( function ( b ) { b . setTreeInternal ( a ) } ) ) } ;
goog . ui . tree . BaseNode . defaultConfig = { indentWidth : 19 , cssRoot : "goog-tree-root goog-tree-item" , cssHideRoot : "goog-tree-hide-root" , cssItem : "goog-tree-item" , cssChildren : "goog-tree-children" , cssChildrenNoLines : "goog-tree-children-nolines" , cssTreeRow : "goog-tree-row" , cssItemLabel : "goog-tree-item-label" , cssTreeIcon : "goog-tree-icon" , cssExpandTreeIcon : "goog-tree-expand-icon" , cssExpandTreeIconPlus : "goog-tree-expand-icon-plus" , cssExpandTreeIconMinus : "goog-tree-expand-icon-minus" , cssExpandTreeIconTPlus : "goog-tree-expand-icon-tplus" ,
cssExpandTreeIconTMinus : "goog-tree-expand-icon-tminus" , cssExpandTreeIconLPlus : "goog-tree-expand-icon-lplus" , cssExpandTreeIconLMinus : "goog-tree-expand-icon-lminus" , cssExpandTreeIconT : "goog-tree-expand-icon-t" , cssExpandTreeIconL : "goog-tree-expand-icon-l" , cssExpandTreeIconBlank : "goog-tree-expand-icon-blank" , cssExpandedFolderIcon : "goog-tree-expanded-folder-icon" , cssCollapsedFolderIcon : "goog-tree-collapsed-folder-icon" , cssFileIcon : "goog-tree-file-icon" , cssExpandedRootIcon : "goog-tree-expanded-folder-icon" ,
cssCollapsedRootIcon : "goog-tree-collapsed-folder-icon" , cssSelectedRow : "selected" } ; goog . ui . tree . TreeNode = function ( a , b , c ) { goog . ui . tree . BaseNode . call ( this , a , b , c ) } ; goog . inherits ( goog . ui . tree . TreeNode , goog . ui . tree . BaseNode ) ; goog . ui . tree . TreeNode . prototype . getTree = function ( ) { if ( this . tree ) return this . tree ; var a = this . getParent ( ) ; return a && ( a = a . getTree ( ) ) ? ( this . setTreeInternal ( a ) , a ) : null } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . TreeNode . prototype . getCalculatedIconClass = function ( ) { var a = this . getExpanded ( ) , b = this . getExpandedIconClass ( ) ; if ( a && b ) return b ; b = this . getIconClass ( ) ; if ( ! a && b ) return b ; b = this . getConfig ( ) ; if ( this . hasChildren ( ) ) { if ( a && b . cssExpandedFolderIcon ) return b . cssTreeIcon + " " + b . cssExpandedFolderIcon ; if ( ! a && b . cssCollapsedFolderIcon ) return b . cssTreeIcon + " " + b . cssCollapsedFolderIcon } else if ( b . cssFileIcon ) return b . cssTreeIcon + " " + b . cssFileIcon ; return "" } ; goog . structs = { } ; goog . structs . getCount = function ( a ) { return a . getCount && "function" == typeof a . getCount ? a . getCount ( ) : goog . isArrayLike ( a ) || goog . isString ( a ) ? a . length : goog . object . getCount ( a ) } ; goog . structs . getValues = function ( a ) { if ( a . getValues && "function" == typeof a . getValues ) return a . getValues ( ) ; if ( goog . isString ( a ) ) return a . split ( "" ) ; if ( goog . isArrayLike ( a ) ) { for ( var b = [ ] , c = a . length , d = 0 ; d < c ; d ++ ) b . push ( a [ d ] ) ; return b } return goog . object . getValues ( a ) } ;
goog . structs . getKeys = function ( a ) { if ( a . getKeys && "function" == typeof a . getKeys ) return a . getKeys ( ) ; if ( ! a . getValues || "function" != typeof a . getValues ) { if ( goog . isArrayLike ( a ) || goog . isString ( a ) ) { var b = [ ] ; a = a . length ; for ( var c = 0 ; c < a ; c ++ ) b . push ( c ) ; return b } return goog . object . getKeys ( a ) } } ;
goog . structs . contains = function ( a , b ) { return a . contains && "function" == typeof a . contains ? a . contains ( b ) : a . containsValue && "function" == typeof a . containsValue ? a . containsValue ( b ) : goog . isArrayLike ( a ) || goog . isString ( a ) ? goog . array . contains ( a , b ) : goog . object . containsValue ( a , b ) } ; goog . structs . isEmpty = function ( a ) { return a . isEmpty && "function" == typeof a . isEmpty ? a . isEmpty ( ) : goog . isArrayLike ( a ) || goog . isString ( a ) ? goog . array . isEmpty ( a ) : goog . object . isEmpty ( a ) } ;
goog . structs . clear = function ( a ) { a . clear && "function" == typeof a . clear ? a . clear ( ) : goog . isArrayLike ( a ) ? goog . array . clear ( a ) : goog . object . clear ( a ) } ; goog . structs . forEach = function ( a , b , c ) { if ( a . forEach && "function" == typeof a . forEach ) a . forEach ( b , c ) ; else if ( goog . isArrayLike ( a ) || goog . isString ( a ) ) goog . array . forEach ( a , b , c ) ; else for ( var d = goog . structs . getKeys ( a ) , e = goog . structs . getValues ( a ) , f = e . length , g = 0 ; g < f ; g ++ ) b . call ( c , e [ g ] , d && d [ g ] , a ) } ;
goog . structs . filter = function ( a , b , c ) { if ( "function" == typeof a . filter ) return a . filter ( b , c ) ; if ( goog . isArrayLike ( a ) || goog . isString ( a ) ) return goog . array . filter ( a , b , c ) ; var d = goog . structs . getKeys ( a ) , e = goog . structs . getValues ( a ) , f = e . length ; if ( d ) { var g = { } ; for ( var h = 0 ; h < f ; h ++ ) b . call ( c , e [ h ] , d [ h ] , a ) && ( g [ d [ h ] ] = e [ h ] ) } else for ( g = [ ] , h = 0 ; h < f ; h ++ ) b . call ( c , e [ h ] , void 0 , a ) && g . push ( e [ h ] ) ; return g } ;
goog . structs . map = function ( a , b , c ) { if ( "function" == typeof a . map ) return a . map ( b , c ) ; if ( goog . isArrayLike ( a ) || goog . isString ( a ) ) return goog . array . map ( a , b , c ) ; var d = goog . structs . getKeys ( a ) , e = goog . structs . getValues ( a ) , f = e . length ; if ( d ) { var g = { } ; for ( var h = 0 ; h < f ; h ++ ) g [ d [ h ] ] = b . call ( c , e [ h ] , d [ h ] , a ) } else for ( g = [ ] , h = 0 ; h < f ; h ++ ) g [ h ] = b . call ( c , e [ h ] , void 0 , a ) ; return g } ;
goog . structs . some = function ( a , b , c ) { if ( "function" == typeof a . some ) return a . some ( b , c ) ; if ( goog . isArrayLike ( a ) || goog . isString ( a ) ) return goog . array . some ( a , b , c ) ; for ( var d = goog . structs . getKeys ( a ) , e = goog . structs . getValues ( a ) , f = e . length , g = 0 ; g < f ; g ++ ) if ( b . call ( c , e [ g ] , d && d [ g ] , a ) ) return ! 0 ; return ! 1 } ;
goog . structs . every = function ( a , b , c ) { if ( "function" == typeof a . every ) return a . every ( b , c ) ; if ( goog . isArrayLike ( a ) || goog . isString ( a ) ) return goog . array . every ( a , b , c ) ; for ( var d = goog . structs . getKeys ( a ) , e = goog . structs . getValues ( a ) , f = e . length , g = 0 ; g < f ; g ++ ) if ( ! b . call ( c , e [ g ] , d && d [ g ] , a ) ) return ! 1 ; return ! 0 } ; goog . structs . Trie = function ( a ) { this . value _ = void 0 ; this . childNodes _ = { } ; a && this . setAll ( a ) } ; goog . structs . Trie . prototype . set = function ( a , b ) { this . setOrAdd _ ( a , b , ! 1 ) } ; goog . structs . Trie . prototype . add = function ( a , b ) { this . setOrAdd _ ( a , b , ! 0 ) } ;
2017-09-25 09:37:41 +00:00
goog . structs . Trie . prototype . setOrAdd _ = function ( a , b , c ) { for ( var d = this , e = 0 ; e < a . length ; e ++ ) { var f = a . charAt ( e ) ; d . childNodes _ [ f ] || ( d . childNodes _ [ f ] = new goog . structs . Trie ) ; d = d . childNodes _ [ f ] } if ( c && void 0 !== d . value _ ) throw Error ( 'The collection already contains the key "' + a + '"' ) ; d . value _ = b } ; goog . structs . Trie . prototype . setAll = function ( a ) { var b = goog . structs . getKeys ( a ) ; a = goog . structs . getValues ( a ) ; for ( var c = 0 ; c < b . length ; c ++ ) this . set ( b [ c ] , a [ c ] ) } ;
2018-01-16 21:13:23 +00:00
goog . structs . Trie . prototype . getChildNode _ = function ( a ) { for ( var b = this , c = 0 ; c < a . length ; c ++ ) { var d = a . charAt ( c ) ; b = b . childNodes _ [ d ] ; if ( ! b ) return } return b } ; goog . structs . Trie . prototype . get = function ( a ) { return ( a = this . getChildNode _ ( a ) ) ? a . value _ : void 0 } ; goog . structs . Trie . prototype . getKeyAndPrefixes = function ( a , b ) { var c = this , d = { } , e = b || 0 ; void 0 !== c . value _ && ( d [ e ] = c . value _ ) ; for ( ; e < a . length ; e ++ ) { var f = a . charAt ( e ) ; if ( ! ( f in c . childNodes _ ) ) break ; c = c . childNodes _ [ f ] ; void 0 !== c . value _ && ( d [ e ] = c . value _ ) } return d } ;
2017-09-25 09:37:41 +00:00
goog . structs . Trie . prototype . getValues = function ( ) { var a = [ ] ; this . getValuesInternal _ ( a ) ; return a } ; goog . structs . Trie . prototype . getValuesInternal _ = function ( a ) { void 0 !== this . value _ && a . push ( this . value _ ) ; for ( var b in this . childNodes _ ) this . childNodes _ [ b ] . getValuesInternal _ ( a ) } ; goog . structs . Trie . prototype . getKeys = function ( a ) { var b = [ ] ; if ( a ) { for ( var c = this , d = 0 ; d < a . length ; d ++ ) { var e = a . charAt ( d ) ; if ( ! c . childNodes _ [ e ] ) return [ ] ; c = c . childNodes _ [ e ] } c . getKeysInternal _ ( a , b ) } else this . getKeysInternal _ ( "" , b ) ; return b } ;
goog . structs . Trie . prototype . getKeysInternal _ = function ( a , b ) { void 0 !== this . value _ && b . push ( a ) ; for ( var c in this . childNodes _ ) this . childNodes _ [ c ] . getKeysInternal _ ( a + c , b ) } ; goog . structs . Trie . prototype . containsKey = function ( a ) { return void 0 !== this . get ( a ) } ; goog . structs . Trie . prototype . containsPrefix = function ( a ) { return 0 == a . length ? ! this . isEmpty ( ) : ! ! this . getChildNode _ ( a ) } ;
goog . structs . Trie . prototype . containsValue = function ( a ) { if ( this . value _ === a ) return ! 0 ; for ( var b in this . childNodes _ ) if ( this . childNodes _ [ b ] . containsValue ( a ) ) return ! 0 ; return ! 1 } ; goog . structs . Trie . prototype . clear = function ( ) { this . childNodes _ = { } ; this . value _ = void 0 } ;
goog . structs . Trie . prototype . remove = function ( a ) { for ( var b = this , c = [ ] , d = 0 ; d < a . length ; d ++ ) { var e = a . charAt ( d ) ; if ( ! b . childNodes _ [ e ] ) throw Error ( 'The collection does not have the key "' + a + '"' ) ; c . push ( [ b , e ] ) ; b = b . childNodes _ [ e ] } a = b . value _ ; for ( delete b . value _ ; 0 < c . length ; ) if ( e = c . pop ( ) , b = e [ 0 ] , e = e [ 1 ] , b . childNodes _ [ e ] . isEmpty ( ) ) delete b . childNodes _ [ e ] ; else break ; return a } ; goog . structs . Trie . prototype . clone = function ( ) { return new goog . structs . Trie ( this ) } ; goog . structs . Trie . prototype . getCount = function ( ) { return goog . structs . getCount ( this . getValues ( ) ) } ;
goog . structs . Trie . prototype . isEmpty = function ( ) { return void 0 === this . value _ && goog . object . isEmpty ( this . childNodes _ ) } ; goog . ui . tree . TypeAhead = function ( ) { this . nodeMap _ = new goog . structs . Trie ; this . buffer _ = "" ; this . matchingNodes _ = this . matchingLabels _ = null ; this . matchingNodeIndex _ = this . matchingLabelIndex _ = 0 } ; goog . ui . tree . TypeAhead . Offset = { DOWN : 1 , UP : - 1 } ;
goog . ui . tree . TypeAhead . prototype . handleNavigation = function ( a ) { var b = ! 1 ; switch ( a . keyCode ) { case goog . events . KeyCodes . DOWN : case goog . events . KeyCodes . UP : a . ctrlKey && ( this . jumpTo _ ( a . keyCode == goog . events . KeyCodes . DOWN ? goog . ui . tree . TypeAhead . Offset . DOWN : goog . ui . tree . TypeAhead . Offset . UP ) , b = ! 0 ) ; break ; case goog . events . KeyCodes . BACKSPACE : a = this . buffer _ . length - 1 ; b = ! 0 ; 0 < a ? ( this . buffer _ = this . buffer _ . substring ( 0 , a ) , this . jumpToLabel _ ( this . buffer _ ) ) : 0 == a ? this . buffer _ = "" : b = ! 1 ; break ; case goog . events . KeyCodes . ESC : this . buffer _ =
"" , b = ! 0 } return b } ; goog . ui . tree . TypeAhead . prototype . handleTypeAheadChar = function ( a ) { var b = ! 1 ; a . ctrlKey || a . altKey || ( a = String . fromCharCode ( a . charCode || a . keyCode ) . toLowerCase ( ) , goog . string . isUnicodeChar ( a ) && ( " " != a || this . buffer _ ) && ( this . buffer _ += a , b = this . jumpToLabel _ ( this . buffer _ ) ) ) ; return b } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . TypeAhead . prototype . setNodeInMap = function ( a ) { var b = a . getText ( ) ; if ( b && ! goog . string . isEmptyOrWhitespace ( goog . string . makeSafe ( b ) ) ) { b = b . toLowerCase ( ) ; var c = this . nodeMap _ . get ( b ) ; c ? c . push ( a ) : this . nodeMap _ . set ( b , [ a ] ) } } ;
goog . ui . tree . TypeAhead . prototype . removeNodeFromMap = function ( a ) { var b = a . getText ( ) ; if ( b && ! goog . string . isEmptyOrWhitespace ( goog . string . makeSafe ( b ) ) ) { b = b . toLowerCase ( ) ; var c = this . nodeMap _ . get ( b ) ; if ( c ) { for ( var d = a . getChildCount ( ) , e = 0 ; e < d ; e ++ ) this . removeNodeFromMap ( a . getChildAt ( e ) ) ; goog . array . remove ( c , a ) ; c . length || this . nodeMap _ . remove ( b ) } } } ;
2017-09-25 09:37:41 +00:00
goog . ui . tree . TypeAhead . prototype . jumpToLabel _ = function ( a ) { var b = ! 1 ; ( a = this . nodeMap _ . getKeys ( a ) ) && a . length && ( this . matchingLabelIndex _ = this . matchingNodeIndex _ = 0 , b = this . nodeMap _ . get ( a [ 0 ] ) , b = this . selectMatchingNode _ ( b ) ) && ( this . matchingLabels _ = a ) ; return b } ;
2018-01-16 21:13:23 +00:00
goog . ui . tree . TypeAhead . prototype . jumpTo _ = function ( a ) { var b = ! 1 , c = this . matchingLabels _ ; if ( c ) { b = null ; var d = ! 1 ; if ( this . matchingNodes _ ) { var e = this . matchingNodeIndex _ + a ; 0 <= e && e < this . matchingNodes _ . length ? ( this . matchingNodeIndex _ = e , b = this . matchingNodes _ ) : d = ! 0 } b || ( e = this . matchingLabelIndex _ + a , 0 <= e && e < c . length && ( this . matchingLabelIndex _ = e ) , c . length > this . matchingLabelIndex _ && ( b = this . nodeMap _ . get ( c [ this . matchingLabelIndex _ ] ) ) , b && b . length && d && ( this . matchingNodeIndex _ = a == goog . ui . tree . TypeAhead . Offset . UP ? b . length -
1 : 0 ) ) ; if ( b = this . selectMatchingNode _ ( b ) ) this . matchingLabels _ = c } return b } ; goog . ui . tree . TypeAhead . prototype . selectMatchingNode _ = function ( a ) { if ( a ) { if ( this . matchingNodeIndex _ < a . length ) { var b = a [ this . matchingNodeIndex _ ] ; this . matchingNodes _ = a } b && ( b . reveal ( ) , b . select ( ) ) } return ! ! b } ; goog . ui . tree . TypeAhead . prototype . clear = function ( ) { this . buffer _ = "" } ; goog . ui . tree . TreeControl = function ( a , b , c ) { goog . ui . tree . BaseNode . call ( this , a , b , c ) ; this . setExpandedInternal ( ! 0 ) ; this . setSelectedInternal ( ! 0 ) ; this . selectedItem _ = this ; this . typeAhead _ = new goog . ui . tree . TypeAhead ; this . focusHandler _ = this . keyHandler _ = null ; this . logger _ = goog . log . getLogger ( "this" ) ; this . focused _ = ! 1 ; this . focusedNode _ = null ; this . showRootLines _ = this . showRootNode _ = this . showExpandIcons _ = this . showLines _ = ! 0 ; if ( goog . userAgent . IE ) try { document . execCommand ( "BackgroundImageCache" , ! 1 , ! 0 ) } catch ( d ) { goog . log . warning ( this . logger _ ,
2017-09-25 09:37:41 +00:00
"Failed to enable background image cache" ) } } ; goog . inherits ( goog . ui . tree . TreeControl , goog . ui . tree . BaseNode ) ; goog . ui . tree . TreeControl . prototype . getTree = function ( ) { return this } ; goog . ui . tree . TreeControl . prototype . getDepth = function ( ) { return 0 } ; goog . ui . tree . TreeControl . prototype . reveal = function ( ) { } ; goog . ui . tree . TreeControl . prototype . handleFocus _ = function ( a ) { this . focused _ = ! 0 ; goog . dom . classlist . add ( goog . asserts . assert ( this . getElement ( ) ) , "focused" ) ; this . selectedItem _ && this . selectedItem _ . select ( ) } ;
goog . ui . tree . TreeControl . prototype . handleBlur _ = function ( a ) { this . focused _ = ! 1 ; goog . dom . classlist . remove ( goog . asserts . assert ( this . getElement ( ) ) , "focused" ) } ; goog . ui . tree . TreeControl . prototype . hasFocus = function ( ) { return this . focused _ } ; goog . ui . tree . TreeControl . prototype . getExpanded = function ( ) { return ! this . showRootNode _ || goog . ui . tree . TreeControl . superClass _ . getExpanded . call ( this ) } ;
goog . ui . tree . TreeControl . prototype . setExpanded = function ( a ) { this . showRootNode _ ? goog . ui . tree . TreeControl . superClass _ . setExpanded . call ( this , a ) : this . setExpandedInternal ( a ) } ; goog . ui . tree . TreeControl . prototype . getExpandIconSafeHtml = function ( ) { return goog . html . SafeHtml . EMPTY } ; goog . ui . tree . TreeControl . prototype . getIconElement = function ( ) { var a = this . getRowElement ( ) ; return a ? a . firstChild : null } ; goog . ui . tree . TreeControl . prototype . getExpandIconElement = function ( ) { return null } ;
goog . ui . tree . TreeControl . prototype . updateExpandIcon = function ( ) { } ; goog . ui . tree . TreeControl . prototype . getRowClassName = function ( ) { return goog . ui . tree . TreeControl . superClass _ . getRowClassName . call ( this ) + ( this . showRootNode _ ? "" : " " + this . getConfig ( ) . cssHideRoot ) } ;
goog . ui . tree . TreeControl . prototype . getCalculatedIconClass = function ( ) { var a = this . getExpanded ( ) , b = this . getExpandedIconClass ( ) ; if ( a && b ) return b ; b = this . getIconClass ( ) ; if ( ! a && b ) return b ; b = this . getConfig ( ) ; return a && b . cssExpandedRootIcon ? b . cssTreeIcon + " " + b . cssExpandedRootIcon : ! a && b . cssCollapsedRootIcon ? b . cssTreeIcon + " " + b . cssCollapsedRootIcon : "" } ;
goog . ui . tree . TreeControl . prototype . setSelectedItem = function ( a ) { if ( this . selectedItem _ != a ) { var b = ! 1 ; this . selectedItem _ && ( b = this . selectedItem _ == this . focusedNode _ , this . selectedItem _ . setSelectedInternal ( ! 1 ) ) ; if ( this . selectedItem _ = a ) a . setSelectedInternal ( ! 0 ) , b && a . select ( ) ; this . dispatchEvent ( goog . events . EventType . CHANGE ) } } ; goog . ui . tree . TreeControl . prototype . getSelectedItem = function ( ) { return this . selectedItem _ } ;
goog . ui . tree . TreeControl . prototype . setShowLines = function ( a ) { this . showLines _ != a && ( this . showLines _ = a , this . isInDocument ( ) && this . updateLinesAndExpandIcons _ ( ) ) } ; goog . ui . tree . TreeControl . prototype . getShowLines = function ( ) { return this . showLines _ } ;
goog . ui . tree . TreeControl . prototype . updateLinesAndExpandIcons _ = function ( ) { function a ( e ) { var f = e . getChildrenElement ( ) ; if ( f ) { var g = ! c || b == e . getParent ( ) && ! d ? e . getConfig ( ) . cssChildrenNoLines : e . getConfig ( ) . cssChildren ; f . className = g ; if ( f = e . getExpandIconElement ( ) ) f . className = e . getExpandIconClass ( ) } e . forEachChild ( a ) } var b = this , c = b . getShowLines ( ) , d = b . getShowRootLines ( ) ; a ( this ) } ;
goog . ui . tree . TreeControl . prototype . setShowRootLines = function ( a ) { this . showRootLines _ != a && ( this . showRootLines _ = a , this . isInDocument ( ) && this . updateLinesAndExpandIcons _ ( ) ) } ; goog . ui . tree . TreeControl . prototype . getShowRootLines = function ( ) { return this . showRootLines _ } ; goog . ui . tree . TreeControl . prototype . setShowExpandIcons = function ( a ) { this . showExpandIcons _ != a && ( this . showExpandIcons _ = a , this . isInDocument ( ) && this . updateLinesAndExpandIcons _ ( ) ) } ; goog . ui . tree . TreeControl . prototype . getShowExpandIcons = function ( ) { return this . showExpandIcons _ } ;
goog . ui . tree . TreeControl . prototype . setShowRootNode = function ( a ) { if ( this . showRootNode _ != a ) { this . showRootNode _ = a ; if ( this . isInDocument ( ) ) { var b = this . getRowElement ( ) ; b && ( b . className = this . getRowClassName ( ) ) } ! a && this . getSelectedItem ( ) == this && this . getFirstChild ( ) && this . setSelectedItem ( this . getFirstChild ( ) ) } } ; goog . ui . tree . TreeControl . prototype . getShowRootNode = function ( ) { return this . showRootNode _ } ;
goog . ui . tree . TreeControl . prototype . initAccessibility = function ( ) { goog . ui . tree . TreeControl . superClass _ . initAccessibility . call ( this ) ; var a = this . getElement ( ) ; goog . asserts . assert ( a , "The DOM element for the tree cannot be null." ) ; goog . a11y . aria . setRole ( a , "tree" ) ; goog . a11y . aria . setState ( a , "labelledby" , this . getLabelElement ( ) . id ) } ;
goog . ui . tree . TreeControl . prototype . enterDocument = function ( ) { goog . ui . tree . TreeControl . superClass _ . enterDocument . call ( this ) ; var a = this . getElement ( ) ; a . className = this . getConfig ( ) . cssRoot ; a . setAttribute ( "hideFocus" , "true" ) ; this . attachEvents _ ( ) ; this . initAccessibility ( ) } ; goog . ui . tree . TreeControl . prototype . exitDocument = function ( ) { goog . ui . tree . TreeControl . superClass _ . exitDocument . call ( this ) ; this . detachEvents _ ( ) } ;
goog . ui . tree . TreeControl . prototype . attachEvents _ = function ( ) { var a = this . getElement ( ) ; a . tabIndex = 0 ; var b = this . keyHandler _ = new goog . events . KeyHandler ( a ) , c = this . focusHandler _ = new goog . events . FocusHandler ( a ) ; this . getHandler ( ) . listen ( c , goog . events . FocusHandler . EventType . FOCUSOUT , this . handleBlur _ ) . listen ( c , goog . events . FocusHandler . EventType . FOCUSIN , this . handleFocus _ ) . listen ( b , goog . events . KeyHandler . EventType . KEY , this . handleKeyEvent ) . listen ( a , goog . events . EventType . MOUSEDOWN , this . handleMouseEvent _ ) . listen ( a ,
goog . events . EventType . CLICK , this . handleMouseEvent _ ) . listen ( a , goog . events . EventType . DBLCLICK , this . handleMouseEvent _ ) } ; goog . ui . tree . TreeControl . prototype . detachEvents _ = function ( ) { this . keyHandler _ . dispose ( ) ; this . keyHandler _ = null ; this . focusHandler _ . dispose ( ) ; this . focusHandler _ = null } ;
goog . ui . tree . TreeControl . prototype . handleMouseEvent _ = function ( a ) { goog . log . fine ( this . logger _ , "Received event " + a . type ) ; var b = this . getNodeFromEvent _ ( a ) ; if ( b ) switch ( a . type ) { case goog . events . EventType . MOUSEDOWN : b . onMouseDown ( a ) ; break ; case goog . events . EventType . CLICK : b . onClick _ ( a ) ; break ; case goog . events . EventType . DBLCLICK : b . onDoubleClick _ ( a ) } } ;
goog . ui . tree . TreeControl . prototype . handleKeyEvent = function ( a ) { var b ; ( b = this . typeAhead _ . handleNavigation ( a ) || this . selectedItem _ && this . selectedItem _ . onKeyDown ( a ) || this . typeAhead _ . handleTypeAheadChar ( a ) ) && a . preventDefault ( ) ; return b } ; goog . ui . tree . TreeControl . prototype . getNodeFromEvent _ = function ( a ) { for ( var b = a . target ; null != b ; ) { if ( a = goog . ui . tree . BaseNode . allNodes [ b . id ] ) return a ; if ( b == this . getElement ( ) ) break ; b = b . parentNode } return null } ;
goog . ui . tree . TreeControl . prototype . createNode = function ( a ) { return new goog . ui . tree . TreeNode ( a || goog . html . SafeHtml . EMPTY , this . getConfig ( ) , this . getDomHelper ( ) ) } ; goog . ui . tree . TreeControl . prototype . setNode = function ( a ) { this . typeAhead _ . setNodeInMap ( a ) } ; goog . ui . tree . TreeControl . prototype . removeNode = function ( a ) { this . typeAhead _ . removeNodeFromMap ( a ) } ; goog . ui . tree . TreeControl . prototype . clearTypeAhead = function ( ) { this . typeAhead _ . clear ( ) } ; goog . ui . tree . TreeControl . defaultConfig = goog . ui . tree . BaseNode . defaultConfig ;
2018-01-16 21:13:23 +00:00
var Blockly = { } ; Blockly . Blocks = Object ( null ) ;
2018-08-17 13:32:56 +00:00
Blockly . Touch = { } ; Blockly . Touch . touchIdentifier _ = null ; Blockly . Touch . TOUCH _MAP = { } ;
goog . global . PointerEvent ? Blockly . Touch . TOUCH _MAP = { mousedown : [ "pointerdown" ] , mouseenter : [ "pointerenter" ] , mouseleave : [ "pointerleave" ] , mousemove : [ "pointermove" ] , mouseout : [ "pointerout" ] , mouseover : [ "pointerover" ] , mouseup : [ "pointerup" , "pointercancel" ] , touchend : [ "pointerup" ] , touchcancel : [ "pointercancel" ] } : goog . events . BrowserFeature . TOUCH _ENABLED && ( Blockly . Touch . TOUCH _MAP = { mousedown : [ "touchstart" ] , mousemove : [ "touchmove" ] , mouseup : [ "touchend" , "touchcancel" ] } ) ; Blockly . longPid _ = 0 ;
Blockly . longStart _ = function ( a , b ) { Blockly . longStop _ ( ) ; a . changedTouches && 1 != a . changedTouches . length || ( Blockly . longPid _ = setTimeout ( function ( ) { a . changedTouches && ( a . button = 2 , a . clientX = a . changedTouches [ 0 ] . clientX , a . clientY = a . changedTouches [ 0 ] . clientY ) ; b && b . handleRightClick ( a ) } , Blockly . LONGPRESS ) ) } ; Blockly . longStop _ = function ( ) { Blockly . longPid _ && ( clearTimeout ( Blockly . longPid _ ) , Blockly . longPid _ = 0 ) } ; Blockly . Touch . clearTouchIdentifier = function ( ) { Blockly . Touch . touchIdentifier _ = null } ;
Blockly . Touch . shouldHandleEvent = function ( a ) { return ! Blockly . Touch . isMouseOrTouchEvent ( a ) || Blockly . Touch . checkTouchIdentifier ( a ) } ; Blockly . Touch . getTouchIdentifierFromEvent = function ( a ) { return void 0 != a . pointerId ? a . pointerId : a . changedTouches && a . changedTouches [ 0 ] && void 0 != a . changedTouches [ 0 ] . identifier && null != a . changedTouches [ 0 ] . identifier ? a . changedTouches [ 0 ] . identifier : "mouse" } ;
Blockly . Touch . checkTouchIdentifier = function ( a ) { var b = Blockly . Touch . getTouchIdentifierFromEvent ( a ) ; return void 0 != Blockly . Touch . touchIdentifier _ && null != Blockly . Touch . touchIdentifier _ ? Blockly . Touch . touchIdentifier _ == b : "mousedown" == a . type || "touchstart" == a . type || "pointerdown" == a . type ? ( Blockly . Touch . touchIdentifier _ = b , ! 0 ) : ! 1 } ; Blockly . Touch . setClientFromTouch = function ( a ) { if ( goog . string . startsWith ( a . type , "touch" ) ) { var b = a . changedTouches [ 0 ] ; a . clientX = b . clientX ; a . clientY = b . clientY } } ;
Blockly . Touch . isMouseOrTouchEvent = function ( a ) { return goog . string . startsWith ( a . type , "touch" ) || goog . string . startsWith ( a . type , "mouse" ) || goog . string . startsWith ( a . type , "pointer" ) } ; Blockly . Touch . isTouchEvent = function ( a ) { return goog . string . startsWith ( a . type , "touch" ) || goog . string . startsWith ( a . type , "pointer" ) } ;
Blockly . Touch . splitEventByTouches = function ( a ) { var b = [ ] ; if ( a . changedTouches ) for ( var c = 0 ; c < a . changedTouches . length ; c ++ ) b [ c ] = { type : a . type , changedTouches : [ a . changedTouches [ c ] ] , target : a . target , stopPropagation : function ( ) { a . stopPropagation ( ) } , preventDefault : function ( ) { a . preventDefault ( ) } } ; else b . push ( a ) ; return b } ; Blockly . Events = { } ; Blockly . Events . group _ = "" ; Blockly . Events . recordUndo = ! 0 ; Blockly . Events . disabled _ = 0 ; Blockly . Events . CREATE = "create" ; Blockly . Events . BLOCK _CREATE = Blockly . Events . CREATE ; Blockly . Events . DELETE = "delete" ; Blockly . Events . BLOCK _DELETE = Blockly . Events . DELETE ; Blockly . Events . CHANGE = "change" ; Blockly . Events . BLOCK _CHANGE = Blockly . Events . CHANGE ; Blockly . Events . MOVE = "move" ; Blockly . Events . BLOCK _MOVE = Blockly . Events . MOVE ; Blockly . Events . VAR _CREATE = "var_create" ; Blockly . Events . VAR _DELETE = "var_delete" ;
Blockly . Events . VAR _RENAME = "var_rename" ; Blockly . Events . UI = "ui" ; Blockly . Events . COMMENT _CREATE = "comment_create" ; Blockly . Events . COMMENT _DELETE = "comment_delete" ; Blockly . Events . COMMENT _CHANGE = "comment_change" ; Blockly . Events . COMMENT _MOVE = "comment_move" ; Blockly . Events . FIRE _QUEUE _ = [ ] ; Blockly . Events . fire = function ( a ) { Blockly . Events . isEnabled ( ) && ( Blockly . Events . FIRE _QUEUE _ . length || setTimeout ( Blockly . Events . fireNow _ , 0 ) , Blockly . Events . FIRE _QUEUE _ . push ( a ) ) } ;
Blockly . Events . fireNow _ = function ( ) { for ( var a = Blockly . Events . filter ( Blockly . Events . FIRE _QUEUE _ , ! 0 ) , b = Blockly . Events . FIRE _QUEUE _ . length = 0 , c ; c = a [ b ] ; b ++ ) { var d = Blockly . Workspace . getById ( c . workspaceId ) ; d && d . fireChangeListener ( c ) } } ;
Blockly . Events . filter = function ( a , b ) { var c = goog . array . clone ( a ) ; b || c . reverse ( ) ; for ( var d = [ ] , e = Object . create ( null ) , f = 0 , g ; g = c [ f ] ; f ++ ) if ( ! g . isNull ( ) ) { var h = [ g . type , g . blockId , g . workspaceId ] . join ( " " ) , k = e [ h ] , l = k ? k . event : null ; k ? g . type == Blockly . Events . MOVE && k . index == f - 1 ? ( l . newParentId = g . newParentId , l . newInputName = g . newInputName , l . newCoordinate = g . newCoordinate , k . index = f ) : g . type == Blockly . Events . CHANGE && g . element == l . element && g . name == l . name ? l . newValue = g . newValue : g . type != Blockly . Events . UI || "click" != g . element ||
"commentOpen" != l . element && "mutatorOpen" != l . element && "warningOpen" != l . element ? ( e [ h ] = { event : g , index : 1 } , d . push ( g ) ) : l . newValue = g . newValue : ( e [ h ] = { event : g , index : f } , d . push ( g ) ) } c = d . filter ( function ( a ) { return ! a . isNull ( ) } ) ; b || c . reverse ( ) ; for ( f = 1 ; g = c [ f ] ; f ++ ) g . type == Blockly . Events . CHANGE && "mutation" == g . element && c . unshift ( c . splice ( f , 1 ) [ 0 ] ) ; return c } ; Blockly . Events . clearPendingUndo = function ( ) { for ( var a = 0 , b ; b = Blockly . Events . FIRE _QUEUE _ [ a ] ; a ++ ) b . recordUndo = ! 1 } ; Blockly . Events . disable = function ( ) { Blockly . Events . disabled _ ++ } ;
Blockly . Events . enable = function ( ) { Blockly . Events . disabled _ -- } ; Blockly . Events . isEnabled = function ( ) { return 0 == Blockly . Events . disabled _ } ; Blockly . Events . getGroup = function ( ) { return Blockly . Events . group _ } ; Blockly . Events . setGroup = function ( a ) { Blockly . Events . group _ = "boolean" == typeof a ? a ? Blockly . utils . genUid ( ) : "" : a } ; Blockly . Events . getDescendantIds _ = function ( a ) { var b = [ ] ; a = a . getDescendants ( ! 1 ) ; for ( var c = 0 , d ; d = a [ c ] ; c ++ ) b [ c ] = d . id ; return b } ;
Blockly . Events . fromJson = function ( a , b ) { switch ( a . type ) { case Blockly . Events . CREATE : var c = new Blockly . Events . Create ( null ) ; break ; case Blockly . Events . DELETE : c = new Blockly . Events . Delete ( null ) ; break ; case Blockly . Events . CHANGE : c = new Blockly . Events . Change ( null , "" , "" , "" , "" ) ; break ; case Blockly . Events . MOVE : c = new Blockly . Events . Move ( null ) ; break ; case Blockly . Events . VAR _CREATE : c = new Blockly . Events . VarCreate ( null ) ; break ; case Blockly . Events . VAR _DELETE : c = new Blockly . Events . VarDelete ( null ) ; break ; case Blockly . Events . VAR _RENAME : c =
new Blockly . Events . VarRename ( null , "" ) ; break ; case Blockly . Events . UI : c = new Blockly . Events . Ui ( null ) ; break ; case Blockly . Events . COMMENT _CREATE : c = new Blockly . Events . CommentCreate ( null ) ; break ; case Blockly . Events . COMMENT _CHANGE : c = new Blockly . Events . CommentChange ( null ) ; break ; case Blockly . Events . COMMENT _MOVE : c = new Blockly . Events . CommentMove ( null ) ; break ; case Blockly . Events . COMMENT _DELETE : c = new Blockly . Events . CommentDelete ( null ) ; break ; default : throw "Unknown event type." ; } c . fromJson ( a ) ; c . workspaceId = b . id ; return c } ;
Blockly . Events . disableOrphans = function ( a ) { if ( a . type == Blockly . Events . MOVE || a . type == Blockly . Events . CREATE ) { var b = Blockly . Workspace . getById ( a . workspaceId ) ; if ( a = b . getBlockById ( a . blockId ) ) if ( a . getParent ( ) && ! a . getParent ( ) . disabled ) { b = a . getDescendants ( ! 1 ) ; a = 0 ; for ( var c ; c = b [ a ] ; a ++ ) c . setDisabled ( ! 1 ) } else if ( ( a . outputConnection || a . previousConnection ) && ! b . isDragging ( ) ) { do a . setDisabled ( ! 0 ) , a = a . getNextBlock ( ) ; while ( a ) } } } ;
Blockly . Events . Abstract = function ( ) { this . workspaceId = void 0 ; this . group = Blockly . Events . group _ ; this . recordUndo = Blockly . Events . recordUndo } ; Blockly . Events . Abstract . prototype . toJson = function ( ) { var a = { type : this . type } ; this . group && ( a . group = this . group ) ; return a } ; Blockly . Events . Abstract . prototype . fromJson = function ( a ) { this . group = a . group } ; Blockly . Events . Abstract . prototype . isNull = function ( ) { return ! 1 } ; Blockly . Events . Abstract . prototype . run = function ( a ) { } ;
Blockly . Events . Abstract . prototype . getEventWorkspace _ = function ( ) { var a = Blockly . Workspace . getById ( this . workspaceId ) ; if ( ! a ) throw Error ( "Workspace is null. Event must have been generated from real Blockly events." ) ; return a } ; Blockly . Events . VarBase = function ( a ) { Blockly . Events . VarBase . superClass _ . constructor . call ( this ) ; this . varId = a . getId ( ) ; this . workspaceId = a . workspace . id } ; goog . inherits ( Blockly . Events . VarBase , Blockly . Events . Abstract ) ; Blockly . Events . VarBase . prototype . toJson = function ( ) { var a = Blockly . Events . VarBase . superClass _ . toJson . call ( this ) ; a . varId = this . varId ; return a } ; Blockly . Events . VarBase . prototype . fromJson = function ( a ) { Blockly . Events . VarBase . superClass _ . toJson . call ( this ) ; this . varId = a . varId } ;
Blockly . Events . VarCreate = function ( a ) { a && ( Blockly . Events . VarCreate . superClass _ . constructor . call ( this , a ) , this . varType = a . type , this . varName = a . name ) } ; goog . inherits ( Blockly . Events . VarCreate , Blockly . Events . VarBase ) ; Blockly . Events . VarCreate . prototype . type = Blockly . Events . VAR _CREATE ; Blockly . Events . VarCreate . prototype . toJson = function ( ) { var a = Blockly . Events . VarCreate . superClass _ . toJson . call ( this ) ; a . varType = this . varType ; a . varName = this . varName ; return a } ;
Blockly . Events . VarCreate . prototype . fromJson = function ( a ) { Blockly . Events . VarCreate . superClass _ . fromJson . call ( this , a ) ; this . varType = a . varType ; this . varName = a . varName } ; Blockly . Events . VarCreate . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? b . createVariable ( this . varName , this . varType , this . varId ) : b . deleteVariableById ( this . varId ) } ; Blockly . Events . VarDelete = function ( a ) { a && ( Blockly . Events . VarDelete . superClass _ . constructor . call ( this , a ) , this . varType = a . type , this . varName = a . name ) } ;
goog . inherits ( Blockly . Events . VarDelete , Blockly . Events . VarBase ) ; Blockly . Events . VarDelete . prototype . type = Blockly . Events . VAR _DELETE ; Blockly . Events . VarDelete . prototype . toJson = function ( ) { var a = Blockly . Events . VarDelete . superClass _ . toJson . call ( this ) ; a . varType = this . varType ; a . varName = this . varName ; return a } ; Blockly . Events . VarDelete . prototype . fromJson = function ( a ) { Blockly . Events . VarDelete . superClass _ . fromJson . call ( this , a ) ; this . varType = a . varType ; this . varName = a . varName } ;
Blockly . Events . VarDelete . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? b . deleteVariableById ( this . varId ) : b . createVariable ( this . varName , this . varType , this . varId ) } ; Blockly . Events . VarRename = function ( a , b ) { a && ( Blockly . Events . VarRename . superClass _ . constructor . call ( this , a ) , this . oldName = a . name , this . newName = b ) } ; goog . inherits ( Blockly . Events . VarRename , Blockly . Events . VarBase ) ; Blockly . Events . VarRename . prototype . type = Blockly . Events . VAR _RENAME ;
Blockly . Events . VarRename . prototype . toJson = function ( ) { var a = Blockly . Events . VarRename . superClass _ . toJson . call ( this ) ; a . oldName = this . oldName ; a . newName = this . newName ; return a } ; Blockly . Events . VarRename . prototype . fromJson = function ( a ) { Blockly . Events . VarRename . superClass _ . fromJson . call ( this , a ) ; this . oldName = a . oldName ; this . newName = a . newName } ; Blockly . Events . VarRename . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? b . renameVariableById ( this . varId , this . newName ) : b . renameVariableById ( this . varId , this . oldName ) } ;
Blockly . VariableMap = function ( a ) { this . variableMap _ = { } ; this . workspace = a } ; Blockly . VariableMap . prototype . clear = function ( ) { this . variableMap _ = Object ( null ) } ; Blockly . VariableMap . prototype . renameVariable = function ( a , b ) { var c = this . getVariable ( b , a . type ) , d = this . workspace . getAllBlocks ( ) ; Blockly . Events . setGroup ( ! 0 ) ; try { c && c . getId ( ) != a . getId ( ) ? this . renameVariableWithConflict _ ( a , b , c , d ) : this . renameVariableAndUses _ ( a , b , d ) } finally { Blockly . Events . setGroup ( ! 1 ) } } ;
Blockly . VariableMap . prototype . renameVariableById = function ( a , b ) { var c = this . getVariableById ( a ) ; if ( ! c ) throw Error ( "Tried to rename a variable that didn't exist. ID: " + a ) ; this . renameVariable ( c , b ) } ; Blockly . VariableMap . prototype . renameVariableAndUses _ = function ( a , b , c ) { Blockly . Events . fire ( new Blockly . Events . VarRename ( a , b ) ) ; a . name = b ; for ( b = 0 ; b < c . length ; b ++ ) c [ b ] . updateVarName ( a ) } ;
Blockly . VariableMap . prototype . renameVariableWithConflict _ = function ( a , b , c , d ) { var e = a . type ; b != c . name && this . renameVariableAndUses _ ( c , b , d ) ; for ( b = 0 ; b < d . length ; b ++ ) d [ b ] . renameVarById ( a . getId ( ) , c . getId ( ) ) ; Blockly . Events . fire ( new Blockly . Events . VarDelete ( a ) ) ; a = this . getVariablesOfType ( e ) . indexOf ( a ) ; this . variableMap _ [ e ] . splice ( a , 1 ) } ;
Blockly . VariableMap . prototype . createVariable = function ( a , b , c ) { var d = this . getVariable ( a , b ) ; if ( d ) { if ( c && d . getId ( ) != c ) throw Error ( 'Variable "' + a + '" is already in use and its id is "' + d . getId ( ) + '" which conflicts with the passed in id, "' + c + '".' ) ; return d } if ( c && this . getVariableById ( c ) ) throw Error ( 'Variable id, "' + c + '", is already in use.' ) ; c = c || Blockly . utils . genUid ( ) ; b = b || "" ; d = new Blockly . VariableModel ( this . workspace , a , b , c ) ; this . variableMap _ [ b ] ? this . variableMap _ [ b ] . push ( d ) : this . variableMap _ [ b ] = [ d ] ; return d } ;
Blockly . VariableMap . prototype . deleteVariable = function ( a ) { for ( var b = this . variableMap _ [ a . type ] , c = 0 , d ; d = b [ c ] ; c ++ ) if ( d . getId ( ) == a . getId ( ) ) { b . splice ( c , 1 ) ; Blockly . Events . fire ( new Blockly . Events . VarDelete ( a ) ) ; break } } ;
Blockly . VariableMap . prototype . deleteVariableById = function ( a ) { var b = this . getVariableById ( a ) ; if ( b ) { var c = b . name , d = this . getVariableUsesById ( a ) ; a = 0 ; for ( var e ; e = d [ a ] ; a ++ ) if ( "procedures_defnoreturn" == e . type || "procedures_defreturn" == e . type ) { a = e . getFieldValue ( "NAME" ) ; c = Blockly . Msg . CANNOT _DELETE _VARIABLE _PROCEDURE . replace ( "%1" , c ) . replace ( "%2" , a ) ; Blockly . alert ( c ) ; return } var f = this ; 1 < d . length ? ( c = Blockly . Msg . DELETE _VARIABLE _CONFIRMATION . replace ( "%1" , String ( d . length ) ) . replace ( "%2" , c ) , Blockly . confirm ( c , function ( a ) { a &&
f . deleteVariableInternal _ ( b , d ) } ) ) : f . deleteVariableInternal _ ( b , d ) } else console . warn ( "Can't delete non-existent variable: " + a ) } ; Blockly . VariableMap . prototype . deleteVariableInternal _ = function ( a , b ) { var c = Blockly . Events . getGroup ( ) ; c || Blockly . Events . setGroup ( ! 0 ) ; try { for ( var d = 0 ; d < b . length ; d ++ ) b [ d ] . dispose ( ! 0 , ! 1 ) ; this . deleteVariable ( a ) } finally { c || Blockly . Events . setGroup ( ! 1 ) } } ;
Blockly . VariableMap . prototype . getVariable = function ( a , b ) { var c = this . variableMap _ [ b || "" ] ; if ( c ) for ( var d = 0 , e ; e = c [ d ] ; d ++ ) if ( Blockly . Names . equals ( e . name , a ) ) return e ; return null } ; Blockly . VariableMap . prototype . getVariableById = function ( a ) { for ( var b = Object . keys ( this . variableMap _ ) , c = 0 ; c < b . length ; c ++ ) for ( var d = b [ c ] , e = 0 , f ; f = this . variableMap _ [ d ] [ e ] ; e ++ ) if ( f . getId ( ) == a ) return f ; return null } ; Blockly . VariableMap . prototype . getVariablesOfType = function ( a ) { return ( a = this . variableMap _ [ a || "" ] ) ? a . slice ( ) : [ ] } ;
Blockly . VariableMap . prototype . getVariableTypes = function ( ) { for ( var a = Object . keys ( this . variableMap _ ) , b = ! 1 , c = 0 ; c < a . length ; c ++ ) "" == a [ c ] && ( b = ! 0 ) ; b || a . push ( "" ) ; return a } ; Blockly . VariableMap . prototype . getAllVariables = function ( ) { for ( var a = [ ] , b = Object . keys ( this . variableMap _ ) , c = 0 ; c < b . length ; c ++ ) a = a . concat ( this . variableMap _ [ b [ c ] ] ) ; return a } ;
Blockly . VariableMap . prototype . getVariableUsesById = function ( a ) { for ( var b = [ ] , c = this . workspace . getAllBlocks ( ) , d = 0 ; d < c . length ; d ++ ) { var e = c [ d ] . getVarModels ( ) ; if ( e ) for ( var f = 0 ; f < e . length ; f ++ ) e [ f ] . getId ( ) == a && b . push ( c [ d ] ) } return b } ; Blockly . Events . CommentBase = function ( a ) { this . commentId = a . id ; this . workspaceId = a . workspace . id ; this . group = Blockly . Events . group _ ; this . recordUndo = Blockly . Events . recordUndo } ; goog . inherits ( Blockly . Events . CommentBase , Blockly . Events . Abstract ) ; Blockly . Events . CommentBase . prototype . toJson = function ( ) { var a = { type : this . type } ; this . group && ( a . group = this . group ) ; this . commentId && ( a . commentId = this . commentId ) ; return a } ; Blockly . Events . CommentBase . prototype . fromJson = function ( a ) { this . commentId = a . commentId ; this . group = a . group } ;
Blockly . Events . CommentChange = function ( a , b , c ) { a && ( Blockly . Events . CommentChange . superClass _ . constructor . call ( this , a ) , this . oldContents _ = b , this . newContents _ = c ) } ; goog . inherits ( Blockly . Events . CommentChange , Blockly . Events . CommentBase ) ; Blockly . Events . CommentChange . prototype . type = Blockly . Events . COMMENT _CHANGE ; Blockly . Events . CommentChange . prototype . toJson = function ( ) { var a = Blockly . Events . CommentChange . superClass _ . toJson . call ( this ) ; a . newContents = this . newContents _ ; return a } ;
Blockly . Events . CommentChange . prototype . fromJson = function ( a ) { Blockly . Events . CommentChange . superClass _ . fromJson . call ( this , a ) ; this . newContents _ = a . newValue } ; Blockly . Events . CommentChange . prototype . isNull = function ( ) { return this . oldContents _ == this . newContents _ } ; Blockly . Events . CommentChange . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) . getCommentById ( this . commentId ) ; b ? b . setContent ( a ? this . newContents _ : this . oldContents _ ) : console . warn ( "Can't change non-existent comment: " + this . commentId ) } ;
Blockly . Events . CommentCreate = function ( a ) { a && ( Blockly . Events . CommentCreate . superClass _ . constructor . call ( this , a ) , this . xml = a . toXmlWithXY ( ) ) } ; goog . inherits ( Blockly . Events . CommentCreate , Blockly . Events . CommentBase ) ; Blockly . Events . CommentCreate . prototype . type = Blockly . Events . COMMENT _CREATE ; Blockly . Events . CommentCreate . prototype . toJson = function ( ) { var a = Blockly . Events . CommentCreate . superClass _ . toJson . call ( this ) ; a . xml = Blockly . Xml . domToText ( this . xml ) ; return a } ;
Blockly . Events . CommentCreate . prototype . fromJson = function ( a ) { Blockly . Events . CommentCreate . superClass _ . fromJson . call ( this , a ) ; this . xml = Blockly . Xml . textToDom ( "<xml>" + a . xml + "</xml>" ) . firstChild } ; Blockly . Events . CommentCreate . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? ( a = goog . dom . createDom ( "xml" ) , a . appendChild ( this . xml ) , Blockly . Xml . domToWorkspace ( a , b ) ) : ( b = b . getCommentById ( this . commentId ) ) ? b . dispose ( ! 1 , ! 1 ) : console . warn ( "Can't uncreate non-existent comment: " + this . commentId ) } ;
Blockly . Events . CommentDelete = function ( a ) { a && ( Blockly . Events . CommentDelete . superClass _ . constructor . call ( this , a ) , this . xml = a . toXmlWithXY ( ) ) } ; goog . inherits ( Blockly . Events . CommentDelete , Blockly . Events . CommentBase ) ; Blockly . Events . CommentDelete . prototype . type = Blockly . Events . COMMENT _DELETE ; Blockly . Events . CommentDelete . prototype . toJson = function ( ) { return Blockly . Events . CommentDelete . superClass _ . toJson . call ( this ) } ;
Blockly . Events . CommentDelete . prototype . fromJson = function ( a ) { Blockly . Events . CommentDelete . superClass _ . fromJson . call ( this , a ) } ; Blockly . Events . CommentDelete . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? ( b = b . getCommentById ( this . commentId ) ) ? b . dispose ( ! 1 , ! 1 ) : console . warn ( "Can't uncreate non-existent comment: " + this . commentId ) : ( a = goog . dom . createDom ( "xml" ) , a . appendChild ( this . xml ) , Blockly . Xml . domToWorkspace ( a , b ) ) } ;
Blockly . Events . CommentMove = function ( a ) { a && ( Blockly . Events . CommentMove . superClass _ . constructor . call ( this , a ) , this . comment _ = a , this . oldCoordinate _ = a . getXY ( ) , this . newCoordinate _ = null ) } ; goog . inherits ( Blockly . Events . CommentMove , Blockly . Events . CommentBase ) ; Blockly . Events . CommentMove . prototype . recordNew = function ( ) { if ( ! this . comment _ ) throw Error ( "Tried to record the new position of a comment on the same event twice." ) ; this . newCoordinate _ = this . comment _ . getXY ( ) ; this . comment _ = null } ;
Blockly . Events . CommentMove . prototype . type = Blockly . Events . COMMENT _MOVE ; Blockly . Events . CommentMove . prototype . setOldCoordinate = function ( a ) { this . oldCoordinate _ = a } ; Blockly . Events . CommentMove . prototype . toJson = function ( ) { var a = Blockly . Events . CommentMove . superClass _ . toJson . call ( this ) ; this . newCoordinate _ && ( a . newCoordinate = Math . round ( this . newCoordinate _ . x ) + "," + Math . round ( this . newCoordinate _ . y ) ) ; return a } ;
Blockly . Events . CommentMove . prototype . fromJson = function ( a ) { Blockly . Events . CommentMove . superClass _ . fromJson . call ( this , a ) ; a . newCoordinate && ( a = a . newCoordinate . split ( "," ) , this . newCoordinate _ = new goog . math . Coordinate ( parseFloat ( a [ 0 ] ) , parseFloat ( a [ 1 ] ) ) ) } ; Blockly . Events . CommentMove . prototype . isNull = function ( ) { return goog . math . Coordinate . equals ( this . oldCoordinate _ , this . newCoordinate _ ) } ;
Blockly . Events . CommentMove . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) . getCommentById ( this . commentId ) ; if ( b ) { a = a ? this . newCoordinate _ : this . oldCoordinate _ ; var c = b . getXY ( ) ; b . moveBy ( a . x - c . x , a . y - c . y ) } else console . warn ( "Can't move non-existent comment: " + this . commentId ) } ; Blockly . WorkspaceComment = function ( a , b , c , d , e ) { this . id = e && ! a . getCommentById ( e ) ? e : Blockly . utils . genUid ( ) ; a . addTopComment ( this ) ; this . xy _ = new goog . math . Coordinate ( 0 , 0 ) ; this . height _ = c ; this . width _ = d ; this . workspace = a ; this . RTL = a . RTL ; this . movable _ = this . deletable _ = ! 0 ; this . content _ = b ; this . isComment = ! 0 ; Blockly . WorkspaceComment . fireCreateEvent ( this ) } ;
Blockly . WorkspaceComment . prototype . dispose = function ( ) { this . workspace && ( Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . CommentDelete ( this ) ) , this . workspace . removeTopComment ( this ) , this . workspace = null ) } ; Blockly . WorkspaceComment . prototype . getHeight = function ( ) { return this . height _ } ; Blockly . WorkspaceComment . prototype . setHeight = function ( a ) { this . height _ = a } ; Blockly . WorkspaceComment . prototype . getWidth = function ( ) { return this . width _ } ;
Blockly . WorkspaceComment . prototype . setWidth = function ( a ) { this . width _ = a } ; Blockly . WorkspaceComment . prototype . getXY = function ( ) { return this . xy _ . clone ( ) } ; Blockly . WorkspaceComment . prototype . moveBy = function ( a , b ) { var c = new Blockly . Events . CommentMove ( this ) ; this . xy _ . translate ( a , b ) ; c . recordNew ( ) ; Blockly . Events . fire ( c ) } ; Blockly . WorkspaceComment . prototype . isDeletable = function ( ) { return this . deletable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ;
Blockly . WorkspaceComment . prototype . setDeletable = function ( a ) { this . deletable _ = a } ; Blockly . WorkspaceComment . prototype . isMovable = function ( ) { return this . movable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; Blockly . WorkspaceComment . prototype . setMovable = function ( a ) { this . movable _ = a } ; Blockly . WorkspaceComment . prototype . getContent = function ( ) { return this . content _ } ;
Blockly . WorkspaceComment . prototype . setContent = function ( a ) { this . content _ != a && ( Blockly . Events . fire ( new Blockly . Events . CommentChange ( this , this . content _ , a ) ) , this . content _ = a ) } ; Blockly . WorkspaceComment . prototype . toXmlWithXY = function ( a ) { a = this . toXml ( a ) ; a . setAttribute ( "x" , Math . round ( this . xy _ . x ) ) ; a . setAttribute ( "y" , Math . round ( this . xy _ . y ) ) ; a . setAttribute ( "h" , this . height _ ) ; a . setAttribute ( "w" , this . width _ ) ; return a } ;
Blockly . WorkspaceComment . prototype . toXml = function ( a ) { var b = goog . dom . createDom ( "comment" ) ; a || b . setAttribute ( "id" , this . id ) ; b . textContent = this . getContent ( ) ; return b } ; Blockly . WorkspaceComment . fireCreateEvent = function ( a ) { if ( Blockly . Events . isEnabled ( ) ) { var b = Blockly . Events . getGroup ( ) ; b || Blockly . Events . setGroup ( ! 0 ) ; try { Blockly . Events . fire ( new Blockly . Events . CommentCreate ( a ) ) } finally { b || Blockly . Events . setGroup ( ! 1 ) } } } ;
Blockly . WorkspaceComment . fromXml = function ( a , b ) { var c = Blockly . WorkspaceComment . parseAttributes ( a ) ; c = new Blockly . WorkspaceComment ( b , c . content , c . h , c . w , c . id ) ; var d = parseInt ( a . getAttribute ( "x" ) , 10 ) , e = parseInt ( a . getAttribute ( "y" ) , 10 ) ; isNaN ( d ) || isNaN ( e ) || c . moveBy ( d , e ) ; Blockly . WorkspaceComment . fireCreateEvent ( c ) ; return c } ;
Blockly . WorkspaceComment . parseAttributes = function ( a ) { var b = a . getAttribute ( "h" ) , c = a . getAttribute ( "w" ) ; return { id : a . getAttribute ( "id" ) , h : b ? parseInt ( b , 10 ) : 100 , w : c ? parseInt ( c , 10 ) : 100 , x : parseInt ( a . getAttribute ( "x" ) , 10 ) , y : parseInt ( a . getAttribute ( "y" ) , 10 ) , content : a . textContent } } ;
Blockly . Workspace = function ( a ) { this . id = Blockly . utils . genUid ( ) ; Blockly . Workspace . WorkspaceDB _ [ this . id ] = this ; this . options = a || { } ; this . RTL = ! ! this . options . RTL ; this . horizontalLayout = ! ! this . options . horizontalLayout ; this . toolboxPosition = this . options . toolboxPosition ; this . topBlocks _ = [ ] ; this . topComments _ = [ ] ; this . commentDB _ = Object . create ( null ) ; this . listeners _ = [ ] ; this . undoStack _ = [ ] ; this . redoStack _ = [ ] ; this . blockDB _ = Object . create ( null ) ; this . variableMap _ = new Blockly . VariableMap ( this ) ; this . potentialVariableMap _ = null } ;
Blockly . Workspace . prototype . rendered = ! 1 ; Blockly . Workspace . prototype . isClearing = ! 1 ; Blockly . Workspace . prototype . MAX _UNDO = 1024 ; Blockly . Workspace . prototype . dispose = function ( ) { this . listeners _ . length = 0 ; this . clear ( ) ; delete Blockly . Workspace . WorkspaceDB _ [ this . id ] } ; Blockly . Workspace . SCAN _ANGLE = 3 ; Blockly . Workspace . prototype . addTopBlock = function ( a ) { this . topBlocks _ . push ( a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Workspace . prototype . removeTopBlock = function ( a ) { if ( ! goog . array . remove ( this . topBlocks _ , a ) ) throw "Block not present in workspace's list of top-most blocks." ; } ; Blockly . Workspace . prototype . getTopBlocks = function ( a ) { var b = [ ] . concat ( this . topBlocks _ ) ; if ( a && 1 < b . length ) { var c = Math . sin ( goog . math . toRadians ( Blockly . Workspace . SCAN _ANGLE ) ) ; this . RTL && ( c *= - 1 ) ; b . sort ( function ( a , b ) { var d = a . getRelativeToSurfaceXY ( ) , e = b . getRelativeToSurfaceXY ( ) ; return d . y + c * d . x - ( e . y + c * e . x ) } ) } return b } ;
2018-08-17 13:32:56 +00:00
Blockly . Workspace . prototype . addTopComment = function ( a ) { this . topComments _ . push ( a ) ; this . commentDB _ [ a . id ] && console . warn ( 'Overriding an existing comment on this workspace, with id "' + a . id + '"' ) ; this . commentDB _ [ a . id ] = a } ; Blockly . Workspace . prototype . removeTopComment = function ( a ) { if ( ! goog . array . remove ( this . topComments _ , a ) ) throw "Comment not present in workspace's list of top-most comments." ; delete this . commentDB _ [ a . id ] } ;
Blockly . Workspace . prototype . getTopComments = function ( a ) { var b = [ ] . concat ( this . topComments _ ) ; if ( a && 1 < b . length ) { var c = Math . sin ( goog . math . toRadians ( Blockly . Workspace . SCAN _ANGLE ) ) ; this . RTL && ( c *= - 1 ) ; b . sort ( function ( a , b ) { var d = a . getRelativeToSurfaceXY ( ) , e = b . getRelativeToSurfaceXY ( ) ; return d . y + c * d . x - ( e . y + c * e . x ) } ) } return b } ;
Blockly . Workspace . prototype . getAllBlocks = function ( a ) { if ( a ) { a = this . getTopBlocks ( ! 0 ) ; for ( var b = [ ] , c = 0 ; c < a . length ; c ++ ) b . push . apply ( b , a [ c ] . getDescendants ( ! 0 ) ) } else for ( b = this . getTopBlocks ( ! 1 ) , c = 0 ; c < b . length ; c ++ ) b . push . apply ( b , b [ c ] . getChildren ( ! 1 ) ) ; return b } ;
Blockly . Workspace . prototype . clear = function ( ) { this . isClearing = ! 0 ; try { var a = Blockly . Events . getGroup ( ) ; for ( a || Blockly . Events . setGroup ( ! 0 ) ; this . topBlocks _ . length ; ) this . topBlocks _ [ 0 ] . dispose ( ) ; for ( ; this . topComments _ . length ; ) this . topComments _ [ this . topComments _ . length - 1 ] . dispose ( ) ; a || Blockly . Events . setGroup ( ! 1 ) ; this . variableMap _ . clear ( ) ; this . potentialVariableMap _ && this . potentialVariableMap _ . clear ( ) } finally { this . isClearing = ! 1 } } ;
Blockly . Workspace . prototype . renameVariableById = function ( a , b ) { this . variableMap _ . renameVariableById ( a , b ) } ; Blockly . Workspace . prototype . createVariable = function ( a , b , c ) { return this . variableMap _ . createVariable ( a , b , c ) } ; Blockly . Workspace . prototype . getVariableUsesById = function ( a ) { return this . variableMap _ . getVariableUsesById ( a ) } ; Blockly . Workspace . prototype . deleteVariableById = function ( a ) { this . variableMap _ . deleteVariableById ( a ) } ;
Blockly . Workspace . prototype . deleteVariableInternal _ = function ( a , b ) { this . variableMap _ . deleteVariableInternal _ ( a , b ) } ; Blockly . Workspace . prototype . variableIndexOf = function ( a ) { console . warn ( "Deprecated call to Blockly.Workspace.prototype.variableIndexOf" ) ; return - 1 } ; Blockly . Workspace . prototype . getVariable = function ( a , b ) { return this . variableMap _ . getVariable ( a , b ) } ; Blockly . Workspace . prototype . getVariableById = function ( a ) { return this . variableMap _ . getVariableById ( a ) } ;
Blockly . Workspace . prototype . getVariablesOfType = function ( a ) { return this . variableMap _ . getVariablesOfType ( a ) } ; Blockly . Workspace . prototype . getVariableTypes = function ( ) { return this . variableMap _ . getVariableTypes ( ) } ; Blockly . Workspace . prototype . getAllVariables = function ( ) { return this . variableMap _ . getAllVariables ( ) } ; Blockly . Workspace . prototype . getWidth = function ( ) { return 0 } ; Blockly . Workspace . prototype . newBlock = function ( a , b ) { return new Blockly . Block ( this , a , b ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Workspace . prototype . remainingCapacity = function ( ) { return isNaN ( this . options . maxBlocks ) ? Infinity : this . options . maxBlocks - this . getAllBlocks ( ) . length } ;
2018-01-16 21:13:23 +00:00
Blockly . Workspace . prototype . undo = function ( a ) { var b = a ? this . redoStack _ : this . undoStack _ , c = a ? this . undoStack _ : this . redoStack _ , d = b . pop ( ) ; if ( d ) { for ( var e = [ d ] ; b . length && d . group && d . group == b [ b . length - 1 ] . group ; ) e . push ( b . pop ( ) ) ; for ( b = 0 ; d = e [ b ] ; b ++ ) c . push ( d ) ; e = Blockly . Events . filter ( e , a ) ; Blockly . Events . recordUndo = ! 1 ; try { for ( b = 0 ; d = e [ b ] ; b ++ ) d . run ( a ) } finally { Blockly . Events . recordUndo = ! 0 } } } ; Blockly . Workspace . prototype . clearUndo = function ( ) { this . undoStack _ . length = 0 ; this . redoStack _ . length = 0 ; Blockly . Events . clearPendingUndo ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Workspace . prototype . addChangeListener = function ( a ) { this . listeners _ . push ( a ) ; return a } ; Blockly . Workspace . prototype . removeChangeListener = function ( a ) { goog . array . remove ( this . listeners _ , a ) } ; Blockly . Workspace . prototype . fireChangeListener = function ( a ) { a . recordUndo && ( this . undoStack _ . push ( a ) , this . redoStack _ . length = 0 , this . undoStack _ . length > this . MAX _UNDO && this . undoStack _ . unshift ( ) ) ; for ( var b = 0 , c ; c = this . listeners _ [ b ] ; b ++ ) c ( a ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Workspace . prototype . getBlockById = function ( a ) { return this . blockDB _ [ a ] || null } ; Blockly . Workspace . prototype . getCommentById = function ( a ) { return this . commentDB _ [ a ] || null } ; Blockly . Workspace . prototype . allInputsFilled = function ( a ) { for ( var b = this . getTopBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) if ( ! d . allInputsFilled ( a ) ) return ! 1 ; return ! 0 } ; Blockly . Workspace . prototype . getPotentialVariableMap = function ( ) { return this . potentialVariableMap _ } ;
Blockly . Workspace . prototype . createPotentialVariableMap = function ( ) { this . potentialVariableMap _ = new Blockly . VariableMap ( this ) } ; Blockly . Workspace . prototype . getVariableMap = function ( ) { return this . variableMap _ } ; Blockly . Workspace . WorkspaceDB _ = Object . create ( null ) ; Blockly . Workspace . getById = function ( a ) { return Blockly . Workspace . WorkspaceDB _ [ a ] || null } ; Blockly . Workspace . prototype . clear = Blockly . Workspace . prototype . clear ; Blockly . Workspace . prototype . clearUndo = Blockly . Workspace . prototype . clearUndo ;
Blockly . Workspace . prototype . addChangeListener = Blockly . Workspace . prototype . addChangeListener ; Blockly . Workspace . prototype . removeChangeListener = Blockly . Workspace . prototype . removeChangeListener ; Blockly . Bubble = function ( a , b , c , d , e , f ) { this . workspace _ = a ; this . content _ = b ; this . shape _ = c ; c = Blockly . Bubble . ARROW _ANGLE ; this . workspace _ . RTL && ( c = - c ) ; this . arrow _radians _ = goog . math . toRadians ( c ) ; a . getBubbleCanvas ( ) . appendChild ( this . createDom _ ( b , ! ( ! e || ! f ) ) ) ; this . setAnchorLocation ( d ) ; e && f || ( b = this . content _ . getBBox ( ) , e = b . width + 2 * Blockly . Bubble . BORDER _WIDTH , f = b . height + 2 * Blockly . Bubble . BORDER _WIDTH ) ; this . setBubbleSize ( e , f ) ; this . positionBubble _ ( ) ; this . renderArrow _ ( ) ; this . rendered _ = ! 0 ; a . options . readOnly || ( Blockly . bindEventWithChecks _ ( this . bubbleBack _ ,
2017-09-25 09:37:41 +00:00
"mousedown" , this , this . bubbleMouseDown _ ) , this . resizeGroup _ && Blockly . bindEventWithChecks _ ( this . resizeGroup _ , "mousedown" , this , this . resizeMouseDown _ ) ) } ; Blockly . Bubble . BORDER _WIDTH = 6 ; Blockly . Bubble . ARROW _THICKNESS = 5 ; Blockly . Bubble . ARROW _ANGLE = 20 ; Blockly . Bubble . ARROW _BEND = 4 ; Blockly . Bubble . ANCHOR _RADIUS = 8 ; Blockly . Bubble . onMouseUpWrapper _ = null ; Blockly . Bubble . onMouseMoveWrapper _ = null ; Blockly . Bubble . prototype . resizeCallback _ = null ;
2018-01-16 21:13:23 +00:00
Blockly . Bubble . unbindDragEvents _ = function ( ) { Blockly . Bubble . onMouseUpWrapper _ && ( Blockly . unbindEvent _ ( Blockly . Bubble . onMouseUpWrapper _ ) , Blockly . Bubble . onMouseUpWrapper _ = null ) ; Blockly . Bubble . onMouseMoveWrapper _ && ( Blockly . unbindEvent _ ( Blockly . Bubble . onMouseMoveWrapper _ ) , Blockly . Bubble . onMouseMoveWrapper _ = null ) } ; Blockly . Bubble . bubbleMouseUp _ = function ( ) { Blockly . Touch . clearTouchIdentifier ( ) ; Blockly . Bubble . unbindDragEvents _ ( ) } ; Blockly . Bubble . prototype . rendered _ = ! 1 ; Blockly . Bubble . prototype . anchorXY _ = null ;
Blockly . Bubble . prototype . relativeLeft _ = 0 ; Blockly . Bubble . prototype . relativeTop _ = 0 ; Blockly . Bubble . prototype . width _ = 0 ; Blockly . Bubble . prototype . height _ = 0 ; Blockly . Bubble . prototype . autoLayout _ = ! 0 ;
2017-09-25 09:37:41 +00:00
Blockly . Bubble . prototype . createDom _ = function ( a , b ) { this . bubbleGroup _ = Blockly . utils . createSvgElement ( "g" , { } , null ) ; var c = { filter : "url(#" + this . workspace _ . options . embossFilterId + ")" } ; - 1 != goog . userAgent . getUserAgentString ( ) . indexOf ( "JavaFX" ) && ( c = { } ) ; c = Blockly . utils . createSvgElement ( "g" , c , this . bubbleGroup _ ) ; this . bubbleArrow _ = Blockly . utils . createSvgElement ( "path" , { } , c ) ; this . bubbleBack _ = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyDraggable" , x : 0 , y : 0 , rx : Blockly . Bubble . BORDER _WIDTH , ry : Blockly . Bubble . BORDER _WIDTH } ,
c ) ; b ? ( this . resizeGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : this . workspace _ . RTL ? "blocklyResizeSW" : "blocklyResizeSE" } , this . bubbleGroup _ ) , c = 2 * Blockly . Bubble . BORDER _WIDTH , Blockly . utils . createSvgElement ( "polygon" , { points : "0,x x,x x,0" . replace ( /x/g , c . toString ( ) ) } , this . resizeGroup _ ) , Blockly . utils . createSvgElement ( "line" , { "class" : "blocklyResizeLine" , x1 : c / 3 , y1 : c - 1 , x2 : c - 1 , y2 : c / 3 } , this . resizeGroup _ ) , Blockly . utils . createSvgElement ( "line" , { "class" : "blocklyResizeLine" , x1 : 2 * c / 3 , y1 : c - 1 , x2 : c - 1 , y2 : 2 * c / 3 } ,
2018-08-17 13:32:56 +00:00
this . resizeGroup _ ) ) : this . resizeGroup _ = null ; this . bubbleGroup _ . appendChild ( a ) ; return this . bubbleGroup _ } ; Blockly . Bubble . prototype . getSvgRoot = function ( ) { return this . bubbleGroup _ } ; Blockly . Bubble . prototype . setSvgId = function ( a ) { this . bubbleGroup _ . dataset && ( this . bubbleGroup _ . dataset . blockId = a ) } ; Blockly . Bubble . prototype . bubbleMouseDown _ = function ( a ) { var b = this . workspace _ . getGesture ( a ) ; b && b . handleBubbleStart ( a , this ) } ; Blockly . Bubble . prototype . showContextMenu _ = function ( a ) { } ;
Blockly . Bubble . prototype . isDeletable = function ( ) { return ! 1 } ;
2018-01-16 21:13:23 +00:00
Blockly . Bubble . prototype . resizeMouseDown _ = function ( a ) { this . promote _ ( ) ; Blockly . Bubble . unbindDragEvents _ ( ) ; Blockly . utils . isRightButton ( a ) || ( this . workspace _ . startDrag ( a , new goog . math . Coordinate ( this . workspace _ . RTL ? - this . width _ : this . width _ , this . height _ ) ) , Blockly . Bubble . onMouseUpWrapper _ = Blockly . bindEventWithChecks _ ( document , "mouseup" , this , Blockly . Bubble . bubbleMouseUp _ ) , Blockly . Bubble . onMouseMoveWrapper _ = Blockly . bindEventWithChecks _ ( document , "mousemove" , this , this . resizeMouseMove _ ) , Blockly . hideChaff ( ) ) ;
2018-08-17 13:32:56 +00:00
a . stopPropagation ( ) } ; Blockly . Bubble . prototype . resizeMouseMove _ = function ( a ) { this . autoLayout _ = ! 1 ; a = this . workspace _ . moveDrag ( a ) ; this . setBubbleSize ( this . workspace _ . RTL ? - a . x : a . x , a . y ) ; this . workspace _ . RTL && this . positionBubble _ ( ) } ; Blockly . Bubble . prototype . registerResizeEvent = function ( a ) { this . resizeCallback _ = a } ; Blockly . Bubble . prototype . promote _ = function ( ) { var a = this . bubbleGroup _ . parentNode ; return a . lastChild !== this . bubbleGroup _ ? ( a . appendChild ( this . bubbleGroup _ ) , ! 0 ) : ! 1 } ;
Blockly . Bubble . prototype . setAnchorLocation = function ( a ) { this . anchorXY _ = a ; this . rendered _ && this . positionBubble _ ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Bubble . prototype . layoutBubble _ = function ( ) { var a = - this . width _ / 4 , b = - this . height _ - Blockly . BlockSvg . MIN _BLOCK _Y , c = this . workspace _ . getMetrics ( ) ; c . viewWidth /= this . workspace _ . scale ; c . viewLeft /= this . workspace _ . scale ; var d = this . anchorXY _ . x ; this . workspace _ . RTL ? d - c . viewLeft - a - this . width _ < Blockly . Scrollbar . scrollbarThickness ? a = d - c . viewLeft - this . width _ - Blockly . Scrollbar . scrollbarThickness : d - c . viewLeft - a > c . viewWidth && ( a = d - c . viewLeft - c . viewWidth ) : d + a < c . viewLeft ? a = c . viewLeft - d : c . viewLeft + c . viewWidth < d + a +
2018-08-17 13:32:56 +00:00
this . width _ + Blockly . BlockSvg . SEP _SPACE _X + Blockly . Scrollbar . scrollbarThickness && ( a = c . viewLeft + c . viewWidth - d - this . width _ - Blockly . Scrollbar . scrollbarThickness ) ; this . anchorXY _ . y + b < c . viewTop && ( b = this . shape _ . getBBox ( ) . height ) ; this . relativeLeft _ = a ; this . relativeTop _ = b } ; Blockly . Bubble . prototype . positionBubble _ = function ( ) { var a = this . anchorXY _ . x ; a = this . workspace _ . RTL ? a - ( this . relativeLeft _ + this . width _ ) : a + this . relativeLeft _ ; this . moveTo ( a , this . relativeTop _ + this . anchorXY _ . y ) } ;
Blockly . Bubble . prototype . moveTo = function ( a , b ) { this . bubbleGroup _ . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } ; Blockly . Bubble . prototype . getBubbleSize = function ( ) { return { width : this . width _ , height : this . height _ } } ;
2017-09-25 09:37:41 +00:00
Blockly . Bubble . prototype . setBubbleSize = function ( a , b ) { var c = 2 * Blockly . Bubble . BORDER _WIDTH ; a = Math . max ( a , c + 45 ) ; b = Math . max ( b , c + 20 ) ; this . width _ = a ; this . height _ = b ; this . bubbleBack _ . setAttribute ( "width" , a ) ; this . bubbleBack _ . setAttribute ( "height" , b ) ; this . resizeGroup _ && ( this . workspace _ . RTL ? this . resizeGroup _ . setAttribute ( "transform" , "translate(" + 2 * Blockly . Bubble . BORDER _WIDTH + "," + ( b - c ) + ") scale(-1 1)" ) : this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( a - c ) + "," + ( b - c ) + ")" ) ) ; this . rendered _ && ( this . autoLayout _ &&
this . layoutBubble _ ( ) , this . positionBubble _ ( ) , this . renderArrow _ ( ) ) ; this . resizeCallback _ && this . resizeCallback _ ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Bubble . prototype . renderArrow _ = function ( ) { var a = [ ] , b = this . width _ / 2 , c = this . height _ / 2 , d = - this . relativeLeft _ , e = - this . relativeTop _ ; if ( b == d && c == e ) a . push ( "M " + b + "," + c ) ; else { e -= c ; d -= b ; this . workspace _ . RTL && ( d *= - 1 ) ; var f = Math . sqrt ( e * e + d * d ) , g = Math . acos ( d / f ) ; 0 > e && ( g = 2 * Math . PI - g ) ; var h = g + Math . PI / 2 ; h > 2 * Math . PI && ( h -= 2 * Math . PI ) ; var k = Math . sin ( h ) , l = Math . cos ( h ) , n = this . getBubbleSize ( ) ; h = ( n . width + n . height ) / Blockly . Bubble . ARROW _THICKNESS ; h = Math . min ( h , n . width , n . height ) / 4 ; n = 1 - Blockly . Bubble . ANCHOR _RADIUS / f ; d = b +
n * d ; e = c + n * e ; n = b + h * l ; var m = c + h * k ; b -= h * l ; c -= h * k ; k = g + this . arrow _radians _ ; k > 2 * Math . PI && ( k -= 2 * Math . PI ) ; g = Math . sin ( k ) * f / Blockly . Bubble . ARROW _BEND ; f = Math . cos ( k ) * f / Blockly . Bubble . ARROW _BEND ; a . push ( "M" + n + "," + m ) ; a . push ( "C" + ( n + f ) + "," + ( m + g ) + " " + d + "," + e + " " + d + "," + e ) ; a . push ( "C" + d + "," + e + " " + ( b + f ) + "," + ( c + g ) + " " + b + "," + c ) } a . push ( "z" ) ; this . bubbleArrow _ . setAttribute ( "d" , a . join ( " " ) ) } ; Blockly . Bubble . prototype . setColour = function ( a ) { this . bubbleBack _ . setAttribute ( "fill" , a ) ; this . bubbleArrow _ . setAttribute ( "fill" , a ) } ;
Blockly . Bubble . prototype . dispose = function ( ) { Blockly . Bubble . unbindDragEvents _ ( ) ; goog . dom . removeNode ( this . bubbleGroup _ ) ; this . shape _ = this . content _ = this . workspace _ = this . resizeGroup _ = this . bubbleBack _ = this . bubbleArrow _ = this . bubbleGroup _ = null } ; Blockly . Bubble . prototype . moveDuringDrag = function ( a , b ) { a ? a . translateSurface ( b . x , b . y ) : this . moveTo ( b . x , b . y ) ; this . relativeLeft _ = this . workspace _ . RTL ? this . anchorXY _ . x - b . x - this . width _ : b . x - this . anchorXY _ . x ; this . relativeTop _ = b . y - this . anchorXY _ . y ; this . renderArrow _ ( ) } ;
Blockly . Bubble . prototype . getRelativeToSurfaceXY = function ( ) { return new goog . math . Coordinate ( this . anchorXY _ . x + this . relativeLeft _ , this . anchorXY _ . y + this . relativeTop _ ) } ; Blockly . Bubble . prototype . setAutoLayout = function ( a ) { this . autoLayout _ = a } ; Blockly . Events . BlockBase = function ( a ) { Blockly . Events . BlockBase . superClass _ . constructor . call ( this ) ; this . blockId = a . id ; this . workspaceId = a . workspace . id } ; goog . inherits ( Blockly . Events . BlockBase , Blockly . Events . Abstract ) ; Blockly . Events . BlockBase . prototype . toJson = function ( ) { var a = Blockly . Events . BlockBase . superClass _ . toJson . call ( this ) ; a . blockId = this . blockId ; return a } ; Blockly . Events . BlockBase . prototype . fromJson = function ( a ) { Blockly . Events . BlockBase . superClass _ . toJson . call ( this ) ; this . blockId = a . blockId } ;
Blockly . Events . Change = function ( a , b , c , d , e ) { a && ( Blockly . Events . Change . superClass _ . constructor . call ( this , a ) , this . element = b , this . name = c , this . oldValue = d , this . newValue = e ) } ; goog . inherits ( Blockly . Events . Change , Blockly . Events . BlockBase ) ; Blockly . Events . BlockChange = Blockly . Events . Change ; Blockly . Events . Change . prototype . type = Blockly . Events . CHANGE ;
Blockly . Events . Change . prototype . toJson = function ( ) { var a = Blockly . Events . Change . superClass _ . toJson . call ( this ) ; a . element = this . element ; this . name && ( a . name = this . name ) ; a . newValue = this . newValue ; return a } ; Blockly . Events . Change . prototype . fromJson = function ( a ) { Blockly . Events . Change . superClass _ . fromJson . call ( this , a ) ; this . element = a . element ; this . name = a . name ; this . newValue = a . newValue } ; Blockly . Events . Change . prototype . isNull = function ( ) { return this . oldValue == this . newValue } ;
Blockly . Events . Change . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) . getBlockById ( this . blockId ) ; if ( b ) switch ( b . mutator && b . mutator . setVisible ( ! 1 ) , a = a ? this . newValue : this . oldValue , this . element ) { case "field" : ( b = b . getField ( this . name ) ) ? ( b . callValidator ( a ) , b . setValue ( a ) ) : console . warn ( "Can't set non-existent field: " + this . name ) ; break ; case "comment" : b . setCommentText ( a || null ) ; break ; case "collapsed" : b . setCollapsed ( a ) ; break ; case "disabled" : b . setDisabled ( a ) ; break ; case "inline" : b . setInputsInline ( a ) ; break ;
case "mutation" : var c = "" ; b . mutationToDom && ( c = ( c = b . mutationToDom ( ) ) && Blockly . Xml . domToText ( c ) ) ; if ( b . domToMutation ) { a = a || "<mutation></mutation>" ; var d = Blockly . Xml . textToDom ( "<xml>" + a + "</xml>" ) ; b . domToMutation ( d . firstChild ) } Blockly . Events . fire ( new Blockly . Events . Change ( b , "mutation" , null , c , a ) ) ; break ; default : console . warn ( "Unknown change type: " + this . element ) } else console . warn ( "Can't change non-existent block: " + this . blockId ) } ;
Blockly . Events . Create = function ( a ) { a && ( Blockly . Events . Create . superClass _ . constructor . call ( this , a ) , this . xml = a . workspace . rendered ? Blockly . Xml . blockToDomWithXY ( a ) : Blockly . Xml . blockToDom ( a ) , this . ids = Blockly . Events . getDescendantIds _ ( a ) ) } ; goog . inherits ( Blockly . Events . Create , Blockly . Events . BlockBase ) ; Blockly . Events . BlockCreate = Blockly . Events . Create ; Blockly . Events . Create . prototype . type = Blockly . Events . CREATE ;
Blockly . Events . Create . prototype . toJson = function ( ) { var a = Blockly . Events . Create . superClass _ . toJson . call ( this ) ; a . xml = Blockly . Xml . domToText ( this . xml ) ; a . ids = this . ids ; return a } ; Blockly . Events . Create . prototype . fromJson = function ( a ) { Blockly . Events . Create . superClass _ . fromJson . call ( this , a ) ; this . xml = Blockly . Xml . textToDom ( "<xml>" + a . xml + "</xml>" ) . firstChild ; this . ids = a . ids } ;
Blockly . Events . Create . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; if ( a ) a = goog . dom . createDom ( "xml" ) , a . appendChild ( this . xml ) , Blockly . Xml . domToWorkspace ( a , b ) ; else { a = 0 ; for ( var c ; c = this . ids [ a ] ; a ++ ) { var d = b . getBlockById ( c ) ; d ? d . dispose ( ! 1 , ! 1 ) : c == this . blockId && console . warn ( "Can't uncreate non-existent block: " + c ) } } } ;
Blockly . Events . Delete = function ( a ) { if ( a ) { if ( a . getParent ( ) ) throw "Connected blocks cannot be deleted." ; Blockly . Events . Delete . superClass _ . constructor . call ( this , a ) ; this . oldXml = a . workspace . rendered ? Blockly . Xml . blockToDomWithXY ( a ) : Blockly . Xml . blockToDom ( a ) ; this . ids = Blockly . Events . getDescendantIds _ ( a ) } } ; goog . inherits ( Blockly . Events . Delete , Blockly . Events . BlockBase ) ; Blockly . Events . BlockDelete = Blockly . Events . Delete ; Blockly . Events . Delete . prototype . type = Blockly . Events . DELETE ;
Blockly . Events . Delete . prototype . toJson = function ( ) { var a = Blockly . Events . Delete . superClass _ . toJson . call ( this ) ; a . ids = this . ids ; return a } ; Blockly . Events . Delete . prototype . fromJson = function ( a ) { Blockly . Events . Delete . superClass _ . fromJson . call ( this , a ) ; this . ids = a . ids } ;
Blockly . Events . Delete . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; if ( a ) { a = 0 ; for ( var c ; c = this . ids [ a ] ; a ++ ) { var d = b . getBlockById ( c ) ; d ? d . dispose ( ! 1 , ! 1 ) : c == this . blockId && console . warn ( "Can't delete non-existent block: " + c ) } } else a = goog . dom . createDom ( "xml" ) , a . appendChild ( this . oldXml ) , Blockly . Xml . domToWorkspace ( a , b ) } ;
Blockly . Events . Move = function ( a ) { a && ( Blockly . Events . Move . superClass _ . constructor . call ( this , a ) , a = this . currentLocation _ ( ) , this . oldParentId = a . parentId , this . oldInputName = a . inputName , this . oldCoordinate = a . coordinate ) } ; goog . inherits ( Blockly . Events . Move , Blockly . Events . BlockBase ) ; Blockly . Events . BlockMove = Blockly . Events . Move ; Blockly . Events . Move . prototype . type = Blockly . Events . MOVE ;
Blockly . Events . Move . prototype . toJson = function ( ) { var a = Blockly . Events . Move . superClass _ . toJson . call ( this ) ; this . newParentId && ( a . newParentId = this . newParentId ) ; this . newInputName && ( a . newInputName = this . newInputName ) ; this . newCoordinate && ( a . newCoordinate = Math . round ( this . newCoordinate . x ) + "," + Math . round ( this . newCoordinate . y ) ) ; return a } ;
Blockly . Events . Move . prototype . fromJson = function ( a ) { Blockly . Events . Move . superClass _ . fromJson . call ( this , a ) ; this . newParentId = a . newParentId ; this . newInputName = a . newInputName ; a . newCoordinate && ( a = a . newCoordinate . split ( "," ) , this . newCoordinate = new goog . math . Coordinate ( parseFloat ( a [ 0 ] ) , parseFloat ( a [ 1 ] ) ) ) } ; Blockly . Events . Move . prototype . recordNew = function ( ) { var a = this . currentLocation _ ( ) ; this . newParentId = a . parentId ; this . newInputName = a . inputName ; this . newCoordinate = a . coordinate } ;
Blockly . Events . Move . prototype . currentLocation _ = function ( ) { var a = Blockly . Workspace . getById ( this . workspaceId ) . getBlockById ( this . blockId ) , b = { } , c = a . getParent ( ) ; if ( c ) { if ( b . parentId = c . id , a = c . getInputWithBlock ( a ) ) b . inputName = a . name } else b . coordinate = a . getRelativeToSurfaceXY ( ) ; return b } ; Blockly . Events . Move . prototype . isNull = function ( ) { return this . oldParentId == this . newParentId && this . oldInputName == this . newInputName && goog . math . Coordinate . equals ( this . oldCoordinate , this . newCoordinate ) } ;
Blockly . Events . Move . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) , c = b . getBlockById ( this . blockId ) ; if ( c ) { var d = a ? this . newParentId : this . oldParentId , e = a ? this . newInputName : this . oldInputName ; a = a ? this . newCoordinate : this . oldCoordinate ; var f = null ; if ( d && ( f = b . getBlockById ( d ) , ! f ) ) { console . warn ( "Can't connect to non-existent block: " + d ) ; return } c . getParent ( ) && c . unplug ( ) ; if ( a ) e = c . getRelativeToSurfaceXY ( ) , c . moveBy ( a . x - e . x , a . y - e . y ) ; else { c = c . outputConnection || c . previousConnection ; if ( e ) { if ( b = f . getInput ( e ) ) var g =
b . connection } else c . type == Blockly . PREVIOUS _STATEMENT && ( g = f . nextConnection ) ; g ? c . connect ( g ) : console . warn ( "Can't connect to non-existent input: " + e ) } } else console . warn ( "Can't move non-existent block: " + this . blockId ) } ; Blockly . Events . Ui = function ( a , b , c , d ) { Blockly . Events . Ui . superClass _ . constructor . call ( this ) ; this . blockId = a ? a . id : null ; this . workspaceId = a ? a . workspace . id : null ; this . element = b ; this . oldValue = c ; this . newValue = d ; this . recordUndo = ! 1 } ; goog . inherits ( Blockly . Events . Ui , Blockly . Events . Abstract ) ; Blockly . Events . Ui . prototype . type = Blockly . Events . UI ;
Blockly . Events . Ui . prototype . toJson = function ( ) { var a = Blockly . Events . Ui . superClass _ . toJson . call ( this ) ; a . element = this . element ; void 0 !== this . newValue && ( a . newValue = this . newValue ) ; this . blockId && ( a . blockId = this . blockId ) ; return a } ; Blockly . Events . Ui . prototype . fromJson = function ( a ) { Blockly . Events . Ui . superClass _ . fromJson . call ( this , a ) ; this . element = a . element ; this . newValue = a . newValue ; this . blockId = a . blockId } ; Blockly . Icon = function ( a ) { this . block _ = a } ; Blockly . Icon . prototype . collapseHidden = ! 0 ; Blockly . Icon . prototype . SIZE = 17 ; Blockly . Icon . prototype . bubble _ = null ; Blockly . Icon . prototype . iconXY _ = null ;
2017-09-25 09:37:41 +00:00
Blockly . Icon . prototype . createIcon = function ( ) { this . iconGroup _ || ( this . iconGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyIconGroup" } , null ) , this . block _ . isInFlyout && Blockly . utils . addClass ( this . iconGroup _ , "blocklyIconGroupReadonly" ) , this . drawIcon _ ( this . iconGroup _ ) , this . block _ . getSvgRoot ( ) . appendChild ( this . iconGroup _ ) , Blockly . bindEventWithChecks _ ( this . iconGroup _ , "mouseup" , this , this . iconClick _ ) , this . updateEditable ( ) ) } ;
Blockly . Icon . prototype . dispose = function ( ) { goog . dom . removeNode ( this . iconGroup _ ) ; this . iconGroup _ = null ; this . setVisible ( ! 1 ) ; this . block _ = null } ; Blockly . Icon . prototype . updateEditable = function ( ) { } ; Blockly . Icon . prototype . isVisible = function ( ) { return ! ! this . bubble _ } ; Blockly . Icon . prototype . iconClick _ = function ( a ) { this . block _ . workspace . isDragging ( ) || this . block _ . isInFlyout || Blockly . utils . isRightButton ( a ) || this . setVisible ( ! this . isVisible ( ) ) } ; Blockly . Icon . prototype . updateColour = function ( ) { this . isVisible ( ) && this . bubble _ . setColour ( this . block _ . getColour ( ) ) } ;
Blockly . Icon . prototype . renderIcon = function ( a ) { if ( this . collapseHidden && this . block _ . isCollapsed ( ) ) return this . iconGroup _ . setAttribute ( "display" , "none" ) , a ; this . iconGroup _ . setAttribute ( "display" , "block" ) ; var b = this . SIZE ; this . block _ . RTL && ( a -= b ) ; this . iconGroup _ . setAttribute ( "transform" , "translate(" + a + ",5)" ) ; this . computeIconLocation ( ) ; return a = this . block _ . RTL ? a - Blockly . BlockSvg . SEP _SPACE _X : a + ( b + Blockly . BlockSvg . SEP _SPACE _X ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Icon . prototype . setIconLocation = function ( a ) { this . iconXY _ = a ; this . isVisible ( ) && this . bubble _ . setAnchorLocation ( a ) } ; Blockly . Icon . prototype . computeIconLocation = function ( ) { var a = this . block _ . getRelativeToSurfaceXY ( ) , b = Blockly . utils . getRelativeXY ( this . iconGroup _ ) ; a = new goog . math . Coordinate ( a . x + b . x + this . SIZE / 2 , a . y + b . y + this . SIZE / 2 ) ; goog . math . Coordinate . equals ( this . getIconLocation ( ) , a ) || this . setIconLocation ( a ) } ; Blockly . Icon . prototype . getIconLocation = function ( ) { return this . iconXY _ } ;
2017-09-25 09:37:41 +00:00
Blockly . Comment = function ( a ) { Blockly . Comment . superClass _ . constructor . call ( this , a ) ; this . createIcon ( ) } ; goog . inherits ( Blockly . Comment , Blockly . Icon ) ; Blockly . Comment . prototype . text _ = "" ; Blockly . Comment . prototype . width _ = 160 ; Blockly . Comment . prototype . height _ = 80 ;
2018-01-16 21:13:23 +00:00
Blockly . Comment . prototype . drawIcon _ = function ( a ) { Blockly . utils . createSvgElement ( "circle" , { "class" : "blocklyIconShape" , r : "8" , cx : "8" , cy : "8" } , a ) ; Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyIconSymbol" , d : "m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z" } , a ) ; Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyIconSymbol" , x : "6.8" , y : "10.78" , height : "2" , width : "2" } , a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Comment . prototype . createEditor _ = function ( ) { this . foreignObject _ = Blockly . utils . createSvgElement ( "foreignObject" , { x : Blockly . Bubble . BORDER _WIDTH , y : Blockly . Bubble . BORDER _WIDTH } , null ) ; var a = document . createElementNS ( Blockly . HTML _NS , "body" ) ; a . setAttribute ( "xmlns" , Blockly . HTML _NS ) ; a . className = "blocklyMinimalBody" ; var b = document . createElementNS ( Blockly . HTML _NS , "textarea" ) ; b . className = "blocklyCommentTextarea" ; b . setAttribute ( "dir" , this . block _ . RTL ? "RTL" : "LTR" ) ; a . appendChild ( b ) ; this . textarea _ = b ; this . foreignObject _ . appendChild ( a ) ;
2018-08-17 13:32:56 +00:00
Blockly . bindEventWithChecks _ ( b , "mouseup" , this , this . textareaFocus _ , ! 0 , ! 0 ) ; Blockly . bindEventWithChecks _ ( b , "wheel" , this , function ( a ) { a . stopPropagation ( ) } ) ; Blockly . bindEventWithChecks _ ( b , "change" , this , function ( a ) { this . text _ != b . value && ( Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . block _ , "comment" , null , this . text _ , b . value ) ) , this . text _ = b . value ) } ) ; setTimeout ( function ( ) { b . focus ( ) } , 0 ) ; return this . foreignObject _ } ;
2017-09-25 09:37:41 +00:00
Blockly . Comment . prototype . updateEditable = function ( ) { this . isVisible ( ) && ( this . setVisible ( ! 1 ) , this . setVisible ( ! 0 ) ) ; Blockly . Icon . prototype . updateEditable . call ( this ) } ; Blockly . Comment . prototype . resizeBubble _ = function ( ) { if ( this . isVisible ( ) ) { var a = this . bubble _ . getBubbleSize ( ) , b = 2 * Blockly . Bubble . BORDER _WIDTH ; this . foreignObject _ . setAttribute ( "width" , a . width - b ) ; this . foreignObject _ . setAttribute ( "height" , a . height - b ) ; this . textarea _ . style . width = a . width - b - 4 + "px" ; this . textarea _ . style . height = a . height - b - 4 + "px" } } ;
2018-08-17 13:32:56 +00:00
Blockly . Comment . prototype . setVisible = function ( a ) { if ( a != this . isVisible ( ) ) if ( Blockly . Events . fire ( new Blockly . Events . Ui ( this . block _ , "commentOpen" , ! a , a ) ) , ! this . block _ . isEditable ( ) && ! this . textarea _ || goog . userAgent . IE ) Blockly . Warning . prototype . setVisible . call ( this , a ) ; else { var b = this . getText ( ) , c = this . getBubbleSize ( ) ; a ? ( this . bubble _ = new Blockly . Bubble ( this . block _ . workspace , this . createEditor _ ( ) , this . block _ . svgPath _ , this . iconXY _ , this . width _ , this . height _ ) , this . bubble _ . setSvgId ( this . block _ . id ) , this . bubble _ . registerResizeEvent ( this . resizeBubble _ . bind ( this ) ) ,
this . updateColour ( ) ) : ( this . bubble _ . dispose ( ) , this . foreignObject _ = this . textarea _ = this . bubble _ = null ) ; this . setText ( b ) ; this . setBubbleSize ( c . width , c . height ) } } ; Blockly . Comment . prototype . textareaFocus _ = function ( a ) { this . bubble _ . promote _ ( ) && this . textarea _ . focus ( ) } ; Blockly . Comment . prototype . getBubbleSize = function ( ) { return this . isVisible ( ) ? this . bubble _ . getBubbleSize ( ) : { width : this . width _ , height : this . height _ } } ;
2018-01-16 21:13:23 +00:00
Blockly . Comment . prototype . setBubbleSize = function ( a , b ) { this . textarea _ ? this . bubble _ . setBubbleSize ( a , b ) : ( this . width _ = a , this . height _ = b ) } ; Blockly . Comment . prototype . getText = function ( ) { return this . textarea _ ? this . textarea _ . value : this . text _ } ; Blockly . Comment . prototype . setText = function ( a ) { this . text _ != a && ( Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . block _ , "comment" , null , this . text _ , a ) ) , this . text _ = a ) ; this . textarea _ && ( this . textarea _ . value = a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Comment . prototype . dispose = function ( ) { Blockly . Events . isEnabled ( ) && this . setText ( "" ) ; this . block _ . comment = null ; Blockly . Icon . prototype . dispose . call ( this ) } ; Blockly . Connection = function ( a , b ) { this . sourceBlock _ = a ; this . type = b ; a . workspace . connectionDBList && ( this . db _ = a . workspace . connectionDBList [ b ] , this . dbOpposite _ = a . workspace . connectionDBList [ Blockly . OPPOSITE _TYPE [ b ] ] , this . hidden _ = ! this . db _ ) } ; Blockly . Connection . CAN _CONNECT = 0 ; Blockly . Connection . REASON _SELF _CONNECTION = 1 ; Blockly . Connection . REASON _WRONG _TYPE = 2 ; Blockly . Connection . REASON _TARGET _NULL = 3 ; Blockly . Connection . REASON _CHECKS _FAILED = 4 ; Blockly . Connection . REASON _DIFFERENT _WORKSPACES = 5 ;
Blockly . Connection . REASON _SHADOW _PARENT = 6 ; Blockly . Connection . prototype . targetConnection = null ; Blockly . Connection . prototype . check _ = null ; Blockly . Connection . prototype . shadowDom _ = null ; Blockly . Connection . prototype . x _ = 0 ; Blockly . Connection . prototype . y _ = 0 ; Blockly . Connection . prototype . inDB _ = ! 1 ; Blockly . Connection . prototype . db _ = null ; Blockly . Connection . prototype . dbOpposite _ = null ; Blockly . Connection . prototype . hidden _ = null ;
Blockly . Connection . prototype . connect _ = function ( a ) { var b = this , c = b . getSourceBlock ( ) , d = a . getSourceBlock ( ) ; a . isConnected ( ) && a . disconnect ( ) ; if ( b . isConnected ( ) ) { var e = b . targetBlock ( ) , f = b . getShadowDom ( ) ; b . setShadowDom ( null ) ; if ( e . isShadow ( ) ) f = Blockly . Xml . blockToDom ( e ) , e . dispose ( ) , e = null ; else if ( b . type == Blockly . INPUT _VALUE ) { if ( ! e . outputConnection ) throw "Orphan block does not have an output connection." ; var g = Blockly . Connection . lastConnectionInRow _ ( d , e ) ; g && ( e . outputConnection . connect ( g ) , e = null ) } else if ( b . type ==
Blockly . NEXT _STATEMENT ) { if ( ! e . previousConnection ) throw "Orphan block does not have a previous connection." ; for ( g = d ; g . nextConnection ; ) { var h = g . getNextBlock ( ) ; if ( h && ! h . isShadow ( ) ) g = h ; else { e . previousConnection . checkType _ ( g . nextConnection ) && ( g . nextConnection . connect ( e . previousConnection ) , e = null ) ; break } } } if ( e && ( b . disconnect ( ) , Blockly . Events . recordUndo ) ) { var k = Blockly . Events . getGroup ( ) ; setTimeout ( function ( ) { e . workspace && ! e . getParent ( ) && ( Blockly . Events . setGroup ( k ) , e . outputConnection ? e . outputConnection . bumpAwayFrom _ ( b ) :
2018-08-17 13:32:56 +00:00
e . previousConnection && e . previousConnection . bumpAwayFrom _ ( b ) , Blockly . Events . setGroup ( ! 1 ) ) } , Blockly . BUMP _DELAY ) } b . setShadowDom ( f ) } var l ; Blockly . Events . isEnabled ( ) && ( l = new Blockly . Events . BlockMove ( d ) ) ; Blockly . Connection . connectReciprocally _ ( b , a ) ; d . setParent ( c ) ; l && ( l . recordNew ( ) , Blockly . Events . fire ( l ) ) } ; Blockly . Connection . prototype . dispose = function ( ) { if ( this . isConnected ( ) ) throw "Disconnect connection before disposing of it." ; this . inDB _ && this . db _ . removeConnection _ ( this ) ; this . dbOpposite _ = this . db _ = null } ;
2018-01-16 21:13:23 +00:00
Blockly . Connection . prototype . getSourceBlock = function ( ) { return this . sourceBlock _ } ; Blockly . Connection . prototype . isSuperior = function ( ) { return this . type == Blockly . INPUT _VALUE || this . type == Blockly . NEXT _STATEMENT } ; Blockly . Connection . prototype . isConnected = function ( ) { return ! ! this . targetConnection } ;
2017-09-25 09:37:41 +00:00
Blockly . Connection . prototype . canConnectWithReason _ = function ( a ) { if ( ! a ) return Blockly . Connection . REASON _TARGET _NULL ; if ( this . isSuperior ( ) ) var b = this . sourceBlock _ , c = a . getSourceBlock ( ) ; else c = this . sourceBlock _ , b = a . getSourceBlock ( ) ; return b && b == c ? Blockly . Connection . REASON _SELF _CONNECTION : a . type != Blockly . OPPOSITE _TYPE [ this . type ] ? Blockly . Connection . REASON _WRONG _TYPE : b && c && b . workspace !== c . workspace ? Blockly . Connection . REASON _DIFFERENT _WORKSPACES : this . checkType _ ( a ) ? b . isShadow ( ) && ! c . isShadow ( ) ? Blockly . Connection . REASON _SHADOW _PARENT :
Blockly . Connection . CAN _CONNECT : Blockly . Connection . REASON _CHECKS _FAILED } ;
2018-01-16 21:13:23 +00:00
Blockly . Connection . prototype . checkConnection _ = function ( a ) { switch ( this . canConnectWithReason _ ( a ) ) { case Blockly . Connection . CAN _CONNECT : break ; case Blockly . Connection . REASON _SELF _CONNECTION : throw "Attempted to connect a block to itself." ; case Blockly . Connection . REASON _DIFFERENT _WORKSPACES : throw "Blocks not on same workspace." ; case Blockly . Connection . REASON _WRONG _TYPE : throw "Attempt to connect incompatible types." ; case Blockly . Connection . REASON _TARGET _NULL : throw "Target connection is null." ; case Blockly . Connection . REASON _CHECKS _FAILED : throw "Connection checks failed. " +
( this + " expected " + this . check _ + ", found " + a . check _ ) ; case Blockly . Connection . REASON _SHADOW _PARENT : throw "Connecting non-shadow to shadow block." ; default : throw "Unknown connection failure: this should never happen!" ; } } ;
2017-09-25 09:37:41 +00:00
Blockly . Connection . prototype . isConnectionAllowed = function ( a ) { if ( this . canConnectWithReason _ ( a ) != Blockly . Connection . CAN _CONNECT ) return ! 1 ; if ( a . type == Blockly . OUTPUT _VALUE || a . type == Blockly . PREVIOUS _STATEMENT ) if ( a . isConnected ( ) || this . isConnected ( ) ) return ! 1 ; return a . type == Blockly . INPUT _VALUE && a . isConnected ( ) && ! a . targetBlock ( ) . isMovable ( ) && ! a . targetBlock ( ) . isShadow ( ) || this . type == Blockly . PREVIOUS _STATEMENT && a . isConnected ( ) && ! this . sourceBlock _ . nextConnection && ! a . targetBlock ( ) . isShadow ( ) && a . targetBlock ( ) . nextConnection ||
- 1 != Blockly . draggingConnections _ . indexOf ( a ) ? ! 1 : ! 0 } ; Blockly . Connection . prototype . connect = function ( a ) { this . targetConnection != a && ( this . checkConnection _ ( a ) , this . isSuperior ( ) ? this . connect _ ( a ) : a . connect _ ( this ) ) } ; Blockly . Connection . connectReciprocally _ = function ( a , b ) { goog . asserts . assert ( a && b , "Cannot connect null connections." ) ; a . targetConnection = b ; b . targetConnection = a } ;
Blockly . Connection . singleConnection _ = function ( a , b ) { for ( var c = ! 1 , d = 0 ; d < a . inputList . length ; d ++ ) { var e = a . inputList [ d ] . connection ; if ( e && e . type == Blockly . INPUT _VALUE && b . outputConnection . checkType _ ( e ) ) { if ( c ) return null ; c = e } } return c } ; Blockly . Connection . lastConnectionInRow _ = function ( a , b ) { for ( var c = a , d ; d = Blockly . Connection . singleConnection _ ( c , b ) ; ) if ( c = d . targetBlock ( ) , ! c || c . isShadow ( ) ) return d ; return null } ;
2018-01-16 21:13:23 +00:00
Blockly . Connection . prototype . disconnect = function ( ) { var a = this . targetConnection ; goog . asserts . assert ( a , "Source connection not connected." ) ; goog . asserts . assert ( a . targetConnection == this , "Target connection not connected to source connection." ) ; if ( this . isSuperior ( ) ) { var b = this . sourceBlock _ ; var c = a . getSourceBlock ( ) ; a = this } else b = a . getSourceBlock ( ) , c = this . sourceBlock _ ; this . disconnectInternal _ ( b , c ) ; a . respawnShadow _ ( ) } ;
Blockly . Connection . prototype . disconnectInternal _ = function ( a , b ) { var c ; Blockly . Events . isEnabled ( ) && ( c = new Blockly . Events . BlockMove ( b ) ) ; this . targetConnection = this . targetConnection . targetConnection = null ; b . setParent ( null ) ; c && ( c . recordNew ( ) , Blockly . Events . fire ( c ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Connection . prototype . respawnShadow _ = function ( ) { var a = this . getSourceBlock ( ) , b = this . getShadowDom ( ) ; if ( a . workspace && b && Blockly . Events . recordUndo ) if ( a = Blockly . Xml . domToBlock ( b , a . workspace ) , a . outputConnection ) this . connect ( a . outputConnection ) ; else if ( a . previousConnection ) this . connect ( a . previousConnection ) ; else throw "Child block does not have output or previous statement." ; } ; Blockly . Connection . prototype . targetBlock = function ( ) { return this . isConnected ( ) ? this . targetConnection . getSourceBlock ( ) : null } ;
2018-01-16 21:13:23 +00:00
Blockly . Connection . prototype . checkType _ = function ( a ) { if ( ! this . check _ || ! a . check _ ) return ! 0 ; for ( var b = 0 ; b < this . check _ . length ; b ++ ) if ( - 1 != a . check _ . indexOf ( this . check _ [ b ] ) ) return ! 0 ; return ! 1 } ; Blockly . Connection . prototype . onCheckChanged _ = function ( ) { this . isConnected ( ) && ! this . checkType _ ( this . targetConnection ) && ( this . isSuperior ( ) ? this . targetBlock ( ) : this . sourceBlock _ ) . unplug ( ) } ;
Blockly . Connection . prototype . setCheck = function ( a ) { a ? ( goog . isArray ( a ) || ( a = [ a ] ) , this . check _ = a , this . onCheckChanged _ ( ) ) : this . check _ = null ; return this } ; Blockly . Connection . prototype . setShadowDom = function ( a ) { this . shadowDom _ = a } ; Blockly . Connection . prototype . getShadowDom = function ( ) { return this . shadowDom _ } ; Blockly . Connection . prototype . neighbours _ = function ( ) { return [ ] } ;
Blockly . Connection . prototype . toString = function ( ) { var a = this . sourceBlock _ ; if ( a ) if ( a . outputConnection == this ) var b = "Output Connection of " ; else if ( a . previousConnection == this ) b = "Previous Connection of " ; else if ( a . nextConnection == this ) b = "Next Connection of " ; else if ( b = goog . array . find ( a . inputList , function ( a ) { return a . connection == this } , this ) ) b = 'Input "' + b . name + '" connection on ' ; else return console . warn ( "Connection not actually connected to sourceBlock_" ) , "Orphan Connection" ; else return "Orphan Connection" ;
2018-08-17 13:32:56 +00:00
return b + a . toDevString ( ) } ; Blockly . ConnectionDB = function ( ) { } ; Blockly . ConnectionDB . prototype = [ ] ; Blockly . ConnectionDB . constructor = Blockly . ConnectionDB ; Blockly . ConnectionDB . prototype . addConnection = function ( a ) { if ( a . inDB _ ) throw "Connection already in database." ; if ( ! a . getSourceBlock ( ) . isInFlyout ) { var b = this . findPositionForConnection _ ( a ) ; this . splice ( b , 0 , a ) ; a . inDB _ = ! 0 } } ;
Blockly . ConnectionDB . prototype . findConnection = function ( a ) { if ( ! this . length ) return - 1 ; var b = this . findPositionForConnection _ ( a ) ; if ( b >= this . length ) return - 1 ; for ( var c = a . y _ , d = b ; 0 <= d && this [ d ] . y _ == c ; ) { if ( this [ d ] == a ) return d ; d -- } for ( ; b < this . length && this [ b ] . y _ == c ; ) { if ( this [ b ] == a ) return b ; b ++ } return - 1 } ;
Blockly . ConnectionDB . prototype . findPositionForConnection _ = function ( a ) { if ( ! this . length ) return 0 ; for ( var b = 0 , c = this . length ; b < c ; ) { var d = Math . floor ( ( b + c ) / 2 ) ; if ( this [ d ] . y _ < a . y _ ) b = d + 1 ; else if ( this [ d ] . y _ > a . y _ ) c = d ; else { b = d ; break } } return b } ; Blockly . ConnectionDB . prototype . removeConnection _ = function ( a ) { if ( ! a . inDB _ ) throw "Connection not in database." ; var b = this . findConnection ( a ) ; if ( - 1 == b ) throw "Unable to find connection in connectionDB." ; a . inDB _ = ! 1 ; this . splice ( b , 1 ) } ;
Blockly . ConnectionDB . prototype . getNeighbours = function ( a , b ) { function c ( a ) { var c = e - d [ a ] . x _ , g = f - d [ a ] . y _ ; Math . sqrt ( c * c + g * g ) <= b && l . push ( d [ a ] ) ; return g < b } for ( var d = this , e = a . x _ , f = a . y _ , g = 0 , h = d . length - 2 , k = h ; g < k ; ) d [ k ] . y _ < f ? g = k : h = k , k = Math . floor ( ( g + h ) / 2 ) ; var l = [ ] ; h = g = k ; if ( d . length ) { for ( ; 0 <= g && c ( g ) ; ) g -- ; do h ++ ; while ( h < d . length && c ( h ) ) } return l } ; Blockly . ConnectionDB . prototype . isInYRange _ = function ( a , b , c ) { return Math . abs ( this [ a ] . y _ - b ) <= c } ;
Blockly . ConnectionDB . prototype . searchForClosest = function ( a , b , c ) { if ( ! this . length ) return { connection : null , radius : b } ; var d = a . y _ , e = a . x _ ; a . x _ = e + c . x ; a . y _ = d + c . y ; var f = this . findPositionForConnection _ ( a ) ; c = null ; for ( var g = b , h , k = f - 1 ; 0 <= k && this . isInYRange _ ( k , a . y _ , b ) ; ) h = this [ k ] , a . isConnectionAllowed ( h , g ) && ( c = h , g = h . distanceFrom ( a ) ) , k -- ; for ( ; f < this . length && this . isInYRange _ ( f , a . y _ , b ) ; ) h = this [ f ] , a . isConnectionAllowed ( h , g ) && ( c = h , g = h . distanceFrom ( a ) ) , f ++ ; a . x _ = e ; a . y _ = d ; return { connection : c , radius : g } } ;
Blockly . ConnectionDB . init = function ( a ) { var b = [ ] ; b [ Blockly . INPUT _VALUE ] = new Blockly . ConnectionDB ; b [ Blockly . OUTPUT _VALUE ] = new Blockly . ConnectionDB ; b [ Blockly . NEXT _STATEMENT ] = new Blockly . ConnectionDB ; b [ Blockly . PREVIOUS _STATEMENT ] = new Blockly . ConnectionDB ; a . connectionDBList = b } ; Blockly . constants = { } ; Blockly . DRAG _RADIUS = 5 ; Blockly . FLYOUT _DRAG _RADIUS = 10 ; Blockly . SNAP _RADIUS = 20 ; Blockly . BUMP _DELAY = 250 ; Blockly . COLLAPSE _CHARS = 30 ; Blockly . LONGPRESS = 750 ; Blockly . SOUND _LIMIT = 100 ; Blockly . DRAG _STACK = ! 0 ; Blockly . HSV _SATURATION = . 45 ; Blockly . HSV _VALUE = . 65 ; Blockly . SPRITE = { width : 96 , height : 124 , url : "sprites.png" } ; Blockly . SVG _NS = "http://www.w3.org/2000/svg" ; Blockly . HTML _NS = "http://www.w3.org/1999/xhtml" ; Blockly . INPUT _VALUE = 1 ; Blockly . OUTPUT _VALUE = 2 ; Blockly . NEXT _STATEMENT = 3 ;
Blockly . PREVIOUS _STATEMENT = 4 ; Blockly . DUMMY _INPUT = 5 ; Blockly . ALIGN _LEFT = - 1 ; Blockly . ALIGN _CENTRE = 0 ; Blockly . ALIGN _RIGHT = 1 ; Blockly . DRAG _NONE = 0 ; Blockly . DRAG _STICKY = 1 ; Blockly . DRAG _BEGIN = 1 ; Blockly . DRAG _FREE = 2 ; Blockly . OPPOSITE _TYPE = [ ] ; Blockly . OPPOSITE _TYPE [ Blockly . INPUT _VALUE ] = Blockly . OUTPUT _VALUE ; Blockly . OPPOSITE _TYPE [ Blockly . OUTPUT _VALUE ] = Blockly . INPUT _VALUE ; Blockly . OPPOSITE _TYPE [ Blockly . NEXT _STATEMENT ] = Blockly . PREVIOUS _STATEMENT ; Blockly . OPPOSITE _TYPE [ Blockly . PREVIOUS _STATEMENT ] = Blockly . NEXT _STATEMENT ;
Blockly . TOOLBOX _AT _TOP = 0 ; Blockly . TOOLBOX _AT _BOTTOM = 1 ; Blockly . TOOLBOX _AT _LEFT = 2 ; Blockly . TOOLBOX _AT _RIGHT = 3 ; Blockly . DELETE _AREA _NONE = null ; Blockly . DELETE _AREA _TRASH = 1 ; Blockly . DELETE _AREA _TOOLBOX = 2 ; Blockly . VARIABLE _CATEGORY _NAME = "VARIABLE" ; Blockly . VARIABLE _DYNAMIC _CATEGORY _NAME = "VARIABLE_DYNAMIC" ; Blockly . PROCEDURE _CATEGORY _NAME = "PROCEDURE" ; Blockly . RENAME _VARIABLE _ID = "RENAME_VARIABLE_ID" ; Blockly . DELETE _VARIABLE _ID = "DELETE_VARIABLE_ID" ; Blockly . BlockAnimations = { } ; Blockly . BlockAnimations . disconnectPid _ = 0 ; Blockly . BlockAnimations . disconnectGroup _ = null ; Blockly . BlockAnimations . disposeUiEffect = function ( a ) { var b = a . workspace , c = a . getSvgRoot ( ) ; b . getAudioManager ( ) . play ( "delete" ) ; a = b . getSvgXY ( c ) ; c = c . cloneNode ( ! 0 ) ; c . translateX _ = a . x ; c . translateY _ = a . y ; c . setAttribute ( "transform" , "translate(" + a . x + "," + a . y + ")" ) ; b . getParentSvg ( ) . appendChild ( c ) ; c . bBox _ = c . getBBox ( ) ; Blockly . BlockAnimations . disposeUiStep _ ( c , b . RTL , new Date , b . scale ) } ;
Blockly . BlockAnimations . disposeUiStep _ = function ( a , b , c , d ) { var e = ( new Date - c ) / 150 ; 1 < e ? goog . dom . removeNode ( a ) : ( a . setAttribute ( "transform" , "translate(" + ( a . translateX _ + ( b ? - 1 : 1 ) * a . bBox _ . width * d / 2 * e ) + "," + ( a . translateY _ + a . bBox _ . height * d * e ) + ") scale(" + ( 1 - e ) * d + ")" ) , setTimeout ( Blockly . BlockAnimations . disposeUiStep _ , 10 , a , b , c , d ) ) } ;
Blockly . BlockAnimations . connectionUiEffect = function ( a ) { var b = a . workspace , c = b . scale ; b . getAudioManager ( ) . play ( "click" ) ; if ( ! ( 1 > c ) ) { var d = b . getSvgXY ( a . getSvgRoot ( ) ) ; a . outputConnection ? ( d . x += ( a . RTL ? 3 : - 3 ) * c , d . y += 13 * c ) : a . previousConnection && ( d . x += ( a . RTL ? - 23 : 23 ) * c , d . y += 3 * c ) ; a = Blockly . utils . createSvgElement ( "circle" , { cx : d . x , cy : d . y , r : 0 , fill : "none" , stroke : "#888" , "stroke-width" : 10 } , b . getParentSvg ( ) ) ; Blockly . BlockAnimations . connectionUiStep _ ( a , new Date , c ) } } ;
Blockly . BlockAnimations . connectionUiStep _ = function ( a , b , c ) { var d = ( new Date - b ) / 150 ; 1 < d ? goog . dom . removeNode ( a ) : ( a . setAttribute ( "r" , 25 * d * c ) , a . style . opacity = 1 - d , Blockly . BlockAnimations . disconnectPid _ = setTimeout ( Blockly . BlockAnimations . connectionUiStep _ , 10 , a , b , c ) ) } ;
Blockly . BlockAnimations . disconnectUiEffect = function ( a ) { a . workspace . getAudioManager ( ) . play ( "disconnect" ) ; if ( ! ( 1 > a . workspace . scale ) ) { var b = a . getHeightWidth ( ) . height ; b = Math . atan ( 10 / b ) / Math . PI * 180 ; a . RTL || ( b *= - 1 ) ; Blockly . BlockAnimations . disconnectUiStep _ ( a . getSvgRoot ( ) , b , new Date ) } } ;
Blockly . BlockAnimations . disconnectUiStep _ = function ( a , b , c ) { var d = ( new Date - c ) / 200 ; 1 < d ? a . skew _ = "" : ( a . skew _ = "skewX(" + Math . round ( Math . sin ( d * Math . PI * 3 ) * ( 1 - d ) * b ) + ")" , Blockly . BlockAnimations . disconnectGroup _ = a , Blockly . BlockAnimations . disconnectPid _ = setTimeout ( Blockly . BlockAnimations . disconnectUiStep _ , 10 , a , b , c ) ) ; a . setAttribute ( "transform" , a . translate _ + a . skew _ ) } ;
Blockly . BlockAnimations . disconnectUiStop = function ( ) { if ( Blockly . BlockAnimations . disconnectGroup _ ) { clearTimeout ( Blockly . BlockAnimations . disconnectPid _ ) ; var a = Blockly . BlockAnimations . disconnectGroup _ ; a . skew _ = "" ; a . setAttribute ( "transform" , a . translate _ ) ; Blockly . BlockAnimations . disconnectGroup _ = null } } ; Blockly . RenderedConnection = function ( a , b ) { Blockly . RenderedConnection . superClass _ . constructor . call ( this , a , b ) ; this . offsetInBlock _ = new goog . math . Coordinate ( 0 , 0 ) } ; goog . inherits ( Blockly . RenderedConnection , Blockly . Connection ) ; Blockly . RenderedConnection . prototype . distanceFrom = function ( a ) { var b = this . x _ - a . x _ ; a = this . y _ - a . y _ ; return Math . sqrt ( b * b + a * a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . RenderedConnection . prototype . bumpAwayFrom _ = function ( a ) { if ( ! this . sourceBlock _ . workspace . isDragging ( ) ) { var b = this . sourceBlock _ . getRootBlock ( ) ; if ( ! b . isInFlyout ) { var c = ! 1 ; if ( ! b . isMovable ( ) ) { b = a . getSourceBlock ( ) . getRootBlock ( ) ; if ( ! b . isMovable ( ) ) return ; a = this ; c = ! 0 } var d = Blockly . selected == b ; d || b . addSelect ( ) ; var e = a . x _ + Blockly . SNAP _RADIUS - this . x _ ; a = a . y _ + Blockly . SNAP _RADIUS - this . y _ ; c && ( a = - a ) ; b . RTL && ( e = - e ) ; b . moveBy ( e , a ) ; d || b . removeSelect ( ) } } } ;
Blockly . RenderedConnection . prototype . moveTo = function ( a , b ) { this . inDB _ && this . db _ . removeConnection _ ( this ) ; this . x _ = a ; this . y _ = b ; this . hidden _ || this . db _ . addConnection ( this ) } ; Blockly . RenderedConnection . prototype . moveBy = function ( a , b ) { this . moveTo ( this . x _ + a , this . y _ + b ) } ; Blockly . RenderedConnection . prototype . moveToOffset = function ( a ) { this . moveTo ( a . x + this . offsetInBlock _ . x , a . y + this . offsetInBlock _ . y ) } ;
Blockly . RenderedConnection . prototype . setOffsetInBlock = function ( a , b ) { this . offsetInBlock _ . x = a ; this . offsetInBlock _ . y = b } ; Blockly . RenderedConnection . prototype . tighten _ = function ( ) { var a = this . targetConnection . x _ - this . x _ , b = this . targetConnection . y _ - this . y _ ; if ( 0 != a || 0 != b ) { var c = this . targetBlock ( ) , d = c . getSvgRoot ( ) ; if ( ! d ) throw "block is not rendered." ; d = Blockly . utils . getRelativeXY ( d ) ; c . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + ( d . x - a ) + "," + ( d . y - b ) + ")" ) ; c . moveConnections _ ( - a , - b ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . RenderedConnection . prototype . closest = function ( a , b ) { return this . dbOpposite _ . searchForClosest ( this , a , b ) } ;
2018-01-16 21:13:23 +00:00
Blockly . RenderedConnection . prototype . highlight = function ( ) { var a = this . type == Blockly . INPUT _VALUE || this . type == Blockly . OUTPUT _VALUE ? "m 0,0 " + Blockly . BlockSvg . TAB _PATH _DOWN + " v 5" : "m -20,0 h 5 " + Blockly . BlockSvg . NOTCH _PATH _LEFT + " h 5" ; var b = this . sourceBlock _ . getRelativeToSurfaceXY ( ) ; Blockly . Connection . highlightedPath _ = Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyHighlightedConnectionPath" , d : a , transform : "translate(" + ( this . x _ - b . x ) + "," + ( this . y _ - b . y ) + ")" + ( this . sourceBlock _ . RTL ? " scale(-1 1)" : "" ) } ,
this . sourceBlock _ . getSvgRoot ( ) ) } ;
Blockly . RenderedConnection . prototype . unhideAll = function ( ) { this . setHidden ( ! 1 ) ; var a = [ ] ; if ( this . type != Blockly . INPUT _VALUE && this . type != Blockly . NEXT _STATEMENT ) return a ; var b = this . targetBlock ( ) ; if ( b ) { if ( b . isCollapsed ( ) ) { var c = [ ] ; b . outputConnection && c . push ( b . outputConnection ) ; b . nextConnection && c . push ( b . nextConnection ) ; b . previousConnection && c . push ( b . previousConnection ) } else c = b . getConnections _ ( ! 0 ) ; for ( var d = 0 ; d < c . length ; d ++ ) a . push . apply ( a , c [ d ] . unhideAll ( ) ) ; a . length || ( a [ 0 ] = b ) } return a } ;
Blockly . RenderedConnection . prototype . unhighlight = function ( ) { goog . dom . removeNode ( Blockly . Connection . highlightedPath _ ) ; delete Blockly . Connection . highlightedPath _ } ; Blockly . RenderedConnection . prototype . setHidden = function ( a ) { ( this . hidden _ = a ) && this . inDB _ ? this . db _ . removeConnection _ ( this ) : a || this . inDB _ || this . db _ . addConnection ( this ) } ;
2018-08-17 13:32:56 +00:00
Blockly . RenderedConnection . prototype . hideAll = function ( ) { this . setHidden ( ! 0 ) ; if ( this . targetConnection ) for ( var a = this . targetBlock ( ) . getDescendants ( ! 1 ) , b = 0 ; b < a . length ; b ++ ) { for ( var c = a [ b ] , d = c . getConnections _ ( ! 0 ) , e = 0 ; e < d . length ; e ++ ) d [ e ] . setHidden ( ! 0 ) ; c = c . getIcons ( ) ; for ( e = 0 ; e < c . length ; e ++ ) c [ e ] . setVisible ( ! 1 ) } } ; Blockly . RenderedConnection . prototype . isConnectionAllowed = function ( a , b ) { return this . distanceFrom ( a ) > b ? ! 1 : Blockly . RenderedConnection . superClass _ . isConnectionAllowed . call ( this , a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . RenderedConnection . prototype . disconnectInternal _ = function ( a , b ) { Blockly . RenderedConnection . superClass _ . disconnectInternal _ . call ( this , a , b ) ; a . rendered && a . render ( ) ; b . rendered && ( b . updateDisabled ( ) , b . render ( ) ) } ;
Blockly . RenderedConnection . prototype . respawnShadow _ = function ( ) { var a = this . getSourceBlock ( ) , b = this . getShadowDom ( ) ; if ( a . workspace && b && Blockly . Events . recordUndo ) { Blockly . RenderedConnection . superClass _ . respawnShadow _ . call ( this ) ; b = this . targetBlock ( ) ; if ( ! b ) throw "Couldn't respawn the shadow block that should exist here." ; b . initSvg ( ) ; b . render ( ! 1 ) ; a . rendered && a . render ( ) } } ; Blockly . RenderedConnection . prototype . neighbours _ = function ( a ) { return this . dbOpposite _ . getNeighbours ( this , a ) } ;
Blockly . RenderedConnection . prototype . connect _ = function ( a ) { Blockly . RenderedConnection . superClass _ . connect _ . call ( this , a ) ; var b = this . getSourceBlock ( ) ; a = a . getSourceBlock ( ) ; b . rendered && b . updateDisabled ( ) ; a . rendered && a . updateDisabled ( ) ; b . rendered && a . rendered && ( this . type == Blockly . NEXT _STATEMENT || this . type == Blockly . PREVIOUS _STATEMENT ? a . render ( ) : b . render ( ) ) } ;
Blockly . RenderedConnection . prototype . onCheckChanged _ = function ( ) { this . isConnected ( ) && ! this . checkType _ ( this . targetConnection ) && ( ( this . isSuperior ( ) ? this . targetBlock ( ) : this . sourceBlock _ ) . unplug ( ) , this . sourceBlock _ . bumpNeighbours _ ( ) ) } ; Blockly . DraggedConnectionManager = function ( a ) { this . topBlock _ = Blockly . selected = a ; this . workspace _ = a . workspace ; this . availableConnections _ = this . initAvailableConnections _ ( ) ; this . localConnection _ = this . closestConnection _ = null ; this . radiusConnection _ = 0 ; this . wouldDeleteBlock _ = ! 1 } ; Blockly . DraggedConnectionManager . prototype . dispose = function ( ) { this . workspace _ = this . topBlock _ = null ; this . availableConnections _ . length = 0 ; this . localConnection _ = this . closestConnection _ = null } ;
2018-08-17 13:32:56 +00:00
Blockly . DraggedConnectionManager . prototype . wouldDeleteBlock = function ( ) { return this . wouldDeleteBlock _ } ; Blockly . DraggedConnectionManager . prototype . wouldConnectBlock = function ( ) { return ! ! this . closestConnection _ } ;
Blockly . DraggedConnectionManager . prototype . applyConnections = function ( ) { if ( this . closestConnection _ ) { this . localConnection _ . connect ( this . closestConnection _ ) ; if ( this . topBlock _ . rendered ) { var a = this . localConnection _ . isSuperior ( ) ? this . closestConnection _ : this . localConnection _ ; Blockly . BlockAnimations . connectionUiEffect ( a . getSourceBlock ( ) ) ; this . topBlock _ . getRootBlock ( ) . bringToFront ( ) } this . removeHighlighting _ ( ) } } ;
2018-01-16 21:13:23 +00:00
Blockly . DraggedConnectionManager . prototype . update = function ( a , b ) { var c = this . closestConnection _ , d = this . updateClosest _ ( a ) ; d && c && c . unhighlight ( ) ; c = ! ! this . closestConnection _ && b != Blockly . DELETE _AREA _TOOLBOX ; var e = ! ! b && ! this . topBlock _ . getParent ( ) && this . topBlock _ . isDeletable ( ) ; this . wouldDeleteBlock _ = e && ! c ; e && this . closestConnection _ && ( this . closestConnection _ . unhighlight ( ) , this . closestConnection _ = null ) ; ! this . wouldDeleteBlock _ && d && this . closestConnection _ && this . addHighlighting _ ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . DraggedConnectionManager . prototype . removeHighlighting _ = function ( ) { this . closestConnection _ && this . closestConnection _ . unhighlight ( ) } ; Blockly . DraggedConnectionManager . prototype . addHighlighting _ = function ( ) { this . closestConnection _ && this . closestConnection _ . highlight ( ) } ; Blockly . DraggedConnectionManager . prototype . initAvailableConnections _ = function ( ) { var a = this . topBlock _ . getConnections _ ( ! 1 ) , b = this . topBlock _ . lastConnectionInStack ( ) ; b && b != this . topBlock _ . nextConnection && a . push ( b ) ; return a } ;
2018-01-16 21:13:23 +00:00
Blockly . DraggedConnectionManager . prototype . updateClosest _ = function ( a ) { var b = this . closestConnection _ ; this . localConnection _ = this . closestConnection _ = null ; this . radiusConnection _ = Blockly . SNAP _RADIUS ; for ( var c = 0 ; c < this . availableConnections _ . length ; c ++ ) { var d = this . availableConnections _ [ c ] , e = d . closest ( this . radiusConnection _ , a ) ; e . connection && ( this . closestConnection _ = e . connection , this . localConnection _ = d , this . radiusConnection _ = e . radius ) } return b != this . closestConnection _ } ; Blockly . BlockDragger = function ( a , b ) { this . draggingBlock _ = a ; this . workspace _ = b ; this . draggedConnectionManager _ = new Blockly . DraggedConnectionManager ( this . draggingBlock _ ) ; this . deleteArea _ = null ; this . wouldDeleteBlock _ = ! 1 ; this . startXY _ = this . draggingBlock _ . getRelativeToSurfaceXY ( ) ; this . dragIconData _ = Blockly . BlockDragger . initIconData _ ( a ) } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockDragger . prototype . dispose = function ( ) { this . startWorkspace _ = this . workspace _ = this . draggingBlock _ = null ; this . dragIconData _ . length = 0 ; this . draggedConnectionManager _ && ( this . draggedConnectionManager _ . dispose ( ) , this . draggedConnectionManager _ = null ) } ; Blockly . BlockDragger . initIconData _ = function ( a ) { var b = [ ] ; a = a . getDescendants ( ! 1 ) ; for ( var c = 0 , d ; d = a [ c ] ; c ++ ) { d = d . getIcons ( ) ; for ( var e = 0 ; e < d . length ; e ++ ) { var f = { location : d [ e ] . getIconLocation ( ) , icon : d [ e ] } ; b . push ( f ) } } return b } ;
Blockly . BlockDragger . prototype . startBlockDrag = function ( a , b ) { Blockly . Events . getGroup ( ) || Blockly . Events . setGroup ( ! 0 ) ; this . workspace _ . setResizesEnabled ( ! 1 ) ; Blockly . BlockAnimations . disconnectUiStop ( ) ; if ( this . draggingBlock _ . getParent ( ) || b && this . draggingBlock _ . nextConnection && this . draggingBlock _ . nextConnection . targetBlock ( ) ) { this . draggingBlock _ . unplug ( b ) ; var c = this . pixelsToWorkspaceUnits _ ( a ) ; c = goog . math . Coordinate . sum ( this . startXY _ , c ) ; this . draggingBlock _ . translate ( c . x , c . y ) ; Blockly . BlockAnimations . disconnectUiEffect ( this . draggingBlock _ ) } this . draggingBlock _ . setDragging ( ! 0 ) ;
this . draggingBlock _ . moveToDragSurface _ ( ) ; if ( c = this . workspace _ . getToolbox ( ) ) { var d = this . draggingBlock _ . isDeletable ( ) ? "blocklyToolboxDelete" : "blocklyToolboxGrab" ; c . addStyle ( d ) } } ; Blockly . BlockDragger . prototype . dragBlock = function ( a , b ) { var c = this . pixelsToWorkspaceUnits _ ( b ) , d = goog . math . Coordinate . sum ( this . startXY _ , c ) ; this . draggingBlock _ . moveDuringDrag ( d ) ; this . dragIcons _ ( c ) ; this . deleteArea _ = this . workspace _ . isDeleteArea ( a ) ; this . draggedConnectionManager _ . update ( c , this . deleteArea _ ) ; this . updateCursorDuringBlockDrag _ ( ) } ;
Blockly . BlockDragger . prototype . endBlockDrag = function ( a , b ) { this . dragBlock ( a , b ) ; this . dragIconData _ = [ ] ; Blockly . BlockAnimations . disconnectUiStop ( ) ; var c = this . pixelsToWorkspaceUnits _ ( b ) , d = goog . math . Coordinate . sum ( this . startXY _ , c ) ; this . draggingBlock _ . moveOffDragSurface _ ( d ) ; this . maybeDeleteBlock _ ( ) || ( this . draggingBlock _ . moveConnections _ ( c . x , c . y ) , this . draggingBlock _ . setDragging ( ! 1 ) , this . fireMoveEvent _ ( ) , this . draggedConnectionManager _ . wouldConnectBlock ( ) ? this . draggedConnectionManager _ . applyConnections ( ) : this . draggingBlock _ . render ( ) ,
this . draggingBlock _ . scheduleSnapAndBump ( ) ) ; this . workspace _ . setResizesEnabled ( ! 0 ) ; if ( c = this . workspace _ . getToolbox ( ) ) d = this . draggingBlock _ . isDeletable ( ) ? "blocklyToolboxDelete" : "blocklyToolboxGrab" , c . removeStyle ( d ) ; Blockly . Events . setGroup ( ! 1 ) } ; Blockly . BlockDragger . prototype . fireMoveEvent _ = function ( ) { var a = new Blockly . Events . BlockMove ( this . draggingBlock _ ) ; a . oldCoordinate = this . startXY _ ; a . recordNew ( ) ; Blockly . Events . fire ( a ) } ;
Blockly . BlockDragger . prototype . maybeDeleteBlock _ = function ( ) { var a = this . workspace _ . trashcan ; this . wouldDeleteBlock _ ? ( a && setTimeout ( a . close . bind ( a ) , 100 ) , this . fireMoveEvent _ ( ) , this . draggingBlock _ . dispose ( ! 1 , ! 0 ) ) : a && a . close ( ) ; return this . wouldDeleteBlock _ } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockDragger . prototype . updateCursorDuringBlockDrag _ = function ( ) { this . wouldDeleteBlock _ = this . draggedConnectionManager _ . wouldDeleteBlock ( ) ; var a = this . workspace _ . trashcan ; this . wouldDeleteBlock _ ? ( this . draggingBlock _ . setDeleteStyle ( ! 0 ) , this . deleteArea _ == Blockly . DELETE _AREA _TRASH && a && a . setOpen _ ( ! 0 ) ) : ( this . draggingBlock _ . setDeleteStyle ( ! 1 ) , a && a . setOpen _ ( ! 1 ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockDragger . prototype . pixelsToWorkspaceUnits _ = function ( a ) { a = new goog . math . Coordinate ( a . x / this . workspace _ . scale , a . y / this . workspace _ . scale ) ; this . workspace _ . isMutator && ( a = a . scale ( 1 / this . workspace _ . options . parentWorkspace . scale ) ) ; return a } ; Blockly . BlockDragger . prototype . dragIcons _ = function ( a ) { for ( var b = 0 ; b < this . dragIconData _ . length ; b ++ ) { var c = this . dragIconData _ [ b ] ; c . icon . setIconLocation ( goog . math . Coordinate . sum ( c . location , a ) ) } } ; Blockly . WorkspaceCommentSvg = function ( a , b , c , d , e ) { this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyComment" } , null ) ; this . svgGroup _ . translate _ = "" ; this . svgRect _ = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyCommentRect" , x : 0 , y : 0 , rx : Blockly . WorkspaceCommentSvg . BORDER _RADIUS , ry : Blockly . WorkspaceCommentSvg . BORDER _RADIUS } ) ; this . svgGroup _ . appendChild ( this . svgRect _ ) ; this . rendered _ = ! 1 ; this . useDragSurface _ = Blockly . utils . is3dSupported ( ) && ! ! a . blockDragSurface _ ; Blockly . WorkspaceCommentSvg . superClass _ . constructor . call ( this ,
a , b , c , d , e ) ; this . render ( ) } ; goog . inherits ( Blockly . WorkspaceCommentSvg , Blockly . WorkspaceComment ) ; Blockly . WorkspaceCommentSvg . DEFAULT _SIZE = 100 ;
Blockly . WorkspaceCommentSvg . prototype . dispose = function ( ) { this . workspace && ( Blockly . selected == this && ( this . unselect ( ) , this . workspace . cancelCurrentGesture ( ) ) , Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . CommentDelete ( this ) ) , goog . dom . removeNode ( this . svgGroup _ ) , this . svgRect _ = this . svgGroup _ = null , this . disposeInternal _ ( ) , Blockly . Events . disable ( ) , Blockly . WorkspaceCommentSvg . superClass _ . dispose . call ( this ) , Blockly . Events . enable ( ) ) } ;
Blockly . WorkspaceCommentSvg . prototype . initSvg = function ( ) { goog . asserts . assert ( this . workspace . rendered , "Workspace is headless." ) ; this . workspace . options . readOnly || this . eventsInit _ || ( Blockly . bindEventWithChecks _ ( this . svgRectTarget _ , "mousedown" , this , this . pathMouseDown _ ) , Blockly . bindEventWithChecks _ ( this . svgHandleTarget _ , "mousedown" , this , this . pathMouseDown _ ) ) ; this . eventsInit _ = ! 0 ; this . updateMovable ( ) ; this . getSvgRoot ( ) . parentNode || this . workspace . getBubbleCanvas ( ) . appendChild ( this . getSvgRoot ( ) ) } ;
Blockly . WorkspaceCommentSvg . prototype . pathMouseDown _ = function ( a ) { var b = this . workspace . getGesture ( a ) ; b && b . handleBubbleStart ( a , this ) } ; Blockly . WorkspaceCommentSvg . prototype . showContextMenu _ = function ( a ) { if ( ! this . workspace . options . readOnly ) { var b = [ ] ; this . isDeletable ( ) && this . isMovable ( ) && ( b . push ( Blockly . ContextMenu . commentDuplicateOption ( this ) ) , b . push ( Blockly . ContextMenu . commentDeleteOption ( this ) ) ) ; Blockly . ContextMenu . show ( a , b , this . RTL ) } } ;
Blockly . WorkspaceCommentSvg . prototype . select = function ( ) { if ( Blockly . selected != this ) { var a = null ; if ( Blockly . selected ) { a = Blockly . selected . id ; Blockly . Events . disable ( ) ; try { Blockly . selected . unselect ( ) } finally { Blockly . Events . enable ( ) } } a = new Blockly . Events . Ui ( null , "selected" , a , this . id ) ; a . workspaceId = this . workspace . id ; Blockly . Events . fire ( a ) ; Blockly . selected = this ; this . addSelect ( ) } } ;
Blockly . WorkspaceCommentSvg . prototype . unselect = function ( ) { if ( Blockly . selected == this ) { var a = new Blockly . Events . Ui ( null , "selected" , this . id , null ) ; a . workspaceId = this . workspace . id ; Blockly . Events . fire ( a ) ; Blockly . selected = null ; this . removeSelect ( ) ; this . blurFocus ( ) } } ; Blockly . WorkspaceCommentSvg . prototype . addSelect = function ( ) { Blockly . utils . addClass ( this . svgGroup _ , "blocklySelected" ) ; this . setFocus ( ) } ;
Blockly . WorkspaceCommentSvg . prototype . removeSelect = function ( ) { Blockly . utils . removeClass ( this . svgGroup _ , "blocklySelected" ) ; this . blurFocus ( ) } ; Blockly . WorkspaceCommentSvg . prototype . addFocus = function ( ) { Blockly . utils . addClass ( this . svgGroup _ , "blocklyFocused" ) } ; Blockly . WorkspaceCommentSvg . prototype . removeFocus = function ( ) { Blockly . utils . removeClass ( this . svgGroup _ , "blocklyFocused" ) } ;
Blockly . WorkspaceCommentSvg . prototype . getRelativeToSurfaceXY = function ( ) { var a = 0 , b = 0 , c = this . useDragSurface _ ? this . workspace . blockDragSurface _ . getGroup ( ) : null , d = this . getSvgRoot ( ) ; if ( d ) { do { var e = Blockly . utils . getRelativeXY ( d ) ; a += e . x ; b += e . y ; this . useDragSurface _ && this . workspace . blockDragSurface _ . getCurrentBlock ( ) == d && ( e = this . workspace . blockDragSurface _ . getSurfaceTranslation ( ) , a += e . x , b += e . y ) ; d = d . parentNode } while ( d && d != this . workspace . getBubbleCanvas ( ) && d != c ) } return this . xy _ = new goog . math . Coordinate ( a , b ) } ;
Blockly . WorkspaceCommentSvg . prototype . moveBy = function ( a , b ) { var c = new Blockly . Events . CommentMove ( this ) , d = this . getRelativeToSurfaceXY ( ) ; this . translate ( d . x + a , d . y + b ) ; this . xy _ = new goog . math . Coordinate ( d . x + a , d . y + b ) ; c . recordNew ( ) ; Blockly . Events . fire ( c ) ; this . workspace . resizeContents ( ) } ; Blockly . WorkspaceCommentSvg . prototype . translate = function ( a , b ) { this . xy _ = new goog . math . Coordinate ( a , b ) ; this . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } ;
Blockly . WorkspaceCommentSvg . prototype . moveToDragSurface _ = function ( ) { if ( this . useDragSurface _ ) { var a = this . getRelativeToSurfaceXY ( ) ; this . clearTransformAttributes _ ( ) ; this . workspace . blockDragSurface _ . translateSurface ( a . x , a . y ) ; this . workspace . blockDragSurface _ . setBlocksAndShow ( this . getSvgRoot ( ) ) } } ; Blockly . WorkspaceCommentSvg . prototype . moveOffDragSurface _ = function ( a ) { this . useDragSurface _ && ( this . translate ( a . x , a . y ) , this . workspace . blockDragSurface _ . clearAndHide ( this . workspace . getCanvas ( ) ) ) } ;
Blockly . WorkspaceCommentSvg . prototype . moveDuringDrag = function ( a , b ) { a ? a . translateSurface ( b . x , b . y ) : ( this . svgGroup _ . translate _ = "translate(" + b . x + "," + b . y + ")" , this . svgGroup _ . setAttribute ( "transform" , this . svgGroup _ . translate _ + this . svgGroup _ . skew _ ) ) } ; Blockly . WorkspaceCommentSvg . prototype . moveTo = function ( a , b ) { this . translate ( a , b ) } ; Blockly . WorkspaceCommentSvg . prototype . clearTransformAttributes _ = function ( ) { Blockly . utils . removeAttribute ( this . getSvgRoot ( ) , "transform" ) } ;
Blockly . WorkspaceCommentSvg . prototype . getBoundingRectangle = function ( ) { var a = this . getRelativeToSurfaceXY ( ) , b = this . getHeightWidth ( ) ; if ( this . RTL ) { var c = new goog . math . Coordinate ( a . x - b . width , a . y ) ; a = new goog . math . Coordinate ( a . x , a . y + b . height ) } else c = new goog . math . Coordinate ( a . x , a . y ) , a = new goog . math . Coordinate ( a . x + b . width , a . y + b . height ) ; return { topLeft : c , bottomRight : a } } ;
Blockly . WorkspaceCommentSvg . prototype . updateMovable = function ( ) { this . isMovable ( ) ? Blockly . utils . addClass ( this . svgGroup _ , "blocklyDraggable" ) : Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDraggable" ) } ; Blockly . WorkspaceCommentSvg . prototype . setMovable = function ( a ) { Blockly . WorkspaceCommentSvg . superClass _ . setMovable . call ( this , a ) ; this . updateMovable ( ) } ;
Blockly . WorkspaceCommentSvg . prototype . setDragging = function ( a ) { a ? ( a = this . getSvgRoot ( ) , a . translate _ = "" , a . skew _ = "" , Blockly . utils . addClass ( this . svgGroup _ , "blocklyDragging" ) ) : Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDragging" ) } ; Blockly . WorkspaceCommentSvg . prototype . getSvgRoot = function ( ) { return this . svgGroup _ } ; Blockly . WorkspaceCommentSvg . prototype . getContent = function ( ) { return this . textarea _ ? this . textarea _ . value : this . content _ } ;
Blockly . WorkspaceCommentSvg . prototype . setContent = function ( a ) { Blockly . WorkspaceCommentSvg . superClass _ . setContent . call ( this , a ) ; this . textarea _ && ( this . textarea _ . value = a ) } ; Blockly . WorkspaceCommentSvg . prototype . setDeleteStyle = function ( a ) { a ? Blockly . utils . addClass ( this . svgGroup _ , "blocklyDraggingDelete" ) : Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDraggingDelete" ) } ; Blockly . WorkspaceCommentSvg . prototype . setAutoLayout = function ( ) { } ;
Blockly . WorkspaceCommentSvg . fromXml = function ( a , b , c ) { Blockly . Events . disable ( ) ; try { var d = Blockly . WorkspaceComment . parseAttributes ( a ) , e = new Blockly . WorkspaceCommentSvg ( b , d . content , d . h , d . w , d . id ) ; b . rendered && ( e . initSvg ( ) , e . render ( ! 1 ) ) ; if ( ! isNaN ( d . x ) && ! isNaN ( d . y ) ) if ( b . RTL ) { var f = c || b . getWidth ( ) ; e . moveBy ( f - d . x , d . y ) } else e . moveBy ( d . x , d . y ) } finally { Blockly . Events . enable ( ) } Blockly . WorkspaceComment . fireCreateEvent ( e ) ; return e } ;
Blockly . WorkspaceCommentSvg . prototype . toXmlWithXY = function ( a ) { var b ; this . workspace . RTL && ( b = this . workspace . getWidth ( ) ) ; a = this . toXml ( a ) ; var c = this . getRelativeToSurfaceXY ( ) ; a . setAttribute ( "x" , Math . round ( this . workspace . RTL ? b - c . x : c . x ) ) ; a . setAttribute ( "y" , Math . round ( c . y ) ) ; a . setAttribute ( "h" , this . getHeight ( ) ) ; a . setAttribute ( "w" , this . getWidth ( ) ) ; return a } ; Blockly . BubbleDragger = function ( a , b ) { this . draggingBubble _ = a ; this . workspace _ = b ; this . deleteArea _ = null ; this . wouldDeleteBubble _ = ! 1 ; this . startXY _ = this . draggingBubble _ . getRelativeToSurfaceXY ( ) ; this . dragSurface _ = Blockly . utils . is3dSupported ( ) && b . getBlockDragSurface ( ) ? b . getBlockDragSurface ( ) : null } ; Blockly . BubbleDragger . prototype . dispose = function ( ) { this . dragSurface _ = this . workspace _ = this . draggingBubble _ = null } ;
Blockly . BubbleDragger . prototype . startBubbleDrag = function ( ) { Blockly . Events . getGroup ( ) || Blockly . Events . setGroup ( ! 0 ) ; this . workspace _ . setResizesEnabled ( ! 1 ) ; this . draggingBubble _ . setAutoLayout ( ! 1 ) ; this . dragSurface _ && this . moveToDragSurface _ ( ) ; this . draggingBubble _ . setDragging && this . draggingBubble _ . setDragging ( ! 0 ) ; var a = this . workspace _ . getToolbox ( ) ; if ( a ) { var b = this . draggingBubble _ . isDeletable ( ) ? "blocklyToolboxDelete" : "blocklyToolboxGrab" ; a . addStyle ( b ) } } ;
Blockly . BubbleDragger . prototype . dragBubble = function ( a , b ) { var c = this . pixelsToWorkspaceUnits _ ( b ) ; c = goog . math . Coordinate . sum ( this . startXY _ , c ) ; this . draggingBubble _ . moveDuringDrag ( this . dragSurface _ , c ) ; this . draggingBubble _ . isDeletable ( ) && ( this . deleteArea _ = this . workspace _ . isDeleteArea ( a ) , this . updateCursorDuringBubbleDrag _ ( ) ) } ;
Blockly . BubbleDragger . prototype . maybeDeleteBubble _ = function ( ) { var a = this . workspace _ . trashcan ; this . wouldDeleteBubble _ ? ( a && setTimeout ( a . close . bind ( a ) , 100 ) , this . fireMoveEvent _ ( ) , this . draggingBubble _ . dispose ( ! 1 , ! 0 ) ) : a && a . close ( ) ; return this . wouldDeleteBubble _ } ;
Blockly . BubbleDragger . prototype . updateCursorDuringBubbleDrag _ = function ( ) { this . wouldDeleteBubble _ = this . deleteArea _ != Blockly . DELETE _AREA _NONE ; var a = this . workspace _ . trashcan ; this . wouldDeleteBubble _ ? ( this . draggingBubble _ . setDeleteStyle ( ! 0 ) , this . deleteArea _ == Blockly . DELETE _AREA _TRASH && a && a . setOpen _ ( ! 0 ) ) : ( this . draggingBubble _ . setDeleteStyle ( ! 1 ) , a && a . setOpen _ ( ! 1 ) ) } ;
Blockly . BubbleDragger . prototype . endBubbleDrag = function ( a , b ) { this . dragBubble ( a , b ) ; var c = this . pixelsToWorkspaceUnits _ ( b ) ; c = goog . math . Coordinate . sum ( this . startXY _ , c ) ; this . draggingBubble _ . moveTo ( c . x , c . y ) ; this . maybeDeleteBubble _ ( ) || ( this . dragSurface _ && this . dragSurface _ . clearAndHide ( this . workspace _ . getBubbleCanvas ( ) ) , this . draggingBubble _ . setDragging && this . draggingBubble _ . setDragging ( ! 1 ) , this . fireMoveEvent _ ( ) ) ; this . workspace _ . setResizesEnabled ( ! 0 ) ; this . workspace _ . toolbox _ && ( c = this . draggingBubble _ . isDeletable ( ) ?
"blocklyToolboxDelete" : "blocklyToolboxGrab" , this . workspace _ . toolbox _ . removeStyle ( c ) ) ; Blockly . Events . setGroup ( ! 1 ) } ; Blockly . BubbleDragger . prototype . fireMoveEvent _ = function ( ) { if ( this . draggingBubble _ . isComment ) { var a = new Blockly . Events . CommentMove ( this . draggingBubble _ ) ; a . setOldCoordinate ( this . startXY _ ) ; a . recordNew ( ) ; Blockly . Events . fire ( a ) } } ;
Blockly . BubbleDragger . prototype . pixelsToWorkspaceUnits _ = function ( a ) { a = new goog . math . Coordinate ( a . x / this . workspace _ . scale , a . y / this . workspace _ . scale ) ; this . workspace _ . isMutator && ( a = a . scale ( 1 / this . workspace _ . options . parentWorkspace . scale ) ) ; return a } ; Blockly . BubbleDragger . prototype . moveToDragSurface _ = function ( ) { this . draggingBubble _ . moveTo ( 0 , 0 ) ; this . dragSurface _ . translateSurface ( this . startXY _ . x , this . startXY _ . y ) ; this . dragSurface _ . setBlocksAndShow ( this . draggingBubble _ . getSvgRoot ( ) ) } ; Blockly . WorkspaceDragger = function ( a ) { this . workspace _ = a ; this . startDragMetrics _ = a . getMetrics ( ) ; this . startScrollXY _ = new goog . math . Coordinate ( a . scrollX , a . scrollY ) } ; Blockly . WorkspaceDragger . prototype . dispose = function ( ) { this . workspace _ = null } ; Blockly . WorkspaceDragger . prototype . startDrag = function ( ) { Blockly . selected && Blockly . selected . unselect ( ) ; this . workspace _ . setupDragSurface ( ) } ; Blockly . WorkspaceDragger . prototype . endDrag = function ( a ) { this . drag ( a ) ; this . workspace _ . resetDragSurface ( ) } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceDragger . prototype . drag = function ( a ) { var b = this . startDragMetrics _ , c = goog . math . Coordinate . sum ( this . startScrollXY _ , a ) ; a = Math . min ( c . x , - b . contentLeft ) ; c = Math . min ( c . y , - b . contentTop ) ; a = Math . max ( a , b . viewWidth - b . contentLeft - b . contentWidth ) ; c = Math . max ( c , b . viewHeight - b . contentTop - b . contentHeight ) ; a = - a - b . contentLeft ; c = - c - b . contentTop ; this . updateScroll _ ( a , c ) } ; Blockly . WorkspaceDragger . prototype . updateScroll _ = function ( a , b ) { this . workspace _ . scrollbar . set ( a , b ) } ; Blockly . FlyoutDragger = function ( a ) { Blockly . FlyoutDragger . superClass _ . constructor . call ( this , a . getWorkspace ( ) ) ; this . scrollbar _ = a . scrollbar _ ; this . horizontalLayout _ = a . horizontalLayout _ } ; goog . inherits ( Blockly . FlyoutDragger , Blockly . WorkspaceDragger ) ; Blockly . FlyoutDragger . prototype . updateScroll _ = function ( a , b ) { this . horizontalLayout _ ? this . scrollbar _ . set ( a ) : this . scrollbar _ . set ( b ) } ; Blockly . Tooltip = { } ; Blockly . Tooltip . visible = ! 1 ; Blockly . Tooltip . blocked _ = ! 1 ; Blockly . Tooltip . LIMIT = 50 ; Blockly . Tooltip . mouseOutPid _ = 0 ; Blockly . Tooltip . showPid _ = 0 ; Blockly . Tooltip . lastX _ = 0 ; Blockly . Tooltip . lastY _ = 0 ; Blockly . Tooltip . element _ = null ; Blockly . Tooltip . poisonedElement _ = null ; Blockly . Tooltip . OFFSET _X = 0 ; Blockly . Tooltip . OFFSET _Y = 10 ; Blockly . Tooltip . RADIUS _OK = 10 ; Blockly . Tooltip . HOVER _MS = 750 ; Blockly . Tooltip . MARGINS = 5 ; Blockly . Tooltip . DIV = null ;
2017-09-25 09:37:41 +00:00
Blockly . Tooltip . createDom = function ( ) { Blockly . Tooltip . DIV || ( Blockly . Tooltip . DIV = goog . dom . createDom ( "DIV" , "blocklyTooltipDiv" ) , document . body . appendChild ( Blockly . Tooltip . DIV ) ) } ; Blockly . Tooltip . bindMouseEvents = function ( a ) { Blockly . bindEvent _ ( a , "mouseover" , null , Blockly . Tooltip . onMouseOver _ ) ; Blockly . bindEvent _ ( a , "mouseout" , null , Blockly . Tooltip . onMouseOut _ ) ; a . addEventListener ( "mousemove" , Blockly . Tooltip . onMouseMove _ , ! 1 ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Tooltip . onMouseOver _ = function ( a ) { if ( ! Blockly . Tooltip . blocked _ ) { for ( a = a . target ; ! goog . isString ( a . tooltip ) && ! goog . isFunction ( a . tooltip ) ; ) a = a . tooltip ; Blockly . Tooltip . element _ != a && ( Blockly . Tooltip . hide ( ) , Blockly . Tooltip . poisonedElement _ = null , Blockly . Tooltip . element _ = a ) ; clearTimeout ( Blockly . Tooltip . mouseOutPid _ ) } } ;
Blockly . Tooltip . onMouseOut _ = function ( a ) { Blockly . Tooltip . blocked _ || ( Blockly . Tooltip . mouseOutPid _ = setTimeout ( function ( ) { Blockly . Tooltip . element _ = null ; Blockly . Tooltip . poisonedElement _ = null ; Blockly . Tooltip . hide ( ) } , 1 ) , clearTimeout ( Blockly . Tooltip . showPid _ ) ) } ;
Blockly . Tooltip . onMouseMove _ = function ( a ) { if ( Blockly . Tooltip . element _ && Blockly . Tooltip . element _ . tooltip && ! Blockly . WidgetDiv . isVisible ( ) && ! Blockly . Tooltip . blocked _ ) if ( Blockly . Tooltip . visible ) { var b = Blockly . Tooltip . lastX _ - a . pageX ; a = Blockly . Tooltip . lastY _ - a . pageY ; Math . sqrt ( b * b + a * a ) > Blockly . Tooltip . RADIUS _OK && Blockly . Tooltip . hide ( ) } else Blockly . Tooltip . poisonedElement _ != Blockly . Tooltip . element _ && ( clearTimeout ( Blockly . Tooltip . showPid _ ) , Blockly . Tooltip . lastX _ = a . pageX , Blockly . Tooltip . lastY _ = a . pageY , Blockly . Tooltip . showPid _ =
setTimeout ( Blockly . Tooltip . show _ , Blockly . Tooltip . HOVER _MS ) ) } ; Blockly . Tooltip . hide = function ( ) { Blockly . Tooltip . visible && ( Blockly . Tooltip . visible = ! 1 , Blockly . Tooltip . DIV && ( Blockly . Tooltip . DIV . style . display = "none" ) ) ; Blockly . Tooltip . showPid _ && clearTimeout ( Blockly . Tooltip . showPid _ ) } ; Blockly . Tooltip . block = function ( ) { Blockly . Tooltip . hide ( ) ; Blockly . Tooltip . blocked _ = ! 0 } ; Blockly . Tooltip . unblock = function ( ) { Blockly . Tooltip . blocked _ = ! 1 } ;
Blockly . Tooltip . show _ = function ( ) { if ( ! Blockly . Tooltip . blocked _ && ( Blockly . Tooltip . poisonedElement _ = Blockly . Tooltip . element _ , Blockly . Tooltip . DIV ) ) { goog . dom . removeChildren ( Blockly . Tooltip . DIV ) ; for ( var a = Blockly . Tooltip . element _ . tooltip ; goog . isFunction ( a ) ; ) a = a ( ) ; a = Blockly . utils . wrap ( a , Blockly . Tooltip . LIMIT ) ; a = a . split ( "\n" ) ; for ( var b = 0 ; b < a . length ; b ++ ) { var c = document . createElement ( "div" ) ; c . appendChild ( document . createTextNode ( a [ b ] ) ) ; Blockly . Tooltip . DIV . appendChild ( c ) } a = Blockly . Tooltip . element _ . RTL ; b = goog . dom . getViewportSize ( ) ;
Blockly . Tooltip . DIV . style . direction = a ? "rtl" : "ltr" ; Blockly . Tooltip . DIV . style . display = "block" ; Blockly . Tooltip . visible = ! 0 ; c = Blockly . Tooltip . lastX _ ; c = a ? c - ( Blockly . Tooltip . OFFSET _X + Blockly . Tooltip . DIV . offsetWidth ) : c + Blockly . Tooltip . OFFSET _X ; var d = Blockly . Tooltip . lastY _ + Blockly . Tooltip . OFFSET _Y ; d + Blockly . Tooltip . DIV . offsetHeight > b . height + window . scrollY && ( d -= Blockly . Tooltip . DIV . offsetHeight + 2 * Blockly . Tooltip . OFFSET _Y ) ; a ? c = Math . max ( Blockly . Tooltip . MARGINS - window . scrollX , c ) : c + Blockly . Tooltip . DIV . offsetWidth >
2018-08-17 13:32:56 +00:00
b . width + window . scrollX - 2 * Blockly . Tooltip . MARGINS && ( c = b . width - Blockly . Tooltip . DIV . offsetWidth - 2 * Blockly . Tooltip . MARGINS ) ; Blockly . Tooltip . DIV . style . top = d + "px" ; Blockly . Tooltip . DIV . style . left = c + "px" } } ; Blockly . Gesture = function ( a , b ) { this . startWorkspace _ = this . targetBlock _ = this . startBlock _ = this . startField _ = this . startBubble _ = this . currentDragDeltaXY _ = this . mouseDownXY _ = null ; this . creatorWorkspace _ = b ; this . isDraggingBubble _ = this . isDraggingBlock _ = this . isDraggingWorkspace _ = this . hasExceededDragRadius _ = ! 1 ; this . mostRecentEvent _ = a ; this . flyout _ = this . workspaceDragger _ = this . blockDragger _ = this . bubbleDragger _ = this . onUpWrapper _ = this . onMoveWrapper _ = null ; this . isEnding _ = this . hasStarted _ = this . calledUpdateIsDragging _ = ! 1 ;
this . healStack _ = ! Blockly . DRAG _STACK } ;
2018-01-16 21:13:23 +00:00
Blockly . Gesture . prototype . dispose = function ( ) { Blockly . Touch . clearTouchIdentifier ( ) ; Blockly . Tooltip . unblock ( ) ; this . creatorWorkspace _ . clearGesture ( ) ; this . onMoveWrapper _ && Blockly . unbindEvent _ ( this . onMoveWrapper _ ) ; this . onUpWrapper _ && Blockly . unbindEvent _ ( this . onUpWrapper _ ) ; this . flyout _ = this . startWorkspace _ = this . targetBlock _ = this . startBlock _ = this . startField _ = null ; this . blockDragger _ && ( this . blockDragger _ . dispose ( ) , this . blockDragger _ = null ) ; this . workspaceDragger _ && ( this . workspaceDragger _ . dispose ( ) , this . workspaceDragger _ =
2018-08-17 13:32:56 +00:00
null ) ; this . bubbleDragger _ && ( this . bubbleDragger _ . dispose ( ) , this . bubbleDragger _ = null ) } ; Blockly . Gesture . prototype . updateFromEvent _ = function ( a ) { var b = new goog . math . Coordinate ( a . clientX , a . clientY ) ; this . updateDragDelta _ ( b ) && ( this . updateIsDragging _ ( ) , Blockly . longStop _ ( ) ) ; this . mostRecentEvent _ = a } ;
2018-01-16 21:13:23 +00:00
Blockly . Gesture . prototype . updateDragDelta _ = function ( a ) { this . currentDragDeltaXY _ = goog . math . Coordinate . difference ( a , this . mouseDownXY _ ) ; return this . hasExceededDragRadius _ ? ! 1 : this . hasExceededDragRadius _ = goog . math . Coordinate . magnitude ( this . currentDragDeltaXY _ ) > ( this . flyout _ ? Blockly . FLYOUT _DRAG _RADIUS : Blockly . DRAG _RADIUS ) } ;
Blockly . Gesture . prototype . updateIsDraggingFromFlyout _ = function ( ) { return this . targetBlock _ . disabled ? ! 1 : ! this . flyout _ . isScrollable ( ) || this . flyout _ . isDragTowardWorkspace ( this . currentDragDeltaXY _ ) ? ( this . startWorkspace _ = this . flyout _ . targetWorkspace _ , this . startWorkspace _ . updateScreenCalculationsIfScrolled ( ) , Blockly . Events . getGroup ( ) || Blockly . Events . setGroup ( ! 0 ) , this . startBlock _ = null , this . targetBlock _ = this . flyout _ . createBlock ( this . targetBlock _ ) , this . targetBlock _ . select ( ) , ! 0 ) : ! 1 } ;
2018-08-17 13:32:56 +00:00
Blockly . Gesture . prototype . updateIsDraggingBubble _ = function ( ) { if ( ! this . startBubble _ ) return ! 1 ; this . isDraggingBubble _ = ! 0 ; this . startDraggingBubble _ ( ) ; return ! 0 } ; Blockly . Gesture . prototype . updateIsDraggingBlock _ = function ( ) { if ( ! this . targetBlock _ ) return ! 1 ; this . flyout _ ? this . isDraggingBlock _ = this . updateIsDraggingFromFlyout _ ( ) : this . targetBlock _ . isMovable ( ) && ( this . isDraggingBlock _ = ! 0 ) ; return this . isDraggingBlock _ ? ( this . startDraggingBlock _ ( ) , ! 0 ) : ! 1 } ;
2018-01-16 21:13:23 +00:00
Blockly . Gesture . prototype . updateIsDraggingWorkspace _ = function ( ) { if ( this . flyout _ ? this . flyout _ . isScrollable ( ) : this . startWorkspace _ && this . startWorkspace _ . isDraggable ( ) ) this . workspaceDragger _ = this . flyout _ ? new Blockly . FlyoutDragger ( this . flyout _ ) : new Blockly . WorkspaceDragger ( this . startWorkspace _ ) , this . isDraggingWorkspace _ = ! 0 , this . workspaceDragger _ . startDrag ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Gesture . prototype . updateIsDragging _ = function ( ) { goog . asserts . assert ( ! this . calledUpdateIsDragging _ , "updateIsDragging_ should only be called once per gesture." ) ; this . calledUpdateIsDragging _ = ! 0 ; this . updateIsDraggingBubble _ ( ) || this . updateIsDraggingBlock _ ( ) || this . updateIsDraggingWorkspace _ ( ) } ;
Blockly . Gesture . prototype . startDraggingBlock _ = function ( ) { this . blockDragger _ = new Blockly . BlockDragger ( this . targetBlock _ , this . startWorkspace _ ) ; this . blockDragger _ . startBlockDrag ( this . currentDragDeltaXY _ , this . healStack _ ) ; this . blockDragger _ . dragBlock ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) } ;
Blockly . Gesture . prototype . startDraggingBubble _ = function ( ) { this . bubbleDragger _ = new Blockly . BubbleDragger ( this . startBubble _ , this . startWorkspace _ ) ; this . bubbleDragger _ . startBubbleDrag ( ) ; this . bubbleDragger _ . dragBubble ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) } ;
Blockly . Gesture . prototype . doStart = function ( a ) { Blockly . utils . isTargetInput ( a ) ? this . cancel ( ) : ( this . hasStarted _ = ! 0 , Blockly . BlockAnimations . disconnectUiStop ( ) , this . startWorkspace _ . updateScreenCalculationsIfScrolled ( ) , this . startWorkspace _ . isMutator && this . startWorkspace _ . resize ( ) , this . startWorkspace _ . markFocused ( ) , this . mostRecentEvent _ = a , Blockly . hideChaff ( ! ! this . flyout _ ) , Blockly . Tooltip . block ( ) , this . targetBlock _ && this . targetBlock _ . select ( ) , Blockly . utils . isRightButton ( a ) ? this . handleRightClick ( a ) : ( ( goog . string . caseInsensitiveEquals ( a . type ,
"touchstart" ) || goog . string . caseInsensitiveEquals ( a . type , "pointerdown" ) && "mouse" != a . pointerType ) && Blockly . longStart _ ( a , this ) , this . mouseDownXY _ = new goog . math . Coordinate ( a . clientX , a . clientY ) , this . healStack _ = a . altKey || a . ctrlKey || a . metaKey , this . bindMouseEvents ( a ) ) ) } ;
Blockly . Gesture . prototype . bindMouseEvents = function ( a ) { this . onMoveWrapper _ = Blockly . bindEventWithChecks _ ( document , "mousemove" , null , this . handleMove . bind ( this ) ) ; this . onUpWrapper _ = Blockly . bindEventWithChecks _ ( document , "mouseup" , null , this . handleUp . bind ( this ) ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } ;
Blockly . Gesture . prototype . handleMove = function ( a ) { this . updateFromEvent _ ( a ) ; this . isDraggingWorkspace _ ? this . workspaceDragger _ . drag ( this . currentDragDeltaXY _ ) : this . isDraggingBlock _ ? this . blockDragger _ . dragBlock ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . isDraggingBubble _ && this . bubbleDragger _ . dragBubble ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } ;
Blockly . Gesture . prototype . handleUp = function ( a ) { this . updateFromEvent _ ( a ) ; Blockly . longStop _ ( ) ; this . isEnding _ ? console . log ( "Trying to end a gesture recursively." ) : ( this . isEnding _ = ! 0 , this . isDraggingBubble _ ? this . bubbleDragger _ . endBubbleDrag ( a , this . currentDragDeltaXY _ ) : this . isDraggingBlock _ ? this . blockDragger _ . endBlockDrag ( a , this . currentDragDeltaXY _ ) : this . isDraggingWorkspace _ ? this . workspaceDragger _ . endDrag ( this . currentDragDeltaXY _ ) : this . isBubbleClick _ ( ) ? this . doBubbleClick _ ( ) : this . isFieldClick _ ( ) ? this . doFieldClick _ ( ) :
this . isBlockClick _ ( ) ? this . doBlockClick _ ( ) : this . isWorkspaceClick _ ( ) && this . doWorkspaceClick _ ( ) , a . preventDefault ( ) , a . stopPropagation ( ) , this . dispose ( ) ) } ;
Blockly . Gesture . prototype . cancel = function ( ) { this . isEnding _ || ( Blockly . longStop _ ( ) , this . isDraggingBubble _ ? this . bubbleDragger _ . endBubbleDrag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . isDraggingBlock _ ? this . blockDragger _ . endBlockDrag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . isDraggingWorkspace _ && this . workspaceDragger _ . endDrag ( this . currentDragDeltaXY _ ) , this . dispose ( ) ) } ;
Blockly . Gesture . prototype . handleRightClick = function ( a ) { this . targetBlock _ ? ( this . bringBlockToFront _ ( ) , Blockly . hideChaff ( this . flyout _ ) , this . targetBlock _ . showContextMenu _ ( a ) ) : this . startBubble _ ? this . startBubble _ . showContextMenu _ ( a ) : this . startWorkspace _ && ! this . flyout _ && ( Blockly . hideChaff ( ) , this . startWorkspace _ . showContextMenu _ ( a ) ) ; a . preventDefault ( ) ; a . stopPropagation ( ) ; this . dispose ( ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Gesture . prototype . handleWsStart = function ( a , b ) { goog . asserts . assert ( ! this . hasStarted _ , "Tried to call gesture.handleWsStart, but the gesture had already been started." ) ; this . setStartWorkspace _ ( b ) ; this . mostRecentEvent _ = a ; this . doStart ( a ) } ; Blockly . Gesture . prototype . handleFlyoutStart = function ( a , b ) { goog . asserts . assert ( ! this . hasStarted _ , "Tried to call gesture.handleFlyoutStart, but the gesture had already been started." ) ; this . setStartFlyout _ ( b ) ; this . handleWsStart ( a , b . getWorkspace ( ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Gesture . prototype . handleBlockStart = function ( a , b ) { goog . asserts . assert ( ! this . hasStarted _ , "Tried to call gesture.handleBlockStart, but the gesture had already been started." ) ; this . setStartBlock ( b ) ; this . mostRecentEvent _ = a } ; Blockly . Gesture . prototype . handleBubbleStart = function ( a , b ) { goog . asserts . assert ( ! this . hasStarted _ , "Tried to call gesture.handleBubbleStart, but the gesture had already been started." ) ; this . setStartBubble ( b ) ; this . mostRecentEvent _ = a } ;
Blockly . Gesture . prototype . doBubbleClick _ = function ( ) { this . startBubble _ . setFocus && this . startBubble _ . setFocus ( ) ; this . startBubble _ . select && this . startBubble _ . select ( ) } ; Blockly . Gesture . prototype . doFieldClick _ = function ( ) { this . startField _ . showEditor _ ( ) ; this . bringBlockToFront _ ( ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Gesture . prototype . doBlockClick _ = function ( ) { this . flyout _ && this . flyout _ . autoClose ? this . targetBlock _ . disabled || ( Blockly . Events . getGroup ( ) || Blockly . Events . setGroup ( ! 0 ) , this . flyout _ . createBlock ( this . targetBlock _ ) . scheduleSnapAndBump ( ) ) : Blockly . Events . fire ( new Blockly . Events . Ui ( this . startBlock _ , "click" , void 0 , void 0 ) ) ; this . bringBlockToFront _ ( ) ; Blockly . Events . setGroup ( ! 1 ) } ; Blockly . Gesture . prototype . doWorkspaceClick _ = function ( ) { Blockly . selected && Blockly . selected . unselect ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Gesture . prototype . bringBlockToFront _ = function ( ) { this . targetBlock _ && ! this . flyout _ && this . targetBlock _ . bringToFront ( ) } ; Blockly . Gesture . prototype . setStartField = function ( a ) { goog . asserts . assert ( ! this . hasStarted _ , "Tried to call gesture.setStartField, but the gesture had already been started." ) ; this . startField _ || ( this . startField _ = a ) } ; Blockly . Gesture . prototype . setStartBubble = function ( a ) { this . startBubble _ || ( this . startBubble _ = a ) } ;
Blockly . Gesture . prototype . setStartBlock = function ( a ) { this . startBlock _ || this . startBubble _ || ( this . startBlock _ = a , a . isInFlyout && a != a . getRootBlock ( ) ? this . setTargetBlock _ ( a . getRootBlock ( ) ) : this . setTargetBlock _ ( a ) ) } ; Blockly . Gesture . prototype . setTargetBlock _ = function ( a ) { a . isShadow ( ) ? this . setTargetBlock _ ( a . getParent ( ) ) : this . targetBlock _ = a } ; Blockly . Gesture . prototype . setStartWorkspace _ = function ( a ) { this . startWorkspace _ || ( this . startWorkspace _ = a ) } ;
Blockly . Gesture . prototype . setStartFlyout _ = function ( a ) { this . flyout _ || ( this . flyout _ = a ) } ; Blockly . Gesture . prototype . isBubbleClick _ = function ( ) { return ! ! this . startBubble _ && ! this . hasExceededDragRadius _ } ; Blockly . Gesture . prototype . isBlockClick _ = function ( ) { return ! ! this . startBlock _ && ! this . hasExceededDragRadius _ && ! this . isFieldClick _ ( ) } ; Blockly . Gesture . prototype . isFieldClick _ = function ( ) { return ( this . startField _ ? this . startField _ . isCurrentlyEditable ( ) : ! 1 ) && ! this . hasExceededDragRadius _ && ( ! this . flyout _ || ! this . flyout _ . autoClose ) } ;
Blockly . Gesture . prototype . isWorkspaceClick _ = function ( ) { return ! this . startBlock _ && ! this . startBubble _ && ! this . startField _ && ! this . hasExceededDragRadius _ } ; Blockly . Gesture . prototype . isDragging = function ( ) { return this . isDraggingWorkspace _ || this . isDraggingBlock _ || this . isDraggingBubble _ } ; Blockly . Gesture . prototype . hasStarted = function ( ) { return this . hasStarted _ } ; Blockly . utils = { } ; Blockly . utils . removeAttribute = function ( a , b ) { goog . userAgent . IE && goog . userAgent . isVersion ( "10.0" ) ? a . setAttribute ( b , null ) : a . removeAttribute ( b ) } ; Blockly . utils . addClass = function ( a , b ) { var c = a . getAttribute ( "class" ) || "" ; if ( - 1 != ( " " + c + " " ) . indexOf ( " " + b + " " ) ) return ! 1 ; c && ( c += " " ) ; a . setAttribute ( "class" , c + b ) ; return ! 0 } ;
2018-01-16 21:13:23 +00:00
Blockly . utils . removeClass = function ( a , b ) { var c = a . getAttribute ( "class" ) ; if ( - 1 == ( " " + c + " " ) . indexOf ( " " + b + " " ) ) return ! 1 ; c = c . split ( /\s+/ ) ; for ( var d = 0 ; d < c . length ; d ++ ) c [ d ] && c [ d ] != b || ( c . splice ( d , 1 ) , d -- ) ; c . length ? a . setAttribute ( "class" , c . join ( " " ) ) : Blockly . utils . removeAttribute ( a , "class" ) ; return ! 0 } ; Blockly . utils . hasClass = function ( a , b ) { return - 1 != ( " " + a . getAttribute ( "class" ) + " " ) . indexOf ( " " + b + " " ) } ; Blockly . utils . noEvent = function ( a ) { a . preventDefault ( ) ; a . stopPropagation ( ) } ;
Blockly . utils . isTargetInput = function ( a ) { return "textarea" == a . target . type || "text" == a . target . type || "number" == a . target . type || "email" == a . target . type || "password" == a . target . type || "search" == a . target . type || "tel" == a . target . type || "url" == a . target . type || a . target . isContentEditable } ;
Blockly . utils . getRelativeXY = function ( a ) { var b = new goog . math . Coordinate ( 0 , 0 ) , c = a . getAttribute ( "x" ) ; c && ( b . x = parseInt ( c , 10 ) ) ; if ( c = a . getAttribute ( "y" ) ) b . y = parseInt ( c , 10 ) ; if ( c = ( c = a . getAttribute ( "transform" ) ) && c . match ( Blockly . utils . getRelativeXY . XY _REGEX _ ) ) b . x += parseFloat ( c [ 1 ] ) , c [ 3 ] && ( b . y += parseFloat ( c [ 3 ] ) ) ; ( a = a . getAttribute ( "style" ) ) && - 1 < a . indexOf ( "translate" ) && ( ( c = a . match ( Blockly . utils . getRelativeXY . XY _2D _REGEX _ ) ) || ( c = a . match ( Blockly . utils . getRelativeXY . XY _3D _REGEX _ ) ) , c && ( b . x += parseFloat ( c [ 1 ] ) , c [ 3 ] &&
2018-08-17 13:32:56 +00:00
( b . y += parseFloat ( c [ 3 ] ) ) ) ) ; return b } ; Blockly . utils . getInjectionDivXY _ = function ( a ) { for ( var b = 0 , c = 0 ; a ; ) { var d = Blockly . utils . getRelativeXY ( a ) ; b += d . x ; c += d . y ; if ( - 1 != ( " " + ( a . getAttribute ( "class" ) || "" ) + " " ) . indexOf ( " injectionDiv " ) ) break ; a = a . parentNode } return new goog . math . Coordinate ( b , c ) } ; Blockly . utils . getRelativeXY . XY _REGEX _ = /translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*\))?/ ; Blockly . utils . getRelativeXY . XY _3D _REGEX _ = /transform:\s*translate3d\(\s*([-+\d.e]+)px([ ,]\s*([-+\d.e]+)\s*)px([ ,]\s*([-+\d.e]+)\s*)px\)?/ ;
Blockly . utils . getRelativeXY . XY _2D _REGEX _ = /transform:\s*translate\(\s*([-+\d.e]+)px([ ,]\s*([-+\d.e]+)\s*)px\)?/ ; Blockly . utils . createSvgElement = function ( a , b , c ) { a = document . createElementNS ( Blockly . SVG _NS , a ) ; for ( var d in b ) a . setAttribute ( d , b [ d ] ) ; document . body . runtimeStyle && ( a . runtimeStyle = a . currentStyle = a . style ) ; c && c . appendChild ( a ) ; return a } ; Blockly . utils . isRightButton = function ( a ) { return a . ctrlKey && goog . userAgent . MAC ? ! 0 : 2 == a . button } ;
Blockly . utils . mouseToSvg = function ( a , b , c ) { var d = b . createSVGPoint ( ) ; d . x = a . clientX ; d . y = a . clientY ; c || ( c = b . getScreenCTM ( ) . inverse ( ) ) ; return d . matrixTransform ( c ) } ; Blockly . utils . shortestStringLength = function ( a ) { return a . length ? a . reduce ( function ( a , c ) { return a . length < c . length ? a : c } ) . length : 0 } ;
Blockly . utils . commonWordPrefix = function ( a , b ) { if ( ! a . length ) return 0 ; if ( 1 == a . length ) return a [ 0 ] . length ; for ( var c = 0 , d = b || Blockly . utils . shortestStringLength ( a ) , e = 0 ; e < d ; e ++ ) { for ( var f = a [ 0 ] [ e ] , g = 1 ; g < a . length ; g ++ ) if ( f != a [ g ] [ e ] ) return c ; " " == f && ( c = e + 1 ) } for ( g = 1 ; g < a . length ; g ++ ) if ( ( f = a [ g ] [ e ] ) && " " != f ) return c ; return d } ;
2018-01-16 21:13:23 +00:00
Blockly . utils . commonWordSuffix = function ( a , b ) { if ( ! a . length ) return 0 ; if ( 1 == a . length ) return a [ 0 ] . length ; for ( var c = 0 , d = b || Blockly . utils . shortestStringLength ( a ) , e = 0 ; e < d ; e ++ ) { for ( var f = a [ 0 ] . substr ( - e - 1 , 1 ) , g = 1 ; g < a . length ; g ++ ) if ( f != a [ g ] . substr ( - e - 1 , 1 ) ) return c ; " " == f && ( c = e + 1 ) } for ( g = 1 ; g < a . length ; g ++ ) if ( ( f = a [ g ] . charAt ( a [ g ] . length - e - 1 ) ) && " " != f ) return c ; return d } ; Blockly . utils . tokenizeInterpolation = function ( a ) { return Blockly . utils . tokenizeInterpolation _ ( a , ! 0 ) } ;
Blockly . utils . replaceMessageReferences = function ( a ) { if ( ! goog . isString ( a ) ) return a ; a = Blockly . utils . tokenizeInterpolation _ ( a , ! 1 ) ; return a . length ? a [ 0 ] : "" } ;
2018-08-17 13:32:56 +00:00
Blockly . utils . checkMessageReferences = function ( a ) { for ( var b = ! 0 , c = Blockly . Msg , d = /%{(BKY_[A-Z][A-Z0-9_]*)}/gi , e = d . exec ( a ) ; e ; ) { var f = e [ 1 ] ; f = f . toUpperCase ( ) ; "BKY_" != f . substr ( 0 , 4 ) ? ( console . log ( "WARNING: Unsupported message table prefix in %{" + e [ 1 ] + "}." ) , b = ! 1 ) : void 0 == c [ f . substr ( 4 ) ] && ( console . log ( "WARNING: No message string for %{" + e [ 1 ] + "}." ) , b = ! 1 ) ; a = a . substring ( e . index + f . length + 1 ) ; e = d . exec ( a ) } return b } ;
2018-01-16 21:13:23 +00:00
Blockly . utils . tokenizeInterpolation _ = function ( a , b ) { var c = [ ] , d = a . split ( "" ) ; d . push ( "" ) ; for ( var e = 0 , f = [ ] , g = null , h = 0 ; h < d . length ; h ++ ) { var k = d [ h ] ; 0 == e ? "%" == k ? ( ( k = f . join ( "" ) ) && c . push ( k ) , f . length = 0 , e = 1 ) : f . push ( k ) : 1 == e ? "%" == k ? ( f . push ( k ) , e = 0 ) : b && "0" <= k && "9" >= k ? ( e = 2 , g = k , ( k = f . join ( "" ) ) && c . push ( k ) , f . length = 0 ) : "{" == k ? e = 3 : ( f . push ( "%" , k ) , e = 0 ) : 2 == e ? "0" <= k && "9" >= k ? g += k : ( c . push ( parseInt ( g , 10 ) ) , h -- , e = 0 ) : 3 == e && ( "" == k ? ( f . splice ( 0 , 0 , "%{" ) , h -- , e = 0 ) : "}" != k ? f . push ( k ) : ( e = f . join ( "" ) , /[a-zA-Z][a-zA-Z0-9_]*/ . test ( e ) ? ( k = e . toUpperCase ( ) ,
2018-08-17 13:32:56 +00:00
( k = goog . string . startsWith ( k , "BKY_" ) ? k . substring ( 4 ) : null ) && k in Blockly . Msg ? ( e = Blockly . Msg [ k ] , goog . isString ( e ) ? Array . prototype . push . apply ( c , Blockly . utils . tokenizeInterpolation _ ( e , b ) ) : b ? c . push ( String ( e ) ) : c . push ( e ) ) : c . push ( "%{" + e + "}" ) ) : c . push ( "%{" + e + "}" ) , e = f . length = 0 ) ) } ( k = f . join ( "" ) ) && c . push ( k ) ; d = [ ] ; for ( h = f . length = 0 ; h < c . length ; ++ h ) "string" == typeof c [ h ] ? f . push ( c [ h ] ) : ( ( k = f . join ( "" ) ) && d . push ( k ) , f . length = 0 , d . push ( c [ h ] ) ) ; ( k = f . join ( "" ) ) && d . push ( k ) ; f . length = 0 ; return d } ;
2018-01-16 21:13:23 +00:00
Blockly . utils . genUid = function ( ) { for ( var a = Blockly . utils . genUid . soup _ . length , b = [ ] , c = 0 ; 20 > c ; c ++ ) b [ c ] = Blockly . utils . genUid . soup _ . charAt ( Math . random ( ) * a ) ; return b . join ( "" ) } ; Blockly . utils . genUid . soup _ = "!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ; Blockly . utils . wrap = function ( a , b ) { for ( var c = a . split ( "\n" ) , d = 0 ; d < c . length ; d ++ ) c [ d ] = Blockly . utils . wrapLine _ ( c [ d ] , b ) ; return c . join ( "\n" ) } ;
2018-08-17 13:32:56 +00:00
Blockly . utils . wrapLine _ = function ( a , b ) { if ( a . length <= b ) return a ; for ( var c = a . trim ( ) . split ( /\s+/ ) , d = 0 ; d < c . length ; d ++ ) c [ d ] . length > b && ( b = c [ d ] . length ) ; d = - Infinity ; var e = 1 ; do { var f = d ; var g = a ; var h = [ ] , k = c . length / e , l = 1 ; for ( d = 0 ; d < c . length - 1 ; d ++ ) l < ( d + 1.5 ) / k ? ( l ++ , h [ d ] = ! 0 ) : h [ d ] = ! 1 ; h = Blockly . utils . wrapMutate _ ( c , h , b ) ; d = Blockly . utils . wrapScore _ ( c , h , b ) ; a = Blockly . utils . wrapToText _ ( c , h ) ; e ++ } while ( d > f ) ; return g } ;
2018-01-16 21:13:23 +00:00
Blockly . utils . wrapScore _ = function ( a , b , c ) { for ( var d = [ 0 ] , e = [ ] , f = 0 ; f < a . length ; f ++ ) d [ d . length - 1 ] += a [ f ] . length , ! 0 === b [ f ] ? ( d . push ( 0 ) , e . push ( a [ f ] . charAt ( a [ f ] . length - 1 ) ) ) : ! 1 === b [ f ] && d [ d . length - 1 ] ++ ; a = Math . max . apply ( Math , d ) ; for ( f = b = 0 ; f < d . length ; f ++ ) b -= 2 * Math . pow ( Math . abs ( c - d [ f ] ) , 1.5 ) , b -= Math . pow ( a - d [ f ] , 1.5 ) , - 1 != ".?!" . indexOf ( e [ f ] ) ? b += c / 3 : - 1 != ",;)]}" . indexOf ( e [ f ] ) && ( b += c / 4 ) ; 1 < d . length && d [ d . length - 1 ] <= d [ d . length - 2 ] && ( b += . 5 ) ; return b } ;
Blockly . utils . wrapMutate _ = function ( a , b , c ) { for ( var d = Blockly . utils . wrapScore _ ( a , b , c ) , e , f = 0 ; f < b . length - 1 ; f ++ ) if ( b [ f ] != b [ f + 1 ] ) { var g = [ ] . concat ( b ) ; g [ f ] = ! g [ f ] ; g [ f + 1 ] = ! g [ f + 1 ] ; var h = Blockly . utils . wrapScore _ ( a , g , c ) ; h > d && ( d = h , e = g ) } return e ? Blockly . utils . wrapMutate _ ( a , e , c ) : b } ; Blockly . utils . wrapToText _ = function ( a , b ) { for ( var c = [ ] , d = 0 ; d < a . length ; d ++ ) c . push ( a [ d ] ) , void 0 !== b [ d ] && c . push ( b [ d ] ? "\n" : " " ) ; return c . join ( "" ) } ;
Blockly . utils . is3dSupported = function ( ) { if ( void 0 !== Blockly . utils . is3dSupported . cached _ ) return Blockly . utils . is3dSupported . cached _ ; if ( ! goog . global . getComputedStyle ) return ! 1 ; var a = document . createElement ( "p" ) , b = "none" , c = { webkitTransform : "-webkit-transform" , OTransform : "-o-transform" , msTransform : "-ms-transform" , MozTransform : "-moz-transform" , transform : "transform" } ; document . body . insertBefore ( a , null ) ; for ( var d in c ) if ( void 0 !== a . style [ d ] ) { a . style [ d ] = "translate3d(1px,1px,1px)" ; b = goog . global . getComputedStyle ( a ) ;
if ( ! b ) return document . body . removeChild ( a ) , ! 1 ; b = b . getPropertyValue ( c [ d ] ) } document . body . removeChild ( a ) ; Blockly . utils . is3dSupported . cached _ = "none" !== b ; return Blockly . utils . is3dSupported . cached _ } ; Blockly . utils . insertAfter _ = function ( a , b ) { var c = b . nextSibling , d = b . parentNode ; if ( ! d ) throw "Reference node has no parent." ; c ? d . insertBefore ( a , c ) : d . appendChild ( a ) } ;
2018-08-17 13:32:56 +00:00
Blockly . utils . runAfterPageLoad = function ( a ) { if ( "object" != typeof document ) throw Error ( "Blockly.utils.runAfterPageLoad() requires browser document." ) ; if ( "complete" === document . readyState ) a ( ) ; else var b = setInterval ( function ( ) { "complete" === document . readyState && ( clearInterval ( b ) , a ( ) ) } , 10 ) } ; Blockly . utils . setCssTransform = function ( a , b ) { a . style . transform = b ; a . style [ "-webkit-transform" ] = b } ;
2018-01-16 21:13:23 +00:00
Blockly . utils . getViewportBBox = function ( ) { var a = goog . dom . getViewportSize ( ) , b = goog . style . getViewportPageOffset ( document ) ; return { right : a . width + b . x , bottom : a . height + b . y , top : b . y , left : b . x } } ; Blockly . Grid = function ( a , b ) { this . gridPattern _ = a ; this . spacing _ = b . spacing ; this . length _ = b . length ; this . line2 _ = ( this . line1 _ = a . firstChild ) && this . line1 _ . nextSibling ; this . snapToGrid _ = b . snap } ; Blockly . Grid . prototype . scale _ = 1 ; Blockly . Grid . prototype . dispose = function ( ) { this . gridPattern _ = null } ; Blockly . Grid . prototype . shouldSnap = function ( ) { return this . snapToGrid _ } ; Blockly . Grid . prototype . getSpacing = function ( ) { return this . spacing _ } ; Blockly . Grid . prototype . getPatternId = function ( ) { return this . gridPattern _ . id } ;
Blockly . Grid . prototype . update = function ( a ) { this . scale _ = a ; var b = this . spacing _ * a || 100 ; this . gridPattern _ . setAttribute ( "width" , b ) ; this . gridPattern _ . setAttribute ( "height" , b ) ; b = Math . floor ( this . spacing _ / 2 ) + . 5 ; var c = b - this . length _ / 2 , d = b + this . length _ / 2 ; b *= a ; c *= a ; d *= a ; this . setLineAttributes _ ( this . line1 _ , a , c , d , b , b ) ; this . setLineAttributes _ ( this . line2 _ , a , b , b , c , d ) } ;
Blockly . Grid . prototype . setLineAttributes _ = function ( a , b , c , d , e , f ) { a && ( a . setAttribute ( "stroke-width" , b ) , a . setAttribute ( "x1" , c ) , a . setAttribute ( "y1" , e ) , a . setAttribute ( "x2" , d ) , a . setAttribute ( "y2" , f ) ) } ; Blockly . Grid . prototype . moveTo = function ( a , b ) { this . gridPattern _ . setAttribute ( "x" , a ) ; this . gridPattern _ . setAttribute ( "y" , b ) ; ( goog . userAgent . IE || goog . userAgent . EDGE ) && this . update ( this . scale _ ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Grid . createDom = function ( a , b , c ) { a = Blockly . utils . createSvgElement ( "pattern" , { id : "blocklyGridPattern" + a , patternUnits : "userSpaceOnUse" } , c ) ; 0 < b . length && 0 < b . spacing ? ( Blockly . utils . createSvgElement ( "line" , { stroke : b . colour } , a ) , 1 < b . length && Blockly . utils . createSvgElement ( "line" , { stroke : b . colour } , a ) ) : Blockly . utils . createSvgElement ( "line" , { } , a ) ; return a } ; Blockly . Options = function ( a ) { var b = ! ! a . readOnly ; if ( b ) var c = null , d = ! 1 , e = ! 1 , f = ! 1 , g = ! 1 , h = ! 1 , k = ! 1 ; else c = Blockly . Options . parseToolboxTree ( a . toolbox ) , d = ! ( ! c || ! c . getElementsByTagName ( "category" ) . length ) , e = a . trashcan , void 0 === e && ( e = d ) , f = a . collapse , void 0 === f && ( f = d ) , g = a . comments , void 0 === g && ( g = d ) , h = a . disable , void 0 === h && ( h = d ) , k = a . sounds , void 0 === k && ( k = ! 0 ) ; var l = ! ! a . rtl , n = a . horizontalLayout ; void 0 === n && ( n = ! 1 ) ; var m = a . toolboxPosition ; m = "end" === m ? ! 1 : ! 0 ; m = n ? m ? Blockly . TOOLBOX _AT _TOP : Blockly . TOOLBOX _AT _BOTTOM : m ==
l ? Blockly . TOOLBOX _AT _RIGHT : Blockly . TOOLBOX _AT _LEFT ; var p = a . scrollbars ; void 0 === p && ( p = d ) ; var q = a . css ; void 0 === q && ( q = ! 0 ) ; var t = "https://blockly-demo.appspot.com/static/media/" ; a . media ? t = a . media : a . path && ( t = a . path + "media/" ) ; var r = void 0 === a . oneBasedIndex ? ! 0 : ! ! a . oneBasedIndex ; this . RTL = l ; this . oneBasedIndex = r ; this . collapse = f ; this . comments = g ; this . disable = h ; this . readOnly = b ; this . maxBlocks = a . maxBlocks || Infinity ; this . pathToMedia = t ; this . hasCategories = d ; this . hasScrollbars = p ; this . hasTrashcan = e ; this . hasSounds = k ;
this . hasCss = q ; this . horizontalLayout = n ; this . languageTree = c ; this . gridOptions = Blockly . Options . parseGridOptions _ ( a ) ; this . zoomOptions = Blockly . Options . parseZoomOptions _ ( a ) ; this . toolboxPosition = m } ; Blockly . Options . prototype . parentWorkspace = null ; Blockly . Options . prototype . setMetrics = null ; Blockly . Options . prototype . getMetrics = null ;
2017-09-25 09:37:41 +00:00
Blockly . Options . parseZoomOptions _ = function ( a ) { a = a . zoom || { } ; var b = { } ; b . controls = void 0 === a . controls ? ! 1 : ! ! a . controls ; b . wheel = void 0 === a . wheel ? ! 1 : ! ! a . wheel ; b . startScale = void 0 === a . startScale ? 1 : parseFloat ( a . startScale ) ; b . maxScale = void 0 === a . maxScale ? 3 : parseFloat ( a . maxScale ) ; b . minScale = void 0 === a . minScale ? . 3 : parseFloat ( a . minScale ) ; b . scaleSpeed = void 0 === a . scaleSpeed ? 1.2 : parseFloat ( a . scaleSpeed ) ; return b } ;
2018-01-16 21:13:23 +00:00
Blockly . Options . parseGridOptions _ = function ( a ) { a = a . grid || { } ; var b = { } ; b . spacing = parseFloat ( a . spacing ) || 0 ; b . colour = a . colour || "#888" ; b . length = parseFloat ( a . length ) || 1 ; b . snap = 0 < b . spacing && ! ! a . snap ; return b } ; Blockly . Options . parseToolboxTree = function ( a ) { a ? ( "string" != typeof a && ( "undefined" == typeof XSLTProcessor && a . outerHTML ? a = a . outerHTML : a instanceof Element || ( a = null ) ) , "string" == typeof a && ( a = Blockly . Xml . textToDom ( a ) ) ) : a = null ; return a } ; Blockly . ScrollbarPair = function ( a ) { this . workspace _ = a ; this . hScroll = new Blockly . Scrollbar ( a , ! 0 , ! 0 , "blocklyMainWorkspaceScrollbar" ) ; this . vScroll = new Blockly . Scrollbar ( a , ! 1 , ! 0 , "blocklyMainWorkspaceScrollbar" ) ; this . corner _ = Blockly . utils . createSvgElement ( "rect" , { height : Blockly . Scrollbar . scrollbarThickness , width : Blockly . Scrollbar . scrollbarThickness , "class" : "blocklyScrollbarBackground" } , null ) ; Blockly . utils . insertAfter _ ( this . corner _ , a . getBubbleCanvas ( ) ) } ; Blockly . ScrollbarPair . prototype . oldHostMetrics _ = null ;
2017-09-25 09:37:41 +00:00
Blockly . ScrollbarPair . prototype . dispose = function ( ) { goog . dom . removeNode ( this . corner _ ) ; this . oldHostMetrics _ = this . workspace _ = this . corner _ = null ; this . hScroll . dispose ( ) ; this . hScroll = null ; this . vScroll . dispose ( ) ; this . vScroll = null } ;
Blockly . ScrollbarPair . prototype . resize = function ( ) { var a = this . workspace _ . getMetrics ( ) ; if ( a ) { var b = ! 1 , c = ! 1 ; this . oldHostMetrics _ && this . oldHostMetrics _ . viewWidth == a . viewWidth && this . oldHostMetrics _ . viewHeight == a . viewHeight && this . oldHostMetrics _ . absoluteTop == a . absoluteTop && this . oldHostMetrics _ . absoluteLeft == a . absoluteLeft ? ( this . oldHostMetrics _ && this . oldHostMetrics _ . contentWidth == a . contentWidth && this . oldHostMetrics _ . viewLeft == a . viewLeft && this . oldHostMetrics _ . contentLeft == a . contentLeft || ( b = ! 0 ) , this . oldHostMetrics _ &&
this . oldHostMetrics _ . contentHeight == a . contentHeight && this . oldHostMetrics _ . viewTop == a . viewTop && this . oldHostMetrics _ . contentTop == a . contentTop || ( c = ! 0 ) ) : c = b = ! 0 ; b && this . hScroll . resize ( a ) ; c && this . vScroll . resize ( a ) ; this . oldHostMetrics _ && this . oldHostMetrics _ . viewWidth == a . viewWidth && this . oldHostMetrics _ . absoluteLeft == a . absoluteLeft || this . corner _ . setAttribute ( "x" , this . vScroll . position _ . x ) ; this . oldHostMetrics _ && this . oldHostMetrics _ . viewHeight == a . viewHeight && this . oldHostMetrics _ . absoluteTop == a . absoluteTop || this . corner _ . setAttribute ( "y" ,
this . hScroll . position _ . y ) ; this . oldHostMetrics _ = a } } ; Blockly . ScrollbarPair . prototype . set = function ( a , b ) { var c = { } , d = a * this . hScroll . ratio _ , e = b * this . vScroll . ratio _ , f = this . vScroll . scrollViewSize _ ; c . x = this . getRatio _ ( d , this . hScroll . scrollViewSize _ ) ; c . y = this . getRatio _ ( e , f ) ; this . workspace _ . setMetrics ( c ) ; this . hScroll . setHandlePosition ( d ) ; this . vScroll . setHandlePosition ( e ) } ; Blockly . ScrollbarPair . prototype . getRatio _ = function ( a , b ) { var c = a / b ; return isNaN ( c ) ? 0 : c } ;
2018-08-17 13:32:56 +00:00
Blockly . Scrollbar = function ( a , b , c , d ) { this . workspace _ = a ; this . pair _ = c || ! 1 ; this . horizontal _ = b ; this . oldHostMetrics _ = null ; this . createDom _ ( d ) ; this . position _ = new goog . math . Coordinate ( 0 , 0 ) ; a = Blockly . Scrollbar . scrollbarThickness ; b ? ( this . svgBackground _ . setAttribute ( "height" , a ) , this . outerSvg _ . setAttribute ( "height" , a ) , this . svgHandle _ . setAttribute ( "height" , a - 5 ) , this . svgHandle _ . setAttribute ( "y" , 2.5 ) , this . lengthAttribute _ = "width" , this . positionAttribute _ = "x" ) : ( this . svgBackground _ . setAttribute ( "width" , a ) , this . outerSvg _ . setAttribute ( "width" ,
a ) , this . svgHandle _ . setAttribute ( "width" , a - 5 ) , this . svgHandle _ . setAttribute ( "x" , 2.5 ) , this . lengthAttribute _ = "height" , this . positionAttribute _ = "y" ) ; this . onMouseDownBarWrapper _ = Blockly . bindEventWithChecks _ ( this . svgBackground _ , "mousedown" , this , this . onMouseDownBar _ ) ; this . onMouseDownHandleWrapper _ = Blockly . bindEventWithChecks _ ( this . svgHandle _ , "mousedown" , this , this . onMouseDownHandle _ ) } ; Blockly . Scrollbar . prototype . origin _ = new goog . math . Coordinate ( 0 , 0 ) ; Blockly . Scrollbar . prototype . startDragMouse _ = 0 ;
Blockly . Scrollbar . prototype . scrollViewSize _ = 0 ; Blockly . Scrollbar . prototype . handleLength _ = 0 ; Blockly . Scrollbar . prototype . handlePosition _ = 0 ; Blockly . Scrollbar . prototype . isVisible _ = ! 0 ; Blockly . Scrollbar . prototype . containerVisible _ = ! 0 ; Blockly . Scrollbar . scrollbarThickness = 15 ; goog . events . BrowserFeature . TOUCH _ENABLED && ( Blockly . Scrollbar . scrollbarThickness = 25 ) ;
Blockly . Scrollbar . metricsAreEquivalent _ = function ( a , b ) { return a && b && a . viewWidth == b . viewWidth && a . viewHeight == b . viewHeight && a . viewLeft == b . viewLeft && a . viewTop == b . viewTop && a . absoluteTop == b . absoluteTop && a . absoluteLeft == b . absoluteLeft && a . contentWidth == b . contentWidth && a . contentHeight == b . contentHeight && a . contentLeft == b . contentLeft && a . contentTop == b . contentTop ? ! 0 : ! 1 } ;
2017-09-25 09:37:41 +00:00
Blockly . Scrollbar . prototype . dispose = function ( ) { this . cleanUp _ ( ) ; Blockly . unbindEvent _ ( this . onMouseDownBarWrapper _ ) ; this . onMouseDownBarWrapper _ = null ; Blockly . unbindEvent _ ( this . onMouseDownHandleWrapper _ ) ; this . onMouseDownHandleWrapper _ = null ; goog . dom . removeNode ( this . outerSvg _ ) ; this . workspace _ = this . svgHandle _ = this . svgBackground _ = this . svgGroup _ = this . outerSvg _ = null } ; Blockly . Scrollbar . prototype . setHandleLength _ = function ( a ) { this . handleLength _ = a ; this . svgHandle _ . setAttribute ( this . lengthAttribute _ , this . handleLength _ ) } ;
Blockly . Scrollbar . prototype . setHandlePosition = function ( a ) { this . handlePosition _ = a ; this . svgHandle _ . setAttribute ( this . positionAttribute _ , this . handlePosition _ ) } ; Blockly . Scrollbar . prototype . setScrollViewSize _ = function ( a ) { this . scrollViewSize _ = a ; this . outerSvg _ . setAttribute ( this . lengthAttribute _ , this . scrollViewSize _ ) ; this . svgBackground _ . setAttribute ( this . lengthAttribute _ , this . scrollViewSize _ ) } ; Blockly . ScrollbarPair . prototype . setContainerVisible = function ( a ) { this . hScroll . setContainerVisible ( a ) ; this . vScroll . setContainerVisible ( a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Scrollbar . prototype . setPosition _ = function ( a , b ) { this . position _ . x = a ; this . position _ . y = b ; Blockly . utils . setCssTransform ( this . outerSvg _ , "translate(" + ( this . position _ . x + this . origin _ . x ) + "px," + ( this . position _ . y + this . origin _ . y ) + "px)" ) } ; Blockly . Scrollbar . prototype . resize = function ( a ) { if ( ! a && ( a = this . workspace _ . getMetrics ( ) , ! a ) ) return ; Blockly . Scrollbar . metricsAreEquivalent _ ( a , this . oldHostMetrics _ ) || ( this . oldHostMetrics _ = a , this . horizontal _ ? this . resizeHorizontal _ ( a ) : this . resizeVertical _ ( a ) , this . onScroll _ ( ) ) } ;
Blockly . Scrollbar . prototype . resizeHorizontal _ = function ( a ) { this . resizeViewHorizontal ( a ) } ; Blockly . Scrollbar . prototype . resizeViewHorizontal = function ( a ) { var b = a . viewWidth - 1 ; this . pair _ && ( b -= Blockly . Scrollbar . scrollbarThickness ) ; this . setScrollViewSize _ ( Math . max ( 0 , b ) ) ; b = a . absoluteLeft + . 5 ; this . pair _ && this . workspace _ . RTL && ( b += Blockly . Scrollbar . scrollbarThickness ) ; this . setPosition _ ( b , a . absoluteTop + a . viewHeight - Blockly . Scrollbar . scrollbarThickness - . 5 ) ; this . resizeContentHorizontal ( a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Scrollbar . prototype . resizeContentHorizontal = function ( a ) { this . pair _ || this . setVisible ( this . scrollViewSize _ < a . contentWidth ) ; this . ratio _ = this . scrollViewSize _ / a . contentWidth ; if ( - Infinity == this . ratio _ || Infinity == this . ratio _ || isNaN ( this . ratio _ ) ) this . ratio _ = 0 ; this . setHandleLength _ ( Math . max ( 0 , a . viewWidth * this . ratio _ ) ) ; this . setHandlePosition ( this . constrainHandle _ ( ( a . viewLeft - a . contentLeft ) * this . ratio _ ) ) } ; Blockly . Scrollbar . prototype . resizeVertical _ = function ( a ) { this . resizeViewVertical ( a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Scrollbar . prototype . resizeViewVertical = function ( a ) { var b = a . viewHeight - 1 ; this . pair _ && ( b -= Blockly . Scrollbar . scrollbarThickness ) ; this . setScrollViewSize _ ( Math . max ( 0 , b ) ) ; b = a . absoluteLeft + . 5 ; this . workspace _ . RTL || ( b += a . viewWidth - Blockly . Scrollbar . scrollbarThickness - 1 ) ; this . setPosition _ ( b , a . absoluteTop + . 5 ) ; this . resizeContentVertical ( a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Scrollbar . prototype . resizeContentVertical = function ( a ) { this . pair _ || this . setVisible ( this . scrollViewSize _ < a . contentHeight ) ; this . ratio _ = this . scrollViewSize _ / a . contentHeight ; if ( - Infinity == this . ratio _ || Infinity == this . ratio _ || isNaN ( this . ratio _ ) ) this . ratio _ = 0 ; this . setHandleLength _ ( Math . max ( 0 , a . viewHeight * this . ratio _ ) ) ; this . setHandlePosition ( this . constrainHandle _ ( ( a . viewTop - a . contentTop ) * this . ratio _ ) ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Scrollbar . prototype . createDom _ = function ( a ) { var b = "blocklyScrollbar" + ( this . horizontal _ ? "Horizontal" : "Vertical" ) ; a && ( b += " " + a ) ; this . outerSvg _ = Blockly . utils . createSvgElement ( "svg" , { "class" : b } , null ) ; this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { } , this . outerSvg _ ) ; this . svgBackground _ = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyScrollbarBackground" } , this . svgGroup _ ) ; a = Math . floor ( ( Blockly . Scrollbar . scrollbarThickness - 5 ) / 2 ) ; this . svgHandle _ = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyScrollbarHandle" ,
2017-09-25 09:37:41 +00:00
rx : a , ry : a } , this . svgGroup _ ) ; Blockly . utils . insertAfter _ ( this . outerSvg _ , this . workspace _ . getParentSvg ( ) ) } ; Blockly . Scrollbar . prototype . isVisible = function ( ) { return this . isVisible _ } ; Blockly . Scrollbar . prototype . setContainerVisible = function ( a ) { var b = a != this . containerVisible _ ; this . containerVisible _ = a ; b && this . updateDisplay _ ( ) } ; Blockly . Scrollbar . prototype . setVisible = function ( a ) { var b = a != this . isVisible ( ) ; if ( this . pair _ ) throw "Unable to toggle visibility of paired scrollbars." ; this . isVisible _ = a ; b && this . updateDisplay _ ( ) } ;
Blockly . Scrollbar . prototype . updateDisplay _ = function ( ) { this . containerVisible _ && this . isVisible ( ) ? this . outerSvg _ . setAttribute ( "display" , "block" ) : this . outerSvg _ . setAttribute ( "display" , "none" ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Scrollbar . prototype . onMouseDownBar _ = function ( a ) { this . workspace _ . markFocused ( ) ; Blockly . Touch . clearTouchIdentifier ( ) ; this . cleanUp _ ( ) ; if ( Blockly . utils . isRightButton ( a ) ) a . stopPropagation ( ) ; else { var b = Blockly . utils . mouseToSvg ( a , this . workspace _ . getParentSvg ( ) , this . workspace _ . getInverseScreenCTM ( ) ) ; b = this . horizontal _ ? b . x : b . y ; var c = Blockly . utils . getInjectionDivXY _ ( this . svgHandle _ ) ; c = this . horizontal _ ? c . x : c . y ; var d = this . handlePosition _ , e = . 95 * this . handleLength _ ; b <= c ? d -= e : b >= c + this . handleLength _ && ( d +=
e ) ; this . setHandlePosition ( this . constrainHandle _ ( d ) ) ; this . onScroll _ ( ) ; a . stopPropagation ( ) ; a . preventDefault ( ) } } ;
Blockly . Scrollbar . prototype . onMouseDownHandle _ = function ( a ) { this . workspace _ . markFocused ( ) ; this . cleanUp _ ( ) ; Blockly . utils . isRightButton ( a ) ? a . stopPropagation ( ) : ( this . startDragHandle = this . handlePosition _ , this . workspace _ . setupDragSurface ( ) , this . startDragMouse _ = this . horizontal _ ? a . clientX : a . clientY , Blockly . Scrollbar . onMouseUpWrapper _ = Blockly . bindEventWithChecks _ ( document , "mouseup" , this , this . onMouseUpHandle _ ) , Blockly . Scrollbar . onMouseMoveWrapper _ = Blockly . bindEventWithChecks _ ( document , "mousemove" , this , this . onMouseMoveHandle _ ) ,
a . stopPropagation ( ) , a . preventDefault ( ) ) } ; Blockly . Scrollbar . prototype . onMouseMoveHandle _ = function ( a ) { this . setHandlePosition ( this . constrainHandle _ ( this . startDragHandle + ( ( this . horizontal _ ? a . clientX : a . clientY ) - this . startDragMouse _ ) ) ) ; this . onScroll _ ( ) } ; Blockly . Scrollbar . prototype . onMouseUpHandle _ = function ( ) { this . workspace _ . resetDragSurface ( ) ; Blockly . Touch . clearTouchIdentifier ( ) ; this . cleanUp _ ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Scrollbar . prototype . cleanUp _ = function ( ) { Blockly . hideChaff ( ! 0 ) ; Blockly . Scrollbar . onMouseUpWrapper _ && ( Blockly . unbindEvent _ ( Blockly . Scrollbar . onMouseUpWrapper _ ) , Blockly . Scrollbar . onMouseUpWrapper _ = null ) ; Blockly . Scrollbar . onMouseMoveWrapper _ && ( Blockly . unbindEvent _ ( Blockly . Scrollbar . onMouseMoveWrapper _ ) , Blockly . Scrollbar . onMouseMoveWrapper _ = null ) } ;
Blockly . Scrollbar . prototype . constrainHandle _ = function ( a ) { return a = 0 >= a || isNaN ( a ) || this . scrollViewSize _ < this . handleLength _ ? 0 : Math . min ( a , this . scrollViewSize _ - this . handleLength _ ) } ; Blockly . Scrollbar . prototype . onScroll _ = function ( ) { var a = this . handlePosition _ / this . scrollViewSize _ ; isNaN ( a ) && ( a = 0 ) ; var b = { } ; this . horizontal _ ? b . x = a : b . y = a ; this . workspace _ . setMetrics ( b ) } ; Blockly . Scrollbar . prototype . set = function ( a ) { this . setHandlePosition ( this . constrainHandle _ ( a * this . ratio _ ) ) ; this . onScroll _ ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Scrollbar . prototype . setOrigin = function ( a , b ) { this . origin _ = new goog . math . Coordinate ( a , b ) } ; Blockly . TouchGesture = function ( a , b ) { Blockly . TouchGesture . superClass _ . constructor . call ( this , a , b ) ; this . isMultiTouch _ = ! 1 ; this . cachedPoints _ = { } ; this . startDistance _ = this . previousScale _ = 0 ; this . onStartWrapper _ = null } ; goog . inherits ( Blockly . TouchGesture , Blockly . Gesture ) ; Blockly . TouchGesture . ZOOM _IN _MULTIPLIER = 5 ; Blockly . TouchGesture . ZOOM _OUT _MULTIPLIER = 6 ; Blockly . TouchGesture . prototype . doStart = function ( a ) { Blockly . TouchGesture . superClass _ . doStart . call ( this , a ) ; ! this . isEnding _ && Blockly . Touch . isTouchEvent ( a ) && this . handleTouchStart ( a ) } ;
Blockly . TouchGesture . prototype . bindMouseEvents = function ( a ) { this . onStartWrapper _ = Blockly . bindEventWithChecks _ ( document , "mousedown" , null , this . handleStart . bind ( this ) , ! 0 ) ; this . onMoveWrapper _ = Blockly . bindEventWithChecks _ ( document , "mousemove" , null , this . handleMove . bind ( this ) , ! 0 ) ; this . onUpWrapper _ = Blockly . bindEventWithChecks _ ( document , "mouseup" , null , this . handleUp . bind ( this ) , ! 0 ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } ;
Blockly . TouchGesture . prototype . handleStart = function ( a ) { ! this . isDragging ( ) && Blockly . Touch . isTouchEvent ( a ) && ( this . handleTouchStart ( a ) , this . isMultiTouch ( ) && Blockly . longStop _ ( ) ) } ; Blockly . TouchGesture . prototype . handleMove = function ( a ) { this . isDragging ( ) ? Blockly . Touch . shouldHandleEvent ( a ) && Blockly . TouchGesture . superClass _ . handleMove . call ( this , a ) : this . isMultiTouch ( ) ? ( Blockly . Touch . isTouchEvent ( a ) && this . handleTouchMove ( a ) , Blockly . longStop _ ( ) ) : Blockly . TouchGesture . superClass _ . handleMove . call ( this , a ) } ;
Blockly . TouchGesture . prototype . handleUp = function ( a ) { Blockly . Touch . isTouchEvent ( a ) && ! this . isDragging ( ) && this . handleTouchEnd ( a ) ; ! this . isMultiTouch ( ) || this . isDragging ( ) ? Blockly . Touch . shouldHandleEvent ( a ) && Blockly . TouchGesture . superClass _ . handleUp . call ( this , a ) : ( a . preventDefault ( ) , a . stopPropagation ( ) , this . dispose ( ) ) } ; Blockly . TouchGesture . prototype . isMultiTouch = function ( ) { return this . isMultiTouch _ } ;
Blockly . TouchGesture . prototype . dispose = function ( ) { Blockly . TouchGesture . superClass _ . dispose . call ( this ) ; this . onStartWrapper _ && Blockly . unbindEvent _ ( this . onStartWrapper _ ) } ; Blockly . TouchGesture . prototype . handleTouchStart = function ( a ) { var b = Blockly . Touch . getTouchIdentifierFromEvent ( a ) ; this . cachedPoints _ [ b ] = this . getTouchPoint ( a ) ; b = Object . keys ( this . cachedPoints _ ) ; 2 == b . length && ( this . startDistance _ = goog . math . Coordinate . distance ( this . cachedPoints _ [ b [ 0 ] ] , this . cachedPoints _ [ b [ 1 ] ] ) , this . isMultiTouch _ = ! 0 , a . preventDefault ( ) ) } ;
Blockly . TouchGesture . prototype . handleTouchMove = function ( a ) { var b = Blockly . Touch . getTouchIdentifierFromEvent ( a ) ; this . cachedPoints _ [ b ] = this . getTouchPoint ( a ) ; b = Object . keys ( this . cachedPoints _ ) ; if ( 2 == b . length ) { b = this . touchScale _ = goog . math . Coordinate . distance ( this . cachedPoints _ [ b [ 0 ] ] , this . cachedPoints _ [ b [ 1 ] ] ) / this . startDistance _ ; if ( 0 < this . previousScale _ && Infinity > this . previousScale _ ) { var c = b - this . previousScale _ ; c = 0 < c ? c * Blockly . TouchGesture . ZOOM _IN _MULTIPLIER : c * Blockly . TouchGesture . ZOOM _OUT _MULTIPLIER ; var d =
this . startWorkspace _ , e = Blockly . utils . mouseToSvg ( a , d . getParentSvg ( ) , d . getInverseScreenCTM ( ) ) ; d . zoom ( e . x , e . y , c ) } this . previousScale _ = b ; a . preventDefault ( ) } } ; Blockly . TouchGesture . prototype . handleTouchEnd = function ( a ) { a = Blockly . Touch . getTouchIdentifierFromEvent ( a ) ; this . cachedPoints _ [ a ] && delete this . cachedPoints _ [ a ] ; 2 > Object . keys ( this . cachedPoints _ ) . length && ( this . cachedPoints _ = { } , this . previousScale _ = 0 ) } ;
Blockly . TouchGesture . prototype . getTouchPoint = function ( a ) { return this . startWorkspace _ ? new goog . math . Coordinate ( a . pageX ? a . pageX : a . changedTouches [ 0 ] . pageX , a . pageY ? a . pageY : a . changedTouches [ 0 ] . pageY ) : null } ; Blockly . Trashcan = function ( a ) { this . workspace _ = a } ; Blockly . Trashcan . prototype . WIDTH _ = 47 ; Blockly . Trashcan . prototype . BODY _HEIGHT _ = 44 ; Blockly . Trashcan . prototype . LID _HEIGHT _ = 16 ; Blockly . Trashcan . prototype . MARGIN _BOTTOM _ = 20 ; Blockly . Trashcan . prototype . MARGIN _SIDE _ = 20 ; Blockly . Trashcan . prototype . MARGIN _HOTSPOT _ = 10 ; Blockly . Trashcan . prototype . SPRITE _LEFT _ = 0 ; Blockly . Trashcan . prototype . SPRITE _TOP _ = 32 ; Blockly . Trashcan . prototype . isOpen = ! 1 ; Blockly . Trashcan . prototype . svgGroup _ = null ;
2017-09-25 09:37:41 +00:00
Blockly . Trashcan . prototype . svgLid _ = null ; Blockly . Trashcan . prototype . lidTask _ = 0 ; Blockly . Trashcan . prototype . lidOpen _ = 0 ; Blockly . Trashcan . prototype . left _ = 0 ; Blockly . Trashcan . prototype . top _ = 0 ;
2018-01-16 21:13:23 +00:00
Blockly . Trashcan . prototype . createDom = function ( ) { this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyTrash" } , null ) ; var a = String ( Math . random ( ) ) . substring ( 2 ) ; var b = Blockly . utils . createSvgElement ( "clipPath" , { id : "blocklyTrashBodyClipPath" + a } , this . svgGroup _ ) ; Blockly . utils . createSvgElement ( "rect" , { width : this . WIDTH _ , height : this . BODY _HEIGHT _ , y : this . LID _HEIGHT _ } , b ) ; Blockly . utils . createSvgElement ( "image" , { width : Blockly . SPRITE . width , x : - this . SPRITE _LEFT _ , height : Blockly . SPRITE . height , y : - this . SPRITE _TOP _ ,
2017-09-25 09:37:41 +00:00
"clip-path" : "url(#blocklyTrashBodyClipPath" + a + ")" } , this . svgGroup _ ) . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , this . workspace _ . options . pathToMedia + Blockly . SPRITE . url ) ; b = Blockly . utils . createSvgElement ( "clipPath" , { id : "blocklyTrashLidClipPath" + a } , this . svgGroup _ ) ; Blockly . utils . createSvgElement ( "rect" , { width : this . WIDTH _ , height : this . LID _HEIGHT _ } , b ) ; this . svgLid _ = Blockly . utils . createSvgElement ( "image" , { width : Blockly . SPRITE . width , x : - this . SPRITE _LEFT _ , height : Blockly . SPRITE . height , y : - this . SPRITE _TOP _ ,
"clip-path" : "url(#blocklyTrashLidClipPath" + a + ")" } , this . svgGroup _ ) ; this . svgLid _ . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , this . workspace _ . options . pathToMedia + Blockly . SPRITE . url ) ; Blockly . bindEventWithChecks _ ( this . svgGroup _ , "mouseup" , this , this . click ) ; this . animateLid _ ( ) ; return this . svgGroup _ } ; Blockly . Trashcan . prototype . init = function ( a ) { this . bottom _ = this . MARGIN _BOTTOM _ + a ; this . setOpen _ ( ! 1 ) ; return this . bottom _ + this . BODY _HEIGHT _ + this . LID _HEIGHT _ } ;
2018-08-17 13:32:56 +00:00
Blockly . Trashcan . prototype . dispose = function ( ) { this . svgGroup _ && ( goog . dom . removeNode ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . workspace _ = this . svgLid _ = null ; clearTimeout ( this . lidTask _ ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Trashcan . prototype . position = function ( ) { var a = this . workspace _ . getMetrics ( ) ; a && ( this . workspace _ . RTL ? ( this . left _ = this . MARGIN _SIDE _ + Blockly . Scrollbar . scrollbarThickness , a . toolboxPosition == Blockly . TOOLBOX _AT _LEFT && ( this . left _ += a . flyoutWidth , this . workspace _ . toolbox _ && ( this . left _ += a . absoluteLeft ) ) ) : ( this . left _ = a . viewWidth + a . absoluteLeft - this . WIDTH _ - this . MARGIN _SIDE _ - Blockly . Scrollbar . scrollbarThickness , a . toolboxPosition == Blockly . TOOLBOX _AT _RIGHT && ( this . left _ -= a . flyoutWidth ) ) , this . top _ = a . viewHeight +
a . absoluteTop - ( this . BODY _HEIGHT _ + this . LID _HEIGHT _ ) - this . bottom _ , a . toolboxPosition == Blockly . TOOLBOX _AT _BOTTOM && ( this . top _ -= a . flyoutHeight ) , this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . left _ + "," + this . top _ + ")" ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Trashcan . prototype . getClientRect = function ( ) { if ( ! this . svgGroup _ ) return null ; var a = this . svgGroup _ . getBoundingClientRect ( ) ; return new goog . math . Rect ( a . left + this . SPRITE _LEFT _ - this . MARGIN _HOTSPOT _ , a . top + this . SPRITE _TOP _ - this . MARGIN _HOTSPOT _ , this . WIDTH _ + 2 * this . MARGIN _HOTSPOT _ , this . LID _HEIGHT _ + this . BODY _HEIGHT _ + 2 * this . MARGIN _HOTSPOT _ ) } ; Blockly . Trashcan . prototype . setOpen _ = function ( a ) { this . isOpen != a && ( clearTimeout ( this . lidTask _ ) , this . isOpen = a , this . animateLid _ ( ) ) } ;
Blockly . Trashcan . prototype . animateLid _ = function ( ) { this . lidOpen _ += this . isOpen ? . 2 : - . 2 ; this . lidOpen _ = goog . math . clamp ( this . lidOpen _ , 0 , 1 ) ; var a = 45 * this . lidOpen _ ; this . svgLid _ . setAttribute ( "transform" , "rotate(" + ( this . workspace _ . RTL ? - a : a ) + "," + ( this . workspace _ . RTL ? 4 : this . WIDTH _ - 4 ) + "," + ( this . LID _HEIGHT _ - 2 ) + ")" ) ; a = goog . math . lerp ( . 4 , . 8 , this . lidOpen _ ) ; this . svgGroup _ . style . opacity = a ; 0 < this . lidOpen _ && 1 > this . lidOpen _ && ( this . lidTask _ = setTimeout ( this . animateLid _ . bind ( this ) , 20 ) ) } ; Blockly . Trashcan . prototype . close = function ( ) { this . setOpen _ ( ! 1 ) } ;
Blockly . Trashcan . prototype . click = function ( ) { var a = this . workspace _ . startScrollX - this . workspace _ . scrollX , b = this . workspace _ . startScrollY - this . workspace _ . scrollY ; Math . sqrt ( a * a + b * b ) > Blockly . DRAG _RADIUS || console . log ( "TODO: Inspect trash." ) } ; Blockly . VariableModel = function ( a , b , c , d ) { this . workspace = a ; this . name = b ; this . type = c || "" ; this . id _ = d || Blockly . utils . genUid ( ) ; Blockly . Events . fire ( new Blockly . Events . VarCreate ( this ) ) } ; Blockly . VariableModel . prototype . getId = function ( ) { return this . id _ } ; Blockly . VariableModel . compareByName = function ( a , b ) { return goog . string . caseInsensitiveCompare ( a . name , b . name ) } ; Blockly . Variables = { } ; Blockly . Variables . NAME _TYPE = Blockly . VARIABLE _CATEGORY _NAME ; Blockly . Variables . allUsedVarModels = function ( a ) { var b = a . getAllBlocks ( ) ; a = Object . create ( null ) ; for ( var c = 0 ; c < b . length ; c ++ ) { var d = b [ c ] . getVarModels ( ) ; if ( d ) for ( var e = 0 ; e < d . length ; e ++ ) { var f = d [ e ] ; f . getId ( ) && ( a [ f . getId ( ) ] = f ) } } b = [ ] ; for ( var g in a ) b . push ( a [ g ] ) ; return b } ; Blockly . Variables . allUsedVariables = function ( ) { console . warn ( "Deprecated call to Blockly.Variables.allUsedVariables. Use Blockly.Variables.allUsedVarModels instead.\nIf this is a major issue please file a bug on GitHub." ) } ;
Blockly . Variables . allDeveloperVariables = function ( a ) { var b = a . getAllBlocks ( ) ; a = { } ; for ( var c = 0 ; c < b . length ; c ++ ) { var d = b [ c ] ; if ( d . getDeveloperVars ) { d = d . getDeveloperVars ( ) ; for ( var e = 0 ; e < d . length ; e ++ ) a [ d [ e ] ] = d [ e ] } } b = [ ] ; for ( var f in a ) b . push ( a [ f ] ) ; return b } ;
Blockly . Variables . flyoutCategory = function ( a ) { var b = [ ] , c = goog . dom . createDom ( "button" ) ; c . setAttribute ( "text" , "%{BKY_NEW_VARIABLE}" ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE" ) ; a . registerButtonCallback ( "CREATE_VARIABLE" , function ( a ) { Blockly . Variables . createVariableButtonHandler ( a . getTargetWorkspace ( ) ) } ) ; b . push ( c ) ; a = Blockly . Variables . flyoutCategoryBlocks ( a ) ; return b = b . concat ( a ) } ;
Blockly . Variables . flyoutCategoryBlocks = function ( a ) { a = a . getVariablesOfType ( "" ) ; a . sort ( Blockly . VariableModel . compareByName ) ; var b = [ ] ; if ( 0 < a . length ) { var c = a [ 0 ] ; if ( Blockly . Blocks . variables _set ) { var d = Blockly . Blocks . math _change ? 8 : 24 ; d = '<xml><block type="variables_set" gap="' + d + '">' + Blockly . Variables . generateVariableFieldXmlString ( c ) + "</block></xml>" ; d = Blockly . Xml . textToDom ( d ) . firstChild ; b . push ( d ) } Blockly . Blocks . math _change && ( d = Blockly . Blocks . variables _get ? 20 : 8 , d = '<xml><block type="math_change" gap="' +
d + '">' + Blockly . Variables . generateVariableFieldXmlString ( c ) + '<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value></block></xml>' , d = Blockly . Xml . textToDom ( d ) . firstChild , b . push ( d ) ) ; for ( c = 0 ; d = a [ c ] ; c ++ ) Blockly . Blocks . variables _get && ( d = '<xml><block type="variables_get" gap="8">' + Blockly . Variables . generateVariableFieldXmlString ( d ) + "</block></xml>" , d = Blockly . Xml . textToDom ( d ) . firstChild , b . push ( d ) ) } return b } ;
Blockly . Variables . generateUniqueName = function ( a ) { a = a . getAllVariables ( ) ; var b = "" ; if ( a . length ) for ( var c = 1 , d = 0 , e = "ijkmnopqrstuvwxyzabcdefgh" . charAt ( d ) ; ! b ; ) { for ( var f = ! 1 , g = 0 ; g < a . length ; g ++ ) if ( a [ g ] . name . toLowerCase ( ) == e ) { f = ! 0 ; break } f ? ( d ++ , 25 == d && ( d = 0 , c ++ ) , e = "ijkmnopqrstuvwxyzabcdefgh" . charAt ( d ) , 1 < c && ( e += c ) ) : b = e } else b = "i" ; return b } ;
Blockly . Variables . createVariableButtonHandler = function ( a , b , c ) { var d = c || "" , e = function ( c ) { Blockly . Variables . promptName ( Blockly . Msg . NEW _VARIABLE _TITLE , c , function ( c ) { if ( c ) { var f = Blockly . Variables . nameUsedWithAnyType _ ( c , a ) ; if ( f ) { var g = c . toLowerCase ( ) ; if ( f . type == d ) var l = Blockly . Msg . VARIABLE _ALREADY _EXISTS . replace ( "%1" , g ) ; else l = Blockly . Msg . VARIABLE _ALREADY _EXISTS _FOR _ANOTHER _TYPE , l = l . replace ( "%1" , g ) . replace ( "%2" , f . type ) ; Blockly . alert ( l , function ( ) { e ( c ) } ) } else a . createVariable ( c , d ) , b && b ( c ) } else b && b ( null ) } ) } ;
e ( "" ) } ; goog . exportSymbol ( "Blockly.Variables.createVariableButtonHandler" , Blockly . Variables . createVariableButtonHandler ) ; Blockly . Variables . createVariable = Blockly . Variables . createVariableButtonHandler ; goog . exportSymbol ( "Blockly.Variables.createVariable" , Blockly . Variables . createVariable ) ;
Blockly . Variables . renameVariable = function ( a , b , c ) { var d = function ( e ) { var f = Blockly . Msg . RENAME _VARIABLE _TITLE . replace ( "%1" , b . name ) ; Blockly . Variables . promptName ( f , e , function ( e ) { if ( e ) { var f = Blockly . Variables . nameUsedWithOtherType _ ( e , b . type , a ) ; f ? ( f = Blockly . Msg . VARIABLE _ALREADY _EXISTS _FOR _ANOTHER _TYPE . replace ( "%1" , e . toLowerCase ( ) ) . replace ( "%2" , f . type ) , Blockly . alert ( f , function ( ) { d ( e ) } ) ) : ( a . renameVariableById ( b . getId ( ) , e ) , c && c ( e ) ) } else c && c ( null ) } ) } ; d ( "" ) } ;
Blockly . Variables . promptName = function ( a , b , c ) { Blockly . prompt ( a , b , function ( a ) { a && ( a = a . replace ( /[\s\xa0]+/g , " " ) . replace ( /^ | $/g , "" ) , a == Blockly . Msg . RENAME _VARIABLE || a == Blockly . Msg . NEW _VARIABLE ) && ( a = null ) ; c ( a ) } ) } ; Blockly . Variables . nameUsedWithOtherType _ = function ( a , b , c ) { c = c . getVariableMap ( ) . getAllVariables ( ) ; a = a . toLowerCase ( ) ; for ( var d = 0 , e ; e = c [ d ] ; d ++ ) if ( e . name . toLowerCase ( ) == a && e . type != b ) return e ; return null } ;
Blockly . Variables . nameUsedWithAnyType _ = function ( a , b ) { var c = b . getVariableMap ( ) . getAllVariables ( ) ; a = a . toLowerCase ( ) ; for ( var d = 0 , e ; e = c [ d ] ; d ++ ) if ( e . name . toLowerCase ( ) == a ) return e ; return null } ; Blockly . Variables . generateVariableFieldXmlString = function ( a ) { var b = a . type ; "" == b && ( b = "''" ) ; return '<field name="VAR" id="' + a . getId ( ) + '" variabletype="' + goog . string . htmlEscape ( b ) + '">' + goog . string . htmlEscape ( a . name ) + "</field>" } ;
Blockly . Variables . generateVariableFieldDom = function ( a ) { a = Blockly . Variables . generateVariableFieldXmlString ( a ) ; return Blockly . Xml . textToDom ( "<xml>" + a + "</xml>" ) . firstChild } ; Blockly . Variables . getOrCreateVariablePackage = function ( a , b , c , d ) { var e = Blockly . Variables . getVariable ( a , b , c , d ) ; e || ( e = Blockly . Variables . createVariable _ ( a , b , c , d ) ) ; return e } ;
Blockly . Variables . getVariable = function ( a , b , c , d ) { var e = a . getPotentialVariableMap ( ) ; if ( b ) { var f = a . getVariableById ( b ) ; ! f && e && ( f = e . getVariableById ( b ) ) } else if ( c ) { if ( void 0 == d ) throw Error ( "Tried to look up a variable by name without a type" ) ; f = a . getVariable ( c , d ) ; ! f && e && ( f = e . getVariable ( c , d ) ) } return f } ;
Blockly . Variables . createVariable _ = function ( a , b , c , d ) { var e = a . getPotentialVariableMap ( ) ; c || ( c = Blockly . Variables . generateUniqueName ( a . isFlyout ? a . targetWorkspace : a ) ) ; return e ? e . createVariable ( c , d , b ) : a . createVariable ( c , d , b ) } ; Blockly . Variables . getAddedVariables = function ( a , b ) { var c = a . getAllVariables ( ) , d = [ ] ; if ( b . length != c . length ) for ( var e = 0 ; e < c . length ; e ++ ) { var f = c [ e ] ; - 1 == b . indexOf ( f ) && d . push ( f ) } return d } ; Blockly . VariablesDynamic = { } ; Blockly . VariablesDynamic . onCreateVariableButtonClick _String = function ( a ) { Blockly . Variables . createVariableButtonHandler ( a . getTargetWorkspace ( ) , null , "String" ) } ; Blockly . VariablesDynamic . onCreateVariableButtonClick _Number = function ( a ) { Blockly . Variables . createVariableButtonHandler ( a . getTargetWorkspace ( ) , null , "Number" ) } ; Blockly . VariablesDynamic . onCreateVariableButtonClick _Colour = function ( a ) { Blockly . Variables . createVariableButtonHandler ( a . getTargetWorkspace ( ) , null , "Colour" ) } ;
Blockly . VariablesDynamic . flyoutCategory = function ( a ) { var b = [ ] , c = goog . dom . createDom ( "button" ) ; c . setAttribute ( "text" , Blockly . Msg . NEW _STRING _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_STRING" ) ; b . push ( c ) ; c = goog . dom . createDom ( "button" ) ; c . setAttribute ( "text" , Blockly . Msg . NEW _NUMBER _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_NUMBER" ) ; b . push ( c ) ; c = goog . dom . createDom ( "button" ) ; c . setAttribute ( "text" , Blockly . Msg . NEW _COLOUR _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_COLOUR" ) ;
b . push ( c ) ; a . registerButtonCallback ( "CREATE_VARIABLE_STRING" , Blockly . VariablesDynamic . onCreateVariableButtonClick _String ) ; a . registerButtonCallback ( "CREATE_VARIABLE_NUMBER" , Blockly . VariablesDynamic . onCreateVariableButtonClick _Number ) ; a . registerButtonCallback ( "CREATE_VARIABLE_COLOUR" , Blockly . VariablesDynamic . onCreateVariableButtonClick _Colour ) ; a = Blockly . VariablesDynamic . flyoutCategoryBlocks ( a ) ; return b = b . concat ( a ) } ;
Blockly . VariablesDynamic . flyoutCategoryBlocks = function ( a ) { a = a . getAllVariables ( ) ; a . sort ( Blockly . VariableModel . compareByName ) ; var b = [ ] ; if ( 0 < a . length ) { if ( Blockly . Blocks . variables _set _dynamic ) { var c = '<xml><block type="variables_set_dynamic" gap="24">' + Blockly . Variables . generateVariableFieldXmlString ( a [ 0 ] ) + "</block></xml>" ; c = Blockly . Xml . textToDom ( c ) . firstChild ; b . push ( c ) } if ( Blockly . Blocks . variables _get _dynamic ) for ( var d = 0 ; c = a [ d ] ; d ++ ) c = '<xml><block type="variables_get_dynamic" gap="8">' + Blockly . Variables . generateVariableFieldXmlString ( c ) +
"</block></xml>" , c = Blockly . Xml . textToDom ( c ) . firstChild , b . push ( c ) } return b } ; Blockly . WorkspaceAudio = function ( a ) { this . parentWorkspace _ = a ; this . SOUNDS _ = Object . create ( null ) } ; Blockly . WorkspaceAudio . prototype . lastSound _ = null ; Blockly . WorkspaceAudio . prototype . dispose = function ( ) { this . SOUNDS _ = this . parentWorkspace _ = null } ; Blockly . WorkspaceAudio . prototype . load = function ( a , b ) { if ( a . length ) { try { var c = new window . Audio } catch ( h ) { return } for ( var d , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] , g = f . match ( /\.(\w+)$/ ) ; if ( g && c . canPlayType ( "audio/" + g [ 1 ] ) ) { d = new window . Audio ( f ) ; break } } d && d . play && ( this . SOUNDS _ [ b ] = d ) } } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceAudio . prototype . preload = function ( ) { for ( var a in this . SOUNDS _ ) { var b = this . SOUNDS _ [ a ] ; b . volume = . 01 ; b . play ( ) ; b . pause ( ) ; if ( goog . userAgent . IPAD || goog . userAgent . IPHONE ) break } } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceAudio . prototype . play = function ( a , b ) { var c = this . SOUNDS _ [ a ] ; if ( c ) { var d = new Date ; null != this . lastSound _ && d - this . lastSound _ < Blockly . SOUND _LIMIT || ( this . lastSound _ = d , c = goog . userAgent . DOCUMENT _MODE && 9 === goog . userAgent . DOCUMENT _MODE || goog . userAgent . IPAD || goog . userAgent . ANDROID ? c : c . cloneNode ( ) , c . volume = void 0 === b ? 1 : b , c . play ( ) ) } else this . parentWorkspace _ && this . parentWorkspace _ . getAudioManager ( ) . play ( a , b ) } ; Blockly . WorkspaceCommentSvg . render = { } ; Blockly . WorkspaceCommentSvg . RESIZE _SIZE = 8 ; Blockly . WorkspaceCommentSvg . BORDER _RADIUS = 3 ; Blockly . WorkspaceCommentSvg . TEXTAREA _OFFSET = 2 ; Blockly . WorkspaceCommentSvg . TOP _OFFSET = 10 ; Blockly . WorkspaceCommentSvg . prototype . getHeightWidth = function ( ) { return { width : this . getWidth ( ) , height : this . getHeight ( ) } } ;
Blockly . WorkspaceCommentSvg . prototype . render = function ( ) { if ( ! this . rendered _ ) { var a = this . getHeightWidth ( ) ; this . createEditor _ ( ) ; this . svgGroup _ . appendChild ( this . foreignObject _ ) ; this . svgHandleTarget _ = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyCommentHandleTarget" , x : 0 , y : 0 } ) ; this . svgGroup _ . appendChild ( this . svgHandleTarget _ ) ; this . svgRectTarget _ = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyCommentTarget" , x : 0 , y : 0 , rx : Blockly . WorkspaceCommentSvg . BORDER _RADIUS , ry : Blockly . WorkspaceCommentSvg . BORDER _RADIUS } ) ;
this . svgGroup _ . appendChild ( this . svgRectTarget _ ) ; this . addResizeDom _ ( ) ; this . isDeletable ( ) && this . addDeleteDom _ ( ) ; this . setSize _ ( a . width , a . height ) ; this . textarea _ . value = this . content _ ; this . rendered _ = ! 0 ; this . resizeGroup _ && Blockly . bindEventWithChecks _ ( this . resizeGroup _ , "mousedown" , this , this . resizeMouseDown _ ) ; this . isDeletable ( ) && ( Blockly . bindEventWithChecks _ ( this . deleteGroup _ , "mousedown" , this , this . deleteMouseDown _ ) , Blockly . bindEventWithChecks _ ( this . deleteGroup _ , "mouseout" , this , this . deleteMouseOut _ ) , Blockly . bindEventWithChecks _ ( this . deleteGroup _ ,
"mouseup" , this , this . deleteMouseUp _ ) ) } } ;
Blockly . WorkspaceCommentSvg . prototype . createEditor _ = function ( ) { this . foreignObject _ = Blockly . utils . createSvgElement ( "foreignObject" , { x : 0 , y : Blockly . WorkspaceCommentSvg . TOP _OFFSET , "class" : "blocklyCommentForeignObject" } , null ) ; var a = document . createElementNS ( Blockly . HTML _NS , "body" ) ; a . setAttribute ( "xmlns" , Blockly . HTML _NS ) ; a . className = "blocklyMinimalBody" ; var b = document . createElementNS ( Blockly . HTML _NS , "textarea" ) ; b . className = "blocklyCommentTextarea" ; b . setAttribute ( "dir" , this . RTL ? "RTL" : "LTR" ) ; a . appendChild ( b ) ;
this . textarea _ = b ; this . foreignObject _ . appendChild ( a ) ; Blockly . bindEventWithChecks _ ( b , "wheel" , this , function ( a ) { a . stopPropagation ( ) } ) ; Blockly . bindEventWithChecks _ ( b , "change" , this , function ( a ) { this . setContent ( b . value ) } ) ; return this . foreignObject _ } ;
Blockly . WorkspaceCommentSvg . prototype . addResizeDom _ = function ( ) { this . resizeGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : this . RTL ? "blocklyResizeSW" : "blocklyResizeSE" } , this . svgGroup _ ) ; var a = Blockly . WorkspaceCommentSvg . RESIZE _SIZE ; Blockly . utils . createSvgElement ( "polygon" , { points : "0,x x,x x,0" . replace ( /x/g , a . toString ( ) ) } , this . resizeGroup _ ) ; Blockly . utils . createSvgElement ( "line" , { "class" : "blocklyResizeLine" , x1 : a / 3 , y1 : a - 1 , x2 : a - 1 , y2 : a / 3 } , this . resizeGroup _ ) ; Blockly . utils . createSvgElement ( "line" , { "class" : "blocklyResizeLine" ,
x1 : 2 * a / 3 , y1 : a - 1 , x2 : a - 1 , y2 : 2 * a / 3 } , this . resizeGroup _ ) } ;
Blockly . WorkspaceCommentSvg . prototype . addDeleteDom _ = function ( ) { this . deleteGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyCommentDeleteIcon" } , this . svgGroup _ ) ; this . deleteIconBorder _ = Blockly . utils . createSvgElement ( "circle" , { "class" : "blocklyDeleteIconShape" , r : "7" , cx : "7.5" , cy : "7.5" } , this . deleteGroup _ ) ; Blockly . utils . createSvgElement ( "line" , { x1 : "5" , y1 : "10" , x2 : "10" , y2 : "5" , stroke : "#fff" , "stroke-width" : "2" } , this . deleteGroup _ ) ; Blockly . utils . createSvgElement ( "line" , { x1 : "5" , y1 : "5" , x2 : "10" , y2 : "10" ,
stroke : "#fff" , "stroke-width" : "2" } , this . deleteGroup _ ) } ;
Blockly . WorkspaceCommentSvg . prototype . resizeMouseDown _ = function ( a ) { this . unbindDragEvents _ ( ) ; Blockly . utils . isRightButton ( a ) || ( this . workspace . startDrag ( a , new goog . math . Coordinate ( this . workspace . RTL ? - this . width _ : this . width _ , this . height _ ) ) , this . onMouseUpWrapper _ = Blockly . bindEventWithChecks _ ( document , "mouseup" , this , this . resizeMouseUp _ ) , this . onMouseMoveWrapper _ = Blockly . bindEventWithChecks _ ( document , "mousemove" , this , this . resizeMouseMove _ ) , Blockly . hideChaff ( ) ) ; a . stopPropagation ( ) } ;
Blockly . WorkspaceCommentSvg . prototype . deleteMouseDown _ = function ( a ) { Blockly . utils . addClass ( this . deleteIconBorder _ , "blocklyDeleteIconHighlighted" ) ; a . stopPropagation ( ) } ; Blockly . WorkspaceCommentSvg . prototype . deleteMouseOut _ = function ( ) { Blockly . utils . removeClass ( this . deleteIconBorder _ , "blocklyDeleteIconHighlighted" ) } ; Blockly . WorkspaceCommentSvg . prototype . deleteMouseUp _ = function ( a ) { this . dispose ( ! 0 , ! 0 ) ; a . stopPropagation ( ) } ;
Blockly . WorkspaceCommentSvg . prototype . unbindDragEvents _ = function ( ) { this . onMouseUpWrapper _ && ( Blockly . unbindEvent _ ( this . onMouseUpWrapper _ ) , this . onMouseUpWrapper _ = null ) ; this . onMouseMoveWrapper _ && ( Blockly . unbindEvent _ ( this . onMouseMoveWrapper _ ) , this . onMouseMoveWrapper _ = null ) } ; Blockly . WorkspaceCommentSvg . prototype . resizeMouseUp _ = function ( ) { Blockly . Touch . clearTouchIdentifier ( ) ; this . unbindDragEvents _ ( ) } ;
Blockly . WorkspaceCommentSvg . prototype . resizeMouseMove _ = function ( a ) { this . autoLayout _ = ! 1 ; a = this . workspace . moveDrag ( a ) ; this . setSize _ ( this . RTL ? - a . x : a . x , a . y ) } ;
Blockly . WorkspaceCommentSvg . prototype . resizeComment _ = function ( ) { var a = this . getHeightWidth ( ) , b = Blockly . WorkspaceCommentSvg . TOP _OFFSET , c = 2 * Blockly . WorkspaceCommentSvg . TEXTAREA _OFFSET ; this . foreignObject _ . setAttribute ( "width" , a . width ) ; this . foreignObject _ . setAttribute ( "height" , a . height - b ) ; this . RTL && this . foreignObject _ . setAttribute ( "x" , - a . width ) ; this . textarea _ . style . width = a . width - c + "px" ; this . textarea _ . style . height = a . height - c - b + "px" } ;
Blockly . WorkspaceCommentSvg . prototype . setSize _ = function ( a , b ) { a = Math . max ( a , 45 ) ; b = Math . max ( b , 20 + Blockly . WorkspaceCommentSvg . TOP _OFFSET ) ; this . width _ = a ; this . height _ = b ; this . svgRect _ . setAttribute ( "width" , a ) ; this . svgRect _ . setAttribute ( "height" , b ) ; this . svgRectTarget _ . setAttribute ( "width" , a ) ; this . svgRectTarget _ . setAttribute ( "height" , b ) ; this . svgHandleTarget _ . setAttribute ( "width" , a ) ; this . svgHandleTarget _ . setAttribute ( "height" , Blockly . WorkspaceCommentSvg . TOP _OFFSET ) ; this . RTL && ( this . svgRect _ . setAttribute ( "transform" ,
"scale(-1 1)" ) , this . svgRectTarget _ . setAttribute ( "transform" , "scale(-1 1)" ) ) ; var c = Blockly . WorkspaceCommentSvg . RESIZE _SIZE ; this . resizeGroup _ && ( this . RTL ? ( this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( - a + c ) + "," + ( b - c ) + ") scale(-1 1)" ) , this . deleteGroup _ . setAttribute ( "transform" , "translate(" + ( - a + c ) + "," + - c + ") scale(-1 1)" ) ) : ( this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( a - c ) + "," + ( b - c ) + ")" ) , this . deleteGroup _ . setAttribute ( "transform" , "translate(" + ( a - c ) + "," + - c + ")" ) ) ) ; this . resizeComment _ ( ) } ;
Blockly . WorkspaceCommentSvg . prototype . disposeInternal _ = function ( ) { this . svgHandleTarget _ = this . svgRectTarget _ = this . foreignObject _ = this . textarea _ = null } ; Blockly . WorkspaceCommentSvg . prototype . setFocus = function ( ) { var a = this ; this . focused _ = ! 0 ; setTimeout ( function ( ) { a . textarea _ . focus ( ) ; a . addFocus ( ) ; Blockly . utils . addClass ( a . svgRectTarget _ , "blocklyCommentTargetFocused" ) ; Blockly . utils . addClass ( a . svgHandleTarget _ , "blocklyCommentHandleTargetFocused" ) } , 0 ) } ;
Blockly . WorkspaceCommentSvg . prototype . blurFocus = function ( ) { var a = this ; this . focused _ = ! 1 ; setTimeout ( function ( ) { a . textarea _ . blur ( ) ; a . removeFocus ( ) ; Blockly . utils . removeClass ( a . svgRectTarget _ , "blocklyCommentTargetFocused" ) ; Blockly . utils . removeClass ( a . svgHandleTarget _ , "blocklyCommentHandleTargetFocused" ) } , 0 ) } ; Blockly . WorkspaceDragSurfaceSvg = function ( a ) { this . container _ = a ; this . createDom ( ) } ; Blockly . WorkspaceDragSurfaceSvg . prototype . SVG _ = null ; Blockly . WorkspaceDragSurfaceSvg . prototype . dragGroup _ = null ; Blockly . WorkspaceDragSurfaceSvg . prototype . container _ = null ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceDragSurfaceSvg . prototype . createDom = function ( ) { this . SVG _ || ( this . SVG _ = Blockly . utils . createSvgElement ( "svg" , { xmlns : Blockly . SVG _NS , "xmlns:html" : Blockly . HTML _NS , "xmlns:xlink" : "http://www.w3.org/1999/xlink" , version : "1.1" , "class" : "blocklyWsDragSurface blocklyOverflowVisible" } , null ) , this . container _ . appendChild ( this . SVG _ ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceDragSurfaceSvg . prototype . translateSurface = function ( a , b ) { var c = a . toFixed ( 0 ) , d = b . toFixed ( 0 ) ; this . SVG _ . style . display = "block" ; Blockly . utils . setCssTransform ( this . SVG _ , "translate3d(" + c + "px, " + d + "px, 0px)" ) } ; Blockly . WorkspaceDragSurfaceSvg . prototype . getSurfaceTranslation = function ( ) { return Blockly . utils . getRelativeXY ( this . SVG _ ) } ;
Blockly . WorkspaceDragSurfaceSvg . prototype . clearAndHide = function ( a ) { if ( ! a ) throw "Couldn't clear and hide the drag surface: missing new surface." ; var b = this . SVG _ . childNodes [ 0 ] , c = this . SVG _ . childNodes [ 1 ] ; if ( ! ( b && c && Blockly . utils . hasClass ( b , "blocklyBlockCanvas" ) && Blockly . utils . hasClass ( c , "blocklyBubbleCanvas" ) ) ) throw "Couldn't clear and hide the drag surface. A node was missing." ; null != this . previousSibling _ ? Blockly . utils . insertAfter _ ( b , this . previousSibling _ ) : a . insertBefore ( b , a . firstChild ) ; Blockly . utils . insertAfter _ ( c ,
b ) ; this . SVG _ . style . display = "none" ; goog . asserts . assert ( 0 == this . SVG _ . childNodes . length , "Drag surface was not cleared." ) ; Blockly . utils . setCssTransform ( this . SVG _ , "" ) ; this . previousSibling _ = null } ;
Blockly . WorkspaceDragSurfaceSvg . prototype . setContentsAndShow = function ( a , b , c , d , e , f ) { goog . asserts . assert ( 0 == this . SVG _ . childNodes . length , "Already dragging a block." ) ; this . previousSibling _ = c ; a . setAttribute ( "transform" , "translate(0, 0) scale(" + f + ")" ) ; b . setAttribute ( "transform" , "translate(0, 0) scale(" + f + ")" ) ; this . SVG _ . setAttribute ( "width" , d ) ; this . SVG _ . setAttribute ( "height" , e ) ; this . SVG _ . appendChild ( a ) ; this . SVG _ . appendChild ( b ) ; this . SVG _ . style . display = "block" } ; Blockly . Xml = { } ; Blockly . Xml . workspaceToDom = function ( a , b ) { var c = goog . dom . createDom ( "xml" ) ; c . appendChild ( Blockly . Xml . variablesToDom ( Blockly . Variables . allUsedVarModels ( a ) ) ) ; for ( var d = a . getTopComments ( ! 0 ) , e = 0 , f ; f = d [ e ] ; e ++ ) c . appendChild ( f . toXmlWithXY ( b ) ) ; d = a . getTopBlocks ( ! 0 ) ; for ( e = 0 ; f = d [ e ] ; e ++ ) c . appendChild ( Blockly . Xml . blockToDomWithXY ( f , b ) ) ; return c } ;
Blockly . Xml . variablesToDom = function ( a ) { for ( var b = goog . dom . createDom ( "variables" ) , c = 0 , d ; d = a [ c ] ; c ++ ) { var e = goog . dom . createDom ( "variable" , null , d . name ) ; e . setAttribute ( "type" , d . type ) ; e . setAttribute ( "id" , d . getId ( ) ) ; b . appendChild ( e ) } return b } ; Blockly . Xml . blockToDomWithXY = function ( a , b ) { var c ; a . workspace . RTL && ( c = a . workspace . getWidth ( ) ) ; var d = Blockly . Xml . blockToDom ( a , b ) , e = a . getRelativeToSurfaceXY ( ) ; d . setAttribute ( "x" , Math . round ( a . workspace . RTL ? c - e . x : e . x ) ) ; d . setAttribute ( "y" , Math . round ( e . y ) ) ; return d } ;
Blockly . Xml . fieldToDomVariable _ = function ( a ) { null == a . getValue ( ) && ( a . initModel ( ) , a . getValue ( ) ) ; var b = a . getVariable ( ) ; if ( ! b ) throw Error ( "Tried to serialize a variable field with no variable." ) ; var c = goog . dom . createDom ( "field" , null , b . name ) ; c . setAttribute ( "name" , a . name ) ; c . setAttribute ( "id" , b . getId ( ) ) ; c . setAttribute ( "variabletype" , b . type ) ; return c } ;
Blockly . Xml . fieldToDom _ = function ( a ) { if ( a . name && a . EDITABLE ) { if ( a . referencesVariables ( ) ) return Blockly . Xml . fieldToDomVariable _ ( a ) ; var b = goog . dom . createDom ( "field" , null , a . getValue ( ) ) ; b . setAttribute ( "name" , a . name ) ; return b } return null } ; Blockly . Xml . allFieldsToDom _ = function ( a , b ) { for ( var c = 0 , d ; d = a . inputList [ c ] ; c ++ ) for ( var e = 0 , f ; f = d . fieldRow [ e ] ; e ++ ) ( f = Blockly . Xml . fieldToDom _ ( f ) ) && b . appendChild ( f ) } ;
Blockly . Xml . blockToDom = function ( a , b ) { var c = goog . dom . createDom ( a . isShadow ( ) ? "shadow" : "block" ) ; c . setAttribute ( "type" , a . type ) ; b || c . setAttribute ( "id" , a . id ) ; if ( a . mutationToDom ) { var d = a . mutationToDom ( ) ; d && ( d . hasChildNodes ( ) || d . hasAttributes ( ) ) && c . appendChild ( d ) } Blockly . Xml . allFieldsToDom _ ( a , c ) ; if ( d = a . getCommentText ( ) ) { d = goog . dom . createDom ( "comment" , null , d ) ; if ( "object" == typeof a . comment ) { d . setAttribute ( "pinned" , a . comment . isVisible ( ) ) ; var e = a . comment . getBubbleSize ( ) ; d . setAttribute ( "h" , e . height ) ; d . setAttribute ( "w" ,
e . width ) } c . appendChild ( d ) } a . data && ( d = goog . dom . createDom ( "data" , null , a . data ) , c . appendChild ( d ) ) ; e = 0 ; for ( var f ; f = a . inputList [ e ] ; e ++ ) { var g , h = ! 0 ; if ( f . type != Blockly . DUMMY _INPUT ) { var k = f . connection . targetBlock ( ) ; f . type == Blockly . INPUT _VALUE ? g = goog . dom . createDom ( "value" ) : f . type == Blockly . NEXT _STATEMENT && ( g = goog . dom . createDom ( "statement" ) ) ; d = f . connection . getShadowDom ( ) ; ! d || k && k . isShadow ( ) || g . appendChild ( Blockly . Xml . cloneShadow _ ( d ) ) ; k && ( g . appendChild ( Blockly . Xml . blockToDom ( k , b ) ) , h = ! 1 ) ; g . setAttribute ( "name" ,
f . name ) ; h || c . appendChild ( g ) } } a . inputsInlineDefault != a . inputsInline && c . setAttribute ( "inline" , a . inputsInline ) ; a . isCollapsed ( ) && c . setAttribute ( "collapsed" , ! 0 ) ; a . disabled && c . setAttribute ( "disabled" , ! 0 ) ; a . isDeletable ( ) || a . isShadow ( ) || c . setAttribute ( "deletable" , ! 1 ) ; a . isMovable ( ) || a . isShadow ( ) || c . setAttribute ( "movable" , ! 1 ) ; a . isEditable ( ) || c . setAttribute ( "editable" , ! 1 ) ; if ( e = a . getNextBlock ( ) ) g = goog . dom . createDom ( "next" , null , Blockly . Xml . blockToDom ( e , b ) ) , c . appendChild ( g ) ; d = a . nextConnection && a . nextConnection . getShadowDom ( ) ;
! d || e && e . isShadow ( ) || g . appendChild ( Blockly . Xml . cloneShadow _ ( d ) ) ; return c } ; Blockly . Xml . cloneShadow _ = function ( a ) { for ( var b = a = a . cloneNode ( ! 0 ) , c ; b ; ) if ( b . firstChild ) b = b . firstChild ; else { for ( ; b && ! b . nextSibling ; ) c = b , b = b . parentNode , 3 == c . nodeType && "" == c . data . trim ( ) && b . firstChild != c && goog . dom . removeNode ( c ) ; b && ( c = b , b = b . nextSibling , 3 == c . nodeType && "" == c . data . trim ( ) && goog . dom . removeNode ( c ) ) } return a } ; Blockly . Xml . domToText = function ( a ) { return ( new XMLSerializer ) . serializeToString ( a ) } ;
Blockly . Xml . domToPrettyText = function ( a ) { a = Blockly . Xml . domToText ( a ) . split ( "<" ) ; for ( var b = "" , c = 1 ; c < a . length ; c ++ ) { var d = a [ c ] ; "/" == d [ 0 ] && ( b = b . substring ( 2 ) ) ; a [ c ] = b + "<" + d ; "/" != d [ 0 ] && "/>" != d . slice ( - 2 ) && ( b += " " ) } a = a . join ( "\n" ) ; a = a . replace ( /(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g , "$1</$2>" ) ; return a . replace ( /^\n/ , "" ) } ; Blockly . Xml . textToDomDocument _ = function ( a ) { return ( new DOMParser ) . parseFromString ( a , "text/xml" ) } ;
Blockly . Xml . textToDom = function ( a ) { a = Blockly . Xml . textToDomDocument _ ( a ) ; if ( ! a || ! a . documentElement || "xml" != a . documentElement . nodeName . toLowerCase ( ) ) throw Error ( "Blockly.Xml.textToDom expected an <xml> document." ) ; return a . documentElement } ; Blockly . Xml . clearWorkspaceAndLoadFromXml = function ( a , b ) { b . setResizesEnabled ( ! 1 ) ; b . clear ( ) ; var c = Blockly . Xml . domToWorkspace ( a , b ) ; b . setResizesEnabled ( ! 0 ) ; return c } ;
Blockly . Xml . domToWorkspace = function ( a , b ) { if ( a instanceof Blockly . Workspace ) { var c = a ; a = b ; b = c ; console . warn ( "Deprecated call to Blockly.Xml.domToWorkspace, swap the arguments." ) } var d ; b . RTL && ( d = b . getWidth ( ) ) ; c = [ ] ; Blockly . Field . startCache ( ) ; var e = a . childNodes . length , f = Blockly . Events . getGroup ( ) ; f || Blockly . Events . setGroup ( ! 0 ) ; b . setResizesEnabled && b . setResizesEnabled ( ! 1 ) ; var g = ! 0 ; try { for ( var h = 0 ; h < e ; h ++ ) { var k = a . childNodes [ h ] , l = k . nodeName . toLowerCase ( ) ; if ( "block" == l || "shadow" == l && ! Blockly . Events . recordUndo ) { var n =
Blockly . Xml . domToBlock ( k , b ) ; c . push ( n . id ) ; var m = k . hasAttribute ( "x" ) ? parseInt ( k . getAttribute ( "x" ) , 10 ) : 10 , p = k . hasAttribute ( "y" ) ? parseInt ( k . getAttribute ( "y" ) , 10 ) : 10 ; isNaN ( m ) || isNaN ( p ) || n . moveBy ( b . RTL ? d - m : m , p ) ; g = ! 1 } else { if ( "shadow" == l ) throw Error ( "Shadow block cannot be a top-level block." ) ; if ( "comment" == l ) b . rendered ? Blockly . WorkspaceCommentSvg . fromXml ( k , b , d ) : Blockly . WorkspaceComment . fromXml ( k , b ) ; else if ( "variables" == l ) { if ( g ) Blockly . Xml . domToVariables ( k , b ) ; else throw Error ( "'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location." ) ;
g = ! 1 } } } } finally { f || Blockly . Events . setGroup ( ! 1 ) , Blockly . Field . stopCache ( ) } b . setResizesEnabled && b . setResizesEnabled ( ! 0 ) ; return c } ;
Blockly . Xml . appendDomToWorkspace = function ( a , b ) { if ( b . hasOwnProperty ( "scale" ) ) { var c = Blockly . BlockSvg . TAB _WIDTH ; try { Blockly . BlockSvg . TAB _WIDTH = 0 ; var d = b . getBlocksBoundingBox ( ) } finally { Blockly . BlockSvg . TAB _WIDTH = c } } c = Blockly . Xml . domToWorkspace ( a , b ) ; if ( d && d . height ) { var e = d . y + d . height ; var f = d . x ; var g = Infinity , h = Infinity ; for ( d = 0 ; d < c . length ; d ++ ) { var k = b . getBlockById ( c [ d ] ) . getRelativeToSurfaceXY ( ) ; k . y < h && ( h = k . y ) ; k . x < g && ( g = k . x ) } e = e - h + Blockly . BlockSvg . SEP _SPACE _Y ; f -= g ; var l ; b . RTL && ( l = b . getWidth ( ) ) ; for ( d = 0 ; d <
c . length ; d ++ ) b . getBlockById ( c [ d ] ) . moveBy ( b . RTL ? l - f : f , e ) } return c } ;
Blockly . Xml . domToBlock = function ( a , b ) { if ( a instanceof Blockly . Workspace ) { var c = a ; a = b ; b = c ; console . warn ( "Deprecated call to Blockly.Xml.domToBlock, swap the arguments." ) } Blockly . Events . disable ( ) ; c = b . getAllVariables ( ) ; try { var d = Blockly . Xml . domToBlockHeadless _ ( a , b ) , e = d . getDescendants ( ! 1 ) ; if ( b . rendered ) { d . setConnectionsHidden ( ! 0 ) ; for ( var f = e . length - 1 ; 0 <= f ; f -- ) e [ f ] . initSvg ( ) ; for ( f = e . length - 1 ; 0 <= f ; f -- ) e [ f ] . render ( ! 1 ) ; setTimeout ( function ( ) { d . workspace && d . setConnectionsHidden ( ! 1 ) } , 1 ) ; d . updateDisabled ( ) ; b . resizeContents ( ) } else for ( f =
e . length - 1 ; 0 <= f ; f -- ) e [ f ] . initModel ( ) } finally { Blockly . Events . enable ( ) } if ( Blockly . Events . isEnabled ( ) ) { e = Blockly . Variables . getAddedVariables ( b , c ) ; for ( f = 0 ; f < e . length ; f ++ ) Blockly . Events . fire ( new Blockly . Events . VarCreate ( e [ f ] ) ) ; Blockly . Events . fire ( new Blockly . Events . BlockCreate ( d ) ) } return d } ;
Blockly . Xml . domToVariables = function ( a , b ) { for ( var c = 0 , d ; d = a . children [ c ] ; c ++ ) { var e = d . getAttribute ( "type" ) , f = d . getAttribute ( "id" ) ; d = d . textContent ; if ( null == e ) throw Error ( "Variable with id, " + f + " is without a type" ) ; b . createVariable ( d , e , f ) } } ;
Blockly . Xml . domToBlockHeadless _ = function ( a , b ) { var c = null , d = a . getAttribute ( "type" ) ; if ( ! d ) throw Error ( "Block type unspecified: " + a . outerHTML ) ; var e = a . getAttribute ( "id" ) ; c = b . newBlock ( d , e ) ; var f = null ; e = 0 ; for ( var g ; g = a . childNodes [ e ] ; e ++ ) if ( 3 != g . nodeType ) { for ( var h = f = null , k = 0 , l ; l = g . childNodes [ k ] ; k ++ ) 1 == l . nodeType && ( "block" == l . nodeName . toLowerCase ( ) ? f = l : "shadow" == l . nodeName . toLowerCase ( ) && ( h = l ) ) ; ! f && h && ( f = h ) ; k = g . getAttribute ( "name" ) ; switch ( g . nodeName . toLowerCase ( ) ) { case "mutation" : c . domToMutation && ( c . domToMutation ( g ) ,
c . initSvg && c . initSvg ( ) ) ; break ; case "comment" : c . setCommentText ( g . textContent ) ; var n = g . getAttribute ( "pinned" ) ; n && ! c . isInFlyout && setTimeout ( function ( ) { c . comment && c . comment . setVisible && c . comment . setVisible ( "true" == n ) } , 1 ) ; f = parseInt ( g . getAttribute ( "w" ) , 10 ) ; g = parseInt ( g . getAttribute ( "h" ) , 10 ) ; ! isNaN ( f ) && ! isNaN ( g ) && c . comment && c . comment . setVisible && c . comment . setBubbleSize ( f , g ) ; break ; case "data" : c . data = g . textContent ; break ; case "title" : case "field" : Blockly . Xml . domToField _ ( c , k , g ) ; break ; case "value" : case "statement" : g =
c . getInput ( k ) ; if ( ! g ) { console . warn ( "Ignoring non-existent input " + k + " in block " + d ) ; break } h && g . connection . setShadowDom ( h ) ; if ( f ) if ( f = Blockly . Xml . domToBlockHeadless _ ( f , b ) , f . outputConnection ) g . connection . connect ( f . outputConnection ) ; else if ( f . previousConnection ) g . connection . connect ( f . previousConnection ) ; else throw Error ( "Child block does not have output or previous statement." ) ; break ; case "next" : h && c . nextConnection && c . nextConnection . setShadowDom ( h ) ; if ( f ) { if ( ! c . nextConnection ) throw Error ( "Next statement does not exist." ) ;
if ( c . nextConnection . isConnected ( ) ) throw Error ( "Next statement is already connected." ) ; f = Blockly . Xml . domToBlockHeadless _ ( f , b ) ; if ( ! f . previousConnection ) throw Error ( "Next block does not have previous statement." ) ; c . nextConnection . connect ( f . previousConnection ) } break ; default : console . warn ( "Ignoring unknown tag: " + g . nodeName ) } } ( e = a . getAttribute ( "inline" ) ) && c . setInputsInline ( "true" == e ) ; ( e = a . getAttribute ( "disabled" ) ) && c . setDisabled ( "true" == e || "disabled" == e ) ; ( e = a . getAttribute ( "deletable" ) ) && c . setDeletable ( "true" ==
e ) ; ( e = a . getAttribute ( "movable" ) ) && c . setMovable ( "true" == e ) ; ( e = a . getAttribute ( "editable" ) ) && c . setEditable ( "true" == e ) ; ( e = a . getAttribute ( "collapsed" ) ) && c . setCollapsed ( "true" == e ) ; if ( "shadow" == a . nodeName . toLowerCase ( ) ) { d = c . getChildren ( ! 1 ) ; for ( e = 0 ; g = d [ e ] ; e ++ ) if ( g . isShadow ( ) ) throw Error ( "Shadow block not allowed non-shadow child." ) ; if ( c . getVarModels ( ) . length ) throw Error ( "Shadow blocks cannot have variable references." ) ; c . setShadow ( ! 0 ) } return c } ;
Blockly . Xml . domToFieldVariable _ = function ( a , b , c , d ) { var e = b . getAttribute ( "variabletype" ) || "" ; "''" == e && ( e = "" ) ; a = Blockly . Variables . getOrCreateVariablePackage ( a , b . id , c , e ) ; if ( null != e && e !== a . type ) throw Error ( "Serialized variable type with id '" + a . getId ( ) + "' had type " + a . type + ", and does not match variable field that references it: " + Blockly . Xml . domToText ( b ) + "." ) ; d . setValue ( a . getId ( ) ) } ;
Blockly . Xml . domToField _ = function ( a , b , c ) { var d = a . getField ( b ) ; d ? ( a = a . workspace , b = c . textContent , d . referencesVariables ( ) ? Blockly . Xml . domToFieldVariable _ ( a , c , b , d ) : d . setValue ( b ) ) : console . warn ( "Ignoring non-existent field " + b + " in block " + a . type ) } ; Blockly . Xml . deleteNext = function ( a ) { for ( var b = 0 , c ; c = a . childNodes [ b ] ; b ++ ) if ( "next" == c . nodeName . toLowerCase ( ) ) { a . removeChild ( c ) ; break } } ; goog . global . Blockly || ( goog . global . Blockly = { } ) ; goog . global . Blockly . Xml || ( goog . global . Blockly . Xml = { } ) ;
goog . global . Blockly . Xml . domToText = Blockly . Xml . domToText ; goog . global . Blockly . Xml . domToWorkspace = Blockly . Xml . domToWorkspace ; goog . global . Blockly . Xml . textToDom = Blockly . Xml . textToDom ; goog . global . Blockly . Xml . workspaceToDom = Blockly . Xml . workspaceToDom ;
2017-09-25 09:37:41 +00:00
Blockly . ZoomControls = function ( a ) { this . workspace _ = a } ; Blockly . ZoomControls . prototype . WIDTH _ = 32 ; Blockly . ZoomControls . prototype . HEIGHT _ = 110 ; Blockly . ZoomControls . prototype . MARGIN _BOTTOM _ = 20 ; Blockly . ZoomControls . prototype . MARGIN _SIDE _ = 20 ; Blockly . ZoomControls . prototype . svgGroup _ = null ; Blockly . ZoomControls . prototype . left _ = 0 ; Blockly . ZoomControls . prototype . top _ = 0 ;
2018-08-17 13:32:56 +00:00
Blockly . ZoomControls . prototype . createDom = function ( ) { this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyZoom" } , null ) ; var a = String ( Math . random ( ) ) . substring ( 2 ) ; this . createZoomOutSvg _ ( a ) ; this . createZoomInSvg _ ( a ) ; this . createZoomResetSvg _ ( a ) ; return this . svgGroup _ } ; Blockly . ZoomControls . prototype . init = function ( a ) { this . bottom _ = this . MARGIN _BOTTOM _ + a ; return this . bottom _ + this . HEIGHT _ } ;
Blockly . ZoomControls . prototype . dispose = function ( ) { this . svgGroup _ && ( goog . dom . removeNode ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . workspace _ = null } ;
2017-09-25 09:37:41 +00:00
Blockly . ZoomControls . prototype . position = function ( ) { var a = this . workspace _ . getMetrics ( ) ; a && ( this . workspace _ . RTL ? ( this . left _ = this . MARGIN _SIDE _ + Blockly . Scrollbar . scrollbarThickness , a . toolboxPosition == Blockly . TOOLBOX _AT _LEFT && ( this . left _ += a . flyoutWidth , this . workspace _ . toolbox _ && ( this . left _ += a . absoluteLeft ) ) ) : ( this . left _ = a . viewWidth + a . absoluteLeft - this . WIDTH _ - this . MARGIN _SIDE _ - Blockly . Scrollbar . scrollbarThickness , a . toolboxPosition == Blockly . TOOLBOX _AT _RIGHT && ( this . left _ -= a . flyoutWidth ) ) , this . top _ = a . viewHeight +
a . absoluteTop - this . HEIGHT _ - this . bottom _ , a . toolboxPosition == Blockly . TOOLBOX _AT _BOTTOM && ( this . top _ -= a . flyoutHeight ) , this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . left _ + "," + this . top _ + ")" ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . ZoomControls . prototype . createZoomOutSvg _ = function ( a ) { var b = this . workspace _ , c = Blockly . utils . createSvgElement ( "clipPath" , { id : "blocklyZoomoutClipPath" + a } , this . svgGroup _ ) ; Blockly . utils . createSvgElement ( "rect" , { width : 32 , height : 32 , y : 77 } , c ) ; a = Blockly . utils . createSvgElement ( "image" , { width : Blockly . SPRITE . width , height : Blockly . SPRITE . height , x : - 64 , y : - 15 , "clip-path" : "url(#blocklyZoomoutClipPath" + a + ")" } , this . svgGroup _ ) ; a . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , b . options . pathToMedia + Blockly . SPRITE . url ) ;
Blockly . bindEventWithChecks _ ( a , "mousedown" , null , function ( a ) { b . markFocused ( ) ; b . zoomCenter ( - 1 ) ; Blockly . Touch . clearTouchIdentifier ( ) ; a . stopPropagation ( ) ; a . preventDefault ( ) } ) } ;
Blockly . ZoomControls . prototype . createZoomInSvg _ = function ( a ) { var b = this . workspace _ , c = Blockly . utils . createSvgElement ( "clipPath" , { id : "blocklyZoominClipPath" + a } , this . svgGroup _ ) ; Blockly . utils . createSvgElement ( "rect" , { width : 32 , height : 32 , y : 43 } , c ) ; a = Blockly . utils . createSvgElement ( "image" , { width : Blockly . SPRITE . width , height : Blockly . SPRITE . height , x : - 32 , y : - 49 , "clip-path" : "url(#blocklyZoominClipPath" + a + ")" } , this . svgGroup _ ) ; a . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , b . options . pathToMedia + Blockly . SPRITE . url ) ;
Blockly . bindEventWithChecks _ ( a , "mousedown" , null , function ( a ) { b . markFocused ( ) ; b . zoomCenter ( 1 ) ; Blockly . Touch . clearTouchIdentifier ( ) ; a . stopPropagation ( ) ; a . preventDefault ( ) } ) } ;
Blockly . ZoomControls . prototype . createZoomResetSvg _ = function ( a ) { var b = this . workspace _ , c = Blockly . utils . createSvgElement ( "clipPath" , { id : "blocklyZoomresetClipPath" + a } , this . svgGroup _ ) ; Blockly . utils . createSvgElement ( "rect" , { width : 32 , height : 32 } , c ) ; a = Blockly . utils . createSvgElement ( "image" , { width : Blockly . SPRITE . width , height : Blockly . SPRITE . height , y : - 92 , "clip-path" : "url(#blocklyZoomresetClipPath" + a + ")" } , this . svgGroup _ ) ; a . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , b . options . pathToMedia + Blockly . SPRITE . url ) ;
Blockly . bindEventWithChecks _ ( a , "mousedown" , null , function ( a ) { b . markFocused ( ) ; b . setScale ( b . options . zoomOptions . startScale ) ; b . scrollCenter ( ) ; Blockly . Touch . clearTouchIdentifier ( ) ; a . stopPropagation ( ) ; a . preventDefault ( ) } ) } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg = function ( a , b , c ) { Blockly . WorkspaceSvg . superClass _ . constructor . call ( this , a ) ; this . getMetrics = a . getMetrics || Blockly . WorkspaceSvg . getTopLevelWorkspaceMetrics _ ; this . setMetrics = a . setMetrics || Blockly . WorkspaceSvg . setTopLevelWorkspaceMetrics _ ; Blockly . ConnectionDB . init ( this ) ; b && ( this . blockDragSurface _ = b ) ; c && ( this . workspaceDragSurface _ = c ) ; this . useWorkspaceDragSurface _ = this . workspaceDragSurface _ && Blockly . utils . is3dSupported ( ) ; this . highlightedBlocks _ = [ ] ; this . audioManager _ = new Blockly . WorkspaceAudio ( a . parentWorkspace ) ;
2018-08-17 13:32:56 +00:00
this . grid _ = this . options . gridPattern ? new Blockly . Grid ( a . gridPattern , a . gridOptions ) : null ; Blockly . Variables && Blockly . Variables . flyoutCategory && this . registerToolboxCategoryCallback ( Blockly . VARIABLE _CATEGORY _NAME , Blockly . Variables . flyoutCategory ) ; Blockly . VariablesDynamic && Blockly . VariablesDynamic . flyoutCategory && this . registerToolboxCategoryCallback ( Blockly . VARIABLE _DYNAMIC _CATEGORY _NAME , Blockly . VariablesDynamic . flyoutCategory ) ; Blockly . Procedures && Blockly . Procedures . flyoutCategory && this . registerToolboxCategoryCallback ( Blockly . PROCEDURE _CATEGORY _NAME ,
Blockly . Procedures . flyoutCategory ) } ; goog . inherits ( Blockly . WorkspaceSvg , Blockly . Workspace ) ; Blockly . WorkspaceSvg . prototype . resizeHandlerWrapper _ = null ; Blockly . WorkspaceSvg . prototype . rendered = ! 0 ; Blockly . WorkspaceSvg . prototype . isFlyout = ! 1 ; Blockly . WorkspaceSvg . prototype . isMutator = ! 1 ; Blockly . WorkspaceSvg . prototype . resizesEnabled _ = ! 0 ; Blockly . WorkspaceSvg . prototype . scrollX = 0 ; Blockly . WorkspaceSvg . prototype . scrollY = 0 ; Blockly . WorkspaceSvg . prototype . startScrollX = 0 ; Blockly . WorkspaceSvg . prototype . startScrollY = 0 ;
Blockly . WorkspaceSvg . prototype . dragDeltaXY _ = null ; Blockly . WorkspaceSvg . prototype . scale = 1 ; Blockly . WorkspaceSvg . prototype . trashcan = null ; Blockly . WorkspaceSvg . prototype . scrollbar = null ; Blockly . WorkspaceSvg . prototype . currentGesture _ = null ; Blockly . WorkspaceSvg . prototype . blockDragSurface _ = null ; Blockly . WorkspaceSvg . prototype . workspaceDragSurface _ = null ; Blockly . WorkspaceSvg . prototype . useWorkspaceDragSurface _ = ! 1 ; Blockly . WorkspaceSvg . prototype . isDragSurfaceActive _ = ! 1 ;
Blockly . WorkspaceSvg . prototype . injectionDiv _ = null ; Blockly . WorkspaceSvg . prototype . lastRecordedPageScroll _ = null ; Blockly . WorkspaceSvg . prototype . flyoutButtonCallbacks _ = { } ; Blockly . WorkspaceSvg . prototype . toolboxCategoryCallbacks _ = { } ; Blockly . WorkspaceSvg . prototype . configureContextMenu = null ; Blockly . WorkspaceSvg . prototype . targetWorkspace = null ; Blockly . WorkspaceSvg . prototype . inverseScreenCTM _ = null ; Blockly . WorkspaceSvg . prototype . inverseScreenCTMDirty _ = ! 0 ;
Blockly . WorkspaceSvg . prototype . getInverseScreenCTM = function ( ) { if ( this . inverseScreenCTMDirty _ ) { var a = this . getParentSvg ( ) . getScreenCTM ( ) ; a && ( this . inverseScreenCTM _ = a . inverse ( ) , this . inverseScreenCTMDirty _ = ! 1 ) } return this . inverseScreenCTM _ } ; Blockly . WorkspaceSvg . prototype . updateInverseScreenCTM = function ( ) { this . inverseScreenCTMDirty _ = ! 0 } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . getSvgXY = function ( a ) { var b = 0 , c = 0 , d = 1 ; if ( goog . dom . contains ( this . getCanvas ( ) , a ) || goog . dom . contains ( this . getBubbleCanvas ( ) , a ) ) d = this . scale ; do { var e = Blockly . utils . getRelativeXY ( a ) ; if ( a == this . getCanvas ( ) || a == this . getBubbleCanvas ( ) ) d = 1 ; b += e . x * d ; c += e . y * d ; a = a . parentNode } while ( a && a != this . getParentSvg ( ) ) ; return new goog . math . Coordinate ( b , c ) } ; Blockly . WorkspaceSvg . prototype . getOriginOffsetInPixels = function ( ) { return Blockly . utils . getInjectionDivXY _ ( this . svgBlockCanvas _ ) } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceSvg . prototype . getInjectionDiv = function ( ) { if ( ! this . injectionDiv _ ) for ( var a = this . svgGroup _ ; a ; ) { if ( - 1 != ( " " + ( a . getAttribute ( "class" ) || "" ) + " " ) . indexOf ( " injectionDiv " ) ) { this . injectionDiv _ = a ; break } a = a . parentNode } return this . injectionDiv _ } ; Blockly . WorkspaceSvg . prototype . setResizeHandlerWrapper = function ( a ) { this . resizeHandlerWrapper _ = a } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . createDom = function ( a ) { this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyWorkspace" } , null ) ; a && ( this . svgBackground _ = Blockly . utils . createSvgElement ( "rect" , { height : "100%" , width : "100%" , "class" : a } , this . svgGroup _ ) , "blocklyMainBackground" == a && this . grid _ && ( this . svgBackground _ . style . fill = "url(#" + this . grid _ . getPatternId ( ) + ")" ) ) ; this . svgBlockCanvas _ = Blockly . utils . createSvgElement ( "g" , { "class" : "blocklyBlockCanvas" } , this . svgGroup _ ) ; this . svgBubbleCanvas _ = Blockly . utils . createSvgElement ( "g" ,
2018-08-17 13:32:56 +00:00
{ "class" : "blocklyBubbleCanvas" } , this . svgGroup _ ) ; a = Blockly . Scrollbar . scrollbarThickness ; this . options . hasTrashcan && ( a = this . addTrashcan _ ( a ) ) ; this . options . zoomOptions && this . options . zoomOptions . controls && this . addZoomControls _ ( a ) ; this . isFlyout || ( Blockly . bindEventWithChecks _ ( this . svgGroup _ , "mousedown" , this , this . onMouseDown _ , ! 1 , ! 0 ) , this . options . zoomOptions && this . options . zoomOptions . wheel && Blockly . bindEventWithChecks _ ( this . svgGroup _ , "wheel" , this , this . onMouseWheel _ ) ) ; this . options . hasCategories && ( this . toolbox _ =
new Blockly . Toolbox ( this ) ) ; this . grid _ && this . grid _ . update ( this . scale ) ; this . recordDeleteAreas ( ) ; return this . svgGroup _ } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . dispose = function ( ) { this . rendered = ! 1 ; this . currentGesture _ && this . currentGesture _ . cancel ( ) ; Blockly . WorkspaceSvg . superClass _ . dispose . call ( this ) ; this . svgGroup _ && ( goog . dom . removeNode ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . svgBubbleCanvas _ = this . svgBlockCanvas _ = null ; this . toolbox _ && ( this . toolbox _ . dispose ( ) , this . toolbox _ = null ) ; this . flyout _ && ( this . flyout _ . dispose ( ) , this . flyout _ = null ) ; this . trashcan && ( this . trashcan . dispose ( ) , this . trashcan = null ) ; this . scrollbar && ( this . scrollbar . dispose ( ) ,
this . scrollbar = null ) ; this . zoomControls _ && ( this . zoomControls _ . dispose ( ) , this . zoomControls _ = null ) ; this . audioManager _ && ( this . audioManager _ . dispose ( ) , this . audioManager _ = null ) ; this . grid _ && ( this . grid _ . dispose ( ) , this . grid _ = null ) ; this . toolboxCategoryCallbacks _ && ( this . toolboxCategoryCallbacks _ = null ) ; this . flyoutButtonCallbacks _ && ( this . flyoutButtonCallbacks _ = null ) ; this . options . parentWorkspace || goog . dom . removeNode ( this . getParentSvg ( ) . parentNode ) ; this . resizeHandlerWrapper _ && ( Blockly . unbindEvent _ ( this . resizeHandlerWrapper _ ) ,
this . resizeHandlerWrapper _ = null ) } ; Blockly . WorkspaceSvg . prototype . newBlock = function ( a , b ) { return new Blockly . BlockSvg ( this , a , b ) } ; Blockly . WorkspaceSvg . prototype . addTrashcan _ = function ( a ) { this . trashcan = new Blockly . Trashcan ( this ) ; var b = this . trashcan . createDom ( ) ; this . svgGroup _ . insertBefore ( b , this . svgBlockCanvas _ ) ; return this . trashcan . init ( a ) } ;
Blockly . WorkspaceSvg . prototype . addZoomControls _ = function ( a ) { this . zoomControls _ = new Blockly . ZoomControls ( this ) ; var b = this . zoomControls _ . createDom ( ) ; this . svgGroup _ . appendChild ( b ) ; return this . zoomControls _ . init ( a ) } ;
Blockly . WorkspaceSvg . prototype . addFlyout _ = function ( a ) { var b = { disabledPatternId : this . options . disabledPatternId , parentWorkspace : this , RTL : this . RTL , oneBasedIndex : this . options . oneBasedIndex , horizontalLayout : this . horizontalLayout , toolboxPosition : this . options . toolboxPosition } ; this . flyout _ = null ; this . flyout _ = this . horizontalLayout ? new Blockly . HorizontalFlyout ( b ) : new Blockly . VerticalFlyout ( b ) ; this . flyout _ . autoClose = ! 1 ; return this . flyout _ . createDom ( a ) } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceSvg . prototype . getFlyout _ = function ( ) { return this . flyout _ ? this . flyout _ : this . toolbox _ ? this . toolbox _ . flyout _ : null } ; Blockly . WorkspaceSvg . prototype . getToolbox = function ( ) { return this . toolbox _ } ; Blockly . WorkspaceSvg . prototype . updateScreenCalculations _ = function ( ) { this . updateInverseScreenCTM ( ) ; this . recordDeleteAreas ( ) } ; Blockly . WorkspaceSvg . prototype . resizeContents = function ( ) { this . resizesEnabled _ && this . rendered && ( this . scrollbar && this . scrollbar . resize ( ) , this . updateInverseScreenCTM ( ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . WorkspaceSvg . prototype . resize = function ( ) { this . toolbox _ && this . toolbox _ . position ( ) ; this . flyout _ && this . flyout _ . position ( ) ; this . trashcan && this . trashcan . position ( ) ; this . zoomControls _ && this . zoomControls _ . position ( ) ; this . scrollbar && this . scrollbar . resize ( ) ; this . updateScreenCalculations _ ( ) } ; Blockly . WorkspaceSvg . prototype . updateScreenCalculationsIfScrolled = function ( ) { var a = goog . dom . getDocumentScroll ( ) ; goog . math . Coordinate . equals ( this . lastRecordedPageScroll _ , a ) || ( this . lastRecordedPageScroll _ = a , this . updateScreenCalculations _ ( ) ) } ;
Blockly . WorkspaceSvg . prototype . getCanvas = function ( ) { return this . svgBlockCanvas _ } ; Blockly . WorkspaceSvg . prototype . getBubbleCanvas = function ( ) { return this . svgBubbleCanvas _ } ; Blockly . WorkspaceSvg . prototype . getParentSvg = function ( ) { if ( this . cachedParentSvg _ ) return this . cachedParentSvg _ ; for ( var a = this . svgGroup _ ; a ; ) { if ( "svg" == a . tagName ) return this . cachedParentSvg _ = a ; a = a . parentNode } return null } ;
Blockly . WorkspaceSvg . prototype . translate = function ( a , b ) { if ( this . useWorkspaceDragSurface _ && this . isDragSurfaceActive _ ) this . workspaceDragSurface _ . translateSurface ( a , b ) ; else { var c = "translate(" + a + "," + b + ") scale(" + this . scale + ")" ; this . svgBlockCanvas _ . setAttribute ( "transform" , c ) ; this . svgBubbleCanvas _ . setAttribute ( "transform" , c ) } this . blockDragSurface _ && this . blockDragSurface _ . translateAndScaleGroup ( a , b , this . scale ) } ;
Blockly . WorkspaceSvg . prototype . resetDragSurface = function ( ) { if ( this . useWorkspaceDragSurface _ ) { this . isDragSurfaceActive _ = ! 1 ; var a = this . workspaceDragSurface _ . getSurfaceTranslation ( ) ; this . workspaceDragSurface _ . clearAndHide ( this . svgGroup _ ) ; a = "translate(" + a . x + "," + a . y + ") scale(" + this . scale + ")" ; this . svgBlockCanvas _ . setAttribute ( "transform" , a ) ; this . svgBubbleCanvas _ . setAttribute ( "transform" , a ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceSvg . prototype . setupDragSurface = function ( ) { if ( this . useWorkspaceDragSurface _ && ! this . isDragSurfaceActive _ ) { this . isDragSurfaceActive _ = ! 0 ; var a = this . svgBlockCanvas _ . previousSibling , b = parseInt ( this . getParentSvg ( ) . getAttribute ( "width" ) , 10 ) , c = parseInt ( this . getParentSvg ( ) . getAttribute ( "height" ) , 10 ) , d = Blockly . utils . getRelativeXY ( this . svgBlockCanvas _ ) ; this . workspaceDragSurface _ . setContentsAndShow ( this . svgBlockCanvas _ , this . svgBubbleCanvas _ , a , b , c , this . scale ) ; this . workspaceDragSurface _ . translateSurface ( d . x ,
d . y ) } } ; Blockly . WorkspaceSvg . prototype . getBlockDragSurface = function ( ) { return this . blockDragSurface _ } ; Blockly . WorkspaceSvg . prototype . getWidth = function ( ) { var a = this . getMetrics ( ) ; return a ? a . viewWidth / this . scale : 0 } ;
Blockly . WorkspaceSvg . prototype . setVisible = function ( a ) { this . scrollbar && this . scrollbar . setContainerVisible ( a ) ; this . getFlyout _ ( ) && this . getFlyout _ ( ) . setContainerVisible ( a ) ; this . getParentSvg ( ) . style . display = a ? "block" : "none" ; this . toolbox _ && ( this . toolbox _ . HtmlDiv . style . display = a ? "block" : "none" ) ; a ? ( this . render ( ) , this . toolbox _ && this . toolbox _ . position ( ) ) : Blockly . hideChaff ( ! 0 ) } ; Blockly . WorkspaceSvg . prototype . render = function ( ) { for ( var a = this . getAllBlocks ( ) , b = a . length - 1 ; 0 <= b ; b -- ) a [ b ] . render ( ! 1 ) } ;
Blockly . WorkspaceSvg . prototype . traceOn = function ( ) { console . warn ( "Deprecated call to traceOn, delete this." ) } ; Blockly . WorkspaceSvg . prototype . highlightBlock = function ( a , b ) { if ( void 0 === b ) { for ( var c = 0 , d ; d = this . highlightedBlocks _ [ c ] ; c ++ ) d . setHighlighted ( ! 1 ) ; this . highlightedBlocks _ . length = 0 } if ( d = a ? this . getBlockById ( a ) : null ) ( c = void 0 === b || b ) ? - 1 == this . highlightedBlocks _ . indexOf ( d ) && this . highlightedBlocks _ . push ( d ) : goog . array . remove ( this . highlightedBlocks _ , d ) , d . setHighlighted ( c ) } ;
Blockly . WorkspaceSvg . prototype . paste = function ( a ) { ! this . rendered || a . getElementsByTagName ( "block" ) . length >= this . remainingCapacity ( ) || ( this . currentGesture _ && this . currentGesture _ . cancel ( ) , "comment" == a . tagName . toLowerCase ( ) ? this . pasteWorkspaceComment _ ( a ) : this . pasteBlock _ ( a ) ) } ;
Blockly . WorkspaceSvg . prototype . pasteBlock _ = function ( a ) { Blockly . Events . disable ( ) ; try { var b = Blockly . Xml . domToBlock ( a , this ) , c = parseInt ( a . getAttribute ( "x" ) , 10 ) , d = parseInt ( a . getAttribute ( "y" ) , 10 ) ; if ( ! isNaN ( c ) && ! isNaN ( d ) ) { this . RTL && ( c = - c ) ; do { a = ! 1 ; for ( var e = this . getAllBlocks ( ) , f = 0 , g ; g = e [ f ] ; f ++ ) { var h = g . getRelativeToSurfaceXY ( ) ; if ( 1 >= Math . abs ( c - h . x ) && 1 >= Math . abs ( d - h . y ) ) { a = ! 0 ; break } } if ( ! a ) { var k = b . getConnections _ ( ! 1 ) ; f = 0 ; for ( var l ; l = k [ f ] ; f ++ ) if ( l . closest ( Blockly . SNAP _RADIUS , new goog . math . Coordinate ( c , d ) ) . connection ) { a =
! 0 ; break } } a && ( c = this . RTL ? c - Blockly . SNAP _RADIUS : c + Blockly . SNAP _RADIUS , d += 2 * Blockly . SNAP _RADIUS ) } while ( a ) ; b . moveBy ( c , d ) } } finally { Blockly . Events . enable ( ) } Blockly . Events . isEnabled ( ) && ! b . isShadow ( ) && Blockly . Events . fire ( new Blockly . Events . BlockCreate ( b ) ) ; b . select ( ) } ;
Blockly . WorkspaceSvg . prototype . pasteWorkspaceComment _ = function ( a ) { Blockly . Events . disable ( ) ; try { var b = Blockly . WorkspaceCommentSvg . fromXml ( a , this ) , c = parseInt ( a . getAttribute ( "x" ) , 10 ) , d = parseInt ( a . getAttribute ( "y" ) , 10 ) ; isNaN ( c ) || isNaN ( d ) || ( this . RTL && ( c = - c ) , b . moveBy ( c + 50 , d + 50 ) ) } finally { Blockly . Events . enable ( ) } Blockly . Events . isEnabled ( ) ; b . select ( ) } ;
Blockly . WorkspaceSvg . prototype . refreshToolboxSelection = function ( ) { var a = this . isFlyout ? this . targetWorkspace : this ; a && ! a . currentGesture _ && a . toolbox _ && a . toolbox _ . flyout _ && a . toolbox _ . refreshSelection ( ) } ; Blockly . WorkspaceSvg . prototype . renameVariableById = function ( a , b ) { Blockly . WorkspaceSvg . superClass _ . renameVariableById . call ( this , a , b ) ; this . refreshToolboxSelection ( ) } ; Blockly . WorkspaceSvg . prototype . deleteVariableById = function ( a ) { Blockly . WorkspaceSvg . superClass _ . deleteVariableById . call ( this , a ) ; this . refreshToolboxSelection ( ) } ;
Blockly . WorkspaceSvg . prototype . createVariable = function ( a , b , c ) { a = Blockly . WorkspaceSvg . superClass _ . createVariable . call ( this , a , b , c ) ; this . refreshToolboxSelection ( ) ; return a } ; Blockly . WorkspaceSvg . prototype . recordDeleteAreas = function ( ) { this . deleteAreaTrash _ = this . trashcan && this . svgGroup _ . parentNode ? this . trashcan . getClientRect ( ) : null ; this . deleteAreaToolbox _ = this . flyout _ ? this . flyout _ . getClientRect ( ) : this . toolbox _ ? this . toolbox _ . getClientRect ( ) : null } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . isDeleteArea = function ( a ) { a = new goog . math . Coordinate ( a . clientX , a . clientY ) ; return this . deleteAreaTrash _ && this . deleteAreaTrash _ . contains ( a ) ? Blockly . DELETE _AREA _TRASH : this . deleteAreaToolbox _ && this . deleteAreaToolbox _ . contains ( a ) ? Blockly . DELETE _AREA _TOOLBOX : Blockly . DELETE _AREA _NONE } ; Blockly . WorkspaceSvg . prototype . onMouseDown _ = function ( a ) { var b = this . getGesture ( a ) ; b && b . handleWsStart ( a , this ) } ;
Blockly . WorkspaceSvg . prototype . startDrag = function ( a , b ) { var c = Blockly . utils . mouseToSvg ( a , this . getParentSvg ( ) , this . getInverseScreenCTM ( ) ) ; c . x /= this . scale ; c . y /= this . scale ; this . dragDeltaXY _ = goog . math . Coordinate . difference ( b , c ) } ; Blockly . WorkspaceSvg . prototype . moveDrag = function ( a ) { a = Blockly . utils . mouseToSvg ( a , this . getParentSvg ( ) , this . getInverseScreenCTM ( ) ) ; a . x /= this . scale ; a . y /= this . scale ; return goog . math . Coordinate . sum ( this . dragDeltaXY _ , a ) } ;
Blockly . WorkspaceSvg . prototype . isDragging = function ( ) { return null != this . currentGesture _ && this . currentGesture _ . isDragging ( ) } ; Blockly . WorkspaceSvg . prototype . isDraggable = function ( ) { return ! ! this . scrollbar } ; Blockly . WorkspaceSvg . prototype . onMouseWheel _ = function ( a ) { this . currentGesture _ && this . currentGesture _ . cancel ( ) ; var b = - a . deltaY / 50 , c = Blockly . utils . mouseToSvg ( a , this . getParentSvg ( ) , this . getInverseScreenCTM ( ) ) ; this . zoom ( c . x , c . y , b ) ; a . preventDefault ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceSvg . prototype . getBlocksBoundingBox = function ( ) { var a = this . getTopBlocks ( ! 1 ) , b = this . getTopComments ( ! 1 ) ; a = a . concat ( b ) ; if ( ! a . length ) return { x : 0 , y : 0 , width : 0 , height : 0 } ; b = a [ 0 ] . getBoundingRectangle ( ) ; for ( var c = 1 ; c < a . length ; c ++ ) { var d = a [ c ] . getBoundingRectangle ( ) ; d . topLeft . x < b . topLeft . x && ( b . topLeft . x = d . topLeft . x ) ; d . bottomRight . x > b . bottomRight . x && ( b . bottomRight . x = d . bottomRight . x ) ; d . topLeft . y < b . topLeft . y && ( b . topLeft . y = d . topLeft . y ) ; d . bottomRight . y > b . bottomRight . y && ( b . bottomRight . y = d . bottomRight . y ) } return { x : b . topLeft . x ,
y : b . topLeft . y , width : b . bottomRight . x - b . topLeft . x , height : b . bottomRight . y - b . topLeft . y } } ; Blockly . WorkspaceSvg . prototype . cleanUp = function ( ) { this . setResizesEnabled ( ! 1 ) ; Blockly . Events . setGroup ( ! 0 ) ; for ( var a = this . getTopBlocks ( ! 0 ) , b = 0 , c = 0 , d ; d = a [ c ] ; c ++ ) { var e = d . getRelativeToSurfaceXY ( ) ; d . moveBy ( - e . x , b - e . y ) ; d . snapToGrid ( ) ; b = d . getRelativeToSurfaceXY ( ) . y + d . getHeightWidth ( ) . height + Blockly . BlockSvg . MIN _BLOCK _Y } Blockly . Events . setGroup ( ! 1 ) ; this . setResizesEnabled ( ! 0 ) } ;
Blockly . WorkspaceSvg . prototype . showContextMenu _ = function ( a ) { function b ( a ) { if ( a . isDeletable ( ) ) p = p . concat ( a . getDescendants ( ! 1 ) ) ; else { a = a . getChildren ( ! 1 ) ; for ( var c = 0 ; c < a . length ; c ++ ) b ( a [ c ] ) } } function c ( ) { Blockly . Events . setGroup ( f ) ; var a = p . shift ( ) ; a && ( a . workspace ? ( a . dispose ( ! 1 , ! 0 ) , setTimeout ( c , 10 ) ) : c ( ) ) ; Blockly . Events . setGroup ( ! 1 ) } if ( ! this . options . readOnly && ! this . isFlyout ) { var d = [ ] , e = this . getTopBlocks ( ! 0 ) , f = Blockly . utils . genUid ( ) , g = this , h = { } ; h . text = Blockly . Msg . UNDO ; h . enabled = 0 < this . undoStack _ . length ; h . callback =
this . undo . bind ( this , ! 1 ) ; d . push ( h ) ; h = { } ; h . text = Blockly . Msg . REDO ; h . enabled = 0 < this . redoStack _ . length ; h . callback = this . undo . bind ( this , ! 0 ) ; d . push ( h ) ; this . scrollbar && ( h = { } , h . text = Blockly . Msg . CLEAN _UP , h . enabled = 1 < e . length , h . callback = this . cleanUp . bind ( this ) , d . push ( h ) ) ; if ( this . options . collapse ) { for ( var k = h = ! 1 , l = 0 ; l < e . length ; l ++ ) for ( var n = e [ l ] ; n ; ) n . isCollapsed ( ) ? h = ! 0 : k = ! 0 , n = n . getNextBlock ( ) ; var m = function ( a ) { for ( var b = 0 , c = 0 ; c < e . length ; c ++ ) for ( var d = e [ c ] ; d ; ) setTimeout ( d . setCollapsed . bind ( d , a ) , b ) , d = d . getNextBlock ( ) ,
b += 10 } ; k = { enabled : k } ; k . text = Blockly . Msg . COLLAPSE _ALL ; k . callback = function ( ) { m ( ! 0 ) } ; d . push ( k ) ; h = { enabled : h } ; h . text = Blockly . Msg . EXPAND _ALL ; h . callback = function ( ) { m ( ! 1 ) } ; d . push ( h ) } var p = [ ] ; for ( l = 0 ; l < e . length ; l ++ ) b ( e [ l ] ) ; h = { text : 1 == p . length ? Blockly . Msg . DELETE _BLOCK : Blockly . Msg . DELETE _X _BLOCKS . replace ( "%1" , String ( p . length ) ) , enabled : 0 < p . length , callback : function ( ) { g . currentGesture _ && g . currentGesture _ . cancel ( ) ; 2 > p . length ? c ( ) : Blockly . confirm ( Blockly . Msg . DELETE _ALL _BLOCKS . replace ( "%1" , p . length ) , function ( a ) { a &&
c ( ) } ) } } ; d . push ( h ) ; this . configureContextMenu && this . configureContextMenu ( d ) ; Blockly . ContextMenu . show ( a , d , this . RTL ) } } ;
2017-09-25 09:37:41 +00:00
Blockly . WorkspaceSvg . prototype . updateToolbox = function ( a ) { if ( a = Blockly . Options . parseToolboxTree ( a ) ) { if ( ! this . options . languageTree ) throw "Existing toolbox is null. Can't create new toolbox." ; if ( a . getElementsByTagName ( "category" ) . length ) { if ( ! this . toolbox _ ) throw "Existing toolbox has no categories. Can't change mode." ; this . options . languageTree = a ; this . toolbox _ . populate _ ( a ) ; this . toolbox _ . addColour _ ( ) } else { if ( ! this . flyout _ ) throw "Existing toolbox has categories. Can't change mode." ; this . options . languageTree =
2018-01-16 21:13:23 +00:00
a ; this . flyout _ . show ( a . childNodes ) } } else if ( this . options . languageTree ) throw "Can't nullify an existing toolbox." ; } ; Blockly . WorkspaceSvg . prototype . markFocused = function ( ) { this . options . parentWorkspace ? this . options . parentWorkspace . markFocused ( ) : ( Blockly . mainWorkspace = this , this . setBrowserFocus ( ) ) } ; Blockly . WorkspaceSvg . prototype . setBrowserFocus = function ( ) { document . activeElement && document . activeElement . blur ( ) ; try { this . getParentSvg ( ) . focus ( ) } catch ( a ) { try { this . getParentSvg ( ) . parentNode . setActive ( ) } catch ( b ) { this . getParentSvg ( ) . parentNode . focus ( ) } } } ;
2017-09-25 09:37:41 +00:00
Blockly . WorkspaceSvg . prototype . zoom = function ( a , b , c ) { var d = this . options . zoomOptions . scaleSpeed , e = this . getMetrics ( ) , f = this . getParentSvg ( ) . createSVGPoint ( ) ; f . x = a ; f . y = b ; f = f . matrixTransform ( this . getCanvas ( ) . getCTM ( ) . inverse ( ) ) ; a = f . x ; b = f . y ; f = this . getCanvas ( ) ; d = Math . pow ( d , c ) ; c = this . scale * d ; c > this . options . zoomOptions . maxScale ? d = this . options . zoomOptions . maxScale / this . scale : c < this . options . zoomOptions . minScale && ( d = this . options . zoomOptions . minScale / this . scale ) ; this . scale != c && ( this . scrollbar && ( a = f . getCTM ( ) . translate ( a *
( 1 - d ) , b * ( 1 - d ) ) . scale ( d ) , this . scrollX = a . e - e . absoluteLeft , this . scrollY = a . f - e . absoluteTop ) , this . setScale ( c ) ) } ; Blockly . WorkspaceSvg . prototype . zoomCenter = function ( a ) { var b = this . getMetrics ( ) ; this . zoom ( b . viewWidth / 2 , b . viewHeight / 2 , a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . zoomToFit = function ( ) { var a = this . getMetrics ( ) , b = this . getBlocksBoundingBox ( ) , c = b . width ; b = b . height ; if ( c ) { var d = a . viewWidth , e = a . viewHeight ; this . flyout _ && ( d -= this . flyout _ . width _ ) ; this . scrollbar || ( c += a . contentLeft , b += a . contentTop ) ; this . setScale ( Math . min ( d / c , e / b ) ) ; this . scrollCenter ( ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceSvg . prototype . scrollCenter = function ( ) { if ( this . scrollbar ) { var a = this . getMetrics ( ) , b = ( a . contentWidth - a . viewWidth ) / 2 ; this . flyout _ && ( b -= this . flyout _ . width _ / 2 ) ; this . scrollbar . set ( b , ( a . contentHeight - a . viewHeight ) / 2 ) } else console . warn ( "Tried to scroll a non-scrollable workspace." ) } ;
Blockly . WorkspaceSvg . prototype . centerOnBlock = function ( a ) { if ( this . scrollbar ) { if ( a = this . getBlockById ( a ) ) { var b = a . getRelativeToSurfaceXY ( ) , c = a . getHeightWidth ( ) , d = this . scale ; a = ( b . x + ( this . RTL ? - 1 : 1 ) * c . width / 2 ) * d ; b = ( b . y + c . height / 2 ) * d ; c = this . getMetrics ( ) ; a = a - c . contentLeft - c . viewWidth / 2 ; b = b - c . contentTop - c . viewHeight / 2 ; Blockly . hideChaff ( ) ; this . scrollbar . set ( a , b ) } } else console . warn ( "Tried to scroll a non-scrollable workspace." ) } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . setScale = function ( a ) { this . options . zoomOptions . maxScale && a > this . options . zoomOptions . maxScale ? a = this . options . zoomOptions . maxScale : this . options . zoomOptions . minScale && a < this . options . zoomOptions . minScale && ( a = this . options . zoomOptions . minScale ) ; this . scale = a ; this . grid _ && this . grid _ . update ( this . scale ) ; this . scrollbar ? this . scrollbar . resize ( ) : this . translate ( this . scrollX , this . scrollY ) ; Blockly . hideChaff ( ! 1 ) ; this . flyout _ && this . flyout _ . reflow ( ) } ;
Blockly . WorkspaceSvg . getDimensionsPx _ = function ( a ) { var b = 0 , c = 0 ; a && ( b = a . getWidth ( ) , c = a . getHeight ( ) ) ; return { width : b , height : c } } ; Blockly . WorkspaceSvg . getContentDimensions _ = function ( a , b ) { return a . scrollbar ? Blockly . WorkspaceSvg . getContentDimensionsBounded _ ( a , b ) : Blockly . WorkspaceSvg . getContentDimensionsExact _ ( a ) } ;
Blockly . WorkspaceSvg . getContentDimensionsExact _ = function ( a ) { var b = a . getBlocksBoundingBox ( ) , c = a . scale ; a = b . width * c ; var d = b . height * c , e = b . x * c ; b = b . y * c ; return { left : e , top : b , right : e + a , bottom : b + d , width : a , height : d } } ;
Blockly . WorkspaceSvg . getContentDimensionsBounded _ = function ( a , b ) { var c = Blockly . WorkspaceSvg . getContentDimensionsExact _ ( a ) , d = b . width , e = b . height , f = d / 2 , g = e / 2 , h = Math . min ( c . left - f , c . right - d ) , k = Math . min ( c . top - g , c . bottom - e ) ; return { left : h , top : k , height : Math . max ( c . bottom + g , c . top + e ) - k , width : Math . max ( c . right + f , c . left + d ) - h } } ;
Blockly . WorkspaceSvg . getTopLevelWorkspaceMetrics _ = function ( ) { var a = Blockly . WorkspaceSvg . getDimensionsPx _ ( this . toolbox _ ) , b = Blockly . WorkspaceSvg . getDimensionsPx _ ( this . flyout _ ) , c = Blockly . svgSize ( this . getParentSvg ( ) ) ; if ( this . toolbox _ ) if ( this . toolboxPosition == Blockly . TOOLBOX _AT _TOP || this . toolboxPosition == Blockly . TOOLBOX _AT _BOTTOM ) c . height -= a . height ; else if ( this . toolboxPosition == Blockly . TOOLBOX _AT _LEFT || this . toolboxPosition == Blockly . TOOLBOX _AT _RIGHT ) c . width -= a . width ; var d = Blockly . WorkspaceSvg . getContentDimensions _ ( this ,
c ) , e = 0 ; this . toolbox _ && this . toolboxPosition == Blockly . TOOLBOX _AT _LEFT && ( e = a . width ) ; var f = 0 ; this . toolbox _ && this . toolboxPosition == Blockly . TOOLBOX _AT _TOP && ( f = a . height ) ; return { contentHeight : d . height , contentWidth : d . width , contentTop : d . top , contentLeft : d . left , viewHeight : c . height , viewWidth : c . width , viewTop : - this . scrollY , viewLeft : - this . scrollX , absoluteTop : f , absoluteLeft : e , toolboxWidth : a . width , toolboxHeight : a . height , flyoutWidth : b . width , flyoutHeight : b . height , toolboxPosition : this . toolboxPosition } } ;
Blockly . WorkspaceSvg . setTopLevelWorkspaceMetrics _ = function ( a ) { if ( ! this . scrollbar ) throw "Attempt to set top level workspace scroll without scrollbars." ; var b = this . getMetrics ( ) ; goog . isNumber ( a . x ) && ( this . scrollX = - b . contentWidth * a . x - b . contentLeft ) ; goog . isNumber ( a . y ) && ( this . scrollY = - b . contentHeight * a . y - b . contentTop ) ; a = this . scrollX + b . absoluteLeft ; b = this . scrollY + b . absoluteTop ; this . translate ( a , b ) ; this . grid _ && this . grid _ . moveTo ( a , b ) } ;
Blockly . WorkspaceSvg . prototype . setResizesEnabled = function ( a ) { var b = ! this . resizesEnabled _ && a ; this . resizesEnabled _ = a ; b && this . resizeContents ( ) } ; Blockly . WorkspaceSvg . prototype . clear = function ( ) { this . setResizesEnabled ( ! 1 ) ; Blockly . WorkspaceSvg . superClass _ . clear . call ( this ) ; this . setResizesEnabled ( ! 0 ) } ; Blockly . WorkspaceSvg . prototype . registerButtonCallback = function ( a , b ) { goog . asserts . assert ( goog . isFunction ( b ) , "Button callbacks must be functions." ) ; this . flyoutButtonCallbacks _ [ a ] = b } ;
Blockly . WorkspaceSvg . prototype . getButtonCallback = function ( a ) { return ( a = this . flyoutButtonCallbacks _ [ a ] ) ? a : null } ; Blockly . WorkspaceSvg . prototype . removeButtonCallback = function ( a ) { this . flyoutButtonCallbacks _ [ a ] = null } ; Blockly . WorkspaceSvg . prototype . registerToolboxCategoryCallback = function ( a , b ) { goog . asserts . assert ( goog . isFunction ( b ) , "Toolbox category callbacks must be functions." ) ; this . toolboxCategoryCallbacks _ [ a ] = b } ;
Blockly . WorkspaceSvg . prototype . getToolboxCategoryCallback = function ( a ) { return ( a = this . toolboxCategoryCallbacks _ [ a ] ) ? a : null } ; Blockly . WorkspaceSvg . prototype . removeToolboxCategoryCallback = function ( a ) { this . toolboxCategoryCallbacks _ [ a ] = null } ;
2018-08-17 13:32:56 +00:00
Blockly . WorkspaceSvg . prototype . getGesture = function ( a ) { var b = "mousedown" == a . type || "touchstart" == a . type || "pointerdown" == a . type , c = this . currentGesture _ ; return c ? b && c . hasStarted ( ) ? ( console . warn ( "tried to start the same gesture twice" ) , c . cancel ( ) , null ) : c : b ? this . currentGesture _ = new Blockly . TouchGesture ( a , this ) : null } ; Blockly . WorkspaceSvg . prototype . clearGesture = function ( ) { this . currentGesture _ = null } ; Blockly . WorkspaceSvg . prototype . cancelCurrentGesture = function ( ) { this . currentGesture _ && this . currentGesture _ . cancel ( ) } ;
2018-01-16 21:13:23 +00:00
Blockly . WorkspaceSvg . prototype . getAudioManager = function ( ) { return this . audioManager _ } ; Blockly . WorkspaceSvg . prototype . getGrid = function ( ) { return this . grid _ } ; Blockly . WorkspaceSvg . prototype . setVisible = Blockly . WorkspaceSvg . prototype . setVisible ; Blockly . Mutator = function ( a ) { Blockly . Mutator . superClass _ . constructor . call ( this , null ) ; this . quarkNames _ = a } ; goog . inherits ( Blockly . Mutator , Blockly . Icon ) ; Blockly . Mutator . prototype . workspaceWidth _ = 0 ; Blockly . Mutator . prototype . workspaceHeight _ = 0 ;
2017-09-25 09:37:41 +00:00
Blockly . Mutator . prototype . drawIcon _ = function ( a ) { Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyIconShape" , rx : "4" , ry : "4" , height : "16" , width : "16" } , a ) ; Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyIconSymbol" , d : "m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z" } , a ) ;
Blockly . utils . createSvgElement ( "circle" , { "class" : "blocklyIconShape" , r : "2.7" , cx : "8" , cy : "8" } , a ) } ; Blockly . Mutator . prototype . iconClick _ = function ( a ) { this . block _ . isEditable ( ) && Blockly . Icon . prototype . iconClick _ . call ( this , a ) } ;
Blockly . Mutator . prototype . createEditor _ = function ( ) { this . svgDialog _ = Blockly . utils . createSvgElement ( "svg" , { x : Blockly . Bubble . BORDER _WIDTH , y : Blockly . Bubble . BORDER _WIDTH } , null ) ; if ( this . quarkNames _ . length ) for ( var a = goog . dom . createDom ( "xml" ) , b = 0 , c ; c = this . quarkNames _ [ b ] ; b ++ ) a . appendChild ( goog . dom . createDom ( "block" , { type : c } ) ) ; else a = null ; a = { languageTree : a , parentWorkspace : this . block _ . workspace , pathToMedia : this . block _ . workspace . options . pathToMedia , RTL : this . block _ . RTL , toolboxPosition : this . block _ . RTL ? Blockly . TOOLBOX _AT _RIGHT :
2018-01-16 21:13:23 +00:00
Blockly . TOOLBOX _AT _LEFT , horizontalLayout : ! 1 , getMetrics : this . getFlyoutMetrics _ . bind ( this ) , setMetrics : null } ; this . workspace _ = new Blockly . WorkspaceSvg ( a ) ; this . workspace _ . isMutator = ! 0 ; a = this . workspace _ . addFlyout _ ( "g" ) ; b = this . workspace _ . createDom ( "blocklyMutatorBackground" ) ; b . insertBefore ( a , this . workspace _ . svgBlockCanvas _ ) ; this . svgDialog _ . appendChild ( b ) ; return this . svgDialog _ } ;
2017-09-25 09:37:41 +00:00
Blockly . Mutator . prototype . updateEditable = function ( ) { this . block _ . isInFlyout || ( this . block _ . isEditable ( ) ? this . iconGroup _ && Blockly . utils . removeClass ( this . iconGroup _ , "blocklyIconGroupReadonly" ) : ( this . setVisible ( ! 1 ) , this . iconGroup _ && Blockly . utils . addClass ( this . iconGroup _ , "blocklyIconGroupReadonly" ) ) ) ; Blockly . Icon . prototype . updateEditable . call ( this ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Mutator . prototype . resizeBubble _ = function ( ) { var a = 2 * Blockly . Bubble . BORDER _WIDTH , b = this . workspace _ . getCanvas ( ) . getBBox ( ) ; var c = this . block _ . RTL ? - b . x : b . width + b . x ; b = b . height + 3 * a ; if ( this . workspace _ . flyout _ ) { var d = this . workspace _ . flyout _ . getMetrics _ ( ) ; b = Math . max ( b , d . contentHeight + 20 ) } c += 3 * a ; if ( Math . abs ( this . workspaceWidth _ - c ) > a || Math . abs ( this . workspaceHeight _ - b ) > a ) this . workspaceWidth _ = c , this . workspaceHeight _ = b , this . bubble _ . setBubbleSize ( c + a , b + a ) , this . svgDialog _ . setAttribute ( "width" , this . workspaceWidth _ ) ,
2017-09-25 09:37:41 +00:00
this . svgDialog _ . setAttribute ( "height" , this . workspaceHeight _ ) ; this . block _ . RTL && ( a = "translate(" + this . workspaceWidth _ + ",0)" , this . workspace _ . getCanvas ( ) . setAttribute ( "transform" , a ) ) ; this . workspace _ . resize ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Mutator . prototype . setVisible = function ( a ) { if ( a != this . isVisible ( ) ) if ( Blockly . Events . fire ( new Blockly . Events . Ui ( this . block _ , "mutatorOpen" , ! a , a ) ) , a ) { this . bubble _ = new Blockly . Bubble ( this . block _ . workspace , this . createEditor _ ( ) , this . block _ . svgPath _ , this . iconXY _ , null , null ) ; this . bubble _ . setSvgId ( this . block _ . id ) ; if ( a = this . workspace _ . options . languageTree ) this . workspace _ . flyout _ . init ( this . workspace _ ) , this . workspace _ . flyout _ . show ( a . childNodes ) ; this . rootBlock _ = this . block _ . decompose ( this . workspace _ ) ; a = this . rootBlock _ . getDescendants ( ! 1 ) ;
for ( var b = 0 , c ; c = a [ b ] ; b ++ ) c . render ( ) ; this . rootBlock _ . setMovable ( ! 1 ) ; this . rootBlock _ . setDeletable ( ! 1 ) ; this . workspace _ . flyout _ ? ( a = 2 * this . workspace _ . flyout _ . CORNER _RADIUS , b = this . workspace _ . flyout _ . width _ + a ) : b = a = 16 ; this . block _ . RTL && ( b = - b ) ; this . rootBlock _ . moveBy ( b , a ) ; if ( this . block _ . saveConnections ) { var d = this ; this . block _ . saveConnections ( this . rootBlock _ ) ; this . sourceListener _ = function ( ) { d . block _ . saveConnections ( d . rootBlock _ ) } ; this . block _ . workspace . addChangeListener ( this . sourceListener _ ) } this . resizeBubble _ ( ) ;
this . workspace _ . addChangeListener ( this . workspaceChanged _ . bind ( this ) ) ; this . updateColour ( ) } else this . svgDialog _ = null , this . workspace _ . dispose ( ) , this . rootBlock _ = this . workspace _ = null , this . bubble _ . dispose ( ) , this . bubble _ = null , this . workspaceHeight _ = this . workspaceWidth _ = 0 , this . sourceListener _ && ( this . block _ . workspace . removeChangeListener ( this . sourceListener _ ) , this . sourceListener _ = null ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Mutator . prototype . workspaceChanged _ = function ( ) { if ( ! this . workspace _ . isDragging ( ) ) for ( var a = this . workspace _ . getTopBlocks ( ! 1 ) , b = 0 , c ; c = a [ b ] ; b ++ ) { var d = c . getRelativeToSurfaceXY ( ) , e = c . getHeightWidth ( ) ; 20 > d . y + e . height && c . moveBy ( 0 , 20 - e . height - d . y ) } if ( this . rootBlock _ . workspace == this . workspace _ ) { Blockly . Events . setGroup ( ! 0 ) ; c = this . block _ ; a = ( a = c . mutationToDom ( ) ) && Blockly . Xml . domToText ( a ) ; b = c . rendered ; c . rendered = ! 1 ; c . compose ( this . rootBlock _ ) ; c . rendered = b ; c . initSvg ( ) ; b = ( b = c . mutationToDom ( ) ) && Blockly . Xml . domToText ( b ) ;
if ( a != b ) { Blockly . Events . fire ( new Blockly . Events . BlockChange ( c , "mutation" , null , a , b ) ) ; var f = Blockly . Events . getGroup ( ) ; setTimeout ( function ( ) { Blockly . Events . setGroup ( f ) ; c . bumpNeighbours _ ( ) ; Blockly . Events . setGroup ( ! 1 ) } , Blockly . BUMP _DELAY ) } c . rendered && c . render ( ) ; this . workspace _ . isDragging ( ) || this . resizeBubble _ ( ) ; Blockly . Events . setGroup ( ! 1 ) } } ; Blockly . Mutator . prototype . getFlyoutMetrics _ = function ( ) { return { viewHeight : this . workspaceHeight _ , viewWidth : this . workspaceWidth _ , absoluteTop : 0 , absoluteLeft : 0 } } ;
2018-08-17 13:32:56 +00:00
Blockly . Mutator . prototype . dispose = function ( ) { this . block _ . mutator = null ; Blockly . Icon . prototype . dispose . call ( this ) } ; Blockly . Mutator . reconnect = function ( a , b , c ) { if ( ! a || ! a . getSourceBlock ( ) . workspace ) return ! 1 ; c = b . getInput ( c ) . connection ; var d = a . targetBlock ( ) ; return d && d != b || c . targetConnection == a ? ! 1 : ( c . isConnected ( ) && c . disconnect ( ) , c . connect ( a ) , ! 0 ) } ;
Blockly . Mutator . findParentWs = function ( a ) { var b = null ; if ( a && a . options ) { var c = a . options . parentWorkspace ; a . isFlyout ? c && c . options && ( b = c . options . parentWorkspace ) : c && ( b = c ) } return b } ; goog . global . Blockly || ( goog . global . Blockly = { } ) ; goog . global . Blockly . Mutator || ( goog . global . Blockly . Mutator = { } ) ; goog . global . Blockly . Mutator . reconnect = Blockly . Mutator . reconnect ; Blockly . Extensions = { } ; Blockly . Extensions . ALL _ = { } ; Blockly . Extensions . register = function ( a , b ) { if ( ! goog . isString ( a ) || goog . string . isEmptyOrWhitespace ( a ) ) throw Error ( 'Error: Invalid extension name "' + a + '"' ) ; if ( Blockly . Extensions . ALL _ [ a ] ) throw Error ( 'Error: Extension "' + a + '" is already registered.' ) ; if ( ! goog . isFunction ( b ) ) throw Error ( 'Error: Extension "' + a + '" must be a function' ) ; Blockly . Extensions . ALL _ [ a ] = b } ;
Blockly . Extensions . registerMixin = function ( a , b ) { if ( ! goog . isObject ( b ) ) throw Error ( 'Error: Mixin "' + a + '" must be a object' ) ; Blockly . Extensions . register ( a , function ( ) { this . mixin ( b ) } ) } ;
Blockly . Extensions . registerMutator = function ( a , b , c , d ) { var e = 'Error when registering mutator "' + a + '": ' ; Blockly . Extensions . checkHasFunction _ ( e , b . domToMutation , "domToMutation" ) ; Blockly . Extensions . checkHasFunction _ ( e , b . mutationToDom , "mutationToDom" ) ; var f = Blockly . Extensions . checkMutatorDialog _ ( b , e ) ; if ( c && ! goog . isFunction ( c ) ) throw Error ( 'Extension "' + a + '" is not a function' ) ; Blockly . Extensions . register ( a , function ( ) { f && this . setMutator ( new Blockly . Mutator ( d ) ) ; this . mixin ( b ) ; c && c . apply ( this ) } ) } ;
Blockly . Extensions . apply = function ( a , b , c ) { var d = Blockly . Extensions . ALL _ [ a ] ; if ( ! goog . isFunction ( d ) ) throw Error ( 'Error: Extension "' + a + '" not found.' ) ; if ( c ) Blockly . Extensions . checkNoMutatorProperties _ ( a , b ) ; else var e = Blockly . Extensions . getMutatorProperties _ ( b ) ; d . apply ( b ) ; if ( c ) Blockly . Extensions . checkBlockHasMutatorProperties _ ( 'Error after applying mutator "' + a + '": ' , b ) ; else if ( ! Blockly . Extensions . mutatorPropertiesMatch _ ( e , b ) ) throw Error ( 'Error when applying extension "' + a + '": mutation properties changed when applying a non-mutator extension.' ) ;
} ; Blockly . Extensions . checkHasFunction _ = function ( a , b , c ) { if ( ! b ) throw Error ( a + 'missing required property "' + c + '"' ) ; if ( "function" != typeof b ) throw Error ( a + '" required property "' + c + '" must be a function' ) ; } ; Blockly . Extensions . checkNoMutatorProperties _ = function ( a , b ) { if ( Blockly . Extensions . getMutatorProperties _ ( b ) . length ) throw Error ( 'Error: tried to apply mutation "' + a + '" to a block that already has mutator functions. Block id: ' + b . id ) ; } ;
Blockly . Extensions . checkMutatorDialog _ = function ( a , b ) { var c = void 0 !== a . compose , d = void 0 !== a . decompose ; if ( c && d ) { if ( "function" != typeof a . compose ) throw Error ( b + "compose must be a function." ) ; if ( "function" != typeof a . decompose ) throw Error ( b + "decompose must be a function." ) ; return ! 0 } if ( c || d ) throw Error ( b + 'Must have both or neither of "compose" and "decompose"' ) ; return ! 1 } ;
Blockly . Extensions . checkBlockHasMutatorProperties _ = function ( a , b ) { if ( "function" != typeof b . domToMutation ) throw Error ( a + 'Applying a mutator didn\'t add "domToMutation"' ) ; if ( "function" != typeof b . mutationToDom ) throw Error ( a + 'Applying a mutator didn\'t add "mutationToDom"' ) ; Blockly . Extensions . checkMutatorDialog _ ( b , a ) } ;
Blockly . Extensions . getMutatorProperties _ = function ( a ) { var b = [ ] ; void 0 !== a . domToMutation && b . push ( a . domToMutation ) ; void 0 !== a . mutationToDom && b . push ( a . mutationToDom ) ; void 0 !== a . compose && b . push ( a . compose ) ; void 0 !== a . decompose && b . push ( a . decompose ) ; return b } ; Blockly . Extensions . mutatorPropertiesMatch _ = function ( a , b ) { var c = Blockly . Extensions . getMutatorProperties _ ( b ) ; if ( c . length != a . length ) return ! 1 ; for ( var d = 0 ; d < c . length ; d ++ ) if ( a [ d ] != c [ d ] ) return ! 1 ; return ! 0 } ;
Blockly . Extensions . buildTooltipForDropdown = function ( a , b ) { var c = [ ] ; "object" == typeof document && Blockly . utils . runAfterPageLoad ( function ( ) { for ( var a in b ) Blockly . utils . checkMessageReferences ( b [ a ] ) } ) ; return function ( ) { this . type && - 1 === c . indexOf ( this . type ) && ( Blockly . Extensions . checkDropdownOptionsInTable _ ( this , a , b ) , c . push ( this . type ) ) ; this . setTooltip ( function ( ) { var d = this . getFieldValue ( a ) , e = b [ d ] ; null == e ? - 1 === c . indexOf ( this . type ) && ( d = "No tooltip mapping for value " + d + " of field " + a , null != this . type && ( d += " of block type " +
this . type ) , console . warn ( d + "." ) ) : e = Blockly . utils . replaceMessageReferences ( e ) ; return e } . bind ( this ) ) } } ; Blockly . Extensions . checkDropdownOptionsInTable _ = function ( a , b , c ) { var d = a . getField ( b ) ; if ( ! d . isOptionListDynamic ( ) ) { d = d . getOptions ( ) ; for ( var e = 0 ; e < d . length ; ++ e ) { var f = d [ e ] [ 1 ] ; null == c [ f ] && console . warn ( "No tooltip mapping for value " + f + " of field " + b + " of block type " + a . type ) } } } ;
Blockly . Extensions . buildTooltipWithFieldText = function ( a , b ) { "object" == typeof document && Blockly . utils . runAfterPageLoad ( function ( ) { Blockly . utils . checkMessageReferences ( a ) } ) ; return function ( ) { this . setTooltip ( function ( ) { var c = this . getField ( b ) ; return Blockly . utils . replaceMessageReferences ( a ) . replace ( "%1" , c ? c . getText ( ) : "" ) } . bind ( this ) ) } } ;
Blockly . Extensions . extensionParentTooltip _ = function ( ) { this . tooltipWhenNotConnected _ = this . tooltip ; this . setTooltip ( function ( ) { var a = this . getParent ( ) ; return a && a . getInputsInline ( ) && a . tooltip || this . tooltipWhenNotConnected _ } . bind ( this ) ) } ; Blockly . Extensions . register ( "parent_tooltip_when_inline" , Blockly . Extensions . extensionParentTooltip _ ) ; Blockly . Field = function ( a , b ) { this . size _ = new goog . math . Size ( 0 , Blockly . BlockSvg . MIN _BLOCK _Y ) ; this . setValue ( a ) ; this . setValidator ( b ) } ; Blockly . Field . TYPE _MAP _ = { } ; Blockly . Field . register = function ( a , b ) { if ( ! goog . isString ( a ) || goog . string . isEmptyOrWhitespace ( a ) ) throw Error ( 'Invalid field type "' + a + '"' ) ; if ( ! goog . isObject ( b ) || ! goog . isFunction ( b . fromJson ) ) throw Error ( 'Field "' + b + '" must have a fromJson function' ) ; Blockly . Field . TYPE _MAP _ [ a ] = b } ;
Blockly . Field . fromJson = function ( a ) { var b = Blockly . Field . TYPE _MAP _ [ a . type ] ; return b ? b . fromJson ( a ) : null } ; Blockly . Field . cacheWidths _ = null ; Blockly . Field . cacheReference _ = 0 ; Blockly . Field . prototype . name = void 0 ; Blockly . Field . prototype . maxDisplayLength = 50 ; Blockly . Field . prototype . text _ = "" ; Blockly . Field . prototype . sourceBlock _ = null ; Blockly . Field . prototype . visible _ = ! 0 ; Blockly . Field . prototype . validator _ = null ; Blockly . Field . NBSP = "\u00a0" ; Blockly . Field . prototype . EDITABLE = ! 0 ;
Blockly . Field . prototype . setSourceBlock = function ( a ) { goog . asserts . assert ( ! this . sourceBlock _ , "Field already bound to a block." ) ; this . sourceBlock _ = a } ;
Blockly . Field . prototype . init = function ( ) { this . fieldGroup _ || ( this . fieldGroup _ = Blockly . utils . createSvgElement ( "g" , { } , null ) , this . visible _ || ( this . fieldGroup _ . style . display = "none" ) , this . borderRect _ = Blockly . utils . createSvgElement ( "rect" , { rx : 4 , ry : 4 , x : - Blockly . BlockSvg . SEP _SPACE _X / 2 , y : 0 , height : 16 } , this . fieldGroup _ ) , this . textElement _ = Blockly . utils . createSvgElement ( "text" , { "class" : "blocklyText" , y : this . size _ . height - 12.5 } , this . fieldGroup _ ) , this . updateEditable ( ) , this . sourceBlock _ . getSvgRoot ( ) . appendChild ( this . fieldGroup _ ) ,
this . mouseDownWrapper _ = Blockly . bindEventWithChecks _ ( this . fieldGroup _ , "mousedown" , this , this . onMouseDown _ ) , this . render _ ( ) ) } ; Blockly . Field . prototype . initModel = function ( ) { } ; Blockly . Field . prototype . dispose = function ( ) { this . mouseDownWrapper _ && ( Blockly . unbindEvent _ ( this . mouseDownWrapper _ ) , this . mouseDownWrapper _ = null ) ; this . sourceBlock _ = null ; goog . dom . removeNode ( this . fieldGroup _ ) ; this . validator _ = this . borderRect _ = this . textElement _ = this . fieldGroup _ = null } ;
Blockly . Field . prototype . updateEditable = function ( ) { var a = this . fieldGroup _ ; this . EDITABLE && a && ( this . sourceBlock _ . isEditable ( ) ? ( Blockly . utils . addClass ( a , "blocklyEditableText" ) , Blockly . utils . removeClass ( a , "blocklyNonEditableText" ) , this . fieldGroup _ . style . cursor = this . CURSOR ) : ( Blockly . utils . addClass ( a , "blocklyNonEditableText" ) , Blockly . utils . removeClass ( a , "blocklyEditableText" ) , this . fieldGroup _ . style . cursor = "" ) ) } ;
Blockly . Field . prototype . isCurrentlyEditable = function ( ) { return this . EDITABLE && ! ! this . sourceBlock _ && this . sourceBlock _ . isEditable ( ) } ; Blockly . Field . prototype . isVisible = function ( ) { return this . visible _ } ; Blockly . Field . prototype . setVisible = function ( a ) { if ( this . visible _ != a ) { this . visible _ = a ; var b = this . getSvgRoot ( ) ; b && ( b . style . display = a ? "block" : "none" , this . render _ ( ) ) } } ; Blockly . Field . prototype . setValidator = function ( a ) { this . validator _ = a } ; Blockly . Field . prototype . getValidator = function ( ) { return this . validator _ } ;
Blockly . Field . prototype . classValidator = function ( a ) { return a } ; Blockly . Field . prototype . callValidator = function ( a ) { var b = this . classValidator ( a ) ; if ( null === b ) return null ; void 0 !== b && ( a = b ) ; if ( b = this . getValidator ( ) ) { b = b . call ( this , a ) ; if ( null === b ) return null ; void 0 !== b && ( a = b ) } return a } ; Blockly . Field . prototype . getSvgRoot = function ( ) { return this . fieldGroup _ } ; Blockly . Field . prototype . render _ = function ( ) { this . visible _ ? ( this . textElement _ . textContent = this . getDisplayText _ ( ) , this . updateWidth ( ) ) : this . size _ . width = 0 } ;
Blockly . Field . prototype . updateWidth = function ( ) { var a = Blockly . Field . getCachedWidth ( this . textElement _ ) ; this . borderRect _ && this . borderRect _ . setAttribute ( "width" , a + Blockly . BlockSvg . SEP _SPACE _X ) ; this . size _ . width = a } ;
Blockly . Field . getCachedWidth = function ( a ) { var b = a . textContent + "\n" + a . className . baseVal , c ; if ( Blockly . Field . cacheWidths _ && ( c = Blockly . Field . cacheWidths _ [ b ] ) ) return c ; try { c = goog . userAgent . IE || goog . userAgent . EDGE ? a . getBBox ( ) . width : a . getComputedTextLength ( ) } catch ( d ) { return 8 * a . textContent . length } Blockly . Field . cacheWidths _ && ( Blockly . Field . cacheWidths _ [ b ] = c ) ; return c } ; Blockly . Field . startCache = function ( ) { Blockly . Field . cacheReference _ ++ ; Blockly . Field . cacheWidths _ || ( Blockly . Field . cacheWidths _ = { } ) } ;
Blockly . Field . stopCache = function ( ) { Blockly . Field . cacheReference _ -- ; Blockly . Field . cacheReference _ || ( Blockly . Field . cacheWidths _ = null ) } ; Blockly . Field . prototype . getSize = function ( ) { this . size _ . width || this . render _ ( ) ; return this . size _ } ; Blockly . Field . prototype . getScaledBBox _ = function ( ) { var a = this . borderRect _ . getBBox ( ) , b = a . height * this . sourceBlock _ . workspace . scale ; a = a . width * this . sourceBlock _ . workspace . scale ; var c = this . getAbsoluteXY _ ( ) ; return { top : c . y , bottom : c . y + b , left : c . x , right : c . x + a } } ;
Blockly . Field . prototype . getDisplayText _ = function ( ) { var a = this . text _ ; if ( ! a ) return Blockly . Field . NBSP ; a . length > this . maxDisplayLength && ( a = a . substring ( 0 , this . maxDisplayLength - 2 ) + "\u2026" ) ; a = a . replace ( /\s/g , Blockly . Field . NBSP ) ; this . sourceBlock _ . RTL && ( a += "\u200f" ) ; return a } ; Blockly . Field . prototype . getText = function ( ) { return this . text _ } ; Blockly . Field . prototype . setText = function ( a ) { null !== a && ( a = String ( a ) , a !== this . text _ && ( this . text _ = a , this . forceRerender ( ) ) ) } ;
Blockly . Field . prototype . forceRerender = function ( ) { this . size _ . width = 0 ; this . sourceBlock _ && this . sourceBlock _ . rendered && ( this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours _ ( ) ) } ; Blockly . Field . prototype . getValue = function ( ) { return this . getText ( ) } ; Blockly . Field . prototype . setValue = function ( a ) { if ( null !== a ) { var b = this . getValue ( ) ; b != a && ( this . sourceBlock _ && Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock _ , "field" , this . name , b , a ) ) , this . setText ( a ) ) } } ;
Blockly . Field . prototype . onMouseDown _ = function ( a ) { this . sourceBlock _ && this . sourceBlock _ . workspace && ( a = this . sourceBlock _ . workspace . getGesture ( a ) ) && a . setStartField ( this ) } ; Blockly . Field . prototype . setTooltip = function ( a ) { } ; Blockly . Field . prototype . getAbsoluteXY _ = function ( ) { return goog . style . getPageOffset ( this . borderRect _ ) } ; Blockly . Field . prototype . referencesVariables = function ( ) { return ! 1 } ; Blockly . FieldLabel = function ( a , b ) { this . size _ = new goog . math . Size ( 0 , 17.5 ) ; this . class _ = b ; this . setValue ( a ) } ; goog . inherits ( Blockly . FieldLabel , Blockly . Field ) ; Blockly . FieldLabel . fromJson = function ( a ) { var b = Blockly . utils . replaceMessageReferences ( a . text ) ; return new Blockly . FieldLabel ( b , a [ "class" ] ) } ; Blockly . FieldLabel . prototype . EDITABLE = ! 1 ;
Blockly . FieldLabel . prototype . init = function ( ) { this . textElement _ || ( this . textElement _ = Blockly . utils . createSvgElement ( "text" , { "class" : "blocklyText" , y : this . size _ . height - 5 } , null ) , this . class _ && Blockly . utils . addClass ( this . textElement _ , this . class _ ) , this . visible _ || ( this . textElement _ . style . display = "none" ) , this . sourceBlock _ . getSvgRoot ( ) . appendChild ( this . textElement _ ) , this . textElement _ . tooltip = this . sourceBlock _ , Blockly . Tooltip . bindMouseEvents ( this . textElement _ ) , this . render _ ( ) ) } ;
Blockly . FieldLabel . prototype . dispose = function ( ) { goog . dom . removeNode ( this . textElement _ ) ; this . textElement _ = null } ; Blockly . FieldLabel . prototype . getSvgRoot = function ( ) { return this . textElement _ } ; Blockly . FieldLabel . prototype . setTooltip = function ( a ) { this . textElement _ . tooltip = a } ; Blockly . Field . register ( "field_label" , Blockly . FieldLabel ) ; Blockly . Input = function ( a , b , c , d ) { if ( a != Blockly . DUMMY _INPUT && ! b ) throw "Value inputs and statement inputs must have non-empty name." ; this . type = a ; this . name = b ; this . sourceBlock _ = c ; this . connection = d ; this . fieldRow = [ ] } ; Blockly . Input . prototype . align = Blockly . ALIGN _LEFT ; Blockly . Input . prototype . visible _ = ! 0 ; Blockly . Input . prototype . appendField = function ( a , b ) { this . insertFieldAt ( this . fieldRow . length , a , b ) ; return this } ;
Blockly . Input . prototype . insertFieldAt = function ( a , b , c ) { if ( 0 > a || a > this . fieldRow . length ) throw Error ( "index " + a + " out of bounds." ) ; if ( ! b && ! c ) return a ; goog . isString ( b ) && ( b = new Blockly . FieldLabel ( b ) ) ; b . setSourceBlock ( this . sourceBlock _ ) ; this . sourceBlock _ . rendered && b . init ( ) ; b . name = c ; b . prefixField && ( a = this . insertFieldAt ( a , b . prefixField ) ) ; this . fieldRow . splice ( a , 0 , b ) ; ++ a ; b . suffixField && ( a = this . insertFieldAt ( a , b . suffixField ) ) ; this . sourceBlock _ . rendered && ( this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours _ ( ) ) ;
return a } ; Blockly . Input . prototype . removeField = function ( a ) { for ( var b = 0 , c ; c = this . fieldRow [ b ] ; b ++ ) if ( c . name === a ) { c . dispose ( ) ; this . fieldRow . splice ( b , 1 ) ; this . sourceBlock _ . rendered && ( this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours _ ( ) ) ; return } goog . asserts . fail ( 'Field "%s" not found.' , a ) } ; Blockly . Input . prototype . isVisible = function ( ) { return this . visible _ } ;
Blockly . Input . prototype . setVisible = function ( a ) { var b = [ ] ; if ( this . visible _ == a ) return b ; for ( var c = ( this . visible _ = a ) ? "block" : "none" , d = 0 , e ; e = this . fieldRow [ d ] ; d ++ ) e . setVisible ( a ) ; this . connection && ( a ? b = this . connection . unhideAll ( ) : this . connection . hideAll ( ) , d = this . connection . targetBlock ( ) ) && ( d . getSvgRoot ( ) . style . display = c , a || ( d . rendered = ! 1 ) ) ; return b } ; Blockly . Input . prototype . setCheck = function ( a ) { if ( ! this . connection ) throw "This input does not have a connection." ; this . connection . setCheck ( a ) ; return this } ;
Blockly . Input . prototype . setAlign = function ( a ) { this . align = a ; this . sourceBlock _ . rendered && this . sourceBlock _ . render ( ) ; return this } ; Blockly . Input . prototype . init = function ( ) { if ( this . sourceBlock _ . workspace . rendered ) for ( var a = 0 ; a < this . fieldRow . length ; a ++ ) this . fieldRow [ a ] . init ( ) } ; Blockly . Input . prototype . dispose = function ( ) { for ( var a = 0 , b ; b = this . fieldRow [ a ] ; a ++ ) b . dispose ( ) ; this . connection && this . connection . dispose ( ) ; this . sourceBlock _ = null } ; Blockly . Warning = function ( a ) { Blockly . Warning . superClass _ . constructor . call ( this , a ) ; this . createIcon ( ) ; this . text _ = { } } ; goog . inherits ( Blockly . Warning , Blockly . Icon ) ; Blockly . Warning . prototype . collapseHidden = ! 1 ;
2017-09-25 09:37:41 +00:00
Blockly . Warning . prototype . drawIcon _ = function ( a ) { Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyIconShape" , d : "M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z" } , a ) ; Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyIconSymbol" , d : "m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z" } , a ) ; Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyIconSymbol" , x : "7" , y : "11" , height : "2" , width : "2" } , a ) } ;
Blockly . Warning . textToDom _ = function ( a ) { var b = Blockly . utils . createSvgElement ( "text" , { "class" : "blocklyText blocklyBubbleText" , y : Blockly . Bubble . BORDER _WIDTH } , null ) ; a = a . split ( "\n" ) ; for ( var c = 0 ; c < a . length ; c ++ ) { var d = Blockly . utils . createSvgElement ( "tspan" , { dy : "1em" , x : Blockly . Bubble . BORDER _WIDTH } , b ) , e = document . createTextNode ( a [ c ] ) ; d . appendChild ( e ) } return b } ;
2018-08-17 13:32:56 +00:00
Blockly . Warning . prototype . setVisible = function ( a ) { if ( a != this . isVisible ( ) ) if ( Blockly . Events . fire ( new Blockly . Events . Ui ( this . block _ , "warningOpen" , ! a , a ) ) , a ) { a = Blockly . Warning . textToDom _ ( this . getText ( ) ) ; this . bubble _ = new Blockly . Bubble ( this . block _ . workspace , a , this . block _ . svgPath _ , this . iconXY _ , null , null ) ; this . bubble _ . setSvgId ( this . block _ . id ) ; if ( this . block _ . RTL ) for ( var b = a . getBBox ( ) . width , c = 0 , d ; d = a . childNodes [ c ] ; c ++ ) d . setAttribute ( "text-anchor" , "end" ) , d . setAttribute ( "x" , b + Blockly . Bubble . BORDER _WIDTH ) ; this . updateColour ( ) ;
a = this . bubble _ . getBubbleSize ( ) ; this . bubble _ . setBubbleSize ( a . width , a . height ) } else this . bubble _ . dispose ( ) , this . body _ = this . bubble _ = null } ; Blockly . Warning . prototype . bodyFocus _ = function ( a ) { this . bubble _ . promote _ ( ) } ; Blockly . Warning . prototype . setText = function ( a , b ) { this . text _ [ b ] != a && ( a ? this . text _ [ b ] = a : delete this . text _ [ b ] , this . isVisible ( ) && ( this . setVisible ( ! 1 ) , this . setVisible ( ! 0 ) ) ) } ; Blockly . Warning . prototype . getText = function ( ) { var a = [ ] , b ; for ( b in this . text _ ) a . push ( this . text _ [ b ] ) ; return a . join ( "\n" ) } ;
Blockly . Warning . prototype . dispose = function ( ) { this . block _ . warning = null ; Blockly . Icon . prototype . dispose . call ( this ) } ; Blockly . Block = function ( a , b , c ) { "undefined" !== typeof Blockly . Generator . prototype [ b ] && console . warn ( 'FUTURE ERROR: Block prototypeName "' + b + '" conflicts with Blockly.Generator members. Registering Generators for this block type will incur errors.\nThis name will be DISALLOWED (throwing an error) in future versions of Blockly.' ) ; this . id = c && ! a . getBlockById ( c ) ? c : Blockly . utils . genUid ( ) ; a . blockDB _ [ this . id ] = this ; this . previousConnection = this . nextConnection = this . outputConnection = null ; this . inputList = [ ] ; this . inputsInline =
void 0 ; this . disabled = ! 1 ; this . tooltip = "" ; this . contextMenu = ! 0 ; this . parentBlock _ = null ; this . childBlocks _ = [ ] ; this . editable _ = this . movable _ = this . deletable _ = ! 0 ; this . collapsed _ = this . isShadow _ = ! 1 ; this . comment = null ; this . xy _ = new goog . math . Coordinate ( 0 , 0 ) ; this . workspace = a ; this . isInFlyout = a . isFlyout ; this . isInMutator = a . isMutator ; this . RTL = a . RTL ; b && ( this . type = b , c = Blockly . Blocks [ b ] , goog . asserts . assertObject ( c , 'Error: Unknown block type "%s".' , b ) , goog . mixin ( this , c ) ) ; a . addTopBlock ( this ) ; goog . isFunction ( this . init ) && this . init ( ) ;
this . inputsInlineDefault = this . inputsInline ; if ( Blockly . Events . isEnabled ( ) ) { ( a = Blockly . Events . getGroup ( ) ) || Blockly . Events . setGroup ( ! 0 ) ; try { Blockly . Events . fire ( new Blockly . Events . BlockCreate ( this ) ) } finally { a || Blockly . Events . setGroup ( ! 1 ) } } goog . isFunction ( this . onchange ) && this . setOnChange ( this . onchange ) } ; Blockly . Block . obtain = function ( a , b ) { console . warn ( "Deprecated call to Blockly.Block.obtain, use workspace.newBlock instead." ) ; return a . newBlock ( b ) } ; Blockly . Block . prototype . data = null ;
Blockly . Block . prototype . colour _ = "#000000" ; Blockly . Block . prototype . hue _ = null ;
Blockly . Block . prototype . dispose = function ( a ) { if ( this . workspace ) { this . onchangeWrapper _ && this . workspace . removeChangeListener ( this . onchangeWrapper _ ) ; this . unplug ( a ) ; Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . BlockDelete ( this ) ) ; Blockly . Events . disable ( ) ; try { this . workspace && ( this . workspace . removeTopBlock ( this ) , delete this . workspace . blockDB _ [ this . id ] , this . workspace = null ) ; Blockly . selected == this && ( Blockly . selected = null ) ; for ( var b = this . childBlocks _ . length - 1 ; 0 <= b ; b -- ) this . childBlocks _ [ b ] . dispose ( ! 1 ) ;
b = 0 ; for ( var c ; c = this . inputList [ b ] ; b ++ ) c . dispose ( ) ; this . inputList . length = 0 ; var d = this . getConnections _ ( ! 0 ) ; for ( b = 0 ; b < d . length ; b ++ ) { var e = d [ b ] ; e . isConnected ( ) && e . disconnect ( ) ; d [ b ] . dispose ( ) } } finally { Blockly . Events . enable ( ) } } } ; Blockly . Block . prototype . initModel = function ( ) { for ( var a = 0 , b ; b = this . inputList [ a ] ; a ++ ) for ( var c = 0 , d ; d = b . fieldRow [ c ] ; c ++ ) d . initModel && d . initModel ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . unplug = function ( a ) { if ( this . outputConnection ) this . outputConnection . isConnected ( ) && this . outputConnection . disconnect ( ) ; else if ( this . previousConnection ) { var b = null ; this . previousConnection . isConnected ( ) && ( b = this . previousConnection . targetConnection , this . previousConnection . disconnect ( ) ) ; var c = this . getNextBlock ( ) ; a && c && ( a = this . nextConnection . targetConnection , a . disconnect ( ) , b && b . checkType _ ( a ) && b . connect ( a ) ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . Block . prototype . getConnections _ = function ( a ) { a = [ ] ; this . outputConnection && a . push ( this . outputConnection ) ; this . previousConnection && a . push ( this . previousConnection ) ; this . nextConnection && a . push ( this . nextConnection ) ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) c . connection && a . push ( c . connection ) ; return a } ; Blockly . Block . prototype . lastConnectionInStack = function ( ) { for ( var a = this . nextConnection ; a ; ) { var b = a . targetBlock ( ) ; if ( ! b ) return a ; a = b . nextConnection } return null } ; Blockly . Block . prototype . bumpNeighbours _ = function ( ) { console . warn ( "Not expected to reach this bumpNeighbours_ function. The BlockSvg function for bumpNeighbours_ was expected to be called instead." ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . getParent = function ( ) { return this . parentBlock _ } ; Blockly . Block . prototype . getInputWithBlock = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . connection && c . connection . targetBlock ( ) == a ) return c ; return null } ; Blockly . Block . prototype . getSurroundParent = function ( ) { var a = this ; do { var b = a ; a = a . getParent ( ) ; if ( ! a ) return null } while ( a . getNextBlock ( ) == b ) ; return a } ; Blockly . Block . prototype . getNextBlock = function ( ) { return this . nextConnection && this . nextConnection . targetBlock ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Block . prototype . getRootBlock = function ( ) { var a = this ; do { var b = a ; a = b . parentBlock _ } while ( a ) ; return b } ; Blockly . Block . prototype . getChildren = function ( a ) { if ( ! a ) return this . childBlocks _ ; a = [ ] ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) c . connection && ( c = c . connection . targetBlock ( ) ) && a . push ( c ) ; ( b = this . getNextBlock ( ) ) && a . push ( b ) ; return a } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . setParent = function ( a ) { if ( a != this . parentBlock _ ) { if ( this . parentBlock _ ) { goog . array . remove ( this . parentBlock _ . childBlocks _ , this ) ; if ( this . previousConnection && this . previousConnection . isConnected ( ) ) throw "Still connected to previous block." ; if ( this . outputConnection && this . outputConnection . isConnected ( ) ) throw "Still connected to parent block." ; this . parentBlock _ = null } else this . workspace . removeTopBlock ( this ) ; ( this . parentBlock _ = a ) ? a . childBlocks _ . push ( this ) : this . workspace . addTopBlock ( this ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . Block . prototype . getDescendants = function ( a ) { for ( var b = [ this ] , c = this . getChildren ( a ) , d , e = 0 ; d = c [ e ] ; e ++ ) b . push . apply ( b , d . getDescendants ( a ) ) ; return b } ; Blockly . Block . prototype . isDeletable = function ( ) { return this . deletable _ && ! this . isShadow _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; Blockly . Block . prototype . setDeletable = function ( a ) { this . deletable _ = a } ; Blockly . Block . prototype . isMovable = function ( ) { return this . movable _ && ! this . isShadow _ && ! ( this . workspace && this . workspace . options . readOnly ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . setMovable = function ( a ) { this . movable _ = a } ; Blockly . Block . prototype . isShadow = function ( ) { return this . isShadow _ } ; Blockly . Block . prototype . setShadow = function ( a ) { this . isShadow _ = a } ; Blockly . Block . prototype . isEditable = function ( ) { return this . editable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; Blockly . Block . prototype . setEditable = function ( a ) { this . editable _ = a ; a = 0 ; for ( var b ; b = this . inputList [ a ] ; a ++ ) for ( var c = 0 , d ; d = b . fieldRow [ c ] ; c ++ ) d . updateEditable ( ) } ;
Blockly . Block . prototype . setConnectionsHidden = function ( a ) { if ( ! a && this . isCollapsed ( ) ) { if ( this . outputConnection && this . outputConnection . setHidden ( a ) , this . previousConnection && this . previousConnection . setHidden ( a ) , this . nextConnection ) { this . nextConnection . setHidden ( a ) ; var b = this . nextConnection . targetBlock ( ) ; b && b . setConnectionsHidden ( a ) } } else for ( var c = this . getConnections _ ( ! 0 ) , d = 0 ; b = c [ d ] ; d ++ ) b . setHidden ( a ) , b . isSuperior ( ) && ( b = b . targetBlock ( ) ) && b . setConnectionsHidden ( a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . setHelpUrl = function ( a ) { this . helpUrl = a } ; Blockly . Block . prototype . setTooltip = function ( a ) { this . tooltip = a } ; Blockly . Block . prototype . getColour = function ( ) { return this . colour _ } ; Blockly . Block . prototype . getHue = function ( ) { return this . hue _ } ;
2018-08-17 13:32:56 +00:00
Blockly . Block . prototype . setColour = function ( a ) { var b = goog . isString ( a ) ? Blockly . utils . replaceMessageReferences ( a ) : a , c = Number ( b ) ; if ( ! isNaN ( c ) && 0 <= c && 360 >= c ) this . hue _ = c , this . colour _ = Blockly . hueToRgb ( c ) ; else if ( goog . isString ( b ) && /^#[0-9a-fA-F]{6}$/ . test ( b ) ) this . colour _ = b , this . hue _ = null ; else throw c = 'Invalid colour: "' + b + '"' , a != b && ( c += ' (from "' + a + '")' ) , c ; } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . setOnChange = function ( a ) { if ( a && ! goog . isFunction ( a ) ) throw Error ( "onchange must be a function." ) ; this . onchangeWrapper _ && this . workspace . removeChangeListener ( this . onchangeWrapper _ ) ; if ( this . onchange = a ) this . onchangeWrapper _ = a . bind ( this ) , this . workspace . addChangeListener ( this . onchangeWrapper _ ) } ; Blockly . Block . prototype . getField = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) if ( e . name === a ) return e ; return null } ;
2018-08-17 13:32:56 +00:00
Blockly . Block . prototype . getVars = function ( ) { for ( var a = [ ] , b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && a . push ( e . getValue ( ) ) ; return a } ; Blockly . Block . prototype . getVarModels = function ( ) { for ( var a = [ ] , b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && ( e = this . workspace . getVariableById ( e . getValue ( ) ) ) && a . push ( e ) ; return a } ;
Blockly . Block . prototype . updateVarName = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && a . getId ( ) == e . getValue ( ) && e . setText ( a . name ) } ; Blockly . Block . prototype . renameVarById = function ( a , b ) { for ( var c = 0 , d ; d = this . inputList [ c ] ; c ++ ) for ( var e = 0 , f ; f = d . fieldRow [ e ] ; e ++ ) f . referencesVariables ( ) && a == f . getValue ( ) && f . setValue ( b ) } ; Blockly . Block . prototype . getFieldValue = function ( a ) { return ( a = this . getField ( a ) ) ? a . getValue ( ) : null } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . setFieldValue = function ( a , b ) { var c = this . getField ( b ) ; goog . asserts . assertObject ( c , 'Field "%s" not found.' , b ) ; c . setValue ( a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . setPreviousStatement = function ( a , b ) { a ? ( void 0 === b && ( b = null ) , this . previousConnection || ( goog . asserts . assert ( ! this . outputConnection , "Remove output connection prior to adding previous connection." ) , this . previousConnection = this . makeConnection _ ( Blockly . PREVIOUS _STATEMENT ) ) , this . previousConnection . setCheck ( b ) ) : this . previousConnection && ( goog . asserts . assert ( ! this . previousConnection . isConnected ( ) , "Must disconnect previous statement before removing connection." ) , this . previousConnection . dispose ( ) ,
this . previousConnection = null ) } ; Blockly . Block . prototype . setNextStatement = function ( a , b ) { a ? ( void 0 === b && ( b = null ) , this . nextConnection || ( this . nextConnection = this . makeConnection _ ( Blockly . NEXT _STATEMENT ) ) , this . nextConnection . setCheck ( b ) ) : this . nextConnection && ( goog . asserts . assert ( ! this . nextConnection . isConnected ( ) , "Must disconnect next statement before removing connection." ) , this . nextConnection . dispose ( ) , this . nextConnection = null ) } ;
Blockly . Block . prototype . setOutput = function ( a , b ) { a ? ( void 0 === b && ( b = null ) , this . outputConnection || ( goog . asserts . assert ( ! this . previousConnection , "Remove previous connection prior to adding output connection." ) , this . outputConnection = this . makeConnection _ ( Blockly . OUTPUT _VALUE ) ) , this . outputConnection . setCheck ( b ) ) : this . outputConnection && ( goog . asserts . assert ( ! this . outputConnection . isConnected ( ) , "Must disconnect output value before removing connection." ) , this . outputConnection . dispose ( ) , this . outputConnection =
2018-01-16 21:13:23 +00:00
null ) } ; Blockly . Block . prototype . setInputsInline = function ( a ) { this . inputsInline != a && ( Blockly . Events . fire ( new Blockly . Events . BlockChange ( this , "inline" , null , this . inputsInline , a ) ) , this . inputsInline = a ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . getInputsInline = function ( ) { if ( void 0 != this . inputsInline ) return this . inputsInline ; for ( var a = 1 ; a < this . inputList . length ; a ++ ) if ( this . inputList [ a - 1 ] . type == Blockly . DUMMY _INPUT && this . inputList [ a ] . type == Blockly . DUMMY _INPUT ) return ! 1 ; for ( a = 1 ; a < this . inputList . length ; a ++ ) if ( this . inputList [ a - 1 ] . type == Blockly . INPUT _VALUE && this . inputList [ a ] . type == Blockly . DUMMY _INPUT ) return ! 0 ; return ! 1 } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . setDisabled = function ( a ) { this . disabled != a && ( Blockly . Events . fire ( new Blockly . Events . BlockChange ( this , "disabled" , null , this . disabled , a ) ) , this . disabled = a ) } ; Blockly . Block . prototype . getInheritedDisabled = function ( ) { for ( var a = this . getSurroundParent ( ) ; a ; ) { if ( a . disabled ) return ! 0 ; a = a . getSurroundParent ( ) } return ! 1 } ; Blockly . Block . prototype . isCollapsed = function ( ) { return this . collapsed _ } ;
Blockly . Block . prototype . setCollapsed = function ( a ) { this . collapsed _ != a && ( Blockly . Events . fire ( new Blockly . Events . BlockChange ( this , "collapsed" , null , this . collapsed _ , a ) ) , this . collapsed _ = a ) } ;
Blockly . Block . prototype . toString = function ( a , b ) { var c = [ ] , d = b || "?" ; if ( this . collapsed _ ) c . push ( this . getInput ( "_TEMP_COLLAPSED_INPUT" ) . fieldRow [ 0 ] . text _ ) ; else for ( var e = 0 , f ; f = this . inputList [ e ] ; e ++ ) { for ( var g = 0 , h ; h = f . fieldRow [ g ] ; g ++ ) h instanceof Blockly . FieldDropdown && ! h . getValue ( ) ? c . push ( d ) : c . push ( h . getText ( ) ) ; f . connection && ( ( f = f . connection . targetBlock ( ) ) ? c . push ( f . toString ( void 0 , b ) ) : c . push ( d ) ) } c = goog . string . trim ( c . join ( " " ) ) || "???" ; a && ( c = goog . string . truncate ( c , a ) ) ; return c } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . appendValueInput = function ( a ) { return this . appendInput _ ( Blockly . INPUT _VALUE , a ) } ; Blockly . Block . prototype . appendStatementInput = function ( a ) { return this . appendInput _ ( Blockly . NEXT _STATEMENT , a ) } ; Blockly . Block . prototype . appendDummyInput = function ( a ) { return this . appendInput _ ( Blockly . DUMMY _INPUT , a || "" ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Block . prototype . jsonInit = function ( a ) { var b = a . type ? 'Block "' + a . type + '": ' : "" ; goog . asserts . assert ( void 0 == a . output || void 0 == a . previousStatement , b + "Must not have both an output and a previousStatement." ) ; this . jsonInitColour _ ( a , b ) ; for ( var c = 0 ; void 0 !== a [ "message" + c ] ; ) this . interpolate _ ( a [ "message" + c ] , a [ "args" + c ] || [ ] , a [ "lastDummyAlign" + c ] ) , c ++ ; void 0 !== a . inputsInline && this . setInputsInline ( a . inputsInline ) ; void 0 !== a . output && this . setOutput ( ! 0 , a . output ) ; void 0 !== a . previousStatement && this . setPreviousStatement ( ! 0 ,
a . previousStatement ) ; void 0 !== a . nextStatement && this . setNextStatement ( ! 0 , a . nextStatement ) ; void 0 !== a . tooltip && ( c = a . tooltip , c = Blockly . utils . replaceMessageReferences ( c ) , this . setTooltip ( c ) ) ; void 0 !== a . enableContextMenu && ( c = a . enableContextMenu , this . contextMenu = ! ! c ) ; void 0 !== a . helpUrl && ( c = a . helpUrl , c = Blockly . utils . replaceMessageReferences ( c ) , this . setHelpUrl ( c ) ) ; goog . isString ( a . extensions ) && ( console . warn ( b + "JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '" + a . type +
"' block." ) , a . extensions = [ a . extensions ] ) ; void 0 !== a . mutator && Blockly . Extensions . apply ( a . mutator , this , ! 0 ) ; if ( Array . isArray ( a . extensions ) ) for ( a = a . extensions , b = 0 ; b < a . length ; ++ b ) Blockly . Extensions . apply ( a [ b ] , this , ! 1 ) } ; Blockly . Block . prototype . jsonInitColour _ = function ( a , b ) { if ( "colour" in a ) if ( void 0 === a . colour ) console . warn ( b + "Undefined color value." ) ; else { var c = a . colour ; try { this . setColour ( c ) } catch ( d ) { console . warn ( b + "Illegal color value: " , c ) } } } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . mixin = function ( a , b ) { if ( goog . isDef ( b ) && ! goog . isBoolean ( b ) ) throw Error ( "opt_disableCheck must be a boolean if provided" ) ; if ( ! b ) { var c = [ ] , d ; for ( d in a ) void 0 !== this [ d ] && c . push ( d ) ; if ( c . length ) throw Error ( "Mixin will overwrite block members: " + JSON . stringify ( c ) ) ; } goog . mixin ( this , a ) } ;
Blockly . Block . prototype . interpolate _ = function ( a , b , c ) { var d = Blockly . utils . tokenizeInterpolation ( a ) , e = [ ] , f = 0 ; a = [ ] ; for ( var g = 0 ; g < d . length ; g ++ ) { var h = d [ g ] ; if ( "number" == typeof h ) { if ( 0 >= h || h > b . length ) throw Error ( 'Block "' + this . type + '": Message index %' + h + " out of range." ) ; if ( e [ h ] ) throw Error ( 'Block "' + this . type + '": Message index %' + h + " duplicated." ) ; e [ h ] = ! 0 ; f ++ ; a . push ( b [ h - 1 ] ) } else ( h = h . trim ( ) ) && a . push ( h ) } if ( f != b . length ) throw Error ( 'Block "' + this . type + '": Message does not reference all ' + b . length + " arg(s)." ) ;
a . length && ( "string" == typeof a [ a . length - 1 ] || goog . string . startsWith ( a [ a . length - 1 ] . type , "field_" ) ) && ( g = { type : "input_dummy" } , c && ( g . align = c ) , a . push ( g ) ) ; c = { LEFT : Blockly . ALIGN _LEFT , RIGHT : Blockly . ALIGN _RIGHT , CENTRE : Blockly . ALIGN _CENTRE } ; b = [ ] ; for ( g = 0 ; g < a . length ; g ++ ) if ( e = a [ g ] , "string" == typeof e ) b . push ( [ e , void 0 ] ) ; else { d = f = null ; do if ( h = ! 1 , "string" == typeof e ) f = new Blockly . FieldLabel ( e ) ; else switch ( e . type ) { case "input_value" : d = this . appendValueInput ( e . name ) ; break ; case "input_statement" : d = this . appendStatementInput ( e . name ) ;
2018-08-17 13:32:56 +00:00
break ; case "input_dummy" : d = this . appendDummyInput ( e . name ) ; break ; default : f = Blockly . Field . fromJson ( e ) , f || ( e . alt ? ( e = e . alt , h = ! 0 ) : console . warn ( "Blockly could not create a field of type " + e . type + ". You may need to register your custom field. See github.com/google/blockly/issues/1584" ) ) } while ( h ) ; if ( f ) b . push ( [ f , e . name ] ) ; else if ( d ) { e . check && d . setCheck ( e . check ) ; e . align && d . setAlign ( c [ e . align ] ) ; for ( e = 0 ; e < b . length ; e ++ ) d . appendField ( b [ e ] [ 0 ] , b [ e ] [ 1 ] ) ; b . length = 0 } } } ;
2017-09-25 09:37:41 +00:00
Blockly . Block . prototype . appendInput _ = function ( a , b ) { var c = null ; if ( a == Blockly . INPUT _VALUE || a == Blockly . NEXT _STATEMENT ) c = this . makeConnection _ ( a ) ; c = new Blockly . Input ( a , b , this , c ) ; this . inputList . push ( c ) ; return c } ;
Blockly . Block . prototype . moveInputBefore = function ( a , b ) { if ( a != b ) { for ( var c = - 1 , d = b ? - 1 : this . inputList . length , e = 0 , f ; f = this . inputList [ e ] ; e ++ ) if ( f . name == a ) { if ( c = e , - 1 != d ) break } else if ( b && f . name == b && ( d = e , - 1 != c ) ) break ; goog . asserts . assert ( - 1 != c , 'Named input "%s" not found.' , a ) ; goog . asserts . assert ( - 1 != d , 'Reference input "%s" not found.' , b ) ; this . moveNumberedInputBefore ( c , d ) } } ;
Blockly . Block . prototype . moveNumberedInputBefore = function ( a , b ) { goog . asserts . assert ( a != b , "Can't move input to itself." ) ; goog . asserts . assert ( a < this . inputList . length , "Input index " + a + " out of bounds." ) ; goog . asserts . assert ( b <= this . inputList . length , "Reference input " + b + " out of bounds." ) ; var c = this . inputList [ a ] ; this . inputList . splice ( a , 1 ) ; a < b && b -- ; this . inputList . splice ( b , 0 , c ) } ;
Blockly . Block . prototype . removeInput = function ( a , b ) { for ( var c = 0 , d ; d = this . inputList [ c ] ; c ++ ) if ( d . name == a ) { if ( d . connection && d . connection . isConnected ( ) ) { d . connection . setShadowDom ( null ) ; var e = d . connection . targetBlock ( ) ; e . isShadow ( ) ? e . dispose ( ) : e . unplug ( ) } d . dispose ( ) ; this . inputList . splice ( c , 1 ) ; return } b || goog . asserts . fail ( 'Input "%s" not found.' , a ) } ; Blockly . Block . prototype . getInput = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . name == a ) return c ; return null } ;
2018-01-16 21:13:23 +00:00
Blockly . Block . prototype . getInputTargetBlock = function ( a ) { return ( a = this . getInput ( a ) ) && a . connection && a . connection . targetBlock ( ) } ; Blockly . Block . prototype . getCommentText = function ( ) { return this . comment || "" } ; Blockly . Block . prototype . setCommentText = function ( a ) { this . comment != a && ( Blockly . Events . fire ( new Blockly . Events . BlockChange ( this , "comment" , null , this . comment , a || "" ) ) , this . comment = a ) } ; Blockly . Block . prototype . setWarningText = function ( a , b ) { } ; Blockly . Block . prototype . setMutator = function ( a ) { } ;
Blockly . Block . prototype . getRelativeToSurfaceXY = function ( ) { return this . xy _ } ; Blockly . Block . prototype . moveBy = function ( a , b ) { goog . asserts . assert ( ! this . parentBlock _ , "Block has parent." ) ; var c = new Blockly . Events . BlockMove ( this ) ; this . xy _ . translate ( a , b ) ; c . recordNew ( ) ; Blockly . Events . fire ( c ) } ; Blockly . Block . prototype . makeConnection _ = function ( a ) { return new Blockly . Connection ( this , a ) } ;
Blockly . Block . prototype . allInputsFilled = function ( a ) { void 0 === a && ( a = ! 0 ) ; if ( ! a && this . isShadow ( ) ) return ! 1 ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . connection && ( c = c . connection . targetBlock ( ) , ! c || ! c . allInputsFilled ( a ) ) ) return ! 1 ; return ( b = this . getNextBlock ( ) ) ? b . allInputsFilled ( a ) : ! 0 } ; Blockly . Block . prototype . toDevString = function ( ) { var a = this . type ? '"' + this . type + '" block' : "Block" ; this . id && ( a += ' (id="' + this . id + '")' ) ; return a } ; Blockly . BlockDragSurfaceSvg = function ( a ) { this . container _ = a ; this . createDom ( ) } ; Blockly . BlockDragSurfaceSvg . prototype . SVG _ = null ; Blockly . BlockDragSurfaceSvg . prototype . dragGroup _ = null ; Blockly . BlockDragSurfaceSvg . prototype . container _ = null ; Blockly . BlockDragSurfaceSvg . prototype . scale _ = 1 ; Blockly . BlockDragSurfaceSvg . prototype . surfaceXY _ = null ;
Blockly . BlockDragSurfaceSvg . prototype . createDom = function ( ) { this . SVG _ || ( this . SVG _ = Blockly . utils . createSvgElement ( "svg" , { xmlns : Blockly . SVG _NS , "xmlns:html" : Blockly . HTML _NS , "xmlns:xlink" : "http://www.w3.org/1999/xlink" , version : "1.1" , "class" : "blocklyBlockDragSurface" } , this . container _ ) , this . dragGroup _ = Blockly . utils . createSvgElement ( "g" , { } , this . SVG _ ) ) } ;
Blockly . BlockDragSurfaceSvg . prototype . setBlocksAndShow = function ( a ) { goog . asserts . assert ( 0 == this . dragGroup _ . childNodes . length , "Already dragging a block." ) ; this . dragGroup _ . appendChild ( a ) ; this . SVG _ . style . display = "block" ; this . surfaceXY _ = new goog . math . Coordinate ( 0 , 0 ) } ; Blockly . BlockDragSurfaceSvg . prototype . translateAndScaleGroup = function ( a , b , c ) { this . scale _ = c ; a = a . toFixed ( 0 ) ; b = b . toFixed ( 0 ) ; this . dragGroup _ . setAttribute ( "transform" , "translate(" + a + "," + b + ") scale(" + c + ")" ) } ;
Blockly . BlockDragSurfaceSvg . prototype . translateSurfaceInternal _ = function ( ) { var a = this . surfaceXY _ . x , b = this . surfaceXY _ . y ; a = a . toFixed ( 0 ) ; b = b . toFixed ( 0 ) ; this . SVG _ . style . display = "block" ; Blockly . utils . setCssTransform ( this . SVG _ , "translate3d(" + a + "px, " + b + "px, 0px)" ) } ; Blockly . BlockDragSurfaceSvg . prototype . translateSurface = function ( a , b ) { this . surfaceXY _ = new goog . math . Coordinate ( a * this . scale _ , b * this . scale _ ) ; this . translateSurfaceInternal _ ( ) } ;
Blockly . BlockDragSurfaceSvg . prototype . getSurfaceTranslation = function ( ) { var a = Blockly . utils . getRelativeXY ( this . SVG _ ) ; return new goog . math . Coordinate ( a . x / this . scale _ , a . y / this . scale _ ) } ; Blockly . BlockDragSurfaceSvg . prototype . getGroup = function ( ) { return this . dragGroup _ } ; Blockly . BlockDragSurfaceSvg . prototype . getCurrentBlock = function ( ) { return this . dragGroup _ . firstChild } ;
Blockly . BlockDragSurfaceSvg . prototype . clearAndHide = function ( a ) { a ? a . appendChild ( this . getCurrentBlock ( ) ) : this . dragGroup _ . removeChild ( this . getCurrentBlock ( ) ) ; this . SVG _ . style . display = "none" ; goog . asserts . assert ( 0 == this . dragGroup _ . childNodes . length , "Drag group was not cleared." ) ; this . surfaceXY _ = null } ; Blockly . utils . uiMenu = { } ; Blockly . utils . uiMenu . getSize = function ( a ) { a = a . getElement ( ) ; var b = goog . style . getSize ( a ) ; b . height = a . scrollHeight ; return b } ; Blockly . utils . uiMenu . adjustBBoxesForRTL = function ( a , b , c ) { b . left += c . width ; b . right += c . width ; a . left += c . width ; a . right += c . width } ; Blockly . ContextMenu = { } ; Blockly . ContextMenu . currentBlock = null ; Blockly . ContextMenu . eventWrapper _ = null ; Blockly . ContextMenu . show = function ( a , b , c ) { Blockly . WidgetDiv . show ( Blockly . ContextMenu , c , null ) ; if ( b . length ) { var d = Blockly . ContextMenu . populate _ ( b , c ) ; goog . events . listen ( d , goog . ui . Component . EventType . ACTION , Blockly . ContextMenu . hide ) ; Blockly . ContextMenu . position _ ( d , a , c ) ; setTimeout ( function ( ) { d . getElement ( ) . focus ( ) } , 1 ) ; Blockly . ContextMenu . currentBlock = null } else Blockly . ContextMenu . hide ( ) } ;
Blockly . ContextMenu . populate _ = function ( a , b ) { var c = new goog . ui . Menu ; c . setRightToLeft ( b ) ; for ( var d = 0 , e ; e = a [ d ] ; d ++ ) { var f = new goog . ui . MenuItem ( e . text ) ; f . setRightToLeft ( b ) ; c . addChild ( f , ! 0 ) ; f . setEnabled ( e . enabled ) ; e . enabled && ( goog . events . listen ( f , goog . ui . Component . EventType . ACTION , e . callback ) , f . handleContextMenu = function ( ) { goog . events . dispatchEvent ( this , goog . ui . Component . EventType . ACTION ) } ) } return c } ;
Blockly . ContextMenu . position _ = function ( a , b , c ) { var d = Blockly . utils . getViewportBBox ( ) ; b = { top : b . clientY + d . top , bottom : b . clientY + d . top , left : b . clientX + d . left , right : b . clientX + d . left } ; Blockly . ContextMenu . createWidget _ ( a ) ; var e = Blockly . utils . uiMenu . getSize ( a ) ; c && Blockly . utils . uiMenu . adjustBBoxesForRTL ( d , b , e ) ; Blockly . WidgetDiv . positionWithAnchor ( d , b , e , c ) ; a . getElement ( ) . focus ( ) } ;
Blockly . ContextMenu . createWidget _ = function ( a ) { a . render ( Blockly . WidgetDiv . DIV ) ; var b = a . getElement ( ) ; Blockly . utils . addClass ( b , "blocklyContextMenu" ) ; Blockly . bindEventWithChecks _ ( b , "contextmenu" , null , Blockly . utils . noEvent ) ; a . setAllowAutoFocus ( ! 0 ) } ; Blockly . ContextMenu . hide = function ( ) { Blockly . WidgetDiv . hideIfOwner ( Blockly . ContextMenu ) ; Blockly . ContextMenu . currentBlock = null ; Blockly . ContextMenu . eventWrapper _ && Blockly . unbindEvent _ ( Blockly . ContextMenu . eventWrapper _ ) } ;
Blockly . ContextMenu . callbackFactory = function ( a , b ) { return function ( ) { Blockly . Events . disable ( ) ; try { var c = Blockly . Xml . domToBlock ( b , a . workspace ) , d = a . getRelativeToSurfaceXY ( ) ; d . x = a . RTL ? d . x - Blockly . SNAP _RADIUS : d . x + Blockly . SNAP _RADIUS ; d . y += 2 * Blockly . SNAP _RADIUS ; c . moveBy ( d . x , d . y ) } finally { Blockly . Events . enable ( ) } Blockly . Events . isEnabled ( ) && ! c . isShadow ( ) && Blockly . Events . fire ( new Blockly . Events . BlockCreate ( c ) ) ; c . select ( ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . ContextMenu . blockDeleteOption = function ( a ) { var b = a . getDescendants ( ! 1 ) . length , c = a . getNextBlock ( ) ; c && ( b -= c . getDescendants ( ! 1 ) . length ) ; return { text : 1 == b ? Blockly . Msg . DELETE _BLOCK : Blockly . Msg . DELETE _X _BLOCKS . replace ( "%1" , String ( b ) ) , enabled : ! 0 , callback : function ( ) { Blockly . Events . setGroup ( ! 0 ) ; a . dispose ( ! 0 , ! 0 ) ; Blockly . Events . setGroup ( ! 1 ) } } } ; Blockly . ContextMenu . blockHelpOption = function ( a ) { return { enabled : ! ( goog . isFunction ( a . helpUrl ) ? ! a . helpUrl ( ) : ! a . helpUrl ) , text : Blockly . Msg . HELP , callback : function ( ) { a . showHelp _ ( ) } } } ;
Blockly . ContextMenu . blockDuplicateOption = function ( a ) { var b = ! 0 ; a . getDescendants ( ! 1 ) . length > a . workspace . remainingCapacity ( ) && ( b = ! 1 ) ; return { text : Blockly . Msg . DUPLICATE _BLOCK , enabled : b , callback : function ( ) { Blockly . duplicate _ ( a ) } } } ; Blockly . ContextMenu . blockCommentOption = function ( a ) { var b = { enabled : ! goog . userAgent . IE } ; a . comment ? ( b . text = Blockly . Msg . REMOVE _COMMENT , b . callback = function ( ) { a . setCommentText ( null ) } ) : ( b . text = Blockly . Msg . ADD _COMMENT , b . callback = function ( ) { a . setCommentText ( "" ) } ) ; return b } ;
Blockly . ContextMenu . commentDeleteOption = function ( a ) { return { text : Blockly . Msg . REMOVE _COMMENT , enabled : ! 0 , callback : function ( ) { Blockly . Events . setGroup ( ! 0 ) ; a . dispose ( ! 0 , ! 0 ) ; Blockly . Events . setGroup ( ! 1 ) } } } ; Blockly . ContextMenu . commentDuplicateOption = function ( a ) { return { text : Blockly . Msg . DUPLICATE _COMMENT , enabled : ! 0 , callback : function ( ) { Blockly . duplicate _ ( a ) } } } ;
Blockly . ContextMenu . workspaceCommentOption = function ( a , b ) { var c = { enabled : ! goog . userAgent . IE } ; c . text = Blockly . Msg . ADD _COMMENT ; c . callback = function ( ) { var c = new Blockly . WorkspaceCommentSvg ( a , Blockly . Msg . WORKSPACE _COMMENT _DEFAULT _TEXT , Blockly . WorkspaceCommentSvg . DEFAULT _SIZE , Blockly . WorkspaceCommentSvg . DEFAULT _SIZE ) , e = a . getInjectionDiv ( ) . getBoundingClientRect ( ) ; e = new goog . math . Coordinate ( b . clientX - e . left , b . clientY - e . top ) ; var f = a . getOriginOffsetInPixels ( ) ; e = goog . math . Coordinate . difference ( e , f ) . scale ( 1 / a . scale ) ;
c . moveBy ( e . x , e . y ) ; a . rendered && ( c . initSvg ( ) , c . render ( ! 1 ) , c . select ( ) ) } ; return c } ; Blockly . BlockSvg = function ( a , b , c ) { this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { } , null ) ; this . svgGroup _ . translate _ = "" ; this . svgPathDark _ = Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyPathDark" , transform : "translate(1,1)" } , this . svgGroup _ ) ; this . svgPath _ = Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyPath" } , this . svgGroup _ ) ; this . svgPathLight _ = Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyPathLight" } , this . svgGroup _ ) ; this . svgPath _ . tooltip = this ; this . rendered = ! 1 ; this . useDragSurface _ =
Blockly . utils . is3dSupported ( ) && ! ! a . blockDragSurface _ ; Blockly . Tooltip . bindMouseEvents ( this . svgPath _ ) ; Blockly . BlockSvg . superClass _ . constructor . call ( this , a , b , c ) ; this . svgGroup _ . dataset && ( this . svgGroup _ . dataset . id = this . id ) } ; goog . inherits ( Blockly . BlockSvg , Blockly . Block ) ; Blockly . BlockSvg . prototype . height = 0 ; Blockly . BlockSvg . prototype . width = 0 ; Blockly . BlockSvg . prototype . dragStartXY _ = null ; Blockly . BlockSvg . prototype . warningTextDb _ = null ; Blockly . BlockSvg . INLINE = - 1 ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . initSvg = function ( ) { goog . asserts . assert ( this . workspace . rendered , "Workspace is headless." ) ; for ( var a = 0 , b ; b = this . inputList [ a ] ; a ++ ) b . init ( ) ; b = this . getIcons ( ) ; for ( a = 0 ; a < b . length ; a ++ ) b [ a ] . createIcon ( ) ; this . updateColour ( ) ; this . updateMovable ( ) ; this . workspace . options . readOnly || this . eventsInit _ || Blockly . bindEventWithChecks _ ( this . getSvgRoot ( ) , "mousedown" , this , this . onMouseDown _ ) ; this . eventsInit _ = ! 0 ; this . getSvgRoot ( ) . parentNode || this . workspace . getCanvas ( ) . appendChild ( this . getSvgRoot ( ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . select = function ( ) { if ( this . isShadow ( ) && this . getParent ( ) ) this . getParent ( ) . select ( ) ; else if ( Blockly . selected != this ) { var a = null ; if ( Blockly . selected ) { a = Blockly . selected . id ; Blockly . Events . disable ( ) ; try { Blockly . selected . unselect ( ) } finally { Blockly . Events . enable ( ) } } a = new Blockly . Events . Ui ( null , "selected" , a , this . id ) ; a . workspaceId = this . workspace . id ; Blockly . Events . fire ( a ) ; Blockly . selected = this ; this . addSelect ( ) } } ;
Blockly . BlockSvg . prototype . unselect = function ( ) { if ( Blockly . selected == this ) { var a = new Blockly . Events . Ui ( null , "selected" , this . id , null ) ; a . workspaceId = this . workspace . id ; Blockly . Events . fire ( a ) ; Blockly . selected = null ; this . removeSelect ( ) } } ; Blockly . BlockSvg . prototype . mutator = null ; Blockly . BlockSvg . prototype . comment = null ; Blockly . BlockSvg . prototype . warning = null ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . getIcons = function ( ) { var a = [ ] ; this . mutator && a . push ( this . mutator ) ; this . comment && a . push ( this . comment ) ; this . warning && a . push ( this . warning ) ; return a } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . setParent = function ( a ) { var b = this . parentBlock _ ; if ( a != b ) { Blockly . Field . startCache ( ) ; Blockly . BlockSvg . superClass _ . setParent . call ( this , a ) ; Blockly . Field . stopCache ( ) ; var c = this . getSvgRoot ( ) ; if ( ! this . workspace . isClearing && c ) { var d = this . getRelativeToSurfaceXY ( ) ; a ? ( a . getSvgRoot ( ) . appendChild ( c ) , a = this . getRelativeToSurfaceXY ( ) , this . moveConnections _ ( a . x - d . x , a . y - d . y ) ) : b && ( this . workspace . getCanvas ( ) . appendChild ( c ) , this . translate ( d . x , d . y ) ) } } } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . getRelativeToSurfaceXY = function ( ) { var a = 0 , b = 0 , c = this . useDragSurface _ ? this . workspace . blockDragSurface _ . getGroup ( ) : null , d = this . getSvgRoot ( ) ; if ( d ) { do { var e = Blockly . utils . getRelativeXY ( d ) ; a += e . x ; b += e . y ; this . useDragSurface _ && this . workspace . blockDragSurface _ . getCurrentBlock ( ) == d && ( e = this . workspace . blockDragSurface _ . getSurfaceTranslation ( ) , a += e . x , b += e . y ) ; d = d . parentNode } while ( d && d != this . workspace . getCanvas ( ) && d != c ) } return new goog . math . Coordinate ( a , b ) } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . moveBy = function ( a , b ) { goog . asserts . assert ( ! this . parentBlock _ , "Block has parent." ) ; var c = Blockly . Events . isEnabled ( ) ; if ( c ) var d = new Blockly . Events . BlockMove ( this ) ; var e = this . getRelativeToSurfaceXY ( ) ; this . translate ( e . x + a , e . y + b ) ; this . moveConnections _ ( a , b ) ; c && ( d . recordNew ( ) , Blockly . Events . fire ( d ) ) ; this . workspace . resizeContents ( ) } ; Blockly . BlockSvg . prototype . translate = function ( a , b ) { this . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . moveToDragSurface _ = function ( ) { if ( this . useDragSurface _ ) { var a = this . getRelativeToSurfaceXY ( ) ; this . clearTransformAttributes _ ( ) ; this . workspace . blockDragSurface _ . translateSurface ( a . x , a . y ) ; this . workspace . blockDragSurface _ . setBlocksAndShow ( this . getSvgRoot ( ) ) } } ; Blockly . BlockSvg . prototype . moveOffDragSurface _ = function ( a ) { this . useDragSurface _ && ( this . translate ( a . x , a . y ) , this . workspace . blockDragSurface _ . clearAndHide ( this . workspace . getCanvas ( ) ) ) } ;
Blockly . BlockSvg . prototype . moveDuringDrag = function ( a ) { this . useDragSurface _ ? this . workspace . blockDragSurface _ . translateSurface ( a . x , a . y ) : ( this . svgGroup _ . translate _ = "translate(" + a . x + "," + a . y + ")" , this . svgGroup _ . setAttribute ( "transform" , this . svgGroup _ . translate _ + this . svgGroup _ . skew _ ) ) } ; Blockly . BlockSvg . prototype . clearTransformAttributes _ = function ( ) { Blockly . utils . removeAttribute ( this . getSvgRoot ( ) , "transform" ) } ;
Blockly . BlockSvg . prototype . snapToGrid = function ( ) { if ( this . workspace && ! this . workspace . isDragging ( ) && ! this . getParent ( ) && ! this . isInFlyout ) { var a = this . workspace . getGrid ( ) ; if ( a && a . shouldSnap ( ) ) { var b = a . getSpacing ( ) , c = b / 2 , d = this . getRelativeToSurfaceXY ( ) ; a = Math . round ( ( d . x - c ) / b ) * b + c - d . x ; b = Math . round ( ( d . y - c ) / b ) * b + c - d . y ; a = Math . round ( a ) ; b = Math . round ( b ) ; 0 == a && 0 == b || this . moveBy ( a , b ) } } } ;
Blockly . BlockSvg . prototype . getBoundingRectangle = function ( ) { var a = this . getRelativeToSurfaceXY ( this ) , b = this . outputConnection ? Blockly . BlockSvg . TAB _WIDTH : 0 , c = this . getHeightWidth ( ) ; if ( this . RTL ) { var d = new goog . math . Coordinate ( a . x - ( c . width - b ) , a . y ) ; a = new goog . math . Coordinate ( a . x + b , a . y + c . height ) } else d = new goog . math . Coordinate ( a . x - b , a . y ) , a = new goog . math . Coordinate ( a . x + c . width - b , a . y + c . height ) ; return { topLeft : d , bottomRight : a } } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . setCollapsed = function ( a ) { if ( this . collapsed _ != a ) { for ( var b = [ ] , c = 0 , d ; d = this . inputList [ c ] ; c ++ ) b . push . apply ( b , d . setVisible ( ! a ) ) ; if ( a ) { d = this . getIcons ( ) ; for ( c = 0 ; c < d . length ; c ++ ) d [ c ] . setVisible ( ! 1 ) ; c = this . toString ( Blockly . COLLAPSE _CHARS ) ; this . appendDummyInput ( "_TEMP_COLLAPSED_INPUT" ) . appendField ( c ) . init ( ) } else this . removeInput ( "_TEMP_COLLAPSED_INPUT" ) , this . setWarningText ( null ) ; Blockly . BlockSvg . superClass _ . setCollapsed . call ( this , a ) ; b . length || ( b [ 0 ] = this ) ; if ( this . rendered ) for ( c = 0 ; a =
2018-01-16 21:13:23 +00:00
b [ c ] ; c ++ ) a . render ( ) } } ; Blockly . BlockSvg . prototype . tab = function ( a , b ) { var c = this . createTabList _ ( ) , d = c . indexOf ( a ) ; - 1 == d && ( d = b ? - 1 : c . length ) ; ( c = c [ b ? d + 1 : d - 1 ] ) ? c instanceof Blockly . Field ? c . showEditor _ ( ) : c . tab ( null , b ) : ( c = this . getParent ( ) ) && c . tab ( this , b ) } ; Blockly . BlockSvg . prototype . createTabList _ = function ( ) { for ( var a = [ ] , b = 0 , c ; c = this . inputList [ b ] ; b ++ ) { for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e instanceof Blockly . FieldTextInput && a . push ( e ) ; c . connection && ( c = c . connection . targetBlock ( ) ) && a . push ( c ) } return a } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . onMouseDown _ = function ( a ) { var b = this . workspace && this . workspace . getGesture ( a ) ; b && b . handleBlockStart ( a , this ) } ; Blockly . BlockSvg . prototype . showHelp _ = function ( ) { var a = goog . isFunction ( this . helpUrl ) ? this . helpUrl ( ) : this . helpUrl ; a && window . open ( a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . showContextMenu _ = function ( a ) { if ( ! this . workspace . options . readOnly && this . contextMenu ) { var b = this , c = [ ] ; if ( this . isDeletable ( ) && this . isMovable ( ) && ! b . isInFlyout ) { c . push ( Blockly . ContextMenu . blockDuplicateOption ( b ) ) ; this . isEditable ( ) && ! this . collapsed _ && this . workspace . options . comments && c . push ( Blockly . ContextMenu . blockCommentOption ( b ) ) ; if ( ! this . collapsed _ ) for ( var d = 1 ; d < this . inputList . length ; d ++ ) if ( this . inputList [ d - 1 ] . type != Blockly . NEXT _STATEMENT && this . inputList [ d ] . type != Blockly . NEXT _STATEMENT ) { d =
2018-08-17 13:32:56 +00:00
{ enabled : ! 0 } ; var e = this . getInputsInline ( ) ; d . text = e ? Blockly . Msg . EXTERNAL _INPUTS : Blockly . Msg . INLINE _INPUTS ; d . callback = function ( ) { b . setInputsInline ( ! e ) } ; c . push ( d ) ; break } this . workspace . options . collapse && ( this . collapsed _ ? ( d = { enabled : ! 0 } , d . text = Blockly . Msg . EXPAND _BLOCK , d . callback = function ( ) { b . setCollapsed ( ! 1 ) } , c . push ( d ) ) : ( d = { enabled : ! 0 } , d . text = Blockly . Msg . COLLAPSE _BLOCK , d . callback = function ( ) { b . setCollapsed ( ! 0 ) } , c . push ( d ) ) ) ; this . workspace . options . disable && ( d = { text : this . disabled ? Blockly . Msg . ENABLE _BLOCK :
Blockly . Msg . DISABLE _BLOCK , enabled : ! this . getInheritedDisabled ( ) , callback : function ( ) { b . setDisabled ( ! b . disabled ) } } , c . push ( d ) ) ; c . push ( Blockly . ContextMenu . blockDeleteOption ( b ) ) } c . push ( Blockly . ContextMenu . blockHelpOption ( b ) ) ; this . customContextMenu && this . customContextMenu ( c ) ; Blockly . ContextMenu . show ( a , c , this . RTL ) ; Blockly . ContextMenu . currentBlock = this } } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . moveConnections _ = function ( a , b ) { if ( this . rendered ) { for ( var c = this . getConnections _ ( ! 1 ) , d = 0 ; d < c . length ; d ++ ) c [ d ] . moveBy ( a , b ) ; c = this . getIcons ( ) ; for ( d = 0 ; d < c . length ; d ++ ) c [ d ] . computeIconLocation ( ) ; for ( d = 0 ; d < this . childBlocks _ . length ; d ++ ) this . childBlocks _ [ d ] . moveConnections _ ( a , b ) } } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . setDragging = function ( a ) { if ( a ) { var b = this . getSvgRoot ( ) ; b . translate _ = "" ; b . skew _ = "" ; Blockly . draggingConnections _ = Blockly . draggingConnections _ . concat ( this . getConnections _ ( ! 0 ) ) ; Blockly . utils . addClass ( this . svgGroup _ , "blocklyDragging" ) } else Blockly . draggingConnections _ = [ ] , Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDragging" ) ; for ( b = 0 ; b < this . childBlocks _ . length ; b ++ ) this . childBlocks _ [ b ] . setDragging ( a ) } ;
Blockly . BlockSvg . prototype . updateMovable = function ( ) { this . isMovable ( ) ? Blockly . utils . addClass ( this . svgGroup _ , "blocklyDraggable" ) : Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDraggable" ) } ; Blockly . BlockSvg . prototype . setMovable = function ( a ) { Blockly . BlockSvg . superClass _ . setMovable . call ( this , a ) ; this . updateMovable ( ) } ; Blockly . BlockSvg . prototype . setEditable = function ( a ) { Blockly . BlockSvg . superClass _ . setEditable . call ( this , a ) ; a = this . getIcons ( ) ; for ( var b = 0 ; b < a . length ; b ++ ) a [ b ] . updateEditable ( ) } ;
Blockly . BlockSvg . prototype . setShadow = function ( a ) { Blockly . BlockSvg . superClass _ . setShadow . call ( this , a ) ; this . updateColour ( ) } ; Blockly . BlockSvg . prototype . getSvgRoot = function ( ) { return this . svgGroup _ } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . dispose = function ( a , b ) { if ( this . workspace ) { Blockly . Tooltip . hide ( ) ; Blockly . Field . startCache ( ) ; var c = this . workspace ; Blockly . selected == this && ( this . unselect ( ) , this . workspace . cancelCurrentGesture ( ) ) ; Blockly . ContextMenu . currentBlock == this && Blockly . ContextMenu . hide ( ) ; b && this . rendered && ( this . unplug ( a ) , Blockly . BlockAnimations . disposeUiEffect ( this ) ) ; this . rendered = ! 1 ; if ( this . warningTextDb _ ) { for ( var d in this . warningTextDb _ ) clearTimeout ( this . warningTextDb _ [ d ] ) ; this . warningTextDb _ = null } Blockly . Events . disable ( ) ;
2018-01-16 21:13:23 +00:00
try { var e = this . getIcons ( ) ; for ( d = 0 ; d < e . length ; d ++ ) e [ d ] . dispose ( ) } finally { Blockly . Events . enable ( ) } Blockly . BlockSvg . superClass _ . dispose . call ( this , a ) ; goog . dom . removeNode ( this . svgGroup _ ) ; c . resizeContents ( ) ; this . svgPathDark _ = this . svgPathLight _ = this . svgPath _ = this . svgGroup _ = null ; Blockly . Field . stopCache ( ) } } ;
Blockly . BlockSvg . prototype . updateColour = function ( ) { if ( ! this . disabled ) { var a = this . getColour ( ) , b = goog . color . hexToRgb ( a ) ; if ( this . isShadow ( ) ) b = goog . color . lighten ( b , . 6 ) , a = goog . color . rgbArrayToHex ( b ) , this . svgPathLight _ . style . display = "none" , this . svgPathDark _ . setAttribute ( "fill" , a ) ; else { this . svgPathLight _ . style . display = "" ; var c = goog . color . rgbArrayToHex ( goog . color . lighten ( b , . 3 ) ) ; b = goog . color . rgbArrayToHex ( goog . color . darken ( b , . 2 ) ) ; this . svgPathLight _ . setAttribute ( "stroke" , c ) ; this . svgPathDark _ . setAttribute ( "fill" ,
2018-08-17 13:32:56 +00:00
b ) } this . svgPath _ . setAttribute ( "fill" , a ) ; a = this . getIcons ( ) ; for ( c = 0 ; c < a . length ; c ++ ) a [ c ] . updateColour ( ) ; for ( a = 0 ; c = this . inputList [ a ] ; a ++ ) { b = 0 ; for ( var d ; d = c . fieldRow [ b ] ; b ++ ) d . forceRerender ( ) } } } ;
Blockly . BlockSvg . prototype . updateDisabled = function ( ) { this . disabled || this . getInheritedDisabled ( ) ? Blockly . utils . addClass ( this . svgGroup _ , "blocklyDisabled" ) && this . svgPath _ . setAttribute ( "fill" , "url(#" + this . workspace . options . disabledPatternId + ")" ) : Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDisabled" ) && this . updateColour ( ) ; for ( var a = this . getChildren ( ! 1 ) , b = 0 , c ; c = a [ b ] ; b ++ ) c . updateDisabled ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . getCommentText = function ( ) { return this . comment ? this . comment . getText ( ) . replace ( /\s+$/ , "" ) . replace ( / +\n/g , "\n" ) : "" } ; Blockly . BlockSvg . prototype . setCommentText = function ( a ) { var b = ! 1 ; goog . isString ( a ) ? ( this . comment || ( this . comment = new Blockly . Comment ( this ) , b = ! 0 ) , this . comment . setText ( a ) ) : this . comment && ( this . comment . dispose ( ) , b = ! 0 ) ; b && this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . setWarningText = function ( a , b ) { this . warningTextDb _ || ( this . warningTextDb _ = Object . create ( null ) ) ; var c = b || "" ; if ( c ) this . warningTextDb _ [ c ] && ( clearTimeout ( this . warningTextDb _ [ c ] ) , delete this . warningTextDb _ [ c ] ) ; else for ( var d in this . warningTextDb _ ) clearTimeout ( this . warningTextDb _ [ d ] ) , delete this . warningTextDb _ [ d ] ; if ( this . workspace . isDragging ( ) ) { var e = this ; this . warningTextDb _ [ c ] = setTimeout ( function ( ) { e . workspace && ( delete e . warningTextDb _ [ c ] , e . setWarningText ( a , c ) ) } , 100 ) } else { this . isInFlyout &&
( a = null ) ; d = this . getSurroundParent ( ) ; for ( var f = null ; d ; ) d . isCollapsed ( ) && ( f = d ) , d = d . getSurroundParent ( ) ; f && f . setWarningText ( a , "collapsed " + this . id + " " + c ) ; d = ! 1 ; goog . isString ( a ) ? ( this . warning || ( this . warning = new Blockly . Warning ( this ) , d = ! 0 ) , this . warning . setText ( a , c ) ) : this . warning && ! c ? ( this . warning . dispose ( ) , d = ! 0 ) : this . warning && ( d = this . warning . getText ( ) , this . warning . setText ( "" , c ) , ( f = this . warning . getText ( ) ) || this . warning . dispose ( ) , d = d != f ) ; d && this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } } ;
Blockly . BlockSvg . prototype . setMutator = function ( a ) { this . mutator && this . mutator !== a && this . mutator . dispose ( ) ; a && ( a . block _ = this , this . mutator = a , a . createIcon ( ) ) } ; Blockly . BlockSvg . prototype . setDisabled = function ( a ) { this . disabled != a && ( Blockly . BlockSvg . superClass _ . setDisabled . call ( this , a ) , this . rendered && this . updateDisabled ( ) ) } ;
Blockly . BlockSvg . prototype . setHighlighted = function ( a ) { this . rendered && ( a ? ( this . svgPath _ . setAttribute ( "filter" , "url(#" + this . workspace . options . embossFilterId + ")" ) , this . svgPathLight _ . style . display = "none" ) : ( Blockly . utils . removeAttribute ( this . svgPath _ , "filter" ) , delete this . svgPathLight _ . style . display ) ) } ; Blockly . BlockSvg . prototype . addSelect = function ( ) { Blockly . utils . addClass ( this . svgGroup _ , "blocklySelected" ) } ; Blockly . BlockSvg . prototype . removeSelect = function ( ) { Blockly . utils . removeClass ( this . svgGroup _ , "blocklySelected" ) } ;
Blockly . BlockSvg . prototype . setDeleteStyle = function ( a ) { a ? Blockly . utils . addClass ( this . svgGroup _ , "blocklyDraggingDelete" ) : Blockly . utils . removeClass ( this . svgGroup _ , "blocklyDraggingDelete" ) } ; Blockly . BlockSvg . prototype . setColour = function ( a ) { Blockly . BlockSvg . superClass _ . setColour . call ( this , a ) ; this . rendered && this . updateColour ( ) } ; Blockly . BlockSvg . prototype . bringToFront = function ( ) { var a = this ; do { var b = a . getSvgRoot ( ) ; b . parentNode . appendChild ( b ) ; a = a . getParent ( ) } while ( a ) } ;
Blockly . BlockSvg . prototype . setPreviousStatement = function ( a , b ) { Blockly . BlockSvg . superClass _ . setPreviousStatement . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ; Blockly . BlockSvg . prototype . setNextStatement = function ( a , b ) { Blockly . BlockSvg . superClass _ . setNextStatement . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ; Blockly . BlockSvg . prototype . setOutput = function ( a , b ) { Blockly . BlockSvg . superClass _ . setOutput . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ;
Blockly . BlockSvg . prototype . setInputsInline = function ( a ) { Blockly . BlockSvg . superClass _ . setInputsInline . call ( this , a ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ; Blockly . BlockSvg . prototype . removeInput = function ( a , b ) { Blockly . BlockSvg . superClass _ . removeInput . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ; Blockly . BlockSvg . prototype . moveNumberedInputBefore = function ( a , b ) { Blockly . BlockSvg . superClass _ . moveNumberedInputBefore . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . appendInput _ = function ( a , b ) { var c = Blockly . BlockSvg . superClass _ . appendInput _ . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours _ ( ) ) ; return c } ; Blockly . BlockSvg . prototype . getConnections _ = function ( a ) { var b = [ ] ; if ( a || this . rendered ) if ( this . outputConnection && b . push ( this . outputConnection ) , this . previousConnection && b . push ( this . previousConnection ) , this . nextConnection && b . push ( this . nextConnection ) , a || ! this . collapsed _ ) { a = 0 ; for ( var c ; c = this . inputList [ a ] ; a ++ ) c . connection && b . push ( c . connection ) } return b } ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . prototype . makeConnection _ = function ( a ) { return new Blockly . RenderedConnection ( this , a ) } ;
Blockly . BlockSvg . prototype . bumpNeighbours _ = function ( ) { if ( this . workspace && ! this . workspace . isDragging ( ) ) { var a = this . getRootBlock ( ) ; if ( ! a . isInFlyout ) for ( var b = this . getConnections _ ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) { d . isConnected ( ) && d . isSuperior ( ) && d . targetBlock ( ) . bumpNeighbours _ ( ) ; for ( var e = d . neighbours _ ( Blockly . SNAP _RADIUS ) , f = 0 , g ; g = e [ f ] ; f ++ ) d . isConnected ( ) && g . isConnected ( ) || g . getSourceBlock ( ) . getRootBlock ( ) != a && ( d . isSuperior ( ) ? g . bumpAwayFrom _ ( d ) : d . bumpAwayFrom _ ( g ) ) } } } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . scheduleSnapAndBump = function ( ) { var a = this , b = Blockly . Events . getGroup ( ) ; setTimeout ( function ( ) { Blockly . Events . setGroup ( b ) ; a . snapToGrid ( ) ; Blockly . Events . setGroup ( ! 1 ) } , Blockly . BUMP _DELAY / 2 ) ; setTimeout ( function ( ) { Blockly . Events . setGroup ( b ) ; a . bumpNeighbours _ ( ) ; Blockly . Events . setGroup ( ! 1 ) } , Blockly . BUMP _DELAY ) } ; Blockly . BlockSvg . render = { } ; Blockly . BlockSvg . PathObject = function ( ) { this . steps = [ ] ; this . highlightSteps = [ ] ; this . inlineSteps = [ ] ; this . highlightInlineSteps = [ ] } ; Blockly . BlockSvg . SEP _SPACE _X = 10 ; Blockly . BlockSvg . SEP _SPACE _Y = 10 ; Blockly . BlockSvg . INLINE _PADDING _Y = 5 ; Blockly . BlockSvg . MIN _BLOCK _Y = 25 ; Blockly . BlockSvg . TAB _HEIGHT = 20 ; Blockly . BlockSvg . TAB _WIDTH = 8 ; Blockly . BlockSvg . NOTCH _WIDTH = 30 ; Blockly . BlockSvg . CORNER _RADIUS = 8 ; Blockly . BlockSvg . START _HAT = ! 1 ; Blockly . BlockSvg . START _HAT _HEIGHT = 15 ;
Blockly . BlockSvg . START _HAT _PATH = "c 30,-" + Blockly . BlockSvg . START _HAT _HEIGHT + " 70,-" + Blockly . BlockSvg . START _HAT _HEIGHT + " 100,0" ; Blockly . BlockSvg . START _HAT _HIGHLIGHT _LTR = "c 17.8,-9.2 45.3,-14.9 75,-8.7 M 100.5,0.5" ; Blockly . BlockSvg . START _HAT _HIGHLIGHT _RTL = "m 25,-8.7 c 29.7,-6.2 57.2,-0.5 75,8.7" ; Blockly . BlockSvg . DISTANCE _45 _INSIDE = ( 1 - Math . SQRT1 _2 ) * ( Blockly . BlockSvg . CORNER _RADIUS - . 5 ) + . 5 ; Blockly . BlockSvg . DISTANCE _45 _OUTSIDE = ( 1 - Math . SQRT1 _2 ) * ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) - . 5 ;
Blockly . BlockSvg . NOTCH _PATH _LEFT = "l 6,4 3,0 6,-4" ; Blockly . BlockSvg . NOTCH _PATH _LEFT _HIGHLIGHT = "l 6,4 3,0 6,-4" ; Blockly . BlockSvg . NOTCH _PATH _RIGHT = "l -6,4 -3,0 -6,-4" ; Blockly . BlockSvg . JAGGED _TEETH = "l 8,0 0,4 8,4 -16,8 8,4" ; Blockly . BlockSvg . JAGGED _TEETH _HEIGHT = 20 ; Blockly . BlockSvg . JAGGED _TEETH _WIDTH = 15 ; Blockly . BlockSvg . TAB _PATH _DOWN = "v 5 c 0,10 -" + Blockly . BlockSvg . TAB _WIDTH + ",-8 -" + Blockly . BlockSvg . TAB _WIDTH + ",7.5 s " + Blockly . BlockSvg . TAB _WIDTH + ",-2.5 " + Blockly . BlockSvg . TAB _WIDTH + ",7.5" ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . TAB _PATH _DOWN _HIGHLIGHT _RTL = "v 6.5 m -" + . 97 * Blockly . BlockSvg . TAB _WIDTH + ",3 q -" + . 05 * Blockly . BlockSvg . TAB _WIDTH + ",10 " + . 3 * Blockly . BlockSvg . TAB _WIDTH + ",9.5 m " + . 67 * Blockly . BlockSvg . TAB _WIDTH + ",-1.9 v 1.4" ; Blockly . BlockSvg . TOP _LEFT _CORNER _START = "m 0," + Blockly . BlockSvg . CORNER _RADIUS ; Blockly . BlockSvg . TOP _LEFT _CORNER _START _HIGHLIGHT _RTL = "m " + Blockly . BlockSvg . DISTANCE _45 _INSIDE + "," + Blockly . BlockSvg . DISTANCE _45 _INSIDE ;
Blockly . BlockSvg . TOP _LEFT _CORNER _START _HIGHLIGHT _LTR = "m 0.5," + ( Blockly . BlockSvg . CORNER _RADIUS - . 5 ) ; Blockly . BlockSvg . TOP _LEFT _CORNER = "A " + Blockly . BlockSvg . CORNER _RADIUS + "," + Blockly . BlockSvg . CORNER _RADIUS + " 0 0,1 " + Blockly . BlockSvg . CORNER _RADIUS + ",0" ; Blockly . BlockSvg . TOP _LEFT _CORNER _HIGHLIGHT = "A " + ( Blockly . BlockSvg . CORNER _RADIUS - . 5 ) + "," + ( Blockly . BlockSvg . CORNER _RADIUS - . 5 ) + " 0 0,1 " + Blockly . BlockSvg . CORNER _RADIUS + ",0.5" ;
Blockly . BlockSvg . INNER _TOP _LEFT _CORNER = Blockly . BlockSvg . NOTCH _PATH _RIGHT + " h -" + ( Blockly . BlockSvg . NOTCH _WIDTH - 15 - Blockly . BlockSvg . CORNER _RADIUS ) + " a " + Blockly . BlockSvg . CORNER _RADIUS + "," + Blockly . BlockSvg . CORNER _RADIUS + " 0 0,0 -" + Blockly . BlockSvg . CORNER _RADIUS + "," + Blockly . BlockSvg . CORNER _RADIUS ; Blockly . BlockSvg . INNER _BOTTOM _LEFT _CORNER = "a " + Blockly . BlockSvg . CORNER _RADIUS + "," + Blockly . BlockSvg . CORNER _RADIUS + " 0 0,0 " + Blockly . BlockSvg . CORNER _RADIUS + "," + Blockly . BlockSvg . CORNER _RADIUS ;
Blockly . BlockSvg . INNER _TOP _LEFT _CORNER _HIGHLIGHT _RTL = "a " + Blockly . BlockSvg . CORNER _RADIUS + "," + Blockly . BlockSvg . CORNER _RADIUS + " 0 0,0 " + ( - Blockly . BlockSvg . DISTANCE _45 _OUTSIDE - . 5 ) + "," + ( Blockly . BlockSvg . CORNER _RADIUS - Blockly . BlockSvg . DISTANCE _45 _OUTSIDE ) ; Blockly . BlockSvg . INNER _BOTTOM _LEFT _CORNER _HIGHLIGHT _RTL = "a " + ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) + "," + ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) + " 0 0,0 " + ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) + "," + ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) ;
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . INNER _BOTTOM _LEFT _CORNER _HIGHLIGHT _LTR = "a " + ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) + "," + ( Blockly . BlockSvg . CORNER _RADIUS + . 5 ) + " 0 0,0 " + ( Blockly . BlockSvg . CORNER _RADIUS - Blockly . BlockSvg . DISTANCE _45 _OUTSIDE ) + "," + ( Blockly . BlockSvg . DISTANCE _45 _OUTSIDE + . 5 ) ; Blockly . BlockSvg . prototype . getHeightWidth = function ( ) { var a = this . height , b = this . width , c = this . getNextBlock ( ) ; c ? ( c = c . getHeightWidth ( ) , a += c . height - 4 , b = Math . max ( b , c . width ) ) : this . nextConnection || this . outputConnection || ( a += 2 ) ; return { height : a , width : b } } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . render = function ( a ) { Blockly . Field . startCache ( ) ; this . rendered = ! 0 ; var b = Blockly . BlockSvg . SEP _SPACE _X ; this . RTL && ( b = - b ) ; for ( var c = this . getIcons ( ) , d = 0 ; d < c . length ; d ++ ) b = c [ d ] . renderIcon ( b ) ; b += this . RTL ? Blockly . BlockSvg . SEP _SPACE _X : - Blockly . BlockSvg . SEP _SPACE _X ; c = this . renderCompute _ ( b ) ; this . renderDraw _ ( b , c ) ; this . renderMoveConnections _ ( ) ; ! 1 !== a && ( ( a = this . getParent ( ) ) ? a . render ( ! 0 ) : this . workspace . resizeContents ( ) ) ; Blockly . Field . stopCache ( ) } ;
Blockly . BlockSvg . prototype . renderFields _ = function ( a , b , c ) { c += Blockly . BlockSvg . INLINE _PADDING _Y ; this . RTL && ( b = - b ) ; for ( var d = 0 , e ; e = a [ d ] ; d ++ ) { var f = e . getSvgRoot ( ) ; f && ( this . RTL ? ( b -= e . renderSep + e . renderWidth , f . setAttribute ( "transform" , "translate(" + b + "," + c + ")" ) , e . renderWidth && ( b -= Blockly . BlockSvg . SEP _SPACE _X ) ) : ( f . setAttribute ( "transform" , "translate(" + ( b + e . renderSep ) + "," + c + ")" ) , e . renderWidth && ( b += e . renderSep + e . renderWidth + Blockly . BlockSvg . SEP _SPACE _X ) ) ) } return this . RTL ? - b : b } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . renderCompute _ = function ( a ) { var b = this . inputList , c = [ ] ; c . rightEdge = a + 2 * Blockly . BlockSvg . SEP _SPACE _X ; if ( this . previousConnection || this . nextConnection ) c . rightEdge = Math . max ( c . rightEdge , Blockly . BlockSvg . NOTCH _WIDTH + Blockly . BlockSvg . SEP _SPACE _X ) ; for ( var d = 0 , e = 0 , f = ! 1 , g = ! 1 , h = ! 1 , k = void 0 , l = this . getInputsInline ( ) && ! this . isCollapsed ( ) , n = 0 , m ; m = b [ n ] ; n ++ ) if ( m . isVisible ( ) ) { if ( l && k && k != Blockly . NEXT _STATEMENT && m . type != Blockly . NEXT _STATEMENT ) var p = c [ c . length - 1 ] ; else k = m . type , p = [ ] , p . type = l &&
m . type != Blockly . NEXT _STATEMENT ? Blockly . BlockSvg . INLINE : m . type , p . height = 0 , c . push ( p ) ; p . push ( m ) ; m . renderHeight = Blockly . BlockSvg . MIN _BLOCK _Y ; m . renderWidth = l && m . type == Blockly . INPUT _VALUE ? Blockly . BlockSvg . TAB _WIDTH + 1.25 * Blockly . BlockSvg . SEP _SPACE _X : 0 ; if ( m . connection && m . connection . isConnected ( ) ) { var q = m . connection . targetBlock ( ) . getHeightWidth ( ) ; m . renderHeight = Math . max ( m . renderHeight , q . height ) ; m . renderWidth = Math . max ( m . renderWidth , q . width ) } l || n != b . length - 1 ? ! l && m . type == Blockly . INPUT _VALUE && b [ n + 1 ] && b [ n + 1 ] . type ==
Blockly . NEXT _STATEMENT && m . renderHeight -- : m . renderHeight -- ; p . height = Math . max ( p . height , m . renderHeight ) ; m . fieldWidth = 0 ; 1 == c . length && ( m . fieldWidth += this . RTL ? - a : a ) ; q = ! 1 ; for ( var t = 0 , r ; r = m . fieldRow [ t ] ; t ++ ) { 0 != t && ( m . fieldWidth += Blockly . BlockSvg . SEP _SPACE _X ) ; var u = r . getSize ( ) ; r . renderWidth = u . width ; r . renderSep = q && r . EDITABLE ? Blockly . BlockSvg . SEP _SPACE _X : 0 ; m . fieldWidth += r . renderWidth + r . renderSep ; p . height = Math . max ( p . height , u . height ) ; q = r . EDITABLE } p . type != Blockly . BlockSvg . INLINE && ( p . type == Blockly . NEXT _STATEMENT ?
( g = ! 0 , e = Math . max ( e , m . fieldWidth ) ) : ( p . type == Blockly . INPUT _VALUE ? f = ! 0 : p . type == Blockly . DUMMY _INPUT && ( h = ! 0 ) , d = Math . max ( d , m . fieldWidth ) ) ) } for ( a = 0 ; p = c [ a ] ; a ++ ) if ( p . thicker = ! 1 , p . type == Blockly . BlockSvg . INLINE ) for ( b = 0 ; m = p [ b ] ; b ++ ) if ( m . type == Blockly . INPUT _VALUE ) { p . height += 2 * Blockly . BlockSvg . INLINE _PADDING _Y ; p . thicker = ! 0 ; break } c . statementEdge = 2 * Blockly . BlockSvg . SEP _SPACE _X + e ; g && ( c . rightEdge = Math . max ( c . rightEdge , c . statementEdge + Blockly . BlockSvg . NOTCH _WIDTH ) ) ; f ? c . rightEdge = Math . max ( c . rightEdge , d + 2 * Blockly . BlockSvg . SEP _SPACE _X +
2018-01-16 21:13:23 +00:00
Blockly . BlockSvg . TAB _WIDTH ) : h && ( c . rightEdge = Math . max ( c . rightEdge , d + 2 * Blockly . BlockSvg . SEP _SPACE _X ) ) ; c . hasValue = f ; c . hasStatement = g ; c . hasDummy = h ; return c } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . renderDraw _ = function ( a , b ) { this . startHat _ = ! 1 ; this . height = 0 ; if ( this . outputConnection ) this . squareBottomLeftCorner _ = this . squareTopLeftCorner _ = ! 0 ; else { this . squareBottomLeftCorner _ = this . squareTopLeftCorner _ = ! 1 ; if ( this . previousConnection ) { var c = this . previousConnection . targetBlock ( ) ; c && c . getNextBlock ( ) == this && ( this . squareTopLeftCorner _ = ! 0 ) } else Blockly . BlockSvg . START _HAT && ( this . startHat _ = this . squareTopLeftCorner _ = ! 0 , this . height += Blockly . BlockSvg . START _HAT _HEIGHT , b . rightEdge = Math . max ( b . rightEdge ,
2018-08-17 13:32:56 +00:00
100 ) ) ; this . getNextBlock ( ) && ( this . squareBottomLeftCorner _ = ! 0 ) } c = new Blockly . BlockSvg . PathObject ; this . renderDrawTop _ ( c , b . rightEdge ) ; var d = this . renderDrawRight _ ( c , b , a ) ; this . renderDrawBottom _ ( c , d ) ; this . renderDrawLeft _ ( c ) ; this . setPaths _ ( c ) } ;
Blockly . BlockSvg . prototype . setPaths _ = function ( a ) { var b = a . steps . join ( " " ) + "\n" + a . inlineSteps . join ( " " ) ; this . svgPath _ . setAttribute ( "d" , b ) ; this . svgPathDark _ . setAttribute ( "d" , b ) ; b = a . highlightSteps . join ( " " ) + "\n" + a . highlightInlineSteps . join ( " " ) ; this . svgPathLight _ . setAttribute ( "d" , b ) ; this . RTL && ( this . svgPath _ . setAttribute ( "transform" , "scale(-1 1)" ) , this . svgPathLight _ . setAttribute ( "transform" , "scale(-1 1)" ) , this . svgPathDark _ . setAttribute ( "transform" , "translate(1,1) scale(-1 1)" ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . BlockSvg . prototype . renderMoveConnections _ = function ( ) { var a = this . getRelativeToSurfaceXY ( ) ; this . previousConnection && this . previousConnection . moveToOffset ( a ) ; this . outputConnection && this . outputConnection . moveToOffset ( a ) ; for ( var b = 0 ; b < this . inputList . length ; b ++ ) { var c = this . inputList [ b ] . connection ; c && ( c . moveToOffset ( a ) , c . isConnected ( ) && c . tighten _ ( ) ) } this . nextConnection && ( this . nextConnection . moveToOffset ( a ) , this . nextConnection . isConnected ( ) && this . nextConnection . tighten _ ( ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . BlockSvg . prototype . renderDrawTop _ = function ( a , b ) { var c = a . steps , d = a . highlightSteps ; this . squareTopLeftCorner _ ? ( c . push ( "m 0,0" ) , d . push ( "m 0.5,0.5" ) , this . startHat _ && ( c . push ( Blockly . BlockSvg . START _HAT _PATH ) , d . push ( this . RTL ? Blockly . BlockSvg . START _HAT _HIGHLIGHT _RTL : Blockly . BlockSvg . START _HAT _HIGHLIGHT _LTR ) ) ) : ( c . push ( Blockly . BlockSvg . TOP _LEFT _CORNER _START ) , d . push ( this . RTL ? Blockly . BlockSvg . TOP _LEFT _CORNER _START _HIGHLIGHT _RTL : Blockly . BlockSvg . TOP _LEFT _CORNER _START _HIGHLIGHT _LTR ) , c . push ( Blockly . BlockSvg . TOP _LEFT _CORNER ) ,
d . push ( Blockly . BlockSvg . TOP _LEFT _CORNER _HIGHLIGHT ) ) ; this . previousConnection && ( c . push ( "H" , Blockly . BlockSvg . NOTCH _WIDTH - 15 ) , d . push ( "H" , Blockly . BlockSvg . NOTCH _WIDTH - 15 ) , c . push ( Blockly . BlockSvg . NOTCH _PATH _LEFT ) , d . push ( Blockly . BlockSvg . NOTCH _PATH _LEFT _HIGHLIGHT ) , this . previousConnection . setOffsetInBlock ( this . RTL ? - Blockly . BlockSvg . NOTCH _WIDTH : Blockly . BlockSvg . NOTCH _WIDTH , 0 ) ) ; c . push ( "H" , b ) ; d . push ( "H" , b - . 5 ) ; this . width = b } ;
Blockly . BlockSvg . prototype . renderDrawRight _ = function ( a , b , c ) { for ( var d = { x : 0 , y : 0 } , e = { x : 0 , y : 0 } , f = 0 , g ; g = b [ f ] ; f ++ ) d . x = Blockly . BlockSvg . SEP _SPACE _X , 0 == f && ( d . x += this . RTL ? - c : c ) , a . highlightSteps . push ( "M" , b . rightEdge - . 5 + "," + ( d . y + . 5 ) ) , this . isCollapsed ( ) ? this . renderJaggedEdge _ ( a , g , d ) : g . type == Blockly . BlockSvg . INLINE ? this . renderInlineRow _ ( a , g , d , e , b . rightEdge ) : g . type == Blockly . INPUT _VALUE ? this . renderExternalValueInput _ ( a , g , d , e , b . rightEdge ) : g . type == Blockly . DUMMY _INPUT ? this . renderDummyInput _ ( a , g , d , b . rightEdge , b . hasValue ) :
g . type == Blockly . NEXT _STATEMENT && this . renderStatementInput _ ( a , g , d , e , b , f ) , d . y += g . height ; b . length || ( d . y = Blockly . BlockSvg . MIN _BLOCK _Y , a . steps . push ( "V" , d . y ) , this . RTL && a . highlightSteps . push ( "V" , d . y - 1 ) ) ; return d . y } ;
Blockly . BlockSvg . prototype . renderDrawBottom _ = function ( a , b ) { var c = a . steps , d = a . highlightSteps ; this . height += b + 1 ; this . nextConnection && ( c . push ( "H" , Blockly . BlockSvg . NOTCH _WIDTH + ( this . RTL ? . 5 : - . 5 ) + " " + Blockly . BlockSvg . NOTCH _PATH _RIGHT ) , this . nextConnection . setOffsetInBlock ( this . RTL ? - Blockly . BlockSvg . NOTCH _WIDTH : Blockly . BlockSvg . NOTCH _WIDTH , b + 1 ) , this . height += 4 ) ; this . squareBottomLeftCorner _ ? ( c . push ( "H 0" ) , this . RTL || d . push ( "M" , "0.5," + ( b - . 5 ) ) ) : ( c . push ( "H" , Blockly . BlockSvg . CORNER _RADIUS ) , c . push ( "a" , Blockly . BlockSvg . CORNER _RADIUS +
"," + Blockly . BlockSvg . CORNER _RADIUS + " 0 0,1 -" + Blockly . BlockSvg . CORNER _RADIUS + ",-" + Blockly . BlockSvg . CORNER _RADIUS ) , this . RTL || ( d . push ( "M" , Blockly . BlockSvg . DISTANCE _45 _INSIDE + "," + ( b - Blockly . BlockSvg . DISTANCE _45 _INSIDE ) ) , d . push ( "A" , Blockly . BlockSvg . CORNER _RADIUS - . 5 + "," + ( Blockly . BlockSvg . CORNER _RADIUS - . 5 ) + " 0 0,1 0.5," + ( b - Blockly . BlockSvg . CORNER _RADIUS ) ) ) ) } ;
Blockly . BlockSvg . prototype . renderDrawLeft _ = function ( a ) { var b = a . steps ; a = a . highlightSteps ; this . outputConnection ? ( this . outputConnection . setOffsetInBlock ( 0 , 0 ) , b . push ( "V" , Blockly . BlockSvg . TAB _HEIGHT ) , b . push ( "c 0,-10 -" + Blockly . BlockSvg . TAB _WIDTH + ",8 -" + Blockly . BlockSvg . TAB _WIDTH + ",-7.5 s " + Blockly . BlockSvg . TAB _WIDTH + ",2.5 " + Blockly . BlockSvg . TAB _WIDTH + ",-7.5" ) , this . RTL ? ( a . push ( "M" , - . 25 * Blockly . BlockSvg . TAB _WIDTH + ",8.4" ) , a . push ( "l" , - . 45 * Blockly . BlockSvg . TAB _WIDTH + ",-2.1" ) ) : ( a . push ( "V" , Blockly . BlockSvg . TAB _HEIGHT -
1.5 ) , a . push ( "m" , - . 92 * Blockly . BlockSvg . TAB _WIDTH + ",-0.5 q " + - . 19 * Blockly . BlockSvg . TAB _WIDTH + ",-5.5 0,-11" ) , a . push ( "m" , . 92 * Blockly . BlockSvg . TAB _WIDTH + ",1 V 0.5 H 1" ) ) , this . width += Blockly . BlockSvg . TAB _WIDTH ) : this . RTL || ( this . squareTopLeftCorner _ ? a . push ( "V" , . 5 ) : a . push ( "V" , Blockly . BlockSvg . CORNER _RADIUS ) ) ; b . push ( "z" ) } ;
Blockly . BlockSvg . prototype . renderJaggedEdge _ = function ( a , b , c ) { var d = a . steps ; a = a . highlightSteps ; this . renderFields _ ( b [ 0 ] . fieldRow , c . x , c . y ) ; d . push ( Blockly . BlockSvg . JAGGED _TEETH ) ; a . push ( "h 8" ) ; b = b . height - Blockly . BlockSvg . JAGGED _TEETH _HEIGHT ; d . push ( "v" , b ) ; this . RTL && ( a . push ( "v 3.9 l 7.2,3.4 m -14.5,8.9 l 7.3,3.5" ) , a . push ( "v" , b - . 7 ) ) ; this . width += Blockly . BlockSvg . JAGGED _TEETH _WIDTH } ;
Blockly . BlockSvg . prototype . renderInlineRow _ = function ( a , b , c , d , e ) { var f = a . inlineSteps , g = a . highlightInlineSteps , h = a . steps ; a = a . highlightSteps ; for ( var k = 0 , l ; l = b [ k ] ; k ++ ) { var n = c . x , m = c . y ; b . thicker && ( m += Blockly . BlockSvg . INLINE _PADDING _Y ) ; c . x = this . renderFields _ ( l . fieldRow , n , m ) ; l . type != Blockly . DUMMY _INPUT && ( c . x += l . renderWidth + Blockly . BlockSvg . SEP _SPACE _X ) ; l . type == Blockly . INPUT _VALUE && ( f . push ( "M" , c . x - Blockly . BlockSvg . SEP _SPACE _X + "," + ( c . y + Blockly . BlockSvg . INLINE _PADDING _Y ) ) , f . push ( "h" , Blockly . BlockSvg . TAB _WIDTH -
2 - l . renderWidth ) , f . push ( Blockly . BlockSvg . TAB _PATH _DOWN ) , f . push ( "v" , l . renderHeight + 1 - Blockly . BlockSvg . TAB _HEIGHT ) , f . push ( "h" , l . renderWidth + 2 - Blockly . BlockSvg . TAB _WIDTH ) , f . push ( "z" ) , this . RTL ? ( g . push ( "M" , c . x - Blockly . BlockSvg . SEP _SPACE _X - 2.5 + Blockly . BlockSvg . TAB _WIDTH - l . renderWidth + "," + ( c . y + Blockly . BlockSvg . INLINE _PADDING _Y + . 5 ) ) , g . push ( Blockly . BlockSvg . TAB _PATH _DOWN _HIGHLIGHT _RTL ) , g . push ( "v" , l . renderHeight - Blockly . BlockSvg . TAB _HEIGHT + 2.5 ) , g . push ( "h" , l . renderWidth - Blockly . BlockSvg . TAB _WIDTH + 2 ) ) : ( g . push ( "M" ,
c . x - Blockly . BlockSvg . SEP _SPACE _X + . 5 + "," + ( c . y + Blockly . BlockSvg . INLINE _PADDING _Y + . 5 ) ) , g . push ( "v" , l . renderHeight + 1 ) , g . push ( "h" , Blockly . BlockSvg . TAB _WIDTH - 2 - l . renderWidth ) , g . push ( "M" , c . x - l . renderWidth - Blockly . BlockSvg . SEP _SPACE _X + . 9 + "," + ( c . y + Blockly . BlockSvg . INLINE _PADDING _Y + Blockly . BlockSvg . TAB _HEIGHT - . 7 ) ) , g . push ( "l" , . 46 * Blockly . BlockSvg . TAB _WIDTH + ",-2.1" ) ) , d . x = this . RTL ? - c . x - Blockly . BlockSvg . TAB _WIDTH + Blockly . BlockSvg . SEP _SPACE _X + l . renderWidth + 1 : c . x + Blockly . BlockSvg . TAB _WIDTH - Blockly . BlockSvg . SEP _SPACE _X -
l . renderWidth - 1 , d . y = c . y + Blockly . BlockSvg . INLINE _PADDING _Y + 1 , l . connection . setOffsetInBlock ( d . x , d . y ) ) } c . x = Math . max ( c . x , e ) ; this . width = Math . max ( this . width , c . x ) ; h . push ( "H" , c . x ) ; a . push ( "H" , c . x - . 5 ) ; h . push ( "v" , b . height ) ; this . RTL && a . push ( "v" , b . height - 1 ) } ;
Blockly . BlockSvg . prototype . renderExternalValueInput _ = function ( a , b , c , d , e ) { var f = a . steps ; a = a . highlightSteps ; var g = b [ 0 ] , h = c . x , k = c . y ; if ( g . align != Blockly . ALIGN _LEFT ) { var l = e - g . fieldWidth - Blockly . BlockSvg . TAB _WIDTH - 2 * Blockly . BlockSvg . SEP _SPACE _X ; g . align == Blockly . ALIGN _RIGHT ? h += l : g . align == Blockly . ALIGN _CENTRE && ( h += l / 2 ) } this . renderFields _ ( g . fieldRow , h , k ) ; f . push ( Blockly . BlockSvg . TAB _PATH _DOWN ) ; b = b . height - Blockly . BlockSvg . TAB _HEIGHT ; f . push ( "v" , b ) ; this . RTL ? ( a . push ( Blockly . BlockSvg . TAB _PATH _DOWN _HIGHLIGHT _RTL ) ,
a . push ( "v" , b + . 5 ) ) : ( a . push ( "M" , e - 5 + "," + ( c . y + Blockly . BlockSvg . TAB _HEIGHT - . 7 ) ) , a . push ( "l" , . 46 * Blockly . BlockSvg . TAB _WIDTH + ",-2.1" ) ) ; d . x = this . RTL ? - e - 1 : e + 1 ; g . connection . setOffsetInBlock ( d . x , c . y ) ; g . connection . isConnected ( ) && ( this . width = Math . max ( this . width , e + g . connection . targetBlock ( ) . getHeightWidth ( ) . width - Blockly . BlockSvg . TAB _WIDTH + 1 ) ) } ;
Blockly . BlockSvg . prototype . renderDummyInput _ = function ( a , b , c , d , e ) { var f = a . steps ; a = a . highlightSteps ; var g = b [ 0 ] , h = c . x ; c = c . y ; g . align != Blockly . ALIGN _LEFT && ( d = d - g . fieldWidth - 2 * Blockly . BlockSvg . SEP _SPACE _X , e && ( d -= Blockly . BlockSvg . TAB _WIDTH ) , g . align == Blockly . ALIGN _RIGHT ? h += d : g . align == Blockly . ALIGN _CENTRE && ( h += d / 2 ) ) ; this . renderFields _ ( g . fieldRow , h , c ) ; f . push ( "v" , b . height ) ; this . RTL && a . push ( "v" , b . height - 1 ) } ;
Blockly . BlockSvg . prototype . renderStatementInput _ = function ( a , b , c , d , e , f ) { var g = a . steps ; a = a . highlightSteps ; var h = b [ 0 ] ; 0 == f && ( g . push ( "v" , Blockly . BlockSvg . SEP _SPACE _Y ) , this . RTL && a . push ( "v" , Blockly . BlockSvg . SEP _SPACE _Y - 1 ) , c . y += Blockly . BlockSvg . SEP _SPACE _Y ) ; var k = c . x , l = c . y ; if ( h . align != Blockly . ALIGN _LEFT ) { var n = e . statementEdge - h . fieldWidth - 2 * Blockly . BlockSvg . SEP _SPACE _X ; h . align == Blockly . ALIGN _RIGHT ? k += n : h . align == Blockly . ALIGN _CENTRE && ( k += n / 2 ) } this . renderFields _ ( h . fieldRow , k , l ) ; c . x = e . statementEdge + Blockly . BlockSvg . NOTCH _WIDTH ;
g . push ( "H" , c . x ) ; g . push ( Blockly . BlockSvg . INNER _TOP _LEFT _CORNER ) ; g . push ( "v" , b . height - 2 * Blockly . BlockSvg . CORNER _RADIUS ) ; g . push ( Blockly . BlockSvg . INNER _BOTTOM _LEFT _CORNER ) ; g . push ( "H" , e . rightEdge ) ; this . RTL ? ( a . push ( "M" , c . x - Blockly . BlockSvg . NOTCH _WIDTH + Blockly . BlockSvg . DISTANCE _45 _OUTSIDE + "," + ( c . y + Blockly . BlockSvg . DISTANCE _45 _OUTSIDE ) ) , a . push ( Blockly . BlockSvg . INNER _TOP _LEFT _CORNER _HIGHLIGHT _RTL ) , a . push ( "v" , b . height - 2 * Blockly . BlockSvg . CORNER _RADIUS ) , a . push ( Blockly . BlockSvg . INNER _BOTTOM _LEFT _CORNER _HIGHLIGHT _RTL ) ) :
( a . push ( "M" , c . x - Blockly . BlockSvg . NOTCH _WIDTH + Blockly . BlockSvg . DISTANCE _45 _OUTSIDE + "," + ( c . y + b . height - Blockly . BlockSvg . DISTANCE _45 _OUTSIDE ) ) , a . push ( Blockly . BlockSvg . INNER _BOTTOM _LEFT _CORNER _HIGHLIGHT _LTR ) ) ; a . push ( "H" , e . rightEdge - . 5 ) ; d . x = this . RTL ? - c . x : c . x + 1 ; h . connection . setOffsetInBlock ( d . x , c . y + 1 ) ; h . connection . isConnected ( ) && ( this . width = Math . max ( this . width , e . statementEdge + h . connection . targetBlock ( ) . getHeightWidth ( ) . width ) ) ; if ( f == e . length - 1 || e [ f + 1 ] . type == Blockly . NEXT _STATEMENT ) g . push ( "v" , Blockly . BlockSvg . SEP _SPACE _Y ) ,
this . RTL && a . push ( "v" , Blockly . BlockSvg . SEP _SPACE _Y - 1 ) , c . y += Blockly . BlockSvg . SEP _SPACE _Y } ; Blockly . Msg = { } ; goog . getMsgOrig = goog . getMsg ; goog . getMsg = function ( a , b ) { var c = goog . getMsg . blocklyMsgMap [ a ] ; c && ( a = Blockly . Msg [ c ] ) ; return goog . getMsgOrig ( a , b ) } ; goog . getMsg . blocklyMsgMap = { Today : "TODAY" } ; Blockly . FieldTextInput = function ( a , b ) { Blockly . FieldTextInput . superClass _ . constructor . call ( this , a , b ) } ; goog . inherits ( Blockly . FieldTextInput , Blockly . Field ) ; Blockly . FieldTextInput . fromJson = function ( a ) { var b = Blockly . utils . replaceMessageReferences ( a . text ) ; b = new Blockly . FieldTextInput ( b , a [ "class" ] ) ; "boolean" === typeof a . spellcheck && b . setSpellcheck ( a . spellcheck ) ; return b } ; Blockly . FieldTextInput . FONTSIZE = 11 ; Blockly . FieldTextInput . htmlInput _ = null ; Blockly . FieldTextInput . prototype . CURSOR = "text" ;
Blockly . FieldTextInput . prototype . spellcheck _ = ! 0 ; Blockly . FieldTextInput . prototype . dispose = function ( ) { Blockly . WidgetDiv . hideIfOwner ( this ) ; Blockly . FieldTextInput . superClass _ . dispose . call ( this ) } ; Blockly . FieldTextInput . prototype . setValue = function ( a ) { if ( null !== a ) { if ( this . sourceBlock _ ) { var b = this . callValidator ( a ) ; null !== b && ( a = b ) } Blockly . Field . prototype . setValue . call ( this , a ) } } ;
Blockly . FieldTextInput . prototype . setText = function ( a ) { null !== a && ( a = String ( a ) , a !== this . text _ && ( this . sourceBlock _ && Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock _ , "field" , this . name , this . text _ , a ) ) , Blockly . Field . prototype . setText . call ( this , a ) ) ) } ; Blockly . FieldTextInput . prototype . setSpellcheck = function ( a ) { this . spellcheck _ = a } ;
Blockly . FieldTextInput . prototype . showEditor _ = function ( a ) { this . workspace _ = this . sourceBlock _ . workspace ; a = a || ! 1 ; ! a && ( goog . userAgent . MOBILE || goog . userAgent . ANDROID || goog . userAgent . IPAD ) ? this . showPromptEditor _ ( ) : this . showInlineEditor _ ( a ) } ; Blockly . FieldTextInput . prototype . showPromptEditor _ = function ( ) { var a = this ; Blockly . prompt ( Blockly . Msg . CHANGE _VALUE _TITLE , this . text _ , function ( b ) { a . sourceBlock _ && ( b = a . callValidator ( b ) ) ; a . setValue ( b ) } ) } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldTextInput . prototype . showInlineEditor _ = function ( a ) { Blockly . WidgetDiv . show ( this , this . sourceBlock _ . RTL , this . widgetDispose _ ( ) ) ; var b = Blockly . WidgetDiv . DIV , c = goog . dom . createDom ( "INPUT" , "blocklyHtmlInput" ) ; c . setAttribute ( "spellcheck" , this . spellcheck _ ) ; var d = Blockly . FieldTextInput . FONTSIZE * this . workspace _ . scale + "pt" ; b . style . fontSize = d ; c . style . fontSize = d ; Blockly . FieldTextInput . htmlInput _ = c ; b . appendChild ( c ) ; c . value = c . defaultValue = this . text _ ; c . oldValue _ = null ; this . validate _ ( ) ; this . resizeEditor _ ( ) ;
a || ( c . focus ( ) , c . select ( ) ) ; this . bindEvents _ ( c ) } ; Blockly . FieldTextInput . prototype . bindEvents _ = function ( a ) { a . onKeyDownWrapper _ = Blockly . bindEventWithChecks _ ( a , "keydown" , this , this . onHtmlInputKeyDown _ ) ; a . onKeyUpWrapper _ = Blockly . bindEventWithChecks _ ( a , "keyup" , this , this . onHtmlInputChange _ ) ; a . onKeyPressWrapper _ = Blockly . bindEventWithChecks _ ( a , "keypress" , this , this . onHtmlInputChange _ ) ; a . onWorkspaceChangeWrapper _ = this . resizeEditor _ . bind ( this ) ; this . workspace _ . addChangeListener ( a . onWorkspaceChangeWrapper _ ) } ;
Blockly . FieldTextInput . prototype . unbindEvents _ = function ( a ) { Blockly . unbindEvent _ ( a . onKeyDownWrapper _ ) ; Blockly . unbindEvent _ ( a . onKeyUpWrapper _ ) ; Blockly . unbindEvent _ ( a . onKeyPressWrapper _ ) ; this . workspace _ . removeChangeListener ( a . onWorkspaceChangeWrapper _ ) } ;
Blockly . FieldTextInput . prototype . onHtmlInputKeyDown _ = function ( a ) { var b = Blockly . FieldTextInput . htmlInput _ ; 13 == a . keyCode ? Blockly . WidgetDiv . hide ( ) : 27 == a . keyCode ? ( b . value = b . defaultValue , Blockly . WidgetDiv . hide ( ) ) : 9 == a . keyCode && ( Blockly . WidgetDiv . hide ( ) , this . sourceBlock _ . tab ( this , ! a . shiftKey ) , a . preventDefault ( ) ) } ;
Blockly . FieldTextInput . prototype . onHtmlInputChange _ = function ( a ) { a = Blockly . FieldTextInput . htmlInput _ ; var b = a . value ; b !== a . oldValue _ ? ( a . oldValue _ = b , this . setValue ( b ) , this . validate _ ( ) ) : goog . userAgent . WEBKIT && this . sourceBlock _ . render ( ) ; this . resizeEditor _ ( ) ; Blockly . svgResize ( this . sourceBlock _ . workspace ) } ;
2017-09-25 09:37:41 +00:00
Blockly . FieldTextInput . prototype . validate _ = function ( ) { var a = ! 0 ; goog . asserts . assertObject ( Blockly . FieldTextInput . htmlInput _ ) ; var b = Blockly . FieldTextInput . htmlInput _ ; this . sourceBlock _ && ( a = this . callValidator ( b . value ) ) ; null === a ? Blockly . utils . addClass ( b , "blocklyInvalidInput" ) : Blockly . utils . removeClass ( b , "blocklyInvalidInput" ) } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldTextInput . prototype . resizeEditor _ = function ( ) { var a = Blockly . WidgetDiv . DIV , b = this . getScaledBBox _ ( ) ; a . style . width = b . right - b . left + "px" ; a . style . height = b . bottom - b . top + "px" ; b = new goog . math . Coordinate ( this . sourceBlock _ . RTL ? b . right - a . offsetWidth : b . left , b . top ) ; b . y += 1 ; goog . userAgent . GECKO && Blockly . WidgetDiv . DIV . style . top && ( -- b . x , -- b . y ) ; goog . userAgent . WEBKIT && ( b . y -= 3 ) ; a . style . left = b . x + "px" ; a . style . top = b . y + "px" } ;
Blockly . FieldTextInput . prototype . widgetDispose _ = function ( ) { var a = this ; return function ( ) { var b = Blockly . FieldTextInput . htmlInput _ ; a . maybeSaveEdit _ ( ) ; a . unbindEvents _ ( b ) ; Blockly . FieldTextInput . htmlInput _ = null ; Blockly . Events . setGroup ( ! 1 ) ; b = Blockly . WidgetDiv . DIV . style ; b . width = "auto" ; b . height = "auto" ; b . fontSize = "" } } ;
Blockly . FieldTextInput . prototype . maybeSaveEdit _ = function ( ) { var a = Blockly . FieldTextInput . htmlInput _ , b = a . value ; if ( this . sourceBlock _ ) if ( b = this . callValidator ( b ) , null === b ) b = a . defaultValue ; else if ( this . onFinishEditing _ ) this . onFinishEditing _ ( b ) ; this . setText ( b ) ; this . sourceBlock _ . rendered && this . sourceBlock _ . render ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldTextInput . numberValidator = function ( a ) { console . warn ( "Blockly.FieldTextInput.numberValidator is deprecated. Use Blockly.FieldNumber instead." ) ; if ( null === a ) return null ; a = String ( a ) ; a = a . replace ( /O/ig , "0" ) ; a = a . replace ( /,/g , "" ) ; a = parseFloat ( a || 0 ) ; return isNaN ( a ) ? null : String ( a ) } ; Blockly . FieldTextInput . nonnegativeIntegerValidator = function ( a ) { ( a = Blockly . FieldTextInput . numberValidator ( a ) ) && ( a = String ( Math . max ( 0 , Math . floor ( a ) ) ) ) ; return a } ; Blockly . Field . register ( "field_input" , Blockly . FieldTextInput ) ; Blockly . FieldAngle = function ( a , b ) { this . symbol _ = Blockly . utils . createSvgElement ( "tspan" , { } , null ) ; this . symbol _ . appendChild ( document . createTextNode ( "\u00b0" ) ) ; a = a && ! isNaN ( a ) ? String ( a ) : "0" ; Blockly . FieldAngle . superClass _ . constructor . call ( this , a , b ) } ; goog . inherits ( Blockly . FieldAngle , Blockly . FieldTextInput ) ; Blockly . FieldAngle . fromJson = function ( a ) { return new Blockly . FieldAngle ( a . angle ) } ; Blockly . FieldAngle . ROUND = 15 ; Blockly . FieldAngle . HALF = 50 ; Blockly . FieldAngle . CLOCKWISE = ! 1 ; Blockly . FieldAngle . OFFSET = 0 ;
Blockly . FieldAngle . WRAP = 360 ; Blockly . FieldAngle . RADIUS = Blockly . FieldAngle . HALF - 1 ; Blockly . FieldAngle . prototype . render _ = function ( ) { this . visible _ ? ( this . textElement _ . textContent = this . getDisplayText _ ( ) , this . sourceBlock _ . RTL ? this . textElement _ . insertBefore ( this . symbol _ , this . textElement _ . firstChild ) : this . textElement _ . appendChild ( this . symbol _ ) , this . updateWidth ( ) ) : this . size _ . width = 0 } ;
2017-09-25 09:37:41 +00:00
Blockly . FieldAngle . prototype . dispose _ = function ( ) { var a = this ; return function ( ) { Blockly . FieldAngle . superClass _ . dispose _ . call ( a ) ( ) ; a . gauge _ = null ; a . clickWrapper _ && Blockly . unbindEvent _ ( a . clickWrapper _ ) ; a . moveWrapper1 _ && Blockly . unbindEvent _ ( a . moveWrapper1 _ ) ; a . moveWrapper2 _ && Blockly . unbindEvent _ ( a . moveWrapper2 _ ) } } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldAngle . prototype . showEditor _ = function ( ) { Blockly . FieldAngle . superClass _ . showEditor _ . call ( this , goog . userAgent . MOBILE || goog . userAgent . ANDROID || goog . userAgent . IPAD ) ; var a = Blockly . WidgetDiv . DIV ; if ( a . firstChild ) { a = Blockly . utils . createSvgElement ( "svg" , { xmlns : "http://www.w3.org/2000/svg" , "xmlns:html" : "http://www.w3.org/1999/xhtml" , "xmlns:xlink" : "http://www.w3.org/1999/xlink" , version : "1.1" , height : 2 * Blockly . FieldAngle . HALF + "px" , width : 2 * Blockly . FieldAngle . HALF + "px" } , a ) ; var b = Blockly . utils . createSvgElement ( "circle" ,
2017-09-25 09:37:41 +00:00
{ cx : Blockly . FieldAngle . HALF , cy : Blockly . FieldAngle . HALF , r : Blockly . FieldAngle . RADIUS , "class" : "blocklyAngleCircle" } , a ) ; this . gauge _ = Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyAngleGauge" } , a ) ; this . line _ = Blockly . utils . createSvgElement ( "line" , { x1 : Blockly . FieldAngle . HALF , y1 : Blockly . FieldAngle . HALF , "class" : "blocklyAngleLine" } , a ) ; for ( var c = 0 ; 360 > c ; c += 15 ) Blockly . utils . createSvgElement ( "line" , { x1 : Blockly . FieldAngle . HALF + Blockly . FieldAngle . RADIUS , y1 : Blockly . FieldAngle . HALF , x2 : Blockly . FieldAngle . HALF +
Blockly . FieldAngle . RADIUS - ( 0 == c % 45 ? 10 : 5 ) , y2 : Blockly . FieldAngle . HALF , "class" : "blocklyAngleMarks" , transform : "rotate(" + c + "," + Blockly . FieldAngle . HALF + "," + Blockly . FieldAngle . HALF + ")" } , a ) ; a . style . marginLeft = 15 - Blockly . FieldAngle . RADIUS + "px" ; this . clickWrapper _ = Blockly . bindEvent _ ( a , "click" , this , Blockly . WidgetDiv . hide ) ; this . moveWrapper1 _ = Blockly . bindEvent _ ( b , "mousemove" , this , this . onMouseMove ) ; this . moveWrapper2 _ = Blockly . bindEvent _ ( this . gauge _ , "mousemove" , this , this . onMouseMove ) ; this . updateGraph _ ( ) } } ;
Blockly . FieldAngle . prototype . onMouseMove = function ( a ) { var b = this . gauge _ . ownerSVGElement . getBoundingClientRect ( ) , c = a . clientX - b . left - Blockly . FieldAngle . HALF ; a = a . clientY - b . top - Blockly . FieldAngle . HALF ; b = Math . atan ( - a / c ) ; isNaN ( b ) || ( b = goog . math . toDegrees ( b ) , 0 > c ? b += 180 : 0 < a && ( b += 360 ) , b = Blockly . FieldAngle . CLOCKWISE ? Blockly . FieldAngle . OFFSET + 360 - b : b - Blockly . FieldAngle . OFFSET , Blockly . FieldAngle . ROUND && ( b = Math . round ( b / Blockly . FieldAngle . ROUND ) * Blockly . FieldAngle . ROUND ) , b = this . callValidator ( b ) , Blockly . FieldTextInput . htmlInput _ . value =
2018-01-16 21:13:23 +00:00
b , this . setValue ( b ) , this . validate _ ( ) , this . resizeEditor _ ( ) ) } ; Blockly . FieldAngle . prototype . setText = function ( a ) { Blockly . FieldAngle . superClass _ . setText . call ( this , a ) ; this . textElement _ && ( this . updateGraph _ ( ) , this . size _ . width = 0 ) } ;
Blockly . FieldAngle . prototype . updateGraph _ = function ( ) { if ( this . gauge _ ) { var a = Number ( this . getText ( ) ) + Blockly . FieldAngle . OFFSET , b = goog . math . toRadians ( a ) ; a = [ "M " , Blockly . FieldAngle . HALF , "," , Blockly . FieldAngle . HALF ] ; var c = Blockly . FieldAngle . HALF , d = Blockly . FieldAngle . HALF ; if ( ! isNaN ( b ) ) { var e = goog . math . toRadians ( Blockly . FieldAngle . OFFSET ) , f = Math . cos ( e ) * Blockly . FieldAngle . RADIUS , g = Math . sin ( e ) * - Blockly . FieldAngle . RADIUS ; Blockly . FieldAngle . CLOCKWISE && ( b = 2 * e - b ) ; c += Math . cos ( b ) * Blockly . FieldAngle . RADIUS ; d -= Math . sin ( b ) *
2017-09-25 09:37:41 +00:00
Blockly . FieldAngle . RADIUS ; b = Math . abs ( Math . floor ( ( b - e ) / Math . PI ) % 2 ) ; Blockly . FieldAngle . CLOCKWISE && ( b = 1 - b ) ; a . push ( " l " , f , "," , g , " A " , Blockly . FieldAngle . RADIUS , "," , Blockly . FieldAngle . RADIUS , " 0 " , b , " " , Number ( Blockly . FieldAngle . CLOCKWISE ) , " " , c , "," , d , " z" ) } this . gauge _ . setAttribute ( "d" , a . join ( "" ) ) ; this . line _ . setAttribute ( "x2" , c ) ; this . line _ . setAttribute ( "y2" , d ) } } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldAngle . prototype . classValidator = function ( a ) { if ( null === a ) return null ; a = parseFloat ( a || 0 ) ; if ( isNaN ( a ) ) return null ; a %= 360 ; 0 > a && ( a += 360 ) ; a > Blockly . FieldAngle . WRAP && ( a -= 360 ) ; return String ( a ) } ; Blockly . Field . register ( "field_angle" , Blockly . FieldAngle ) ; Blockly . FieldCheckbox = function ( a , b ) { Blockly . FieldCheckbox . superClass _ . constructor . call ( this , "" , b ) ; this . setValue ( a ) } ; goog . inherits ( Blockly . FieldCheckbox , Blockly . Field ) ; Blockly . FieldCheckbox . fromJson = function ( a ) { return new Blockly . FieldCheckbox ( a . checked ? "TRUE" : "FALSE" ) } ; Blockly . FieldCheckbox . CHECK _CHAR = "\u2713" ; Blockly . FieldCheckbox . prototype . CURSOR = "default" ;
2017-09-25 09:37:41 +00:00
Blockly . FieldCheckbox . prototype . init = function ( ) { if ( ! this . fieldGroup _ ) { Blockly . FieldCheckbox . superClass _ . init . call ( this ) ; this . checkElement _ = Blockly . utils . createSvgElement ( "text" , { "class" : "blocklyText blocklyCheckbox" , x : - 3 , y : 14 } , this . fieldGroup _ ) ; var a = document . createTextNode ( Blockly . FieldCheckbox . CHECK _CHAR ) ; this . checkElement _ . appendChild ( a ) ; this . checkElement _ . style . display = this . state _ ? "block" : "none" } } ; Blockly . FieldCheckbox . prototype . getValue = function ( ) { return String ( this . state _ ) . toUpperCase ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldCheckbox . prototype . setValue = function ( a ) { a = "string" == typeof a ? "TRUE" == a . toUpperCase ( ) : ! ! a ; this . state _ !== a && ( this . sourceBlock _ && Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock _ , "field" , this . name , this . state _ , a ) ) , this . state _ = a , this . checkElement _ && ( this . checkElement _ . style . display = a ? "block" : "none" ) ) } ; Blockly . FieldCheckbox . prototype . showEditor _ = function ( ) { var a = ! this . state _ ; this . sourceBlock _ && ( a = this . callValidator ( a ) ) ; null !== a && this . setValue ( String ( a ) . toUpperCase ( ) ) } ;
Blockly . Field . register ( "field_checkbox" , Blockly . FieldCheckbox ) ; Blockly . FieldColour = function ( a , b ) { Blockly . FieldColour . superClass _ . constructor . call ( this , a , b ) ; this . setText ( Blockly . Field . NBSP + Blockly . Field . NBSP + Blockly . Field . NBSP ) } ; goog . inherits ( Blockly . FieldColour , Blockly . Field ) ; Blockly . FieldColour . fromJson = function ( a ) { return new Blockly . FieldColour ( a . colour ) } ; Blockly . FieldColour . prototype . colours _ = null ; Blockly . FieldColour . prototype . columns _ = 0 ;
Blockly . FieldColour . prototype . init = function ( ) { Blockly . FieldColour . superClass _ . init . call ( this ) ; this . borderRect _ . style . fillOpacity = 1 ; this . setValue ( this . getValue ( ) ) } ; Blockly . FieldColour . prototype . CURSOR = "default" ; Blockly . FieldColour . prototype . dispose = function ( ) { Blockly . WidgetDiv . hideIfOwner ( this ) ; Blockly . FieldColour . superClass _ . dispose . call ( this ) } ; Blockly . FieldColour . prototype . getValue = function ( ) { return this . colour _ } ;
Blockly . FieldColour . prototype . setValue = function ( a ) { this . sourceBlock _ && Blockly . Events . isEnabled ( ) && this . colour _ != a && Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock _ , "field" , this . name , this . colour _ , a ) ) ; this . colour _ = a ; this . borderRect _ && ( this . borderRect _ . style . fill = a ) } ; Blockly . FieldColour . prototype . getText = function ( ) { var a = this . colour _ , b = a . match ( /^#(.)\1(.)\2(.)\3$/ ) ; b && ( a = "#" + b [ 1 ] + b [ 2 ] + b [ 3 ] ) ; return a } ; Blockly . FieldColour . COLOURS = goog . ui . ColorPicker . SIMPLE _GRID _COLORS ;
Blockly . FieldColour . COLUMNS = 7 ; Blockly . FieldColour . prototype . setColours = function ( a ) { this . colours _ = a ; return this } ; Blockly . FieldColour . prototype . setColumns = function ( a ) { this . columns _ = a ; return this } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldColour . prototype . showEditor _ = function ( ) { Blockly . WidgetDiv . show ( this , this . sourceBlock _ . RTL , Blockly . FieldColour . widgetDispose _ ) ; var a = Blockly . utils . getViewportBBox ( ) , b = this . getScaledBBox _ ( ) , c = this . createWidget _ ( ) , d = goog . style . getSize ( c . getElement ( ) ) ; Blockly . WidgetDiv . positionWithAnchor ( a , b , d , this . sourceBlock _ . RTL ) ; var e = this ; Blockly . FieldColour . changeEventKey _ = goog . events . listen ( c , goog . ui . ColorPicker . EventType . CHANGE , function ( a ) { a = a . target . getSelectedColor ( ) || "#000000" ; Blockly . WidgetDiv . hide ( ) ;
2018-08-17 13:32:56 +00:00
e . sourceBlock _ && ( a = e . callValidator ( a ) ) ; null !== a && e . setValue ( a ) } ) } ; Blockly . FieldColour . prototype . createWidget _ = function ( ) { var a = new goog . ui . ColorPicker ; a . setSize ( this . columns _ || Blockly . FieldColour . COLUMNS ) ; a . setColors ( this . colours _ || Blockly . FieldColour . COLOURS ) ; a . render ( Blockly . WidgetDiv . DIV ) ; a . setSelectedColor ( this . getValue ( ) ) ; return a } ; Blockly . FieldColour . widgetDispose _ = function ( ) { Blockly . FieldColour . changeEventKey _ && goog . events . unlistenByKey ( Blockly . FieldColour . changeEventKey _ ) ; Blockly . Events . setGroup ( ! 1 ) } ;
Blockly . Field . register ( "field_colour" , Blockly . FieldColour ) ; Blockly . FieldDropdown = function ( a , b ) { goog . isFunction ( a ) || Blockly . FieldDropdown . validateOptions _ ( a ) ; this . menuGenerator _ = a ; this . trimOptions _ ( ) ; var c = this . getOptions ( ) [ 0 ] ; Blockly . FieldDropdown . superClass _ . constructor . call ( this , c [ 1 ] , b ) } ; goog . inherits ( Blockly . FieldDropdown , Blockly . Field ) ; Blockly . FieldDropdown . fromJson = function ( a ) { return new Blockly . FieldDropdown ( a . options ) } ; Blockly . FieldDropdown . CHECKMARK _OVERHANG = 25 ; Blockly . FieldDropdown . MAX _MENU _HEIGHT _VH = . 45 ;
Blockly . FieldDropdown . ARROW _CHAR = goog . userAgent . ANDROID ? "\u25bc" : "\u25be" ; Blockly . FieldDropdown . prototype . CURSOR = "default" ; Blockly . FieldDropdown . prototype . value _ = "" ; Blockly . FieldDropdown . prototype . imageElement _ = null ; Blockly . FieldDropdown . prototype . imageJson _ = null ;
Blockly . FieldDropdown . prototype . init = function ( ) { this . fieldGroup _ || ( this . arrow _ = Blockly . utils . createSvgElement ( "tspan" , { } , null ) , this . arrow _ . appendChild ( document . createTextNode ( this . sourceBlock _ . RTL ? Blockly . FieldDropdown . ARROW _CHAR + " " : " " + Blockly . FieldDropdown . ARROW _CHAR ) ) , Blockly . FieldDropdown . superClass _ . init . call ( this ) ) } ; Blockly . FieldDropdown . prototype . showEditor _ = function ( ) { Blockly . WidgetDiv . show ( this , this . sourceBlock _ . RTL , null ) ; var a = this . createMenu _ ( ) ; this . addActionListener _ ( a ) ; this . positionMenu _ ( a ) } ;
Blockly . FieldDropdown . prototype . addActionListener _ = function ( a ) { var b = this ; goog . events . listen ( a , goog . ui . Component . EventType . ACTION , function ( a ) { if ( a = a . target ) b . onItemSelected ( this , a ) ; Blockly . WidgetDiv . hideIfOwner ( b ) ; Blockly . Events . setGroup ( ! 1 ) } ) } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldDropdown . prototype . createMenu _ = function ( ) { var a = new goog . ui . Menu ; a . setRightToLeft ( this . sourceBlock _ . RTL ) ; for ( var b = this . getOptions ( ) , c = 0 ; c < b . length ; c ++ ) { var d = b [ c ] [ 0 ] , e = b [ c ] [ 1 ] ; if ( "object" == typeof d ) { var f = new Image ( d . width , d . height ) ; f . src = d . src ; f . alt = d . alt || "" ; d = f } d = new goog . ui . MenuItem ( d ) ; d . setRightToLeft ( this . sourceBlock _ . RTL ) ; d . setValue ( e ) ; d . setCheckable ( ! 0 ) ; a . addChild ( d , ! 0 ) ; d . setChecked ( e == this . value _ ) } return a } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldDropdown . prototype . positionMenu _ = function ( a ) { var b = Blockly . utils . getViewportBBox ( ) , c = this . getAnchorDimensions _ ( ) ; this . createWidget _ ( a ) ; var d = Blockly . utils . uiMenu . getSize ( a ) , e = Blockly . FieldDropdown . MAX _MENU _HEIGHT _VH * document . documentElement . clientHeight ; d . height > e && ( d . height = e ) ; this . sourceBlock _ . RTL && Blockly . utils . uiMenu . adjustBBoxesForRTL ( b , c , d ) ; Blockly . WidgetDiv . positionWithAnchor ( b , c , d , this . sourceBlock _ . RTL ) ; a . getElement ( ) . focus ( ) } ;
Blockly . FieldDropdown . prototype . createWidget _ = function ( a ) { a . render ( Blockly . WidgetDiv . DIV ) ; Blockly . utils . addClass ( a . getElement ( ) , "blocklyDropdownMenu" ) ; a . setAllowAutoFocus ( ! 0 ) } ; Blockly . FieldDropdown . prototype . getAnchorDimensions _ = function ( ) { var a = this . getScaledBBox _ ( ) ; this . sourceBlock _ . RTL ? a . right += Blockly . FieldDropdown . CHECKMARK _OVERHANG : a . left -= Blockly . FieldDropdown . CHECKMARK _OVERHANG ; return a } ;
Blockly . FieldDropdown . prototype . onItemSelected = function ( a , b ) { var c = b . getValue ( ) ; this . sourceBlock _ && ( c = this . callValidator ( c ) ) ; null !== c && this . setValue ( c ) } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldDropdown . prototype . trimOptions _ = function ( ) { this . suffixField = this . prefixField = null ; var a = this . menuGenerator _ ; if ( goog . isArray ( a ) ) { for ( var b = ! 1 , c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] [ 0 ] ; "string" == typeof d ? a [ c ] [ 0 ] = Blockly . utils . replaceMessageReferences ( d ) : ( null != d . alt && ( a [ c ] [ 0 ] . alt = Blockly . utils . replaceMessageReferences ( d . alt ) ) , b = ! 0 ) } if ( ! ( b || 2 > a . length ) ) { b = [ ] ; for ( c = 0 ; c < a . length ; c ++ ) b . push ( a [ c ] [ 0 ] ) ; c = Blockly . utils . shortestStringLength ( b ) ; d = Blockly . utils . commonWordPrefix ( b , c ) ; var e = Blockly . utils . commonWordSuffix ( b ,
c ) ; ! d && ! e || c <= d + e || ( d && ( this . prefixField = b [ 0 ] . substring ( 0 , d - 1 ) ) , e && ( this . suffixField = b [ 0 ] . substr ( 1 - e ) ) , this . menuGenerator _ = Blockly . FieldDropdown . applyTrim _ ( a , d , e ) ) } } } ; Blockly . FieldDropdown . applyTrim _ = function ( a , b , c ) { for ( var d = [ ] , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] [ 0 ] , g = a [ e ] [ 1 ] ; f = f . substring ( b , f . length - c ) ; d [ e ] = [ f , g ] } return d } ; Blockly . FieldDropdown . prototype . isOptionListDynamic = function ( ) { return goog . isFunction ( this . menuGenerator _ ) } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldDropdown . prototype . getOptions = function ( ) { if ( goog . isFunction ( this . menuGenerator _ ) ) { var a = this . menuGenerator _ . call ( this ) ; Blockly . FieldDropdown . validateOptions _ ( a ) ; return a } return this . menuGenerator _ } ; Blockly . FieldDropdown . prototype . getValue = function ( ) { return this . value _ } ;
2018-01-16 21:13:23 +00:00
Blockly . FieldDropdown . prototype . setValue = function ( a ) { if ( null !== a && a !== this . value _ ) { this . sourceBlock _ && Blockly . Events . isEnabled ( ) && Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock _ , "field" , this . name , this . value _ , a ) ) ; this . value _ = a ; for ( var b = this . getOptions ( ) , c = 0 ; c < b . length ; c ++ ) if ( b [ c ] [ 1 ] == a ) { a = b [ c ] [ 0 ] ; "object" == typeof a ? ( this . imageJson _ = a , this . text _ = a . alt ) : ( this . imageJson _ = null , this . text _ = a ) ; this . forceRerender ( ) ; return } this . text _ = a ; this . forceRerender ( ) } } ;
Blockly . FieldDropdown . prototype . render _ = function ( ) { this . visible _ ? ( this . sourceBlock _ && this . arrow _ && ( this . arrow _ . style . fill = this . sourceBlock _ . getColour ( ) ) , goog . dom . removeChildren ( this . textElement _ ) , goog . dom . removeNode ( this . imageElement _ ) , this . imageElement _ = null , this . imageJson _ ? this . renderSelectedImage _ ( ) : this . renderSelectedText _ ( ) , this . borderRect _ . setAttribute ( "height" , this . size _ . height - 9 ) , this . borderRect _ . setAttribute ( "width" , this . size _ . width + Blockly . BlockSvg . SEP _SPACE _X ) ) : this . size _ . width = 0 } ;
Blockly . FieldDropdown . prototype . renderSelectedImage _ = function ( ) { this . imageElement _ = Blockly . utils . createSvgElement ( "image" , { y : 5 , height : this . imageJson _ . height + "px" , width : this . imageJson _ . width + "px" } , this . fieldGroup _ ) ; this . imageElement _ . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , this . imageJson _ . src ) ; this . textElement _ . appendChild ( this . arrow _ ) ; var a = Blockly . Field . getCachedWidth ( this . arrow _ ) ; this . size _ . height = Number ( this . imageJson _ . height ) + 19 ; this . size _ . width = Number ( this . imageJson _ . width ) +
a ; this . sourceBlock _ . RTL ? ( this . imageElement _ . setAttribute ( "x" , a ) , this . textElement _ . setAttribute ( "x" , - 1 ) ) : ( this . textElement _ . setAttribute ( "text-anchor" , "end" ) , this . textElement _ . setAttribute ( "x" , this . size _ . width + 1 ) ) } ;
Blockly . FieldDropdown . prototype . renderSelectedText _ = function ( ) { var a = document . createTextNode ( this . getDisplayText _ ( ) ) ; this . textElement _ . appendChild ( a ) ; this . sourceBlock _ . RTL ? this . textElement _ . insertBefore ( this . arrow _ , this . textElement _ . firstChild ) : this . textElement _ . appendChild ( this . arrow _ ) ; this . textElement _ . setAttribute ( "text-anchor" , "start" ) ; this . textElement _ . setAttribute ( "x" , 0 ) ; this . size _ . height = Blockly . BlockSvg . MIN _BLOCK _Y ; this . size _ . width = Blockly . Field . getCachedWidth ( this . textElement _ ) } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldDropdown . prototype . updateWidth = function ( ) { if ( this . imageJson _ && ( goog . userAgent . IE || goog . userAgent . EDGE ) ) { var a = Blockly . Field . getCachedWidth ( this . arrow _ ) ; a = Number ( this . imageJson _ . width ) + a + Blockly . BlockSvg . SEP _SPACE _X ; this . borderRect _ && this . borderRect _ . setAttribute ( "width" , a ) ; this . size _ . width = a } else Blockly . Field . prototype . updateWidth . call ( this ) } ; Blockly . FieldDropdown . prototype . dispose = function ( ) { Blockly . WidgetDiv . hideIfOwner ( this ) ; Blockly . FieldDropdown . superClass _ . dispose . call ( this ) } ;
Blockly . FieldDropdown . validateOptions _ = function ( a ) { if ( ! goog . isArray ( a ) ) throw "FieldDropdown options must be an array." ; for ( var b = ! 1 , c = 0 ; c < a . length ; ++ c ) { var d = a [ c ] ; goog . isArray ( a ) ? goog . isString ( d [ 1 ] ) ? goog . isString ( d [ 0 ] ) || goog . isString ( d [ 0 ] . src ) || ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option must have a string label or image description. Found" + d [ 0 ] + " in: " , d ) ) : ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option id must be a string. Found " + d [ 1 ] + " in: " , d ) ) :
( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option must be an array. Found: " , d ) ) } if ( b ) throw "Found invalid FieldDropdown options." ; } ; Blockly . Field . register ( "field_dropdown" , Blockly . FieldDropdown ) ; Blockly . FieldImage = function ( a , b , c , d , e ) { this . sourceBlock _ = null ; this . height _ = Number ( c ) ; this . width _ = Number ( b ) ; this . size _ = new goog . math . Size ( this . width _ , this . height _ + 2 * Blockly . BlockSvg . INLINE _PADDING _Y ) ; this . text _ = d || "" ; this . setValue ( a ) ; "function" == typeof e && ( this . clickHandler _ = e ) } ; goog . inherits ( Blockly . FieldImage , Blockly . Field ) ;
Blockly . FieldImage . fromJson = function ( a ) { var b = Blockly . utils . replaceMessageReferences ( a . src ) , c = Number ( Blockly . utils . replaceMessageReferences ( a . width ) ) , d = Number ( Blockly . utils . replaceMessageReferences ( a . height ) ) ; a = Blockly . utils . replaceMessageReferences ( a . alt ) ; return new Blockly . FieldImage ( b , c , d , a ) } ; Blockly . FieldImage . prototype . EDITABLE = ! 1 ;
2018-01-16 21:13:23 +00:00
Blockly . FieldImage . prototype . init = function ( ) { this . fieldGroup _ || ( this . fieldGroup _ = Blockly . utils . createSvgElement ( "g" , { } , null ) , this . visible _ || ( this . fieldGroup _ . style . display = "none" ) , this . imageElement _ = Blockly . utils . createSvgElement ( "image" , { height : this . height _ + "px" , width : this . width _ + "px" } , this . fieldGroup _ ) , this . setValue ( this . src _ ) , this . sourceBlock _ . getSvgRoot ( ) . appendChild ( this . fieldGroup _ ) , this . setTooltip ( this . sourceBlock _ ) , Blockly . Tooltip . bindMouseEvents ( this . imageElement _ ) , this . maybeAddClickHandler _ ( ) ) } ;
Blockly . FieldImage . prototype . dispose = function ( ) { goog . dom . removeNode ( this . fieldGroup _ ) ; this . imageElement _ = this . fieldGroup _ = null } ; Blockly . FieldImage . prototype . maybeAddClickHandler _ = function ( ) { this . clickHandler _ && ( this . mouseDownWrapper _ = Blockly . bindEventWithChecks _ ( this . fieldGroup _ , "mousedown" , this , this . onMouseDown _ ) ) } ; Blockly . FieldImage . prototype . setTooltip = function ( a ) { this . imageElement _ . tooltip = a } ; Blockly . FieldImage . prototype . getValue = function ( ) { return this . src _ } ;
2018-08-17 13:32:56 +00:00
Blockly . FieldImage . prototype . setValue = function ( a ) { null !== a && ( this . src _ = a , this . imageElement _ && this . imageElement _ . setAttributeNS ( "http://www.w3.org/1999/xlink" , "xlink:href" , a || "" ) ) } ; Blockly . FieldImage . prototype . setText = function ( a ) { null !== a && ( this . text _ = a ) } ; Blockly . FieldImage . prototype . render _ = function ( ) { } ; Blockly . FieldImage . prototype . forceRerender = function ( ) { } ; Blockly . FieldImage . prototype . updateWidth = function ( ) { } ; Blockly . FieldImage . prototype . showEditor _ = function ( ) { this . clickHandler _ && this . clickHandler _ ( this ) } ;
Blockly . Field . register ( "field_image" , Blockly . FieldImage ) ; Blockly . FieldNumber = function ( a , b , c , d , e ) { a = a && ! isNaN ( a ) ? String ( a ) : "0" ; Blockly . FieldNumber . superClass _ . constructor . call ( this , a , e ) ; this . setConstraints ( b , c , d ) } ; goog . inherits ( Blockly . FieldNumber , Blockly . FieldTextInput ) ; Blockly . FieldNumber . fromJson = function ( a ) { return new Blockly . FieldNumber ( a . value , a . min , a . max , a . precision ) } ;
Blockly . FieldNumber . prototype . setConstraints = function ( a , b , c ) { c = parseFloat ( c ) ; this . precision _ = isNaN ( c ) ? 0 : c ; a = parseFloat ( a ) ; this . min _ = isNaN ( a ) ? - Infinity : a ; b = parseFloat ( b ) ; this . max _ = isNaN ( b ) ? Infinity : b ; this . setValue ( this . callValidator ( this . getValue ( ) ) ) } ;
Blockly . FieldNumber . prototype . classValidator = function ( a ) { if ( null === a ) return null ; a = String ( a ) ; a = a . replace ( /O/ig , "0" ) ; a = a . replace ( /,/g , "" ) ; a = parseFloat ( a || 0 ) ; if ( isNaN ( a ) ) return null ; this . precision _ && isFinite ( a ) && ( a = Math . round ( a / this . precision _ ) * this . precision _ ) ; a = goog . math . clamp ( a , this . min _ , this . max _ ) ; return String ( a ) } ; Blockly . Field . register ( "field_number" , Blockly . FieldNumber ) ; Blockly . FieldVariable = function ( a , b , c , d ) { this . menuGenerator _ = Blockly . FieldVariable . dropdownCreate ; this . size _ = new goog . math . Size ( 0 , Blockly . BlockSvg . MIN _BLOCK _Y ) ; this . setValidator ( b ) ; this . defaultVariableName = a || "" ; this . setTypes _ ( c , d ) ; this . value _ = null } ; goog . inherits ( Blockly . FieldVariable , Blockly . FieldDropdown ) ; Blockly . FieldVariable . fromJson = function ( a ) { var b = Blockly . utils . replaceMessageReferences ( a . variable ) ; return new Blockly . FieldVariable ( b , null , a . variableTypes , a . defaultType ) } ;
Blockly . FieldVariable . prototype . init = function ( ) { this . fieldGroup _ || ( Blockly . FieldVariable . superClass _ . init . call ( this ) , this . initModel ( ) ) } ; Blockly . FieldVariable . prototype . initModel = function ( ) { if ( ! this . variable _ ) { this . workspace _ = this . sourceBlock _ . workspace ; var a = Blockly . Variables . getOrCreateVariablePackage ( this . workspace _ , null , this . defaultVariableName , this . defaultType _ ) ; Blockly . Events . disable ( ) ; try { this . setValue ( a . getId ( ) ) } finally { Blockly . Events . enable ( ) } } } ;
Blockly . FieldVariable . prototype . dispose = function ( ) { Blockly . FieldVariable . superClass _ . dispose . call ( this ) ; this . variableMap _ = this . workspace _ = null } ; Blockly . FieldVariable . prototype . setSourceBlock = function ( a ) { goog . asserts . assert ( ! a . isShadow ( ) , "Variable fields are not allowed to exist on shadow blocks." ) ; Blockly . FieldVariable . superClass _ . setSourceBlock . call ( this , a ) } ; Blockly . FieldVariable . prototype . getValue = function ( ) { return this . variable _ ? this . variable _ . getId ( ) : null } ;
Blockly . FieldVariable . prototype . getText = function ( ) { return this . variable _ ? this . variable _ . name : "" } ; Blockly . FieldVariable . prototype . getVariable = function ( ) { return this . variable _ } ;
Blockly . FieldVariable . prototype . setValue = function ( a ) { var b = Blockly . Variables . getVariable ( this . sourceBlock _ . workspace , a ) ; if ( ! b ) throw Error ( "Variable id doesn't point to a real variable! ID was " + a ) ; var c = b . type ; if ( ! this . typeIsAllowed _ ( c ) ) throw Error ( "Variable type doesn't match this field! Type was " + c ) ; this . sourceBlock _ && Blockly . Events . isEnabled ( ) && ( c = this . variable _ ? this . variable _ . getId ( ) : null , Blockly . Events . fire ( new Blockly . Events . BlockChange ( this . sourceBlock _ , "field" , this . name , c , a ) ) ) ; this . variable _ =
b ; this . value _ = a ; this . setText ( b . name ) } ; Blockly . FieldVariable . prototype . typeIsAllowed _ = function ( a ) { var b = this . getVariableTypes _ ( ) ; if ( ! b ) return ! 0 ; for ( var c = 0 ; c < b . length ; c ++ ) if ( a == b [ c ] ) return ! 0 ; return ! 1 } ; Blockly . FieldVariable . prototype . getVariableTypes _ = function ( ) { var a = this . variableTypes ; if ( null === a && this . sourceBlock _ ) return this . sourceBlock _ . workspace . getVariableTypes ( ) ; a = a || [ "" ] ; if ( 0 == a . length ) throw a = this . getText ( ) , Error ( "'variableTypes' of field variable " + a + " was an empty list" ) ; return a } ;
Blockly . FieldVariable . prototype . setTypes _ = function ( a , b ) { var c = b || "" ; if ( null == a || void 0 == a ) var d = null ; else if ( Array . isArray ( a ) ) { d = a ; for ( var e = ! 1 , f = 0 ; f < d . length ; f ++ ) d [ f ] == c && ( e = ! 0 ) ; if ( ! e ) throw Error ( "Invalid default type '" + c + "' in the definition of a FieldVariable" ) ; } else throw Error ( "'variableTypes' was not an array in the definition of a FieldVariable" ) ; this . defaultType _ = c ; this . variableTypes = d } ;
Blockly . FieldVariable . dropdownCreate = function ( ) { if ( ! this . variable _ ) throw Error ( "Tried to call dropdownCreate on a variable field with no variable selected." ) ; var a = this . getText ( ) , b = null ; this . sourceBlock _ && ( b = this . sourceBlock _ . workspace ) ; var c = [ ] ; if ( b ) for ( var d = this . getVariableTypes _ ( ) , e = 0 ; e < d . length ; e ++ ) { var f = b . getVariablesOfType ( d [ e ] ) ; c = c . concat ( f ) } c . sort ( Blockly . VariableModel . compareByName ) ; b = [ ] ; for ( e = 0 ; e < c . length ; e ++ ) b [ e ] = [ c [ e ] . name , c [ e ] . getId ( ) ] ; b . push ( [ Blockly . Msg . RENAME _VARIABLE , Blockly . RENAME _VARIABLE _ID ] ) ;
Blockly . Msg . DELETE _VARIABLE && b . push ( [ Blockly . Msg . DELETE _VARIABLE . replace ( "%1" , a ) , Blockly . DELETE _VARIABLE _ID ] ) ; return b } ; Blockly . FieldVariable . prototype . onItemSelected = function ( a , b ) { var c = b . getValue ( ) ; if ( this . sourceBlock _ && this . sourceBlock _ . workspace ) { var d = this . sourceBlock _ . workspace ; if ( c == Blockly . RENAME _VARIABLE _ID ) { Blockly . Variables . renameVariable ( d , this . variable _ ) ; return } if ( c == Blockly . DELETE _VARIABLE _ID ) { d . deleteVariableById ( this . variable _ . getId ( ) ) ; return } } this . setValue ( c ) } ;
Blockly . FieldVariable . prototype . referencesVariables = function ( ) { return ! 0 } ; Blockly . Field . register ( "field_variable" , Blockly . FieldVariable ) ; Blockly . Generator = function ( a ) { this . name _ = a ; this . FUNCTION _NAME _PLACEHOLDER _REGEXP _ = new RegExp ( this . FUNCTION _NAME _PLACEHOLDER _ , "g" ) } ; Blockly . Generator . NAME _TYPE = "generated_function" ; Blockly . Generator . prototype . INFINITE _LOOP _TRAP = null ; Blockly . Generator . prototype . STATEMENT _PREFIX = null ; Blockly . Generator . prototype . INDENT = " " ; Blockly . Generator . prototype . COMMENT _WRAP = 60 ; Blockly . Generator . prototype . ORDER _OVERRIDES = [ ] ;
Blockly . Generator . prototype . workspaceToCode = function ( a ) { a || ( console . warn ( "No workspace specified in workspaceToCode call. Guessing." ) , a = Blockly . getMainWorkspace ( ) ) ; var b = [ ] ; this . init ( a ) ; a = a . getTopBlocks ( ! 0 ) ; for ( var c = 0 , d ; d = a [ c ] ; c ++ ) { var e = this . blockToCode ( d ) ; goog . isArray ( e ) && ( e = e [ 0 ] ) ; e && ( d . outputConnection && ( e = this . scrubNakedValue ( e ) ) , b . push ( e ) ) } b = b . join ( "\n" ) ; b = this . finish ( b ) ; b = b . replace ( /^\s+\n/ , "" ) ; b = b . replace ( /\n\s+$/ , "\n" ) ; return b = b . replace ( /[ \t]+\n/g , "\n" ) } ;
Blockly . Generator . prototype . prefixLines = function ( a , b ) { return b + a . replace ( /(?!\n$)\n/g , "\n" + b ) } ; Blockly . Generator . prototype . allNestedComments = function ( a ) { var b = [ ] ; a = a . getDescendants ( ! 0 ) ; for ( var c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] . getCommentText ( ) ; d && b . push ( d ) } b . length && b . push ( "" ) ; return b . join ( "\n" ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Generator . prototype . blockToCode = function ( a ) { if ( ! a ) return "" ; if ( a . disabled ) return this . blockToCode ( a . getNextBlock ( ) ) ; var b = this [ a . type ] ; goog . asserts . assertFunction ( b , 'Language "%s" does not know how to generate code for block type "%s".' , this . name _ , a . type ) ; b = b . call ( a , a ) ; if ( goog . isArray ( b ) ) return goog . asserts . assert ( a . outputConnection , 'Expecting string from statement block "%s".' , a . type ) , [ this . scrub _ ( a , b [ 0 ] ) , b [ 1 ] ] ; if ( goog . isString ( b ) ) { var c = a . id . replace ( /\$/g , "$$$$" ) ; this . STATEMENT _PREFIX && ( b =
this . STATEMENT _PREFIX . replace ( /%1/g , "'" + c + "'" ) + b ) ; return this . scrub _ ( a , b ) } if ( null === b ) return "" ; goog . asserts . fail ( "Invalid code generated: %s" , b ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Generator . prototype . valueToCode = function ( a , b , c ) { isNaN ( c ) && goog . asserts . fail ( 'Expecting valid order from block "%s".' , a . type ) ; var d = a . getInputTargetBlock ( b ) ; if ( ! d ) return "" ; b = this . blockToCode ( d ) ; if ( "" === b ) return "" ; goog . asserts . assertArray ( b , 'Expecting tuple from value block "%s".' , d . type ) ; a = b [ 0 ] ; b = b [ 1 ] ; isNaN ( b ) && goog . asserts . fail ( 'Expecting valid order from value block "%s".' , d . type ) ; if ( ! a ) return "" ; d = ! 1 ; var e = Math . floor ( c ) , f = Math . floor ( b ) ; if ( e <= f && ( e != f || 0 != e && 99 != e ) ) for ( d = ! 0 , e = 0 ; e < this . ORDER _OVERRIDES . length ; e ++ ) if ( this . ORDER _OVERRIDES [ e ] [ 0 ] ==
2017-09-25 09:37:41 +00:00
c && this . ORDER _OVERRIDES [ e ] [ 1 ] == b ) { d = ! 1 ; break } d && ( a = "(" + a + ")" ) ; return a } ; Blockly . Generator . prototype . statementToCode = function ( a , b ) { var c = a . getInputTargetBlock ( b ) , d = this . blockToCode ( c ) ; goog . asserts . assertString ( d , 'Expecting code from statement block "%s".' , c && c . type ) ; d && ( d = this . prefixLines ( d , this . INDENT ) ) ; return d } ;
Blockly . Generator . prototype . addLoopTrap = function ( a , b ) { b = b . replace ( /\$/g , "$$$$" ) ; this . INFINITE _LOOP _TRAP && ( a = this . INFINITE _LOOP _TRAP . replace ( /%1/g , "'" + b + "'" ) + a ) ; this . STATEMENT _PREFIX && ( a += this . prefixLines ( this . STATEMENT _PREFIX . replace ( /%1/g , "'" + b + "'" ) , this . INDENT ) ) ; return a } ; Blockly . Generator . prototype . RESERVED _WORDS _ = "" ; Blockly . Generator . prototype . addReservedWords = function ( a ) { this . RESERVED _WORDS _ += a + "," } ; Blockly . Generator . prototype . FUNCTION _NAME _PLACEHOLDER _ = "{leCUI8hutHZI4480Dc}" ;
2018-08-17 13:32:56 +00:00
Blockly . Generator . prototype . provideFunction _ = function ( a , b ) { if ( ! this . definitions _ [ a ] ) { var c = this . variableDB _ . getDistinctName ( a , Blockly . Procedures . NAME _TYPE ) ; this . functionNames _ [ a ] = c ; c = b . join ( "\n" ) . replace ( this . FUNCTION _NAME _PLACEHOLDER _REGEXP _ , c ) ; for ( var d ; d != c ; ) d = c , c = c . replace ( /^(( {2})*) {2}/gm , "$1\x00" ) ; c = c . replace ( /\0/g , this . INDENT ) ; this . definitions _ [ a ] = c } return this . functionNames _ [ a ] } ; Blockly . Generator . prototype . init = function ( a ) { } ; Blockly . Generator . prototype . scrub _ = function ( a , b ) { return b } ;
Blockly . Generator . prototype . finish = function ( a ) { return a } ; Blockly . Generator . prototype . scrubNakedValue = function ( a ) { return a } ; Blockly . Names = function ( a , b ) { this . variablePrefix _ = b || "" ; this . reservedDict _ = Object . create ( null ) ; if ( a ) for ( var c = a . split ( "," ) , d = 0 ; d < c . length ; d ++ ) this . reservedDict _ [ c [ d ] ] = ! 0 ; this . reset ( ) } ; Blockly . Names . DEVELOPER _VARIABLE _TYPE = "DEVELOPER_VARIABLE" ; Blockly . Names . prototype . reset = function ( ) { this . db _ = Object . create ( null ) ; this . dbReverse _ = Object . create ( null ) ; this . variableMap _ = null } ; Blockly . Names . prototype . setVariableMap = function ( a ) { this . variableMap _ = a } ;
Blockly . Names . prototype . getNameForUserVariable _ = function ( a ) { return this . variableMap _ ? ( a = this . variableMap _ . getVariableById ( a ) ) ? a . name : null : ( console . log ( "Deprecated call to Blockly.Names.prototype.getName without defining a variable map. To fix, add the folowing code in your generator's init() function:\nBlockly.YourGeneratorName.variableDB_.setVariableMap(workspace.getVariableMap());" ) , null ) } ;
Blockly . Names . prototype . getName = function ( a , b ) { if ( b == Blockly . Variables . NAME _TYPE ) { var c = this . getNameForUserVariable _ ( a ) ; c && ( a = c ) } c = a . toLowerCase ( ) + "_" + b ; var d = b == Blockly . Variables . NAME _TYPE || b == Blockly . Names . DEVELOPER _VARIABLE _TYPE ? this . variablePrefix _ : "" ; if ( c in this . db _ ) return d + this . db _ [ c ] ; var e = this . getDistinctName ( a , b ) ; this . db _ [ c ] = e . substr ( d . length ) ; return e } ;
Blockly . Names . prototype . getDistinctName = function ( a , b ) { for ( var c = this . safeName _ ( a ) , d = "" ; this . dbReverse _ [ c + d ] || c + d in this . reservedDict _ ; ) d = d ? d + 1 : 2 ; c += d ; this . dbReverse _ [ c ] = ! 0 ; return ( b == Blockly . Variables . NAME _TYPE || b == Blockly . Names . DEVELOPER _VARIABLE _TYPE ? this . variablePrefix _ : "" ) + c } ; Blockly . Names . prototype . safeName _ = function ( a ) { a ? ( a = encodeURI ( a . replace ( / /g , "_" ) ) . replace ( /[^\w]/g , "_" ) , - 1 != "0123456789" . indexOf ( a [ 0 ] ) && ( a = "my_" + a ) ) : a = "unnamed" ; return a } ;
Blockly . Names . equals = function ( a , b ) { return a . toLowerCase ( ) == b . toLowerCase ( ) } ; Blockly . Procedures = { } ; Blockly . Procedures . NAME _TYPE = Blockly . PROCEDURE _CATEGORY _NAME ; Blockly . Procedures . allProcedures = function ( a ) { a = a . getAllBlocks ( ) ; for ( var b = [ ] , c = [ ] , d = 0 ; d < a . length ; d ++ ) if ( a [ d ] . getProcedureDef ) { var e = a [ d ] . getProcedureDef ( ) ; e && ( e [ 2 ] ? b . push ( e ) : c . push ( e ) ) } c . sort ( Blockly . Procedures . procTupleComparator _ ) ; b . sort ( Blockly . Procedures . procTupleComparator _ ) ; return [ c , b ] } ; Blockly . Procedures . procTupleComparator _ = function ( a , b ) { return a [ 0 ] . toLowerCase ( ) . localeCompare ( b [ 0 ] . toLowerCase ( ) ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Procedures . findLegalName = function ( a , b ) { if ( b . isInFlyout ) return a ; for ( ; ! Blockly . Procedures . isLegalName _ ( a , b . workspace , b ) ; ) { var c = a . match ( /^(.*?)(\d+)$/ ) ; a = c ? c [ 1 ] + ( parseInt ( c [ 2 ] , 10 ) + 1 ) : a + "2" } return a } ; Blockly . Procedures . isLegalName _ = function ( a , b , c ) { return ! Blockly . Procedures . isNameUsed ( a , b , c ) } ; Blockly . Procedures . isNameUsed = function ( a , b , c ) { b = b . getAllBlocks ( ) ; for ( var d = 0 ; d < b . length ; d ++ ) if ( b [ d ] != c && b [ d ] . getProcedureDef ) { var e = b [ d ] . getProcedureDef ( ) ; if ( Blockly . Names . equals ( e [ 0 ] , a ) ) return ! 0 } return ! 1 } ;
2017-09-25 09:37:41 +00:00
Blockly . Procedures . rename = function ( a ) { a = a . replace ( /^[\s\xa0]+|[\s\xa0]+$/g , "" ) ; var b = Blockly . Procedures . findLegalName ( a , this . sourceBlock _ ) , c = this . text _ ; if ( c != a && c != b ) { a = this . sourceBlock _ . workspace . getAllBlocks ( ) ; for ( var d = 0 ; d < a . length ; d ++ ) a [ d ] . renameProcedure && a [ d ] . renameProcedure ( c , b ) } return b } ;
2018-08-17 13:32:56 +00:00
Blockly . Procedures . flyoutCategory = function ( a ) { function b ( a , b ) { for ( var d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] [ 0 ] , f = a [ d ] [ 1 ] , g = goog . dom . createDom ( "block" ) ; g . setAttribute ( "type" , b ) ; g . setAttribute ( "gap" , 16 ) ; var m = goog . dom . createDom ( "mutation" ) ; m . setAttribute ( "name" , e ) ; g . appendChild ( m ) ; for ( e = 0 ; e < f . length ; e ++ ) { var p = goog . dom . createDom ( "arg" ) ; p . setAttribute ( "name" , f [ e ] ) ; m . appendChild ( p ) } c . push ( g ) } } var c = [ ] ; if ( Blockly . Blocks . procedures _defnoreturn ) { var d = goog . dom . createDom ( "block" ) ; d . setAttribute ( "type" , "procedures_defnoreturn" ) ;
2017-09-25 09:37:41 +00:00
d . setAttribute ( "gap" , 16 ) ; var e = goog . dom . createDom ( "field" , null , Blockly . Msg . PROCEDURES _DEFNORETURN _PROCEDURE ) ; e . setAttribute ( "name" , "NAME" ) ; d . appendChild ( e ) ; c . push ( d ) } Blockly . Blocks . procedures _defreturn && ( d = goog . dom . createDom ( "block" ) , d . setAttribute ( "type" , "procedures_defreturn" ) , d . setAttribute ( "gap" , 16 ) , e = goog . dom . createDom ( "field" , null , Blockly . Msg . PROCEDURES _DEFRETURN _PROCEDURE ) , e . setAttribute ( "name" , "NAME" ) , d . appendChild ( e ) , c . push ( d ) ) ; Blockly . Blocks . procedures _ifreturn && ( d = goog . dom . createDom ( "block" ) ,
d . setAttribute ( "type" , "procedures_ifreturn" ) , d . setAttribute ( "gap" , 16 ) , c . push ( d ) ) ; c . length && c [ c . length - 1 ] . setAttribute ( "gap" , 24 ) ; a = Blockly . Procedures . allProcedures ( a ) ; b ( a [ 0 ] , "procedures_callnoreturn" ) ; b ( a [ 1 ] , "procedures_callreturn" ) ; return c } ; Blockly . Procedures . getCallers = function ( a , b ) { for ( var c = [ ] , d = b . getAllBlocks ( ) , e = 0 ; e < d . length ; e ++ ) if ( d [ e ] . getProcedureCall ) { var f = d [ e ] . getProcedureCall ( ) ; f && Blockly . Names . equals ( f , a ) && c . push ( d [ e ] ) } return c } ;
2018-01-16 21:13:23 +00:00
Blockly . Procedures . mutateCallers = function ( a ) { var b = Blockly . Events . recordUndo , c = a . getProcedureDef ( ) [ 0 ] , d = a . mutationToDom ( ! 0 ) ; a = Blockly . Procedures . getCallers ( c , a . workspace ) ; c = 0 ; for ( var e ; e = a [ c ] ; c ++ ) { var f = e . mutationToDom ( ) ; f = f && Blockly . Xml . domToText ( f ) ; e . domToMutation ( d ) ; var g = e . mutationToDom ( ) ; g = g && Blockly . Xml . domToText ( g ) ; f != g && ( Blockly . Events . recordUndo = ! 1 , Blockly . Events . fire ( new Blockly . Events . BlockChange ( e , "mutation" , null , f , g ) ) , Blockly . Events . recordUndo = b ) } } ;
2017-09-25 09:37:41 +00:00
Blockly . Procedures . getDefinition = function ( a , b ) { for ( var c = b . getTopBlocks ( ! 1 ) , d = 0 ; d < c . length ; d ++ ) if ( c [ d ] . getProcedureDef ) { var e = c [ d ] . getProcedureDef ( ) ; if ( e && Blockly . Names . equals ( e [ 0 ] , a ) ) return c [ d ] } return null } ; Blockly . FlyoutButton = function ( a , b , c , d ) { this . workspace _ = a ; this . targetWorkspace _ = b ; this . text _ = c . getAttribute ( "text" ) ; this . position _ = new goog . math . Coordinate ( 0 , 0 ) ; this . isLabel _ = d ; this . callback _ = null ; a = c . getAttribute ( "callbackKey" ) ; this . isLabel _ && a ? console . warn ( "Labels should not have callbacks. Label text: " + this . text _ ) : this . isLabel _ || a && b . getButtonCallback ( a ) ? this . callback _ = b . getButtonCallback ( a ) : console . warn ( "Buttons should have callbacks. Button text: " + this . text _ ) ; this . cssClass _ = c . getAttribute ( "web-class" ) ||
2018-01-16 21:13:23 +00:00
null } ; Blockly . FlyoutButton . MARGIN = 5 ; Blockly . FlyoutButton . prototype . width = 0 ; Blockly . FlyoutButton . prototype . height = 0 ; Blockly . FlyoutButton . prototype . onMouseUpWrapper _ = null ;
Blockly . FlyoutButton . prototype . createDom = function ( ) { var a = this . isLabel _ ? "blocklyFlyoutLabel" : "blocklyFlyoutButton" ; this . cssClass _ && ( a += " " + this . cssClass _ ) ; this . svgGroup _ = Blockly . utils . createSvgElement ( "g" , { "class" : a } , this . workspace _ . getCanvas ( ) ) ; if ( ! this . isLabel _ ) var b = Blockly . utils . createSvgElement ( "rect" , { "class" : "blocklyFlyoutButtonShadow" , rx : 4 , ry : 4 , x : 1 , y : 1 } , this . svgGroup _ ) ; a = Blockly . utils . createSvgElement ( "rect" , { "class" : this . isLabel _ ? "blocklyFlyoutLabelBackground" : "blocklyFlyoutButtonBackground" ,
2018-08-17 13:32:56 +00:00
rx : 4 , ry : 4 } , this . svgGroup _ ) ; var c = Blockly . utils . createSvgElement ( "text" , { "class" : this . isLabel _ ? "blocklyFlyoutLabelText" : "blocklyText" , x : 0 , y : 0 , "text-anchor" : "middle" } , this . svgGroup _ ) ; c . textContent = Blockly . utils . replaceMessageReferences ( this . text _ ) ; this . width = Blockly . Field . getCachedWidth ( c ) ; this . height = 20 ; this . isLabel _ || ( this . width += 2 * Blockly . FlyoutButton . MARGIN , b . setAttribute ( "width" , this . width ) , b . setAttribute ( "height" , this . height ) ) ; a . setAttribute ( "width" , this . width ) ; a . setAttribute ( "height" , this . height ) ;
c . setAttribute ( "x" , this . width / 2 ) ; c . setAttribute ( "y" , this . height - Blockly . FlyoutButton . MARGIN ) ; this . updateTransform _ ( ) ; this . onMouseUpWrapper _ = Blockly . bindEventWithChecks _ ( this . svgGroup _ , "mouseup" , this , this . onMouseUp _ ) ; return this . svgGroup _ } ; Blockly . FlyoutButton . prototype . show = function ( ) { this . updateTransform _ ( ) ; this . svgGroup _ . setAttribute ( "display" , "block" ) } ;
Blockly . FlyoutButton . prototype . updateTransform _ = function ( ) { this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . position _ . x + "," + this . position _ . y + ")" ) } ; Blockly . FlyoutButton . prototype . moveTo = function ( a , b ) { this . position _ . x = a ; this . position _ . y = b ; this . updateTransform _ ( ) } ; Blockly . FlyoutButton . prototype . getPosition = function ( ) { return this . position _ } ; Blockly . FlyoutButton . prototype . getTargetWorkspace = function ( ) { return this . targetWorkspace _ } ;
2018-01-16 21:13:23 +00:00
Blockly . FlyoutButton . prototype . dispose = function ( ) { this . onMouseUpWrapper _ && Blockly . unbindEvent _ ( this . onMouseUpWrapper _ ) ; this . svgGroup _ && ( goog . dom . removeNode ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . targetWorkspace _ = this . workspace _ = null } ; Blockly . FlyoutButton . prototype . onMouseUp _ = function ( a ) { ( a = this . targetWorkspace _ . getGesture ( a ) ) && a . cancel ( ) ; this . callback _ && this . callback _ ( this ) } ; Blockly . Flyout = function ( a ) { a . getMetrics = this . getMetrics _ . bind ( this ) ; a . setMetrics = this . setMetrics _ . bind ( this ) ; this . workspace _ = new Blockly . WorkspaceSvg ( a ) ; this . workspace _ . isFlyout = ! 0 ; this . RTL = ! ! a . RTL ; this . toolboxPosition _ = a . toolboxPosition ; this . eventWrappers _ = [ ] ; this . mats _ = [ ] ; this . buttons _ = [ ] ; this . listeners _ = [ ] ; this . permanentlyDisabled _ = [ ] } ; Blockly . Flyout . prototype . autoClose = ! 0 ; Blockly . Flyout . prototype . isVisible _ = ! 1 ; Blockly . Flyout . prototype . containerVisible _ = ! 0 ;
Blockly . Flyout . prototype . CORNER _RADIUS = 8 ; Blockly . Flyout . prototype . MARGIN = Blockly . Flyout . prototype . CORNER _RADIUS ; Blockly . Flyout . prototype . GAP _X = 3 * Blockly . Flyout . prototype . MARGIN ; Blockly . Flyout . prototype . GAP _Y = 3 * Blockly . Flyout . prototype . MARGIN ; Blockly . Flyout . prototype . SCROLLBAR _PADDING = 2 ; Blockly . Flyout . prototype . width _ = 0 ; Blockly . Flyout . prototype . height _ = 0 ; Blockly . Flyout . prototype . dragAngleRange _ = 70 ;
2017-09-25 09:37:41 +00:00
Blockly . Flyout . prototype . createDom = function ( a ) { this . svgGroup _ = Blockly . utils . createSvgElement ( a , { "class" : "blocklyFlyout" , style : "display: none" } , null ) ; this . svgBackground _ = Blockly . utils . createSvgElement ( "path" , { "class" : "blocklyFlyoutBackground" } , this . svgGroup _ ) ; this . svgGroup _ . appendChild ( this . workspace _ . createDom ( ) ) ; return this . svgGroup _ } ;
2018-01-16 21:13:23 +00:00
Blockly . Flyout . prototype . init = function ( a ) { this . targetWorkspace _ = a ; this . workspace _ . targetWorkspace = a ; this . scrollbar _ = new Blockly . Scrollbar ( this . workspace _ , this . horizontalLayout _ , ! 1 , "blocklyFlyoutScrollbar" ) ; this . hide ( ) ; Array . prototype . push . apply ( this . eventWrappers _ , Blockly . bindEventWithChecks _ ( this . svgGroup _ , "wheel" , this , this . wheel _ ) ) ; this . autoClose || ( this . filterWrapper _ = this . filterForCapacity _ . bind ( this ) , this . targetWorkspace _ . addChangeListener ( this . filterWrapper _ ) ) ; Array . prototype . push . apply ( this . eventWrappers _ ,
2018-08-17 13:32:56 +00:00
Blockly . bindEventWithChecks _ ( this . svgBackground _ , "mousedown" , this , this . onMouseDown _ ) ) ; this . workspace _ . getGesture = this . targetWorkspace _ . getGesture . bind ( this . targetWorkspace _ ) ; this . workspace _ . variableMap _ = this . targetWorkspace _ . getVariableMap ( ) ; this . workspace _ . createPotentialVariableMap ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Flyout . prototype . dispose = function ( ) { this . hide ( ) ; Blockly . unbindEvent _ ( this . eventWrappers _ ) ; this . filterWrapper _ && ( this . targetWorkspace _ . removeChangeListener ( this . filterWrapper _ ) , this . filterWrapper _ = null ) ; this . scrollbar _ && ( this . scrollbar _ . dispose ( ) , this . scrollbar _ = null ) ; this . workspace _ && ( this . workspace _ . targetWorkspace = null , this . workspace _ . dispose ( ) , this . workspace _ = null ) ; this . svgGroup _ && ( goog . dom . removeNode ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . targetWorkspace _ = this . svgBackground _ = null } ;
2018-01-16 21:13:23 +00:00
Blockly . Flyout . prototype . getWidth = function ( ) { return this . width _ } ; Blockly . Flyout . prototype . getHeight = function ( ) { return this . height _ } ; Blockly . Flyout . prototype . getWorkspace = function ( ) { return this . workspace _ } ; Blockly . Flyout . prototype . isVisible = function ( ) { return this . isVisible _ } ; Blockly . Flyout . prototype . setVisible = function ( a ) { var b = a != this . isVisible ( ) ; this . isVisible _ = a ; b && this . updateDisplay _ ( ) } ;
Blockly . Flyout . prototype . setContainerVisible = function ( a ) { var b = a != this . containerVisible _ ; this . containerVisible _ = a ; b && this . updateDisplay _ ( ) } ; Blockly . Flyout . prototype . updateDisplay _ = function ( ) { var a = this . containerVisible _ ? this . isVisible ( ) : ! 1 ; this . svgGroup _ . style . display = a ? "block" : "none" ; this . scrollbar _ . setContainerVisible ( a ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Flyout . prototype . positionAt _ = function ( a , b , c , d ) { this . svgGroup _ . setAttribute ( "width" , a ) ; this . svgGroup _ . setAttribute ( "height" , b ) ; "svg" == this . svgGroup _ . tagName ? Blockly . utils . setCssTransform ( this . svgGroup _ , "translate(" + c + "px," + d + "px)" ) : this . svgGroup _ . setAttribute ( "transform" , "translate(" + c + "," + d + ")" ) ; this . scrollbar _ && ( this . scrollbar _ . setOrigin ( c , d ) , this . scrollbar _ . resize ( ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Flyout . prototype . hide = function ( ) { if ( this . isVisible ( ) ) { this . setVisible ( ! 1 ) ; for ( var a = 0 , b ; b = this . listeners _ [ a ] ; a ++ ) Blockly . unbindEvent _ ( b ) ; this . listeners _ . length = 0 ; this . reflowWrapper _ && ( this . workspace _ . removeChangeListener ( this . reflowWrapper _ ) , this . reflowWrapper _ = null ) } } ;
2018-01-16 21:13:23 +00:00
Blockly . Flyout . prototype . show = function ( a ) { this . workspace _ . setResizesEnabled ( ! 1 ) ; this . hide ( ) ; this . clearOldBlocks _ ( ) ; "string" == typeof a && ( a = this . workspace _ . targetWorkspace . getToolboxCategoryCallback ( a ) , goog . asserts . assert ( goog . isFunction ( a ) , "Couldn't find a callback function when opening a toolbox category." ) , a = a ( this . workspace _ . targetWorkspace ) , goog . asserts . assert ( goog . isArray ( a ) , "The result of a toolbox category callback must be an array." ) ) ; this . setVisible ( ! 0 ) ; for ( var b = [ ] , c = [ ] , d = this . permanentlyDisabled _ . length =
0 , e ; e = a [ d ] ; d ++ ) if ( e . tagName ) { var f = e . tagName . toUpperCase ( ) , g = this . horizontalLayout _ ? this . GAP _X : this . GAP _Y ; if ( "BLOCK" == f ) f = Blockly . Xml . domToBlock ( e , this . workspace _ ) , f . disabled && this . permanentlyDisabled _ . push ( f ) , b . push ( { type : "block" , block : f } ) , e = parseInt ( e . getAttribute ( "gap" ) , 10 ) , c . push ( isNaN ( e ) ? g : e ) ; else if ( "SEP" == e . tagName . toUpperCase ( ) ) e = parseInt ( e . getAttribute ( "gap" ) , 10 ) , ! isNaN ( e ) && 0 < c . length ? c [ c . length - 1 ] = e : c . push ( g ) ; else if ( "BUTTON" == f || "LABEL" == f ) e = new Blockly . FlyoutButton ( this . workspace _ , this . targetWorkspace _ ,
e , "LABEL" == f ) , b . push ( { type : "button" , button : e } ) , c . push ( g ) } this . layout _ ( b , c ) ; this . listeners _ . push ( Blockly . bindEventWithChecks _ ( this . svgBackground _ , "mouseover" , this , function ( ) { for ( var a = this . workspace _ . getTopBlocks ( ! 1 ) , b = 0 , c ; c = a [ b ] ; b ++ ) c . removeSelect ( ) } ) ) ; this . horizontalLayout _ ? this . height _ = 0 : this . width _ = 0 ; this . workspace _ . setResizesEnabled ( ! 0 ) ; this . reflow ( ) ; this . filterForCapacity _ ( ) ; this . position ( ) ; this . reflowWrapper _ = this . reflow . bind ( this ) ; this . workspace _ . addChangeListener ( this . reflowWrapper _ ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Flyout . prototype . clearOldBlocks _ = function ( ) { for ( var a = this . workspace _ . getTopBlocks ( ! 1 ) , b = 0 , c ; c = a [ b ] ; b ++ ) c . workspace == this . workspace _ && c . dispose ( ! 1 , ! 1 ) ; for ( b = 0 ; b < this . mats _ . length ; b ++ ) ( a = this . mats _ [ b ] ) && goog . dom . removeNode ( a ) ; for ( b = this . mats _ . length = 0 ; a = this . buttons _ [ b ] ; b ++ ) a . dispose ( ) ; this . buttons _ . length = 0 ; this . workspace _ . getPotentialVariableMap ( ) . clear ( ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Flyout . prototype . addBlockListeners _ = function ( a , b , c ) { this . listeners _ . push ( Blockly . bindEventWithChecks _ ( a , "mousedown" , null , this . blockMouseDown _ ( b ) ) ) ; this . listeners _ . push ( Blockly . bindEventWithChecks _ ( c , "mousedown" , null , this . blockMouseDown _ ( b ) ) ) ; this . listeners _ . push ( Blockly . bindEvent _ ( a , "mouseover" , b , b . addSelect ) ) ; this . listeners _ . push ( Blockly . bindEvent _ ( a , "mouseout" , b , b . removeSelect ) ) ; this . listeners _ . push ( Blockly . bindEvent _ ( c , "mouseover" , b , b . addSelect ) ) ; this . listeners _ . push ( Blockly . bindEvent _ ( c ,
2018-01-16 21:13:23 +00:00
"mouseout" , b , b . removeSelect ) ) } ; Blockly . Flyout . prototype . blockMouseDown _ = function ( a ) { var b = this ; return function ( c ) { var d = b . targetWorkspace _ . getGesture ( c ) ; d && ( d . setStartBlock ( a ) , d . handleFlyoutStart ( c , b ) ) } } ; Blockly . Flyout . prototype . onMouseDown _ = function ( a ) { var b = this . targetWorkspace _ . getGesture ( a ) ; b && b . handleFlyoutStart ( a , this ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Flyout . prototype . createBlock = function ( a ) { var b = null ; Blockly . Events . disable ( ) ; var c = this . targetWorkspace _ . getAllVariables ( ) ; this . targetWorkspace _ . setResizesEnabled ( ! 1 ) ; try { b = this . placeNewBlock _ ( a ) , Blockly . hideChaff ( ) } finally { Blockly . Events . enable ( ) } a = Blockly . Variables . getAddedVariables ( this . targetWorkspace _ , c ) ; if ( Blockly . Events . isEnabled ( ) ) for ( Blockly . Events . setGroup ( ! 0 ) , Blockly . Events . fire ( new Blockly . Events . Create ( b ) ) , c = 0 ; c < a . length ; c ++ ) Blockly . Events . fire ( new Blockly . Events . VarCreate ( a [ c ] ) ) ;
this . autoClose ? this . hide ( ) : this . filterForCapacity _ ( ) ; return b } ; Blockly . Flyout . prototype . initFlyoutButton _ = function ( a , b , c ) { var d = a . createDom ( ) ; a . moveTo ( b , c ) ; a . show ( ) ; this . listeners _ . push ( Blockly . bindEventWithChecks _ ( d , "mousedown" , this , this . onMouseDown _ ) ) ; this . buttons _ . push ( a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Flyout . prototype . createRect _ = function ( a , b , c , d , e ) { b = Blockly . utils . createSvgElement ( "rect" , { "fill-opacity" : 0 , x : b , y : c , height : d . height , width : d . width } , null ) ; b . tooltip = a ; Blockly . Tooltip . bindMouseEvents ( b ) ; this . workspace _ . getCanvas ( ) . insertBefore ( b , a . getSvgRoot ( ) ) ; a . flyoutRect _ = b ; return this . mats _ [ e ] = b } ;
Blockly . Flyout . prototype . moveRectToBlock _ = function ( a , b ) { var c = b . getHeightWidth ( ) ; a . setAttribute ( "width" , c . width ) ; a . setAttribute ( "height" , c . height ) ; var d = b . startHat _ ? Blockly . BlockSvg . START _HAT _HEIGHT : 0 ; d && b . moveBy ( 0 , d ) ; d = b . outputConnection ? Blockly . BlockSvg . TAB _WIDTH : 0 ; var e = b . getRelativeToSurfaceXY ( ) ; a . setAttribute ( "y" , e . y ) ; a . setAttribute ( "x" , this . RTL ? e . x - c . width + d : e . x - d ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Flyout . prototype . filterForCapacity _ = function ( ) { for ( var a = this . targetWorkspace _ . remainingCapacity ( ) , b = this . workspace _ . getTopBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) if ( - 1 == this . permanentlyDisabled _ . indexOf ( d ) ) { var e = d . getDescendants ( ! 1 ) ; d . setDisabled ( e . length > a ) } } ; Blockly . Flyout . prototype . reflow = function ( ) { this . reflowWrapper _ && this . workspace _ . removeChangeListener ( this . reflowWrapper _ ) ; this . reflowInternal _ ( ) ; this . reflowWrapper _ && this . workspace _ . addChangeListener ( this . reflowWrapper _ ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Flyout . prototype . isScrollable = function ( ) { return this . scrollbar _ ? this . scrollbar _ . isVisible ( ) : ! 1 } ;
Blockly . Flyout . prototype . placeNewBlock _ = function ( a ) { var b = this . targetWorkspace _ ; if ( ! a . getSvgRoot ( ) ) throw "oldBlock is not rendered." ; var c = Blockly . Xml . blockToDom ( a ) ; b . setResizesEnabled ( ! 1 ) ; c = Blockly . Xml . domToBlock ( c , b ) ; if ( ! c . getSvgRoot ( ) ) throw "block is not rendered." ; var d = b . getOriginOffsetInPixels ( ) , e = this . workspace _ . getOriginOffsetInPixels ( ) ; a = a . getRelativeToSurfaceXY ( ) . scale ( this . workspace _ . scale ) ; a = goog . math . Coordinate . sum ( e , a ) ; b = goog . math . Coordinate . difference ( a , d ) . scale ( 1 / b . scale ) ; c . moveBy ( b . x ,
b . y ) ; return c } ; Blockly . HorizontalFlyout = function ( a ) { a . getMetrics = this . getMetrics _ . bind ( this ) ; a . setMetrics = this . setMetrics _ . bind ( this ) ; Blockly . HorizontalFlyout . superClass _ . constructor . call ( this , a ) ; this . horizontalLayout _ = ! 0 } ; goog . inherits ( Blockly . HorizontalFlyout , Blockly . Flyout ) ;
Blockly . HorizontalFlyout . prototype . getMetrics _ = function ( ) { if ( ! this . isVisible ( ) ) return null ; try { var a = this . workspace _ . getCanvas ( ) . getBBox ( ) } catch ( e ) { a = { height : 0 , y : 0 , width : 0 , x : 0 } } var b = this . SCROLLBAR _PADDING , c = this . SCROLLBAR _PADDING ; this . toolboxPosition _ == Blockly . TOOLBOX _AT _BOTTOM && ( b = 0 ) ; var d = this . height _ ; this . toolboxPosition _ == Blockly . TOOLBOX _AT _TOP && ( d -= this . SCROLLBAR _PADDING ) ; return { viewHeight : d , viewWidth : this . width _ - 2 * this . SCROLLBAR _PADDING , contentHeight : ( a . height + 2 * this . MARGIN ) * this . workspace _ . scale ,
contentWidth : ( a . width + 2 * this . MARGIN ) * this . workspace _ . scale , viewTop : - this . workspace _ . scrollY , viewLeft : - this . workspace _ . scrollX , contentTop : a . y , contentLeft : a . x , absoluteTop : b , absoluteLeft : c } } ; Blockly . HorizontalFlyout . prototype . setMetrics _ = function ( a ) { var b = this . getMetrics _ ( ) ; b && ( goog . isNumber ( a . x ) && ( this . workspace _ . scrollX = - b . contentWidth * a . x ) , this . workspace _ . translate ( this . workspace _ . scrollX + b . absoluteLeft , this . workspace _ . scrollY + b . absoluteTop ) ) } ;
Blockly . HorizontalFlyout . prototype . position = function ( ) { if ( this . isVisible ( ) ) { var a = this . targetWorkspace _ . getMetrics ( ) ; if ( a ) { this . width _ = a . viewWidth ; this . setBackgroundPath _ ( a . viewWidth - 2 * this . CORNER _RADIUS , this . height _ - this . CORNER _RADIUS ) ; var b = a . absoluteLeft , c = a . absoluteTop ; this . toolboxPosition _ == Blockly . TOOLBOX _AT _BOTTOM && ( c += a . viewHeight - this . height _ ) ; this . positionAt _ ( this . width _ , this . height _ , b , c ) } } } ;
Blockly . HorizontalFlyout . prototype . setBackgroundPath _ = function ( a , b ) { var c = this . toolboxPosition _ == Blockly . TOOLBOX _AT _TOP , d = [ "M 0," + ( c ? 0 : this . CORNER _RADIUS ) ] ; c ? ( d . push ( "h" , a + 2 * this . CORNER _RADIUS ) , d . push ( "v" , b ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , - this . CORNER _RADIUS , this . CORNER _RADIUS ) , d . push ( "h" , - 1 * a ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , - this . CORNER _RADIUS , - this . CORNER _RADIUS ) ) : ( d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , this . CORNER _RADIUS , - this . CORNER _RADIUS ) ,
d . push ( "h" , a ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , this . CORNER _RADIUS , this . CORNER _RADIUS ) , d . push ( "v" , b ) , d . push ( "h" , - a - 2 * this . CORNER _RADIUS ) ) ; d . push ( "z" ) ; this . svgBackground _ . setAttribute ( "d" , d . join ( " " ) ) } ; Blockly . HorizontalFlyout . prototype . scrollToStart = function ( ) { this . scrollbar _ . set ( this . RTL ? Infinity : 0 ) } ;
Blockly . HorizontalFlyout . prototype . wheel _ = function ( a ) { var b = a . deltaX ; if ( b ) { goog . userAgent . GECKO && 1 === a . deltaMode && ( b *= 10 ) ; var c = this . getMetrics _ ( ) ; b = c . viewLeft + b ; b = Math . min ( b , c . contentWidth - c . viewWidth ) ; b = Math . max ( b , 0 ) ; this . scrollbar _ . set ( b ) ; Blockly . WidgetDiv . hide ( ) } a . preventDefault ( ) ; a . stopPropagation ( ) } ;
2018-08-17 13:32:56 +00:00
Blockly . HorizontalFlyout . prototype . layout _ = function ( a , b ) { this . workspace _ . scale = this . targetWorkspace _ . scale ; var c = this . MARGIN , d = this . RTL ? c : c + Blockly . BlockSvg . TAB _WIDTH ; this . RTL && ( a = a . reverse ( ) ) ; for ( var e = 0 , f ; f = a [ e ] ; e ++ ) if ( "block" == f . type ) { f = f . block ; for ( var g = f . getDescendants ( ! 1 ) , h = 0 , k ; k = g [ h ] ; h ++ ) k . isInFlyout = ! 0 ; f . render ( ) ; g = f . getSvgRoot ( ) ; h = f . getHeightWidth ( ) ; k = f . outputConnection ? Blockly . BlockSvg . TAB _WIDTH : 0 ; k = this . RTL ? d + h . width : d + k ; f . moveBy ( k , c ) ; k = this . createRect _ ( f , k , c , h , e ) ; d += h . width + b [ e ] ; this . addBlockListeners _ ( g ,
f , k ) } else "button" == f . type && ( this . initFlyoutButton _ ( f . button , d , c ) , d += f . button . width + b [ e ] ) } ; Blockly . HorizontalFlyout . prototype . isDragTowardWorkspace = function ( a ) { a = Math . atan2 ( a . y , a . x ) / Math . PI * 180 ; var b = this . dragAngleRange _ ; return a < 90 + b && a > 90 - b || a > - 90 - b && a < - 90 + b ? ! 0 : ! 1 } ;
2018-01-16 21:13:23 +00:00
Blockly . HorizontalFlyout . prototype . getClientRect = function ( ) { if ( ! this . svgGroup _ ) return null ; var a = this . svgGroup _ . getBoundingClientRect ( ) , b = a . top ; a = a . height ; if ( this . toolboxPosition _ == Blockly . TOOLBOX _AT _TOP ) return new goog . math . Rect ( - 1E9 , b - 1E9 , 2E9 , 1E9 + a ) ; if ( this . toolboxPosition _ == Blockly . TOOLBOX _AT _BOTTOM ) return new goog . math . Rect ( - 1E9 , b , 2E9 , 1E9 + a ) } ;
Blockly . HorizontalFlyout . prototype . reflowInternal _ = function ( ) { this . workspace _ . scale = this . targetWorkspace _ . scale ; for ( var a = 0 , b = this . workspace _ . getTopBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) a = Math . max ( a , d . getHeightWidth ( ) . height ) ; a += 1.5 * this . MARGIN ; a *= this . workspace _ . scale ; a += Blockly . Scrollbar . scrollbarThickness ; if ( this . height _ != a ) { for ( c = 0 ; d = b [ c ] ; c ++ ) d . flyoutRect _ && this . moveRectToBlock _ ( d . flyoutRect _ , d ) ; this . height _ = a ; this . targetWorkspace _ . resize ( ) } } ; Blockly . VerticalFlyout = function ( a ) { a . getMetrics = this . getMetrics _ . bind ( this ) ; a . setMetrics = this . setMetrics _ . bind ( this ) ; Blockly . VerticalFlyout . superClass _ . constructor . call ( this , a ) ; this . horizontalLayout _ = ! 1 } ; goog . inherits ( Blockly . VerticalFlyout , Blockly . Flyout ) ;
Blockly . VerticalFlyout . prototype . getMetrics _ = function ( ) { if ( ! this . isVisible ( ) ) return null ; try { var a = this . workspace _ . getCanvas ( ) . getBBox ( ) } catch ( e ) { a = { height : 0 , y : 0 , width : 0 , x : 0 } } var b = this . SCROLLBAR _PADDING , c = this . height _ - 2 * this . SCROLLBAR _PADDING , d = this . width _ ; this . RTL || ( d -= this . SCROLLBAR _PADDING ) ; return { viewHeight : c , viewWidth : d , contentHeight : a . height * this . workspace _ . scale + 2 * this . MARGIN , contentWidth : a . width * this . workspace _ . scale + 2 * this . MARGIN , viewTop : - this . workspace _ . scrollY + a . y , viewLeft : - this . workspace _ . scrollX ,
contentTop : a . y , contentLeft : a . x , absoluteTop : b , absoluteLeft : 0 } } ; Blockly . VerticalFlyout . prototype . setMetrics _ = function ( a ) { var b = this . getMetrics _ ( ) ; b && ( goog . isNumber ( a . y ) && ( this . workspace _ . scrollY = - b . contentHeight * a . y ) , this . workspace _ . translate ( this . workspace _ . scrollX + b . absoluteLeft , this . workspace _ . scrollY + b . absoluteTop ) ) } ;
2018-08-17 13:32:56 +00:00
Blockly . VerticalFlyout . prototype . position = function ( ) { if ( this . isVisible ( ) ) { var a = this . targetWorkspace _ . getMetrics ( ) ; if ( a ) { this . height _ = a . viewHeight ; this . setBackgroundPath _ ( this . width _ - this . CORNER _RADIUS , a . viewHeight - 2 * this . CORNER _RADIUS ) ; var b = a . absoluteTop , c = a . absoluteLeft ; this . toolboxPosition _ == Blockly . TOOLBOX _AT _RIGHT && ( this . leftEdge _ = c += a . viewWidth - this . width _ ) ; this . positionAt _ ( this . width _ , this . height _ , c , b ) } } } ;
2018-01-16 21:13:23 +00:00
Blockly . VerticalFlyout . prototype . setBackgroundPath _ = function ( a , b ) { var c = this . toolboxPosition _ == Blockly . TOOLBOX _AT _RIGHT , d = a + this . CORNER _RADIUS ; d = [ "M " + ( c ? d : 0 ) + ",0" ] ; d . push ( "h" , c ? - a : a ) ; d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , c ? 0 : 1 , c ? - this . CORNER _RADIUS : this . CORNER _RADIUS , this . CORNER _RADIUS ) ; d . push ( "v" , Math . max ( 0 , b ) ) ; d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , c ? 0 : 1 , c ? this . CORNER _RADIUS : - this . CORNER _RADIUS , this . CORNER _RADIUS ) ; d . push ( "h" , c ? a : - a ) ; d . push ( "z" ) ; this . svgBackground _ . setAttribute ( "d" ,
2018-08-17 13:32:56 +00:00
d . join ( " " ) ) } ; Blockly . VerticalFlyout . prototype . scrollToStart = function ( ) { this . scrollbar _ . set ( 0 ) } ; Blockly . VerticalFlyout . prototype . wheel _ = function ( a ) { var b = a . deltaY ; if ( b ) { goog . userAgent . GECKO && 1 === a . deltaMode && ( b *= 10 ) ; var c = this . getMetrics _ ( ) ; b = c . viewTop - c . contentTop + b ; b = Math . min ( b , c . contentHeight - c . viewHeight ) ; b = Math . max ( b , 0 ) ; this . scrollbar _ . set ( b ) ; Blockly . WidgetDiv . hide ( ) } a . preventDefault ( ) ; a . stopPropagation ( ) } ;
Blockly . VerticalFlyout . prototype . layout _ = function ( a , b ) { this . workspace _ . scale = this . targetWorkspace _ . scale ; for ( var c = this . MARGIN , d = this . RTL ? c : c + Blockly . BlockSvg . TAB _WIDTH , e = 0 , f ; f = a [ e ] ; e ++ ) if ( "block" == f . type ) { f = f . block ; for ( var g = f . getDescendants ( ! 1 ) , h = 0 , k ; k = g [ h ] ; h ++ ) k . isInFlyout = ! 0 ; f . render ( ) ; g = f . getSvgRoot ( ) ; h = f . getHeightWidth ( ) ; f . moveBy ( d , c ) ; k = this . createRect _ ( f , this . RTL ? d - h . width : d , c , h , e ) ; this . addBlockListeners _ ( g , f , k ) ; c += h . height + b [ e ] } else "button" == f . type && ( this . initFlyoutButton _ ( f . button , d , c ) , c +=
f . button . height + b [ e ] ) } ; Blockly . VerticalFlyout . prototype . isDragTowardWorkspace = function ( a ) { a = Math . atan2 ( a . y , a . x ) / Math . PI * 180 ; var b = this . dragAngleRange _ ; return a < b && a > - b || a < - 180 + b || a > 180 - b ? ! 0 : ! 1 } ;
Blockly . VerticalFlyout . prototype . getClientRect = function ( ) { if ( ! this . svgGroup _ ) return null ; var a = this . svgGroup _ . getBoundingClientRect ( ) , b = a . left ; a = a . width ; if ( this . toolboxPosition _ == Blockly . TOOLBOX _AT _LEFT ) return new goog . math . Rect ( b - 1E9 , - 1E9 , 1E9 + a , 2E9 ) ; if ( goog . userAgent . GECKO && this . targetWorkspace _ && this . targetWorkspace _ . isMutator ) { var c = this . targetWorkspace _ . svgGroup _ . getBoundingClientRect ( ) . x ; 10 > Math . abs ( c - b ) && ( b += this . leftEdge _ * this . targetWorkspace _ . options . parentWorkspace . scale ) } return new goog . math . Rect ( b ,
- 1E9 , 1E9 + a , 2E9 ) } ;
2018-01-16 21:13:23 +00:00
Blockly . VerticalFlyout . prototype . reflowInternal _ = function ( ) { this . workspace _ . scale = this . targetWorkspace _ . scale ; for ( var a = 0 , b = this . workspace _ . getTopBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) { var e = d . getHeightWidth ( ) . width ; d . outputConnection && ( e -= Blockly . BlockSvg . TAB _WIDTH ) ; a = Math . max ( a , e ) } for ( c = 0 ; d = this . buttons _ [ c ] ; c ++ ) a = Math . max ( a , d . width ) ; a += 1.5 * this . MARGIN + Blockly . BlockSvg . TAB _WIDTH ; a *= this . workspace _ . scale ; a += Blockly . Scrollbar . scrollbarThickness ; if ( this . width _ != a ) { for ( c = 0 ; d = b [ c ] ; c ++ ) this . RTL && ( e = d . getRelativeToSurfaceXY ( ) . x ,
2018-08-17 13:32:56 +00:00
d . moveBy ( a / this . workspace _ . scale - this . MARGIN - Blockly . BlockSvg . TAB _WIDTH - e , 0 ) ) , d . flyoutRect _ && this . moveRectToBlock _ ( d . flyoutRect _ , d ) ; if ( this . RTL ) for ( c = 0 ; d = this . buttons _ [ c ] ; c ++ ) b = d . getPosition ( ) . y , d . moveTo ( a / this . workspace _ . scale - d . width - this . MARGIN - Blockly . BlockSvg . TAB _WIDTH , b ) ; this . width _ = a ; this . targetWorkspace _ . resize ( ) } } ; Blockly . Toolbox = function ( a ) { this . workspace _ = a ; this . RTL = a . options . RTL ; this . horizontalLayout _ = a . options . horizontalLayout ; this . toolboxPosition = a . options . toolboxPosition ; this . config _ = { indentWidth : 19 , cssRoot : "blocklyTreeRoot" , cssHideRoot : "blocklyHidden" , cssItem : "" , cssTreeRow : "blocklyTreeRow" , cssItemLabel : "blocklyTreeLabel" , cssTreeIcon : "blocklyTreeIcon" , cssExpandedFolderIcon : "blocklyTreeIconOpen" , cssFileIcon : "blocklyTreeIconNone" , cssSelectedRow : "blocklyTreeSelected" } ; this . treeSeparatorConfig _ = { cssTreeRow : "blocklyTreeSeparator" } ;
2017-09-25 09:37:41 +00:00
this . horizontalLayout _ && ( this . config _ . cssTreeRow += a . RTL ? " blocklyHorizontalTreeRtl" : " blocklyHorizontalTree" , this . treeSeparatorConfig _ . cssTreeRow = "blocklyTreeSeparatorHorizontal " + ( a . RTL ? "blocklyHorizontalTreeRtl" : "blocklyHorizontalTree" ) , this . config _ . cssTreeIcon = "" ) } ; Blockly . Toolbox . prototype . width = 0 ; Blockly . Toolbox . prototype . height = 0 ; Blockly . Toolbox . prototype . selectedOption _ = null ; Blockly . Toolbox . prototype . lastCategory _ = null ;
2018-01-16 21:13:23 +00:00
Blockly . Toolbox . prototype . init = function ( ) { var a = this . workspace _ , b = this . workspace _ . getParentSvg ( ) ; this . HtmlDiv = goog . dom . createDom ( "DIV" , "blocklyToolboxDiv" ) ; this . HtmlDiv . setAttribute ( "dir" , a . RTL ? "RTL" : "LTR" ) ; b . parentNode . insertBefore ( this . HtmlDiv , b ) ; Blockly . bindEventWithChecks _ ( this . HtmlDiv , "mousedown" , this , function ( a ) { Blockly . utils . isRightButton ( a ) || a . target == this . HtmlDiv ? Blockly . hideChaff ( ! 1 ) : Blockly . hideChaff ( ! 0 ) ; Blockly . Touch . clearTouchIdentifier ( ) } , ! 1 , ! 0 ) ; b = { disabledPatternId : a . options . disabledPatternId ,
parentWorkspace : a , RTL : a . RTL , oneBasedIndex : a . options . oneBasedIndex , horizontalLayout : a . horizontalLayout , toolboxPosition : a . options . toolboxPosition } ; this . flyout _ = null ; this . flyout _ = a . horizontalLayout ? new Blockly . HorizontalFlyout ( b ) : new Blockly . VerticalFlyout ( b ) ; goog . dom . insertSiblingAfter ( this . flyout _ . createDom ( "svg" ) , this . workspace _ . getParentSvg ( ) ) ; this . flyout _ . init ( a ) ; this . config _ . cleardotPath = a . options . pathToMedia + "1x1.gif" ; this . config _ . cssCollapsedFolderIcon = "blocklyTreeIconClosed" + ( a . RTL ? "Rtl" : "Ltr" ) ;
this . tree _ = b = new Blockly . Toolbox . TreeControl ( this , this . config _ ) ; b . setShowRootNode ( ! 1 ) ; b . setShowLines ( ! 1 ) ; b . setShowExpandIcons ( ! 1 ) ; b . setSelectedItem ( null ) ; a = this . populate _ ( a . options . languageTree ) ; b . render ( this . HtmlDiv ) ; a && b . setSelectedItem ( a ) ; this . addColour _ ( ) ; this . position ( ) } ; Blockly . Toolbox . prototype . dispose = function ( ) { this . flyout _ . dispose ( ) ; this . tree _ . dispose ( ) ; goog . dom . removeNode ( this . HtmlDiv ) ; this . lastCategory _ = this . workspace _ = null } ; Blockly . Toolbox . prototype . getWidth = function ( ) { return this . width } ;
Blockly . Toolbox . prototype . getHeight = function ( ) { return this . height } ;
Blockly . Toolbox . prototype . position = function ( ) { var a = this . HtmlDiv ; if ( a ) { var b = this . workspace _ . getParentSvg ( ) ; b = Blockly . svgSize ( b ) ; this . horizontalLayout _ ? ( a . style . left = "0" , a . style . height = "auto" , a . style . width = b . width + "px" , this . height = a . offsetHeight , this . toolboxPosition == Blockly . TOOLBOX _AT _TOP ? a . style . top = "0" : a . style . bottom = "0" ) : ( this . toolboxPosition == Blockly . TOOLBOX _AT _RIGHT ? a . style . right = "0" : a . style . left = "0" , a . style . height = b . height + "px" , this . width = a . offsetWidth ) ; this . flyout _ . position ( ) } } ;
2017-09-25 09:37:41 +00:00
Blockly . Toolbox . prototype . populate _ = function ( a ) { this . tree _ . removeChildren ( ) ; this . tree _ . blocks = [ ] ; this . hasColours _ = ! 1 ; a = this . syncTrees _ ( a , this . tree _ , this . workspace _ . options . pathToMedia ) ; if ( this . tree _ . blocks . length ) throw "Toolbox cannot have both blocks and categories in the root level." ; this . workspace _ . resizeContents ( ) ; return a } ;
2018-08-17 13:32:56 +00:00
Blockly . Toolbox . prototype . syncTrees _ = function ( a , b , c ) { for ( var d = null , e = null , f = 0 , g ; g = a . childNodes [ f ] ; f ++ ) if ( g . tagName ) switch ( g . tagName . toUpperCase ( ) ) { case "CATEGORY" : e = Blockly . utils . replaceMessageReferences ( g . getAttribute ( "name" ) ) ; var h = this . tree _ . createNode ( e ) ; h . blocks = [ ] ; b . add ( h ) ; var k = g . getAttribute ( "custom" ) ; k ? h . blocks = k : ( k = this . syncTrees _ ( g , h , c ) ) && ( d = k ) ; k = Blockly . utils . replaceMessageReferences ( g . getAttribute ( "colour" ) ) ; null === k || "" === k ? h . hexColour = "" : /^#[0-9a-fA-F]{6}$/ . test ( k ) ? ( h . hexColour = k ,
this . hasColours _ = ! 0 ) : "number" === typeof k || "string" === typeof k && ! isNaN ( Number ( k ) ) ? ( h . hexColour = Blockly . hueToRgb ( Number ( k ) ) , this . hasColours _ = ! 0 ) : ( h . hexColour = "" , console . warn ( 'Toolbox category "' + e + '" has unrecognized colour attribute: ' + k ) ) ; "true" == g . getAttribute ( "expanded" ) ? ( h . blocks . length && ( d = h ) , h . setExpanded ( ! 0 ) ) : h . setExpanded ( ! 1 ) ; e = g ; break ; case "SEP" : e && ( "CATEGORY" == e . tagName . toUpperCase ( ) ? b . add ( new Blockly . Toolbox . TreeSeparator ( this . treeSeparatorConfig _ ) ) : ( g = parseFloat ( g . getAttribute ( "gap" ) ) ,
! isNaN ( g ) && e && e . setAttribute ( "gap" , g ) ) ) ; break ; case "BLOCK" : case "SHADOW" : case "LABEL" : case "BUTTON" : b . blocks . push ( g ) , e = g } return d } ; Blockly . Toolbox . prototype . addColour _ = function ( a ) { a = ( a || this . tree _ ) . getChildren ( ! 1 ) ; for ( var b = 0 , c ; c = a [ b ] ; b ++ ) { var d = c . getRowElement ( ) ; if ( d ) { var e = this . hasColours _ ? "8px solid " + ( c . hexColour || "#ddd" ) : "none" ; this . workspace _ . RTL ? d . style . borderRight = e : d . style . borderLeft = e } this . addColour _ ( c ) } } ; Blockly . Toolbox . prototype . clearSelection = function ( ) { this . tree _ . setSelectedItem ( null ) } ;
Blockly . Toolbox . prototype . addStyle = function ( a ) { Blockly . utils . addClass ( this . HtmlDiv , a ) } ; Blockly . Toolbox . prototype . removeStyle = function ( a ) { Blockly . utils . removeClass ( this . HtmlDiv , a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Toolbox . prototype . getClientRect = function ( ) { if ( ! this . HtmlDiv ) return null ; var a = this . HtmlDiv . getBoundingClientRect ( ) , b = a . left , c = a . top , d = a . width ; a = a . height ; return this . toolboxPosition == Blockly . TOOLBOX _AT _LEFT ? new goog . math . Rect ( - 1E7 , - 1E7 , 1E7 + b + d , 2E7 ) : this . toolboxPosition == Blockly . TOOLBOX _AT _RIGHT ? new goog . math . Rect ( b , - 1E7 , 1E7 + d , 2E7 ) : this . toolboxPosition == Blockly . TOOLBOX _AT _TOP ? new goog . math . Rect ( - 1E7 , - 1E7 , 2E7 , 1E7 + c + a ) : new goog . math . Rect ( 0 , c , 2E7 , 1E7 + d ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Toolbox . prototype . refreshSelection = function ( ) { var a = this . tree _ . getSelectedItem ( ) ; a && a . blocks && this . flyout _ . show ( a . blocks ) } ; Blockly . Toolbox . TreeControl = function ( a , b ) { this . toolbox _ = a ; goog . ui . tree . TreeControl . call ( this , goog . html . SafeHtml . EMPTY , b ) } ; goog . inherits ( Blockly . Toolbox . TreeControl , goog . ui . tree . TreeControl ) ;
2018-01-16 21:13:23 +00:00
Blockly . Toolbox . TreeControl . prototype . enterDocument = function ( ) { Blockly . Toolbox . TreeControl . superClass _ . enterDocument . call ( this ) ; if ( goog . events . BrowserFeature . TOUCH _ENABLED ) { var a = this . getElement ( ) ; Blockly . bindEventWithChecks _ ( a , goog . events . EventType . TOUCHEND , this , this . handleTouchEvent _ ) } } ; Blockly . Toolbox . TreeControl . prototype . handleTouchEvent _ = function ( a ) { var b = this . getNodeFromEvent _ ( a ) ; b && a . type === goog . events . EventType . TOUCHEND && setTimeout ( function ( ) { b . onClick _ ( a ) } , 1 ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Toolbox . TreeControl . prototype . createNode = function ( a ) { a = a ? goog . html . SafeHtml . htmlEscape ( a ) : goog . html . SafeHtml . EMPTY ; return new Blockly . Toolbox . TreeNode ( this . toolbox _ , a , this . getConfig ( ) , this . getDomHelper ( ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . Toolbox . TreeControl . prototype . setSelectedItem = function ( a ) { var b = this . toolbox _ ; if ( a != this . selectedItem _ && a != b . tree _ ) { b . lastCategory _ && ( b . lastCategory _ . getRowElement ( ) . style . backgroundColor = "" ) ; if ( a ) { var c = a . hexColour || "#57e" ; a . getRowElement ( ) . style . backgroundColor = c ; b . addColour _ ( a ) } c = this . getSelectedItem ( ) ; goog . ui . tree . TreeControl . prototype . setSelectedItem . call ( this , a ) ; a && a . blocks && a . blocks . length ? ( b . flyout _ . show ( a . blocks ) , b . lastCategory _ != a && b . flyout _ . scrollToStart ( ) ) : b . flyout _ . hide ( ) ; c !=
a && c != this && ( c = new Blockly . Events . Ui ( null , "category" , c && c . getHtml ( ) , a && a . getHtml ( ) ) , c . workspaceId = b . workspace _ . id , Blockly . Events . fire ( c ) ) ; a && ( b . lastCategory _ = a ) } } ; Blockly . Toolbox . TreeNode = function ( a , b , c , d ) { goog . ui . tree . TreeNode . call ( this , b , c , d ) ; a && ( b = function ( ) { Blockly . svgResize ( a . workspace _ ) } , goog . events . listen ( a . tree _ , goog . ui . tree . BaseNode . EventType . EXPAND , b ) , goog . events . listen ( a . tree _ , goog . ui . tree . BaseNode . EventType . COLLAPSE , b ) ) } ; goog . inherits ( Blockly . Toolbox . TreeNode , goog . ui . tree . TreeNode ) ;
2018-01-16 21:13:23 +00:00
Blockly . Toolbox . TreeNode . prototype . getExpandIconSafeHtml = function ( ) { return goog . html . SafeHtml . create ( "span" ) } ; Blockly . Toolbox . TreeNode . prototype . onClick _ = function ( a ) { this . hasChildren ( ) && this . isUserCollapsible _ ? ( this . toggle ( ) , this . select ( ) ) : this . isSelected ( ) ? this . getTree ( ) . setSelectedItem ( null ) : this . select ( ) ; this . updateRow ( ) } ; Blockly . Toolbox . TreeNode . prototype . onMouseDown = function ( a ) { } ; Blockly . Toolbox . TreeNode . prototype . onDoubleClick _ = function ( a ) { } ;
2017-09-25 09:37:41 +00:00
Blockly . Toolbox . TreeNode . prototype . onKeyDown = function ( a ) { if ( this . tree . toolbox _ . horizontalLayout _ ) { var b = { } , c = goog . events . KeyCodes . DOWN , d = goog . events . KeyCodes . UP ; b [ goog . events . KeyCodes . RIGHT ] = this . rightToLeft _ ? d : c ; b [ goog . events . KeyCodes . LEFT ] = this . rightToLeft _ ? c : d ; b [ goog . events . KeyCodes . UP ] = goog . events . KeyCodes . LEFT ; b [ goog . events . KeyCodes . DOWN ] = goog . events . KeyCodes . RIGHT ; a . keyCode = b [ a . keyCode ] || a . keyCode } return Blockly . Toolbox . TreeNode . superClass _ . onKeyDown . call ( this , a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . Toolbox . TreeSeparator = function ( a ) { Blockly . Toolbox . TreeNode . call ( this , null , goog . html . SafeHtml . EMPTY , a ) } ; goog . inherits ( Blockly . Toolbox . TreeSeparator , Blockly . Toolbox . TreeNode ) ; Blockly . Css = { } ; Blockly . Css . Cursor = { OPEN : "handopen" , CLOSED : "handclosed" , DELETE : "handdelete" } ; Blockly . Css . currentCursor _ = "" ; Blockly . Css . styleSheet _ = null ; Blockly . Css . mediaPath _ = "" ;
Blockly . Css . inject = function ( a , b ) { if ( ! Blockly . Css . styleSheet _ ) { var c = ".blocklyDraggable {}\n" ; a && ( c += Blockly . Css . CONTENT . join ( "\n" ) , Blockly . FieldDate && ( c += Blockly . FieldDate . CSS . join ( "\n" ) ) ) ; Blockly . Css . mediaPath _ = b . replace ( /[\\\/]$/ , "" ) ; c = c . replace ( /<<<PATH>>>/g , Blockly . Css . mediaPath _ ) ; var d = document . createElement ( "style" ) ; document . head . insertBefore ( d , document . head . firstChild ) ; c = document . createTextNode ( c ) ; d . appendChild ( c ) ; Blockly . Css . styleSheet _ = d . sheet } } ; Blockly . Css . setCursor = function ( a ) { console . warn ( "Deprecated call to Blockly.Css.setCursor.See https://github.com/google/blockly/issues/981 for context" ) } ;
2018-08-17 13:32:56 +00:00
Blockly . Css . CONTENT = [ ".blocklySvg {" , "background-color: #fff;" , "outline: none;" , "overflow: hidden;" , "position: absolute;" , "display: block;" , "}" , ".blocklyWidgetDiv {" , "display: none;" , "position: absolute;" , "z-index: 99999;" , "}" , ".injectionDiv {" , "height: 100%;" , "position: relative;" , "overflow: hidden;" , "touch-action: none" , "}" , ".blocklyNonSelectable {" , "user-select: none;" , "-moz-user-select: none;" , "-ms-user-select: none;" , "-webkit-user-select: none;" , "}" , ".blocklyWsDragSurface {" , "display: none;" ,
"position: absolute;" , "top: 0;" , "left: 0;" , "}" , ".blocklyWsDragSurface.blocklyOverflowVisible {" , "overflow: visible;" , "}" , ".blocklyBlockDragSurface {" , "display: none;" , "position: absolute;" , "top: 0;" , "left: 0;" , "right: 0;" , "bottom: 0;" , "overflow: visible !important;" , "z-index: 50;" , "}" , ".blocklyTooltipDiv {" , "background-color: #ffffc7;" , "border: 1px solid #ddc;" , "box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);" , "color: #000;" , "display: none;" , "font-family: sans-serif;" , "font-size: 9pt;" , "opacity: .9;" ,
"padding: 2px;" , "position: absolute;" , "z-index: 100000;" , "}" , ".blocklyResizeSE {" , "cursor: se-resize;" , "fill: #aaa;" , "}" , ".blocklyResizeSW {" , "cursor: sw-resize;" , "fill: #aaa;" , "}" , ".blocklyResizeLine {" , "stroke: #515A5A;" , "stroke-width: 1;" , "}" , ".blocklyHighlightedConnectionPath {" , "fill: none;" , "stroke: #fc3;" , "stroke-width: 4px;" , "}" , ".blocklyPathLight {" , "fill: none;" , "stroke-linecap: round;" , "stroke-width: 1;" , "}" , ".blocklySelected>.blocklyPath {" , "stroke: #fc3;" , "stroke-width: 3px;" , "}" , ".blocklySelected>.blocklyPathLight {" ,
"display: none;" , "}" , ".blocklyDraggable {" , 'cursor: url("<<<PATH>>>/handopen.cur"), auto;' , "cursor: grab;" , "cursor: -webkit-grab;" , "}" , ".blocklyDragging {" , 'cursor: url("<<<PATH>>>/handclosed.cur"), auto;' , "cursor: grabbing;" , "cursor: -webkit-grabbing;" , "}" , ".blocklyDraggable:active {" , 'cursor: url("<<<PATH>>>/handclosed.cur"), auto;' , "cursor: grabbing;" , "cursor: -webkit-grabbing;" , "}" , ".blocklyBlockDragSurface .blocklyDraggable {" , 'cursor: url("<<<PATH>>>/handclosed.cur"), auto;' , "cursor: grabbing;" ,
"cursor: -webkit-grabbing;" , "}" , ".blocklyDragging.blocklyDraggingDelete {" , 'cursor: url("<<<PATH>>>/handdelete.cur"), auto;' , "}" , ".blocklyToolboxDelete {" , 'cursor: url("<<<PATH>>>/handdelete.cur"), auto;' , "}" , ".blocklyToolboxGrab {" , 'cursor: url("<<<PATH>>>/handclosed.cur"), auto;' , "cursor: grabbing;" , "cursor: -webkit-grabbing;" , "}" , ".blocklyDragging>.blocklyPath," , ".blocklyDragging>.blocklyPathLight {" , "fill-opacity: .8;" , "stroke-opacity: .8;" , "}" , ".blocklyDragging>.blocklyPathDark {" , "display: none;" ,
"}" , ".blocklyDisabled>.blocklyPath {" , "fill-opacity: .5;" , "stroke-opacity: .5;" , "}" , ".blocklyDisabled>.blocklyPathLight," , ".blocklyDisabled>.blocklyPathDark {" , "display: none;" , "}" , ".blocklyText {" , "cursor: default;" , "fill: #fff;" , "font-family: sans-serif;" , "font-size: 11pt;" , "}" , ".blocklyNonEditableText>text {" , "pointer-events: none;" , "}" , ".blocklyNonEditableText>rect," , ".blocklyEditableText>rect {" , "fill: #fff;" , "fill-opacity: .6;" , "}" , ".blocklyNonEditableText>text," , ".blocklyEditableText>text {" ,
"fill: #000;" , "}" , ".blocklyEditableText:hover>rect {" , "stroke: #fff;" , "stroke-width: 2;" , "}" , ".blocklyBubbleText {" , "fill: #000;" , "}" , ".blocklyFlyout {" , "position: absolute;" , "z-index: 20;" , "}" , ".blocklyFlyoutButton {" , "fill: #888;" , "cursor: default;" , "}" , ".blocklyFlyoutButtonShadow {" , "fill: #666;" , "}" , ".blocklyFlyoutButton:hover {" , "fill: #aaa;" , "}" , ".blocklyFlyoutLabel {" , "cursor: default;" , "}" , ".blocklyFlyoutLabelBackground {" , "opacity: 0;" , "}" , ".blocklyFlyoutLabelText {" , "fill: #000;" , "}" , ".blocklySvg text, .blocklyBlockDragSurface text {" ,
"user-select: none;" , "-moz-user-select: none;" , "-ms-user-select: none;" , "-webkit-user-select: none;" , "cursor: inherit;" , "}" , ".blocklyHidden {" , "display: none;" , "}" , ".blocklyFieldDropdown:not(.blocklyHidden) {" , "display: block;" , "}" , ".blocklyIconGroup {" , "cursor: default;" , "}" , ".blocklyIconGroup:not(:hover)," , ".blocklyIconGroupReadonly {" , "opacity: .6;" , "}" , ".blocklyIconShape {" , "fill: #00f;" , "stroke: #fff;" , "stroke-width: 1px;" , "}" , ".blocklyIconSymbol {" , "fill: #fff;" , "}" , ".blocklyMinimalBody {" ,
"margin: 0;" , "padding: 0;" , "}" , ".blocklyCommentForeignObject {" , "position: relative;" , "z-index: 0;" , "}" , ".blocklyCommentRect {" , "fill: #E7DE8E;" , "stroke: #bcA903;" , "stroke-width: 1px" , "}" , ".blocklyCommentTarget {" , "fill: transparent;" , "stroke: #bcA903;" , "}" , ".blocklyCommentTargetFocused {" , "fill: none;" , "}" , ".blocklyCommentHandleTarget {" , "fill: none;" , "}" , ".blocklyCommentHandleTargetFocused {" , "fill: transparent;" , "}" , ".blocklyFocused>.blocklyCommentRect {" , "fill: #B9B272;" , "stroke: #B9B272;" , "}" ,
".blocklySelected>.blocklyCommentTarget {" , "stroke: #fc3;" , "stroke-width: 3px;" , "}" , ".blocklyCommentTextarea {" , "background-color: #fef49c;" , "border: 0;" , "outline: 0;" , "margin: 0;" , "padding: 3px;" , "resize: none;" , "display: block;" , "overflow: hidden;" , "}" , ".blocklyCommentDeleteIcon {" , "cursor: pointer;" , "fill: #000;" , "display: none" , "}" , ".blocklySelected > .blocklyCommentDeleteIcon {" , "display: block" , "}" , ".blocklyDeleteIconShape {" , "fill: #000;" , "stroke: #000;" , "stroke-width: 1px;" , "}" , ".blocklyDeleteIconShape.blocklyDeleteIconHighlighted {" ,
"stroke: #fc3;" , "}" , ".blocklyHtmlInput {" , "border: none;" , "border-radius: 4px;" , "font-family: sans-serif;" , "height: 100%;" , "margin: 0;" , "outline: none;" , "padding: 0 1px;" , "width: 100%" , "}" , ".blocklyMainBackground {" , "stroke-width: 1;" , "stroke: #c6c6c6;" , "}" , ".blocklyMutatorBackground {" , "fill: #fff;" , "stroke: #ddd;" , "stroke-width: 1;" , "}" , ".blocklyFlyoutBackground {" , "fill: #ddd;" , "fill-opacity: .8;" , "}" , ".blocklyTransparentBackground {" , "opacity: 0;" , "}" , ".blocklyMainWorkspaceScrollbar {" , "z-index: 20;" ,
"}" , ".blocklyFlyoutScrollbar {" , "z-index: 30;" , "}" , ".blocklyScrollbarHorizontal, .blocklyScrollbarVertical {" , "position: absolute;" , "outline: none;" , "}" , ".blocklyScrollbarBackground {" , "opacity: 0;" , "}" , ".blocklyScrollbarHandle {" , "fill: #ccc;" , "}" , ".blocklyScrollbarBackground:hover+.blocklyScrollbarHandle," , ".blocklyScrollbarHandle:hover {" , "fill: #bbb;" , "}" , ".blocklyZoom>image {" , "opacity: .4;" , "}" , ".blocklyZoom>image:hover {" , "opacity: .6;" , "}" , ".blocklyZoom>image:active {" , "opacity: .8;" , "}" ,
".blocklyFlyout .blocklyScrollbarHandle {" , "fill: #bbb;" , "}" , ".blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle," , ".blocklyFlyout .blocklyScrollbarHandle:hover {" , "fill: #aaa;" , "}" , ".blocklyInvalidInput {" , "background: #faa;" , "}" , ".blocklyAngleCircle {" , "stroke: #444;" , "stroke-width: 1;" , "fill: #ddd;" , "fill-opacity: .8;" , "}" , ".blocklyAngleMarks {" , "stroke: #444;" , "stroke-width: 1;" , "}" , ".blocklyAngleGauge {" , "fill: #f88;" , "fill-opacity: .8;" , "}" , ".blocklyAngleLine {" , "stroke: #f00;" ,
"stroke-width: 2;" , "stroke-linecap: round;" , "pointer-events: none;" , "}" , ".blocklyContextMenu {" , "border-radius: 4px;" , "}" , ".blocklyDropdownMenu {" , "padding: 0 !important;" , "}" , ".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox," , ".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {" , "background: url(<<<PATH>>>/sprites.png) no-repeat -48px -16px !important;" , "}" , ".blocklyToolboxDiv {" , "background-color: #ddd;" , "overflow-x: visible;" , "overflow-y: auto;" , "position: absolute;" ,
"user-select: none;" , "-moz-user-select: none;" , "-ms-user-select: none;" , "-webkit-user-select: none;" , "z-index: 70;" , "-webkit-tap-highlight-color: transparent;" , "}" , ".blocklyTreeRoot {" , "padding: 4px 0;" , "}" , ".blocklyTreeRoot:focus {" , "outline: none;" , "}" , ".blocklyTreeRow {" , "height: 22px;" , "line-height: 22px;" , "margin-bottom: 3px;" , "padding-right: 8px;" , "white-space: nowrap;" , "}" , ".blocklyHorizontalTree {" , "float: left;" , "margin: 1px 5px 8px 0;" , "}" , ".blocklyHorizontalTreeRtl {" , "float: right;" , "margin: 1px 0 8px 5px;" ,
"}" , '.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {' , "margin-left: 8px;" , "}" , ".blocklyTreeRow:not(.blocklyTreeSelected):hover {" , "background-color: #e4e4e4;" , "}" , ".blocklyTreeSeparator {" , "border-bottom: solid #e5e5e5 1px;" , "height: 0;" , "margin: 5px 0;" , "}" , ".blocklyTreeSeparatorHorizontal {" , "border-right: solid #e5e5e5 1px;" , "width: 0;" , "padding: 5px 0;" , "margin: 0 5px;" , "}" , ".blocklyTreeIcon {" , "background-image: url(<<<PATH>>>/sprites.png);" , "height: 16px;" , "vertical-align: middle;" , "width: 16px;" ,
"}" , ".blocklyTreeIconClosedLtr {" , "background-position: -32px -1px;" , "}" , ".blocklyTreeIconClosedRtl {" , "background-position: 0 -1px;" , "}" , ".blocklyTreeIconOpen {" , "background-position: -16px -1px;" , "}" , ".blocklyTreeSelected>.blocklyTreeIconClosedLtr {" , "background-position: -32px -17px;" , "}" , ".blocklyTreeSelected>.blocklyTreeIconClosedRtl {" , "background-position: 0 -17px;" , "}" , ".blocklyTreeSelected>.blocklyTreeIconOpen {" , "background-position: -16px -17px;" , "}" , ".blocklyTreeIconNone," , ".blocklyTreeSelected>.blocklyTreeIconNone {" ,
"background-position: -48px -1px;" , "}" , ".blocklyTreeLabel {" , "cursor: default;" , "font-family: sans-serif;" , "font-size: 16px;" , "padding: 0 3px;" , "vertical-align: middle;" , "}" , ".blocklyToolboxDelete .blocklyTreeLabel {" , 'cursor: url("<<<PATH>>>/handdelete.cur"), auto;' , "}" , ".blocklyTreeSelected .blocklyTreeLabel {" , "color: #fff;" , "}" , ".blocklyWidgetDiv .goog-palette {" , "outline: none;" , "cursor: default;" , "}" , ".blocklyWidgetDiv .goog-palette-table {" , "border: 1px solid #666;" , "border-collapse: collapse;" ,
"}" , ".blocklyWidgetDiv .goog-palette-cell {" , "height: 13px;" , "width: 15px;" , "margin: 0;" , "border: 0;" , "text-align: center;" , "vertical-align: middle;" , "border-right: 1px solid #666;" , "font-size: 1px;" , "}" , ".blocklyWidgetDiv .goog-palette-colorswatch {" , "position: relative;" , "height: 13px;" , "width: 15px;" , "border: 1px solid #666;" , "}" , ".blocklyWidgetDiv .goog-palette-cell-hover .goog-palette-colorswatch {" , "border: 1px solid #FFF;" , "}" , ".blocklyWidgetDiv .goog-palette-cell-selected .goog-palette-colorswatch {" ,
"border: 1px solid #000;" , "color: #fff;" , "}" , ".blocklyWidgetDiv .goog-menu {" , "background: #fff;" , "border-color: #ccc #666 #666 #ccc;" , "border-style: solid;" , "border-width: 1px;" , "cursor: default;" , "font: normal 13px Arial, sans-serif;" , "margin: 0;" , "outline: none;" , "padding: 4px 0;" , "position: absolute;" , "overflow-y: auto;" , "overflow-x: hidden;" , "max-height: 100%;" , "z-index: 20000;" , "}" , ".blocklyWidgetDiv .goog-menuitem {" , "color: #000;" , "font: normal 13px Arial, sans-serif;" , "list-style: none;" ,
"margin: 0;" , "padding: 4px 7em 4px 28px;" , "white-space: nowrap;" , "}" , ".blocklyWidgetDiv .goog-menuitem.goog-menuitem-rtl {" , "padding-left: 7em;" , "padding-right: 28px;" , "}" , ".blocklyWidgetDiv .goog-menu-nocheckbox .goog-menuitem," , ".blocklyWidgetDiv .goog-menu-noicon .goog-menuitem {" , "padding-left: 12px;" , "}" , ".blocklyWidgetDiv .goog-menu-noaccel .goog-menuitem {" , "padding-right: 20px;" , "}" , ".blocklyWidgetDiv .goog-menuitem-content {" , "color: #000;" , "font: normal 13px Arial, sans-serif;" , "}" , ".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-accel," ,
".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-content {" , "color: #ccc !important;" , "}" , ".blocklyWidgetDiv .goog-menuitem-disabled .goog-menuitem-icon {" , "opacity: 0.3;" , "filter: alpha(opacity=30);" , "}" , ".blocklyWidgetDiv .goog-menuitem-highlight," , ".blocklyWidgetDiv .goog-menuitem-hover {" , "background-color: #d6e9f8;" , "border-color: #d6e9f8;" , "border-style: dotted;" , "border-width: 1px 0;" , "padding-bottom: 3px;" , "padding-top: 3px;" , "}" , ".blocklyWidgetDiv .goog-menuitem-checkbox," , ".blocklyWidgetDiv .goog-menuitem-icon {" ,
"background-repeat: no-repeat;" , "height: 16px;" , "left: 6px;" , "position: absolute;" , "right: auto;" , "vertical-align: middle;" , "width: 16px;" , "}" , ".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-checkbox," , ".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-icon {" , "left: auto;" , "right: 6px;" , "}" , ".blocklyWidgetDiv .goog-option-selected .goog-menuitem-checkbox," , ".blocklyWidgetDiv .goog-option-selected .goog-menuitem-icon {" , "background: url(//ssl.gstatic.com/editor/editortoolbar.png) no-repeat -512px 0;" ,
2018-01-16 21:13:23 +00:00
"}" , ".blocklyWidgetDiv .goog-menuitem-accel {" , "color: #999;" , "direction: ltr;" , "left: auto;" , "padding: 0 6px;" , "position: absolute;" , "right: 0;" , "text-align: right;" , "}" , ".blocklyWidgetDiv .goog-menuitem-rtl .goog-menuitem-accel {" , "left: 0;" , "right: auto;" , "text-align: left;" , "}" , ".blocklyWidgetDiv .goog-menuitem-mnemonic-hint {" , "text-decoration: underline;" , "}" , ".blocklyWidgetDiv .goog-menuitem-mnemonic-separator {" , "color: #999;" , "font-size: 12px;" , "padding-left: 4px;" , "}" , ".blocklyWidgetDiv .goog-menuseparator {" ,
"border-top: 1px solid #ccc;" , "margin: 4px 0;" , "padding: 0;" , "}" , "" ] ; Blockly . WidgetDiv = { } ; Blockly . WidgetDiv . DIV = null ; Blockly . WidgetDiv . owner _ = null ; Blockly . WidgetDiv . dispose _ = null ; Blockly . WidgetDiv . createDom = function ( ) { Blockly . WidgetDiv . DIV || ( Blockly . WidgetDiv . DIV = goog . dom . createDom ( "DIV" , "blocklyWidgetDiv" ) , document . body . appendChild ( Blockly . WidgetDiv . DIV ) ) } ;
2017-09-25 09:37:41 +00:00
Blockly . WidgetDiv . show = function ( a , b , c ) { Blockly . WidgetDiv . hide ( ) ; Blockly . WidgetDiv . owner _ = a ; Blockly . WidgetDiv . dispose _ = c ; a = goog . style . getViewportPageOffset ( document ) ; Blockly . WidgetDiv . DIV . style . top = a . y + "px" ; Blockly . WidgetDiv . DIV . style . direction = b ? "rtl" : "ltr" ; Blockly . WidgetDiv . DIV . style . display = "block" } ;
Blockly . WidgetDiv . hide = function ( ) { Blockly . WidgetDiv . owner _ && ( Blockly . WidgetDiv . owner _ = null , Blockly . WidgetDiv . DIV . style . display = "none" , Blockly . WidgetDiv . DIV . style . left = "" , Blockly . WidgetDiv . DIV . style . top = "" , Blockly . WidgetDiv . dispose _ && Blockly . WidgetDiv . dispose _ ( ) , Blockly . WidgetDiv . dispose _ = null , goog . dom . removeChildren ( Blockly . WidgetDiv . DIV ) ) } ; Blockly . WidgetDiv . isVisible = function ( ) { return ! ! Blockly . WidgetDiv . owner _ } ; Blockly . WidgetDiv . hideIfOwner = function ( a ) { Blockly . WidgetDiv . owner _ == a && Blockly . WidgetDiv . hide ( ) } ;
2018-01-16 21:13:23 +00:00
Blockly . WidgetDiv . position = function ( a , b , c , d , e ) { b < d . y && ( b = d . y ) ; e ? a > c . width + d . x && ( a = c . width + d . x ) : a < d . x && ( a = d . x ) ; Blockly . WidgetDiv . positionInternal _ ( a , b , c . height ) } ; Blockly . WidgetDiv . positionInternal _ = function ( a , b , c ) { Blockly . WidgetDiv . DIV . style . left = a + "px" ; Blockly . WidgetDiv . DIV . style . top = b + "px" ; Blockly . WidgetDiv . DIV . style . height = c + "px" } ;
2018-08-17 13:32:56 +00:00
Blockly . WidgetDiv . positionWithAnchor = function ( a , b , c , d ) { var e = Blockly . WidgetDiv . calculateY _ ( a , b , c ) ; a = Blockly . WidgetDiv . calculateX _ ( a , b , c , d ) ; Blockly . WidgetDiv . positionInternal _ ( a , e , c . height ) } ; Blockly . WidgetDiv . calculateX _ = function ( a , b , c , d ) { if ( d ) return b = Math . max ( b . right - c . width , a . left ) , Math . min ( b , a . right - c . width ) ; b = Math . min ( b . left , a . right - c . width ) ; return Math . max ( b , a . left ) } ; Blockly . WidgetDiv . calculateY _ = function ( a , b , c ) { return b . bottom + c . height >= a . bottom ? b . top - c . height : b . bottom } ; Blockly . inject = function ( a , b ) { Blockly . checkBlockColourConstants ( ) ; goog . isString ( a ) && ( a = document . getElementById ( a ) || document . querySelector ( a ) ) ; if ( ! goog . dom . contains ( document , a ) ) throw "Error: container is not in current document." ; var c = new Blockly . Options ( b || { } ) , d = goog . dom . createDom ( "DIV" , "injectionDiv" ) ; a . appendChild ( d ) ; var e = Blockly . createDom _ ( d , c ) , f = new Blockly . BlockDragSurfaceSvg ( d ) ; d = new Blockly . WorkspaceDragSurfaceSvg ( d ) ; c = Blockly . createMainWorkspace _ ( e , c , f , d ) ; Blockly . init _ ( c ) ; Blockly . mainWorkspace =
c ; Blockly . svgResize ( c ) ; return c } ;
2017-09-25 09:37:41 +00:00
Blockly . createDom _ = function ( a , b ) { a . setAttribute ( "dir" , "LTR" ) ; goog . ui . Component . setDefaultRightToLeft ( b . RTL ) ; Blockly . Css . inject ( b . hasCss , b . pathToMedia ) ; var c = Blockly . utils . createSvgElement ( "svg" , { xmlns : "http://www.w3.org/2000/svg" , "xmlns:html" : "http://www.w3.org/1999/xhtml" , "xmlns:xlink" : "http://www.w3.org/1999/xlink" , version : "1.1" , "class" : "blocklySvg" } , a ) , d = Blockly . utils . createSvgElement ( "defs" , { } , c ) , e = String ( Math . random ( ) ) . substring ( 2 ) , f = Blockly . utils . createSvgElement ( "filter" , { id : "blocklyEmbossFilter" +
e } , d ) ; Blockly . utils . createSvgElement ( "feGaussianBlur" , { "in" : "SourceAlpha" , stdDeviation : 1 , result : "blur" } , f ) ; var g = Blockly . utils . createSvgElement ( "feSpecularLighting" , { "in" : "blur" , surfaceScale : 1 , specularConstant : . 5 , specularExponent : 10 , "lighting-color" : "white" , result : "specOut" } , f ) ; Blockly . utils . createSvgElement ( "fePointLight" , { x : - 5E3 , y : - 1E4 , z : 2E4 } , g ) ; Blockly . utils . createSvgElement ( "feComposite" , { "in" : "specOut" , in2 : "SourceAlpha" , operator : "in" , result : "specOut" } , f ) ; Blockly . utils . createSvgElement ( "feComposite" ,
2018-01-16 21:13:23 +00:00
{ "in" : "SourceGraphic" , in2 : "specOut" , operator : "arithmetic" , k1 : 0 , k2 : 1 , k3 : 1 , k4 : 0 } , f ) ; b . embossFilterId = f . id ; f = Blockly . utils . createSvgElement ( "pattern" , { id : "blocklyDisabledPattern" + e , patternUnits : "userSpaceOnUse" , width : 10 , height : 10 } , d ) ; Blockly . utils . createSvgElement ( "rect" , { width : 10 , height : 10 , fill : "#aaa" } , f ) ; Blockly . utils . createSvgElement ( "path" , { d : "M 0 0 L 10 10 M 10 0 L 0 10" , stroke : "#cc0" } , f ) ; b . disabledPatternId = f . id ; b . gridPattern = Blockly . Grid . createDom ( e , b . gridOptions , d ) ; return c } ;
Blockly . createMainWorkspace _ = function ( a , b , c , d ) { b . parentWorkspace = null ; var e = new Blockly . WorkspaceSvg ( b , c , d ) ; e . scale = b . zoomOptions . startScale ; a . appendChild ( e . createDom ( "blocklyMainBackground" ) ) ; ! b . hasCategories && b . languageTree && ( c = e . addFlyout _ ( "svg" ) , Blockly . utils . insertAfter _ ( c , a ) ) ; e . translate ( 0 , 0 ) ; Blockly . mainWorkspace = e ; b . readOnly || b . hasScrollbars || e . addChangeListener ( function ( ) { if ( ! e . isDragging ( ) ) { var a = e . getMetrics ( ) , c = a . viewLeft + a . absoluteLeft , d = a . viewTop + a . absoluteTop ; if ( a . contentTop < d || a . contentTop +
2018-08-17 13:32:56 +00:00
a . contentHeight > a . viewHeight + d || a . contentLeft < ( b . RTL ? a . viewLeft : c ) || a . contentLeft + a . contentWidth > ( b . RTL ? a . viewWidth : a . viewWidth + c ) ) for ( var k = e . getTopBlocks ( ! 1 ) , l = 0 , n ; n = k [ l ] ; l ++ ) { var m = n . getRelativeToSurfaceXY ( ) , p = n . getHeightWidth ( ) , q = d + 25 - p . height - m . y ; 0 < q && n . moveBy ( 0 , q ) ; q = d + a . viewHeight - 25 - m . y ; 0 > q && n . moveBy ( 0 , q ) ; q = 25 + c - m . x - ( b . RTL ? 0 : p . width ) ; 0 < q && n . moveBy ( q , 0 ) ; m = c + a . viewWidth - 25 - m . x + ( b . RTL ? p . width : 0 ) ; 0 > m && n . moveBy ( m , 0 ) } } } ) ; Blockly . svgResize ( e ) ; Blockly . WidgetDiv . createDom ( ) ; Blockly . Tooltip . createDom ( ) ;
2017-09-25 09:37:41 +00:00
return e } ;
2018-01-16 21:13:23 +00:00
Blockly . init _ = function ( a ) { var b = a . options , c = a . getParentSvg ( ) ; Blockly . bindEventWithChecks _ ( c . parentNode , "contextmenu" , null , function ( a ) { Blockly . utils . isTargetInput ( a ) || a . preventDefault ( ) } ) ; c = Blockly . bindEventWithChecks _ ( window , "resize" , null , function ( ) { Blockly . hideChaff ( ! 0 ) ; Blockly . svgResize ( a ) } ) ; a . setResizeHandlerWrapper ( c ) ; Blockly . inject . bindDocumentEvents _ ( ) ; b . languageTree && ( a . toolbox _ ? a . toolbox _ . init ( a ) : a . flyout _ && ( a . flyout _ . init ( a ) , a . flyout _ . show ( b . languageTree . childNodes ) , a . flyout _ . scrollToStart ( ) , a . scrollX =
2017-09-25 09:37:41 +00:00
a . flyout _ . width _ , b . toolboxPosition == Blockly . TOOLBOX _AT _RIGHT && ( a . scrollX *= - 1 ) , a . translate ( a . scrollX , 0 ) ) ) ; b . hasScrollbars && ( a . scrollbar = new Blockly . ScrollbarPair ( a ) , a . scrollbar . resize ( ) ) ; b . hasSounds && Blockly . inject . loadSounds _ ( b . pathToMedia , a ) } ;
2018-01-16 21:13:23 +00:00
Blockly . inject . bindDocumentEvents _ = function ( ) { Blockly . documentEventsBound _ || ( Blockly . bindEventWithChecks _ ( document , "keydown" , null , Blockly . onKeyDown _ ) , Blockly . bindEvent _ ( document , "touchend" , null , Blockly . longStop _ ) , Blockly . bindEvent _ ( document , "touchcancel" , null , Blockly . longStop _ ) , goog . userAgent . IPAD && Blockly . bindEventWithChecks _ ( window , "orientationchange" , document , function ( ) { Blockly . svgResize ( Blockly . getMainWorkspace ( ) ) } ) ) ; Blockly . documentEventsBound _ = ! 0 } ;
Blockly . inject . loadSounds _ = function ( a , b ) { var c = b . getAudioManager ( ) ; c . load ( [ a + "click.mp3" , a + "click.wav" , a + "click.ogg" ] , "click" ) ; c . load ( [ a + "disconnect.wav" , a + "disconnect.mp3" , a + "disconnect.ogg" ] , "disconnect" ) ; c . load ( [ a + "delete.mp3" , a + "delete.ogg" , a + "delete.wav" ] , "delete" ) ; var d = [ ] , e = function ( ) { for ( ; d . length ; ) Blockly . unbindEvent _ ( d . pop ( ) ) ; c . preload ( ) } ; d . push ( Blockly . bindEventWithChecks _ ( document , "mousemove" , null , e , ! 0 ) ) ; d . push ( Blockly . bindEventWithChecks _ ( document , "touchstart" , null , e , ! 0 ) ) } ;
Blockly . updateToolbox = function ( a ) { console . warn ( "Deprecated call to Blockly.updateToolbox, use workspace.updateToolbox instead." ) ; Blockly . getMainWorkspace ( ) . updateToolbox ( a ) } ; var CLOSURE _DEFINES = { "goog.DEBUG" : ! 1 } ; Blockly . mainWorkspace = null ; Blockly . selected = null ; Blockly . draggingConnections _ = [ ] ; Blockly . clipboardXml _ = null ; Blockly . clipboardSource _ = null ; Blockly . cache3dSupported _ = null ; Blockly . hueToRgb = function ( a ) { return goog . color . hsvToHex ( a , Blockly . HSV _SATURATION , 255 * Blockly . HSV _VALUE ) } ; Blockly . svgSize = function ( a ) { return { width : a . cachedWidth _ , height : a . cachedHeight _ } } ; Blockly . resizeSvgContents = function ( a ) { a . resizeContents ( ) } ;
Blockly . svgResize = function ( a ) { for ( ; a . options . parentWorkspace ; ) a = a . options . parentWorkspace ; var b = a . getParentSvg ( ) , c = b . parentNode ; if ( c ) { var d = c . offsetWidth ; c = c . offsetHeight ; b . cachedWidth _ != d && ( b . setAttribute ( "width" , d + "px" ) , b . cachedWidth _ = d ) ; b . cachedHeight _ != c && ( b . setAttribute ( "height" , c + "px" ) , b . cachedHeight _ = c ) ; a . resize ( ) } } ;
Blockly . onKeyDown _ = function ( a ) { if ( ! Blockly . mainWorkspace . options . readOnly && ! Blockly . utils . isTargetInput ( a ) ) { var b = ! 1 ; if ( 27 == a . keyCode ) Blockly . hideChaff ( ) ; else if ( 8 == a . keyCode || 46 == a . keyCode ) { a . preventDefault ( ) ; if ( Blockly . mainWorkspace . isDragging ( ) ) return ; Blockly . selected && Blockly . selected . isDeletable ( ) && ( b = ! 0 ) } else if ( a . altKey || a . ctrlKey || a . metaKey ) { if ( Blockly . mainWorkspace . isDragging ( ) ) return ; Blockly . selected && Blockly . selected . isDeletable ( ) && Blockly . selected . isMovable ( ) && ( 67 == a . keyCode ? ( Blockly . hideChaff ( ) ,
2018-08-17 13:32:56 +00:00
Blockly . copy _ ( Blockly . selected ) ) : 88 != a . keyCode || Blockly . selected . workspace . isFlyout || ( Blockly . copy _ ( Blockly . selected ) , b = ! 0 ) ) ; 86 == a . keyCode ? Blockly . clipboardXml _ && ( Blockly . Events . setGroup ( ! 0 ) , a = Blockly . clipboardSource _ , a . isFlyout && ( a = a . targetWorkspace ) , a . paste ( Blockly . clipboardXml _ ) , Blockly . Events . setGroup ( ! 1 ) ) : 90 == a . keyCode && ( Blockly . hideChaff ( ) , Blockly . mainWorkspace . undo ( a . shiftKey ) ) } b && ! Blockly . selected . workspace . isFlyout && ( Blockly . Events . setGroup ( ! 0 ) , Blockly . hideChaff ( ) , Blockly . selected . dispose ( ! 0 ,
! 0 ) , Blockly . Events . setGroup ( ! 1 ) ) } } ; Blockly . copy _ = function ( a ) { if ( a . isComment ) var b = a . toXmlWithXY ( ) ; else { b = Blockly . Xml . blockToDom ( a ) ; Blockly . Xml . deleteNext ( b ) ; var c = a . getRelativeToSurfaceXY ( ) ; b . setAttribute ( "x" , a . RTL ? - c . x : c . x ) ; b . setAttribute ( "y" , c . y ) } Blockly . clipboardXml _ = b ; Blockly . clipboardSource _ = a . workspace } ;
Blockly . duplicate _ = function ( a ) { var b = Blockly . clipboardXml _ , c = Blockly . clipboardSource _ ; Blockly . copy _ ( a ) ; a . workspace . paste ( Blockly . clipboardXml _ ) ; Blockly . clipboardXml _ = b ; Blockly . clipboardSource _ = c } ; Blockly . onContextMenu _ = function ( a ) { Blockly . utils . isTargetInput ( a ) || a . preventDefault ( ) } ; Blockly . hideChaff = function ( a ) { Blockly . Tooltip . hide ( ) ; Blockly . WidgetDiv . hide ( ) ; a || ( a = Blockly . getMainWorkspace ( ) , a . toolbox _ && a . toolbox _ . flyout _ && a . toolbox _ . flyout _ . autoClose && a . toolbox _ . clearSelection ( ) ) } ;
Blockly . addChangeListener = function ( a ) { console . warn ( "Deprecated call to Blockly.addChangeListener, use workspace.addChangeListener instead." ) ; return Blockly . getMainWorkspace ( ) . addChangeListener ( a ) } ; Blockly . getMainWorkspace = function ( ) { return Blockly . mainWorkspace } ; Blockly . alert = function ( a , b ) { window . alert ( a ) ; b && b ( ) } ; Blockly . confirm = function ( a , b ) { b ( window . confirm ( a ) ) } ; Blockly . prompt = function ( a , b , c ) { c ( window . prompt ( a , b ) ) } ; Blockly . jsonInitFactory _ = function ( a ) { return function ( ) { this . jsonInit ( a ) } } ;
Blockly . defineBlocksWithJsonArray = function ( a ) { for ( var b = 0 ; b < a . length ; b ++ ) { var c = a [ b ] ; if ( c ) { var d = c . type ; null == d || "" === d ? console . warn ( "Block definition #" + b + " in JSON array is missing a type attribute. Skipping." ) : ( Blockly . Blocks [ d ] && console . warn ( "Block definition #" + b + ' in JSON array overwrites prior definition of "' + d + '".' ) , Blockly . Blocks [ d ] = { init : Blockly . jsonInitFactory _ ( c ) } ) } else console . warn ( "Block definition #" + b + " in JSON array is " + c + ". Skipping." ) } } ;
Blockly . bindEventWithChecks _ = function ( a , b , c , d , e , f ) { var g = ! 1 , h = function ( a ) { var b = ! e ; a = Blockly . Touch . splitEventByTouches ( a ) ; for ( var f = 0 , h ; h = a [ f ] ; f ++ ) if ( ! b || Blockly . Touch . shouldHandleEvent ( h ) ) Blockly . Touch . setClientFromTouch ( h ) , c ? d . call ( c , h ) : d ( h ) , g = ! 0 } , k = [ ] ; if ( goog . global . PointerEvent && b in Blockly . Touch . TOUCH _MAP ) for ( var l = 0 , n ; n = Blockly . Touch . TOUCH _MAP [ b ] [ l ] ; l ++ ) a . addEventListener ( n , h , ! 1 ) , k . push ( [ a , n , h ] ) ; else if ( a . addEventListener ( b , h , ! 1 ) , k . push ( [ a , b , h ] ) , b in Blockly . Touch . TOUCH _MAP ) { var m = function ( a ) { h ( a ) ;
var b = ! f ; g && b && a . preventDefault ( ) } ; for ( l = 0 ; n = Blockly . Touch . TOUCH _MAP [ b ] [ l ] ; l ++ ) a . addEventListener ( n , m , ! 1 ) , k . push ( [ a , n , m ] ) } return k } ;
Blockly . bindEvent _ = function ( a , b , c , d ) { var e = function ( a ) { c ? d . call ( c , a ) : d ( a ) } , f = [ ] , g = goog . global . window ; if ( g && g . PointerEvent && b in Blockly . Touch . TOUCH _MAP ) { g = 0 ; for ( var h ; h = Blockly . Touch . TOUCH _MAP [ b ] [ g ] ; g ++ ) a . addEventListener ( h , e , ! 1 ) , f . push ( [ a , h , e ] ) } else if ( a . addEventListener ( b , e , ! 1 ) , f . push ( [ a , b , e ] ) , b in Blockly . Touch . TOUCH _MAP ) { var k = function ( a ) { if ( a . changedTouches && 1 == a . changedTouches . length ) { var b = a . changedTouches [ 0 ] ; a . clientX = b . clientX ; a . clientY = b . clientY } e ( a ) ; a . preventDefault ( ) } ; for ( g = 0 ; h = Blockly . Touch . TOUCH _MAP [ b ] [ g ] ; g ++ ) a . addEventListener ( h ,
k , ! 1 ) , f . push ( [ a , h , k ] ) } return f } ; Blockly . unbindEvent _ = function ( a ) { for ( ; a . length ; ) { var b = a . pop ( ) , c = b [ 2 ] ; b [ 0 ] . removeEventListener ( b [ 1 ] , c , ! 1 ) } return c } ; Blockly . isNumber = function ( a ) { return /^\s*-?\d+(\.\d+)?\s*$/ . test ( a ) } ;
Blockly . checkBlockColourConstants = function ( ) { Blockly . checkBlockColourConstant _ ( "LOGIC_HUE" , [ "Blocks" , "logic" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "LOGIC_HUE" , [ "Constants" , "Logic" , "HUE" ] , 210 ) ; Blockly . checkBlockColourConstant _ ( "LOOPS_HUE" , [ "Blocks" , "loops" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "LOOPS_HUE" , [ "Constants" , "Loops" , "HUE" ] , 120 ) ; Blockly . checkBlockColourConstant _ ( "MATH_HUE" , [ "Blocks" , "math" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "MATH_HUE" , [ "Constants" , "Math" ,
"HUE" ] , 230 ) ; Blockly . checkBlockColourConstant _ ( "TEXTS_HUE" , [ "Blocks" , "texts" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "TEXTS_HUE" , [ "Constants" , "Text" , "HUE" ] , 160 ) ; Blockly . checkBlockColourConstant _ ( "LISTS_HUE" , [ "Blocks" , "lists" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "LISTS_HUE" , [ "Constants" , "Lists" , "HUE" ] , 260 ) ; Blockly . checkBlockColourConstant _ ( "COLOUR_HUE" , [ "Blocks" , "colour" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "COLOUR_HUE" , [ "Constants" , "Colour" , "HUE" ] , 20 ) ; Blockly . checkBlockColourConstant _ ( "VARIABLES_HUE" ,
[ "Blocks" , "variables" , "HUE" ] , void 0 ) ; Blockly . checkBlockColourConstant _ ( "VARIABLES_HUE" , [ "Constants" , "Variables" , "HUE" ] , 330 ) ; Blockly . checkBlockColourConstant _ ( "VARIABLES_DYNAMIC_HUE" , [ "Constants" , "VariablesDynamic" , "HUE" ] , 310 ) ; Blockly . checkBlockColourConstant _ ( "PROCEDURES_HUE" , [ "Blocks" , "procedures" , "HUE" ] , void 0 ) } ;
Blockly . checkBlockColourConstant _ = function ( a , b , c ) { for ( var d = "Blockly" , e = Blockly , f = 0 ; f < b . length ; ++ f ) d += "." + b [ f ] , e && ( e = e [ b [ f ] ] ) ; e && e !== c && ( a = ( void 0 === c ? '%1 has been removed. Use Blockly.Msg["%2"].' : '%1 is deprecated and unused. Override Blockly.Msg["%2"].' ) . replace ( "%1" , d ) . replace ( "%2" , a ) , console . warn ( a ) ) } ; goog . global . console || ( goog . global . console = { log : function ( ) { } , warn : function ( ) { } } ) ; goog . global . Blockly || ( goog . global . Blockly = { } ) ; goog . global . Blockly . getMainWorkspace = Blockly . getMainWorkspace ;
goog . global . Blockly . addChangeListener = Blockly . addChangeListener ;