<commit_before>/**
 * @module proact
 * @submodule proact-core
 */

/**
 * ProAct.js turns plain JavaScript objects into holders of reactive properties.
 * You can define the dependencies between these objects and properties using the 'vanilla' js syntax.
 * For example if an object should have a property 'x', that depends on its two fields 'a' and 'b', the only thing that's needed
 * is to define a function 'x', that refers to 'this.a' and 'this.b'.
 *
 * So ProAct.js can turn every vanilla JavaScript value to a set of reactive properties, and this generates a dependency graph between them.
 * The data flow in this oriented graph is determined by its edges. So if we should receive data from the outside of this dependency system we'll need
 * a powerful but easy to use tool to turn every user or server generated action into a data event, common to the graph. Enter the ProAct.Stream - the functional
 * part of ProAct.js
 *
 * ProAct.js can be used to define bindings, to separate views from models (mv*), for performance optimizations... It is a tool.
 * A powerful tool for creating other, high level tools, or applications.
 * Everything should be defined in this namespace. It can be used as P or Pro.
 *
 * ProAct is powerful Functional Reactive Programming (FRP) lib too. Its streams and events
 *
 * are integrated with the reactive properties mentioned above.
 * Everything can be described using declarative expressions.
 * All ProAct classes and functions are defined in this namespace.
 * You can use `Pro` and `P` instead of `ProAct` too.
 *
 * The `proact-core` module provides base utilties and common functionality for all the other
 * modules of the lib.
 *
 * @class ProAct
 * @static
 */
var ProAct = Pro = P = {},

    arrayProto = Array.prototype,
    concat = arrayProto.concat,
    every = arrayProto.every,
    filter = arrayProto.filter,
    forEach = arrayProto.forEach,
    indexOf = arrayProto.indexOf,
    join = arrayProto.join,
    lastIndexOf = arrayProto.lastIndexOf,
    map = arrayProto.map,
    pop = arrayProto.pop,
    push = arrayProto.push,
    reduce = arrayProto.reduce,
    reduceRight = arrayProto.reduceRight,
    reverse = arrayProto.reverse,
    shift = arrayProto.shift,
    slice = arrayProto.slice,
    some = arrayProto.some,
    sort = arrayProto.sort,
    splice = arrayProto.splice,
    toLocaleString = arrayProto.toLocaleString,
    toString = arrayProto.toString,
    unshift = arrayProto.unshift,
    pArray, pArrayOps, pArrayProto, pArrayLs,
    rProto,
    dsl, dslOps,
    opStoreAll,
    streamProvider, functionProvider,
    attachers, attacherKeys,
    ActorUtil, StreamUtil;


/**
 * @property VERSION
 * @type String
 * @static
 * @for ProAct
 */
ProAct.VERSION = '1.2.1';

/**
 * Defines the possible states of the {{#crossLink "ProAct.Actor"}}{{/crossLink}} instances.
 *
 * @class States
 * @namespace ProAct
 * @static
 */
ProAct.States = {

  /**
   * Initialized : It is not usable yet.
   *
   * For example a computed property (property depending on other properties/actors) is
   * in `init` state when it's created and not read yet.
   * When something reads its value it computes it for the the first time and becomes in `ready`
   * state.
   *
   * @property init
   * @type Number
   * @final
   * @for ProAct.States
   */
  init: 1,

  /**
   * Ready for use.
   *
   * Active {{#crossLink "ProAct.Actor"}}Actors{{/crossLink}} have this state. It can be listened to, it
   * can be updated and notify all of its dependencies.
   *
   * @property ready
   * @type Number
   * @final
   * @for ProAct.States
   */
  ready: 2,

  /**
   * Ended it's lifecycle.
   *
   * Every {{#crossLink "ProAct.Actor"}}{{/crossLink}} can be `destroyed`. All the resources it uses are freed.
   * All the dependent objects don't depend on it anymore.
   *
   * For example if an application has states/routing, {{#crossLink "ProAct.Actor"}}Actors{{/crossLink}} that were active in one
   * of the states should be `destroyed` before going into other route/state.
   *
   * @property destroyed
   * @type Number
   * @final
   * @for ProAct.States
   */
  destroyed: 3,

  /**
   * Error has occured in the {{#crossLink "ProAct.Actor"}}{{/crossLink}}'s lifecycle.
   *
   * For example, if there was an exception in the object's initialization.
   *
   * @property error
   * @type Number
   * @final
   * @for ProAct.States
   */
  error: 4,

  /**
   * A closed ProAct object.
   *
   * Streams that can emmit events anymore are closed streams.
   *
   * Properties which value can not be updated are closed (constants).
   *
   * @property closed
   * @type Number
   * @final
   * @for ProAct.States
   */
  closed: 5
};


/**
 * Contains a set of utility functions to ease working with arrays and objects.
 * Can be reffered by using `ProAct.U` too.
 *
 * This class is part of the `proact-core` module of ProAct.js.
 *
 * @namespace ProAct
 * @class Utils
 * @static
 */
ProAct.Utils = Pro.U = {

  /**
   * Generates an unique id.
   * The idea is to be used as keynames in the {@link ProAct.Registry}.
   *
   * @memberof ProAct.Utils
   * @function uuid
   * @return {String}
   *      Unique string.
   */
  uuid: function () {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
      var r = Math.random() * 16 | 0,
          v = c === 'x' ? r : (r & 0x3 | 0x8);

      return v.toString(16);
    });
  },
<commit_msg>ProAct.Utils.uuid docs updated to YUIDoc.<commit_after>/**
 * @module proact
 * @submodule proact-core
 */

/**
 * ProAct.js turns plain JavaScript objects into holders of reactive properties.
 * You can define the dependencies between these objects and properties using the 'vanilla' js syntax.
 * For example if an object should have a property 'x', that depends on its two fields 'a' and 'b', the only thing that's needed
 * is to define a function 'x', that refers to 'this.a' and 'this.b'.
 *
 * So ProAct.js can turn every vanilla JavaScript value to a set of reactive properties, and this generates a dependency graph between them.
 * The data flow in this oriented graph is determined by its edges. So if we should receive data from the outside of this dependency system we'll need
 * a powerful but easy to use tool to turn every user or server generated action into a data event, common to the graph. Enter the ProAct.Stream - the functional
 * part of ProAct.js
 *
 * ProAct.js can be used to define bindings, to separate views from models (mv*), for performance optimizations... It is a tool.
 * A powerful tool for creating other, high level tools, or applications.
 * Everything should be defined in this namespace. It can be used as P or Pro.
 *
 * ProAct is powerful Functional Reactive Programming (FRP) lib too. Its streams and events
 *
 * are integrated with the reactive properties mentioned above.
 * Everything can be described using declarative expressions.
 * All ProAct classes and functions are defined in this namespace.
 * You can use `Pro` and `P` instead of `ProAct` too.
 *
 * The `proact-core` module provides base utilties and common functionality for all the other
 * modules of the lib.
 *
 * @class ProAct
 * @static
 */
var ProAct = Pro = P = {},

    arrayProto = Array.prototype,
    concat = arrayProto.concat,
    every = arrayProto.every,
    filter = arrayProto.filter,
    forEach = arrayProto.forEach,
    indexOf = arrayProto.indexOf,
    join = arrayProto.join,
    lastIndexOf = arrayProto.lastIndexOf,
    map = arrayProto.map,
    pop = arrayProto.pop,
    push = arrayProto.push,
    reduce = arrayProto.reduce,
    reduceRight = arrayProto.reduceRight,
    reverse = arrayProto.reverse,
    shift = arrayProto.shift,
    slice = arrayProto.slice,
    some = arrayProto.some,
    sort = arrayProto.sort,
    splice = arrayProto.splice,
    toLocaleString = arrayProto.toLocaleString,
    toString = arrayProto.toString,
    unshift = arrayProto.unshift,
    pArray, pArrayOps, pArrayProto, pArrayLs,
    rProto,
    dsl, dslOps,
    opStoreAll,
    streamProvider, functionProvider,
    attachers, attacherKeys,
    ActorUtil, StreamUtil;


/**
 * @property VERSION
 * @type String
 * @static
 * @for ProAct
 */
ProAct.VERSION = '1.2.1';

/**
 * Defines the possible states of the {{#crossLink "ProAct.Actor"}}{{/crossLink}} instances.
 *
 * @class States
 * @namespace ProAct
 * @static
 */
ProAct.States = {

  /**
   * Initialized : It is not usable yet.
   *
   * For example a computed property (property depending on other properties/actors) is
   * in `init` state when it's created and not read yet.
   * When something reads its value it computes it for the the first time and becomes in `ready`
   * state.
   *
   * @property init
   * @type Number
   * @final
   * @for ProAct.States
   */
  init: 1,

  /**
   * Ready for use.
   *
   * Active {{#crossLink "ProAct.Actor"}}Actors{{/crossLink}} have this state. It can be listened to, it
   * can be updated and notify all of its dependencies.
   *
   * @property ready
   * @type Number
   * @final
   * @for ProAct.States
   */
  ready: 2,

  /**
   * Ended it's lifecycle.
   *
   * Every {{#crossLink "ProAct.Actor"}}{{/crossLink}} can be `destroyed`. All the resources it uses are freed.
   * All the dependent objects don't depend on it anymore.
   *
   * For example if an application has states/routing, {{#crossLink "ProAct.Actor"}}Actors{{/crossLink}} that were active in one
   * of the states should be `destroyed` before going into other route/state.
   *
   * @property destroyed
   * @type Number
   * @final
   * @for ProAct.States
   */
  destroyed: 3,

  /**
   * Error has occured in the {{#crossLink "ProAct.Actor"}}{{/crossLink}}'s lifecycle.
   *
   * For example, if there was an exception in the object's initialization.
   *
   * @property error
   * @type Number
   * @final
   * @for ProAct.States
   */
  error: 4,

  /**
   * A closed ProAct object.
   *
   * Streams that can emmit events anymore are closed streams.
   *
   * Properties which value can not be updated are closed (constants).
   *
   * @property closed
   * @type Number
   * @final
   * @for ProAct.States
   */
  closed: 5
};


/**
 * Contains a set of utility functions to ease working with arrays and objects.
 * Can be reffered by using `ProAct.U` too.
 *
 * This class is part of the `proact-core` module of ProAct.js.
 *
 * @namespace ProAct
 * @class Utils
 * @static
 */
ProAct.Utils = Pro.U = {

  /**
   * Generates an universally unique identifier.
   *
   * @method uuid
   * @return {String} Unique string.
   */
  uuid: function () {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
      var r = Math.random() * 16 | 0,
          v = c === 'x' ? r : (r & 0x3 | 0x8);

      return v.toString(16);
    });
  },

{'fraction_non_alphanumeric': 0.102295871134975, 'fraction_numerical': 0.0033327161636733937, 'mean_word_length': 2.9848764293618593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3570311', 'n_tokens_mistral': 3297, 'n_tokens_neox': 3198, 'n_words': 1255}