text: define(["exports", "../../@polymer/polymer/polymer-element.js"], function (_exports, _polymerElement) {
    "use strict";
  
    Object.defineProperty(_exports, "__esModule", {
      value: true
    });
    _exports.LayoutBuilder = void 0;
  
    var _templateObject_6b948250af6311ebbe560fe9c4727db1;
  
    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; } }
  
    /**
     * `layout-builder`
     * @element layout-builder
     * `A new UI for adding content to layouts`
     *
     * @microcopy - language worth noting:
     *  -
     *
    
     * @polymer
     * @demo demo/index.html
     */
    var LayoutBuilder = /*#__PURE__*/function (_PolymerElement) {
      babelHelpers.inherits(LayoutBuilder, _PolymerElement);
  
      var _super = _createSuper(LayoutBuilder);
  
      function LayoutBuilder() {
        babelHelpers.classCallCheck(this, LayoutBuilder);
        return _super.apply(this, arguments);
      }
  
      babelHelpers.createClass(LayoutBuilder, [{
        key: "render",
        value: // render function
        function render() {
          return (0, _polymerElement.html)(_templateObject_6b948250af6311ebbe560fe9c4727db1 || (_templateObject_6b948250af6311ebbe560fe9c4727db1 = babelHelpers.taggedTemplateLiteral([" <style>\n        :host {\n          display: block;\n        }\n\n        :host button {\n          display: block;\n          margin: 0;\n        }\n\n        :host button,\n        :host #content-wrapper {\n          border: 1px solid #ddd;\n        }\n\n        :host #content:not(:empty) {\n          padding: 15px;\n        }\n\n        :host([hidden]) {\n          display: none;\n        }\n      </style>\n      <div id=\"content-wrapper\">\n        <div id=\"prepend-child\">\n          <button on-tap=\"_handleAddChild\">Insert into [[type]]</button>\n        </div>\n        <div id=\"content\"><slot></slot></div>\n      </div>\n      <div id=\"insert-sibling-after\">\n        <button on-tap=\"_handleAddSibling\">Add new [[type]]</button>\n      </div>"])));
        } // haxProperty definition
  
      }, {
        key: "connectedCallback",
        value:
        /**
         * life cycle, element is afixed to the DOM
         */
        function connectedCallback() {
          babelHelpers.get(babelHelpers.getPrototypeOf(LayoutBuilder.prototype), "connectedCallback", this).call(this);
          this.id = this._generateUUID();
        }
      }, {
        key: "_handleAddChild",
        value: function _handleAddChild() {
          var lb = document.createElement("layout-builder");
          lb.type = "sub-" + this.type;
          lb.innerHTML = "I am a ".concat(this.type, " of ").concat(this.id, ".");
          this.prepend(lb);
        }
      }, {
        key: "_handleAddSibling",
        value: function _handleAddSibling() {
          var lb = document.createElement("layout-builder");
          lb.type = this.type;
          lb.innerHTML = "I am a ".concat(this.type, " of ").concat(this.id, ".");
          this.parentNode.insertBefore(lb, this.nextSibling);
        }
        /**
         * Generate a UUID
         */
  
      }, {
        key: "_generateUUID",
        value: function _generateUUID() {
          var hex = Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
          return this.type + "-ss-s-s-s-sss".replace(/s/g, hex);
        }
        /**
         * life cycle, element is removed from the DOM
         */
        //disconnectedCallback() {}
  
      }], [{
        key: "haxProperties",
        get: function get() {
          return {
            canScale: true,
            canPosition: true,
            canEditSource: true,
            gizmo: {
              title: "Layout builder",
              description: "A new UI for adding content to layouts",
              icon: "icons:android",
              color: "green",
              groups: ["Builder"],
              handles: [{
                type: "todo:read-the-docs-for-usage"
              }],
              meta: {
                author: "nikkimk",
                owner: "The Pennsylvania State University"
              }
            },
            settings: {
              configure: [],
              advanced: []
            }
          };
        } // properties available to the custom element for data binding
  
      }, {
        key: "properties",
        get: function get() {
          return _objectSpread(_objectSpread({}, babelHelpers.get(babelHelpers.getPrototypeOf(LayoutBuilder), "properties", this)), {}, {
            type: {
              name: "type",
              type: Boolean,
              value: "layout"
            },
            id: {
              name: "id",
              type: String,
              reflecttoAttribute: true
            }
          });
        }
        /**
         * Store the tag name to make it easier to obtain directly.
         * @notice function name must be here for tooling to operate correctly
         */
  
      }, {
        key: "tag",
        get: function get() {
          return "layout-builder";
        }
      }]);
      return LayoutBuilder;
    }(_polymerElement.PolymerElement);
  
    _exports.LayoutBuilder = LayoutBuilder;
    window.customElements.define(LayoutBuilder.tag, LayoutBuilder);
  });