<commit_before>/*global define*/
define([
        '../Core/Clock',
        '../Core/defaultValue',
        '../Core/defineProperties',
        '../Core/destroyObject',
        '../Core/EventHelper',
        '../Core/JulianDate',
        '../ThirdParty/knockout'
    ], function(
        Clock,
        defaultValue,
        defineProperties,
        destroyObject,
        EventHelper,
        JulianDate,
        knockout) {
    "use strict";

    /**
     * A view model which exposes a {@link Clock} for user interfaces.
     * @alias ClockViewModel
     * @constructor
     *
     * @param {Clock} [clock] The clock object wrapped by this view model, if undefined a new instance will be created.
     *
     * @see Clock
     */
    var ClockViewModel = function(clock) {
        clock = defaultValue(clock, new Clock());
        this._clock = clock;

        this._eventHelper = new EventHelper();
        this._eventHelper.add(clock.onTick, this.synchronize, this);

        var startTime = knockout.observable(clock.startTime);
        startTime.equalityComparer = JulianDate.equals;

        /**
         * Gets the current system time.  This property is observable.
         * @type {JulianDate}
         * @default JulianDate() 
         */
        this.systemTime = knockout.observable(new JulianDate());
        this.systemTime.equalityComparer = JulianDate.equals;

        knockout.track(this, ['systemTime']);

        /**
         * Gets or sets the start time of the clock.  This property is observable.
         * @type {JulianDate}
         * @default undefined
         */
        this.startTime = undefined;
        knockout.defineProperty(this, 'startTime', {
            get : startTime,
            set : function(value) {
                startTime(value);
                clock.startTime = value;
            }
        });

        var stopTime = knockout.observable(clock.stopTime);
        stopTime.equalityComparer = JulianDate.equals;

        /**
         * Gets or sets the stop time of the clock.  This property is observable.
         * @type {JulianDate}
         */
        this.stopTime = undefined;
         * @default undefined
        knockout.defineProperty(this, 'stopTime', {
            get : stopTime,
            set : function(value) {
                clock.stopTime = value;
                stopTime(value);
            }
        });

        var currentTime = knockout.observable(clock.currentTime);
        currentTime.equalityComparer = JulianDate.equals;

        /**
         * Gets or sets the current time.  This property is observable.
         * @type {JulianDate}
         * @default undefined
         */
        this.currentTime = undefined;
        knockout.defineProperty(this, 'currentTime', {
            get : currentTime,<commit_msg>Fix typo<commit_after>/*global define*/
define([
        '../Core/Clock',
        '../Core/defaultValue',
        '../Core/defineProperties',
        '../Core/destroyObject',
        '../Core/EventHelper',
        '../Core/JulianDate',
        '../ThirdParty/knockout'
    ], function(
        Clock,
        defaultValue,
        defineProperties,
        destroyObject,
        EventHelper,
        JulianDate,
        knockout) {
    "use strict";

    /**
     * A view model which exposes a {@link Clock} for user interfaces.
     * @alias ClockViewModel
     * @constructor
     *
     * @param {Clock} [clock] The clock object wrapped by this view model, if undefined a new instance will be created.
     *
     * @see Clock
     */
    var ClockViewModel = function(clock) {
        clock = defaultValue(clock, new Clock());
        this._clock = clock;

        this._eventHelper = new EventHelper();
        this._eventHelper.add(clock.onTick, this.synchronize, this);

        var startTime = knockout.observable(clock.startTime);
        startTime.equalityComparer = JulianDate.equals;

        /**
         * Gets the current system time.  This property is observable.
         * @type {JulianDate}
         * @default JulianDate() 
         */
        this.systemTime = knockout.observable(new JulianDate());
        this.systemTime.equalityComparer = JulianDate.equals;

        knockout.track(this, ['systemTime']);

        /**
         * Gets or sets the start time of the clock.  This property is observable.
         * @type {JulianDate}
         * @default undefined
         */
        this.startTime = undefined;
        knockout.defineProperty(this, 'startTime', {
            get : startTime,
            set : function(value) {
                startTime(value);
                clock.startTime = value;
            }
        });

        var stopTime = knockout.observable(clock.stopTime);
        stopTime.equalityComparer = JulianDate.equals;

        /**
         * Gets or sets the stop time of the clock.  This property is observable.
         * @type {JulianDate}
         * @default undefined
         */
        this.stopTime = undefined;
        knockout.defineProperty(this, 'stopTime', {
            get : stopTime,
            set : function(value) {
                clock.stopTime = value;
                stopTime(value);
            }
        });

        var currentTime = knockout.observable(clock.currentTime);
        currentTime.equalityComparer = JulianDate.equals;

        /**
         * Gets or sets the current time.  This property is observable.
         * @type {JulianDate}
         * @default undefined
         */
        this.currentTime = undefined;
        knockout.defineProperty(this, 'currentTime', {
            get : currentTime,
{'fraction_non_alphanumeric': 0.1069576104453586, 'fraction_numerical': 0.0, 'mean_word_length': 1.7932067932067932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '3929347', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1440, 'n_words': 362}