text: define(["../../../@polymer/polymer/polymer-legacy.js","../../../@polymer/polymer/lib/utils/async.js","../../../@polymer/iron-list/iron-list.js","../../../@polymer/paper-input/paper-input.js","../../grafitto-filter/grafitto-filter.js","../../dropdown-select/dropdown-select.js","../../simple-colors/simple-colors.js","./hax-gizmo-browser-item.js","./hax-shared-styles.js"],function(_polymerLegacy,async){"use strict";async=babelHelpers.interopRequireWildcard(async);function _templateObject_48c54a903c4511e9a62bc38461e84786(){var data=babelHelpers.taggedTemplateLiteral(["\n    <style is=\"custom-style\" include=\"simple-colors hax-shared-styles\">\n      :host {\n        display: block;\n      }\n      hax-gizmo-browser-item {\n        margin: 10px;\n        -webkit-transition: 0.3s all linear;\n        transition: 0.3s all linear;\n      }\n      #ironlist {\n        min-height: 50vh;\n        margin: 0;\n        padding: 16px;\n      }\n      .title {\n        position: relative;\n        padding: 16px;\n        outline: 0;\n        font-weight: 600;\n        text-align: left;\n        margin: 0;\n        background-color: var(--hax-color-menu-heading-bg);\n        font-size: 18px;\n        line-height: 18px;\n        font-family: \"Noto Serif\", serif;\n        color: var(--hax-color-text);\n      }\n      .toolbar-inner {\n        display: inline-flex;\n        padding: 10px;\n      }\n    </style>\n    <h3 class=\"title\">[[title]]</h3>\n    <div class=\"toolbar-inner\">\n      <dropdown-select id=\"filtertype\" label=\"Filter by\" value=\"title\">\n        <paper-item value=\"title\">Title</paper-item>\n      </dropdown-select>\n      <paper-input\n        label=\"Filter\"\n        id=\"inputfilter\"\n        aria-controls=\"filter\"\n        value=\"\"\n        always-float-label=\"\"\n      ></paper-input>\n    </div>\n    <grafitto-filter\n      id=\"filter\"\n      items=\"[[__gizmoList]]\"\n      like=\"\"\n      where=\"title\"\n      as=\"filtered\"\n    >\n      <template>\n        <iron-list id=\"ironlist\" items=\"[[filtered]]\" as=\"gizmo\" grid>\n          <template>\n            <div class=\"gizmo-container\">\n              <hax-gizmo-browser-item\n                index=\"[[gizmo.index]]\"\n                title=\"[[gizmo.title]]\"\n                tag=\"[[gizmo.tag]]\"\n                icon=\"[[gizmo.icon]]\"\n                image=\"[[gizmo.image]]\"\n                color=\"[[gizmo.color]]\"\n                author=\"[[gizmo.author]]\"\n                teaser=\"[[gizmo.teaser]]\"\n                description=\"[[gizmo.description]]\"\n                examples=\"[[gizmo.examples]]\"\n                status=\"[[gizmo.status]]\"\n              ></hax-gizmo-browser-item>\n            </div>\n          </template>\n        </iron-list>\n      </template>\n    </grafitto-filter>\n  "]);_templateObject_48c54a903c4511e9a62bc38461e84786=function(){return data};return data}(0,_polymerLegacy.Polymer)({_template:(0,_polymerLegacy.html)(_templateObject_48c54a903c4511e9a62bc38461e84786()),is:"hax-gizmo-browser",properties:{search:{type:String},title:{type:String,value:"Make"}},attached:function attached(){var _this=this;this.resetBrowser();this.shadowRoot.querySelector("#inputfilter").addEventListener("value-changed",function(e){_this.shadowRoot.querySelector("#filter").like=e.target.value});this.shadowRoot.querySelector("#filtertype").addEventListener("change",function(e){_this.shadowRoot.querySelector("#inputfilter").value="";_this.shadowRoot.querySelector("#filter").where=e.detail.value;_this.shadowRoot.querySelector("#filter").like=""});document.body.addEventListener("hax-store-property-updated",this._haxStorePropertyUpdated.bind(this))},detached:function detached(){document.body.removeEventListener("hax-store-property-updated",this._haxStorePropertyUpdated.bind(this))},_haxStorePropertyUpdated:function _haxStorePropertyUpdated(e){if(e.detail&&babelHelpers.typeof(e.detail.value)!=="undefined"&&e.detail.property){this.set(e.detail.property,e.detail.value)}},resetBrowser:function resetBrowser(){var _this2=this;if(babelHelpers.typeof(this.$.filter)!=="undefined"){async.microTask.run(function(){_this2.set("__gizmoList",window.HaxStore.instance.gizmoList);if(_this2.$.filter.shadowRoot.querySelector("#ironlist")){_this2.$.filter.shadowRoot.querySelector("#ironlist").filtered=_this2.__gizmoList}_this2.$.inputfilter.value="";_this2.$.filtertype.value="title";_this2.$.filter.value="";_this2.$.filter.filter();_this2.$.filter.where="title";_this2.$.filter.like="";setTimeout(function(){if(_this2.$.filter.shadowRoot.querySelector("#ironlist")){_this2.$.filter.shadowRoot.querySelector("#ironlist").fire("iron-resize");window.dispatchEvent(new Event("resize"))}},100)})}}})});