text: define(["exports", "../../@polymer/polymer/polymer-element.js", "../schema-behaviors/schema-behaviors.js", "../simple-fields/lib/simple-fields-field.js"], function (_exports, _polymerElement, _schemaBehaviors, _simpleFieldsField) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.ToDo = void 0;
  
    var _templateObject_705fed10af6311ebbe560fe9c4727db1;
  
    function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  
    function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { babelHelpers.defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  
    function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = babelHelpers.getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = babelHelpers.getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return babelHelpers.possibleConstructorReturn(this, result); }; }
  
    function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  
    /**
     * `to-do`
     * @element to-do
     * @demo demo/index.html
     */
    var ToDo = /*#__PURE__*/function (_SchemaBehaviors) {
      babelHelpers.inherits(ToDo, _SchemaBehaviors);
  
      var _super = _createSuper(ToDo);
  
      function ToDo() {
        babelHelpers.classCallCheck(this, ToDo);
        return _super.apply(this, arguments);
      }
  
      babelHelpers.createClass(ToDo, [{
        key: "_valueChanged",
        value:
        /**
         * Ensure the values change.
         */
        function _valueChanged(e) {
          for (var i in e.base) {
            for (var j in e.base[i]) {
              this.notifyPath("items." + i + "." + j);
            }
          }
        }
        /**
         * Add a new item to the list.
         */
  
      }, {
        key: "_addItemToList",
        value: function _addItemToList(e) {
          if (this.shadowRoot.querySelector("#itemtext").value != "" && babelHelpers.typeof(this.shadowRoot.querySelector("#itemtext").value) !== (typeof undefined === "undefined" ? "undefined" : babelHelpers.typeof(undefined))) {
            this.push("items", {
              label: this.shadowRoot.querySelector("#itemtext").value,
              value: false,
              disabled: this.disabledList,
              id: "item-id-" + this.items.length
            });
            this.shadowRoot.querySelector("#itemtext").value = "";
          }
        }
      }], [{
        key: "template",
        get: function get() {
          return (0, _polymerElement.html)(_templateObject_705fed10af6311ebbe560fe9c4727db1 || (_templateObject_705fed10af6311ebbe560fe9c4727db1 = babelHelpers.taggedTemplateLiteral(["\n      <style>\n        :host {\n          display: block;\n        }\n        :host([hide-form]) ul {\n          border: 1px solid black;\n        }\n        div.card {\n          width: 100%;\n          padding: 8px;\n        }\n        .task-list-wrapper {\n          width: 100%;\n          height: 100%;\n          border: 2px solid black;\n          list-style: none;\n          padding: 0;\n        }\n        .task-list-wrapper li {\n          padding: 8px;\n        }\n        .task-list-wrapper li:nth-child(even) {\n          background-color: #f5f5f5;\n        }\n        .task-list-wrapper li:nth-child(odd) {\n          background-color: #e5e5e5;\n        }\n        .task-list-wrapper li:hover {\n          background-color: #ffffff;\n        }\n        .task-list-wrapper li:active {\n          background-color: #ffffff;\n        }\n        .task-list-wrapper li:focus {\n          background-color: #ffffff;\n        }\n        h3 {\n          margin: 4px;\n          padding: 0;\n          font-size: 20px;\n        }\n      </style>\n      <div class=\"card\">\n        <h3>[[name]]</h3>\n        <div class=\"card-content\">\n          <div hidden$=\"[[hideForm]]\">\n            <simple-fields-field\n              label=\"Task to accomplish\"\n              id=\"itemtext\"\n            ></simple-fields-field>\n            <button raised=\"\" id=\"itembutton\" on-click=\"_addItemToList\">\n              Add item\n            </button>\n          </div>\n          <ul class=\"task-list-wrapper\">\n            <template is=\"dom-repeat\" items=\"[[items]]\" as=\"item\">\n              <li data-item-id$=\"[[item.id]]\">\n                <simple-fields-field\n                  type=\"checkbox\"\n                  value=\"{{item.value}}\"\n                  disabled=\"[[item.disabled]]\"\n                  label=\"[[item.label]]\"\n                ></simple-fields-field>\n              </li>\n            </template>\n          </ul>\n        </div>\n      </div>\n    "])));
        }
      }, {
        key: "tag",
        get: function get() {
          return "to-do";
        }
      }, {
        key: "observers",
        get: function get() {
          return ["_valueChanged(items.*)"];
        }
      }, {
        key: "properties",
        get: function get() {
          return _objectSpread(_objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(ToDo), "properties", this)), {}, {
            /**
             * Allow for hiding the input form for new data.
             */
            hideForm: {
              type: Boolean,
              value: false,
              reflectToAttribute: true
            },
  
            /**
             * Whether or not the list of items is disabled
             * checkboxes.
             */
            disabledList: {
              type: Boolean,
              value: false,
              reflectToAttribute: true
            },
  
            /**
             * Name of this to do list
             */
            name: {
              type: String,
              value: "To do list"
            },
  
            /**
             * Items
             */
            items: {
              type: Array,
              value: [],
              notify: true
            }
          });
        }
      }, {
        key: "haxProperties",
        get: function get() {
          return {
            canScale: true,
            canPosition: true,
            canEditSource: true,
            gizmo: {
              title: "To do list",
              description: "A list of things to do so people can keep calm.",
              icon: "icons:list",
              color: "grey",
              groups: ["List"],
              handles: [],
              meta: {
                author: "ELMS:LN"
              }
            },
            settings: {
              configure: [{
                property: "name",
                title: "Name",
                description: "The name of this to do list",
                inputMethod: "textfield",
                icon: "editor:title"
              }, {
                property: "items",
                title: "List of items",
                description: "List of items to display in our list.",
                inputMethod: "array",
                itemLabel: "label",
                properties: [{
                  property: "label",
                  title: "Task",
                  description: "Name of the task",
                  inputMethod: "textfield",
                  required: true
                }, {
                  property: "value",
                  title: "Done",
                  description: "Completion state",
                  inputMethod: "boolean"
                }]
              }],
              advanced: []
            }
          };
        }
      }]);
      return ToDo;
    }((0, _schemaBehaviors.SchemaBehaviors)(_polymerElement.PolymerElement));
  
    _exports.ToDo = ToDo;
    window.customElements.define(ToDo.tag, ToDo);
  });