/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
import{Polymer as e}from"../../../polymer/lib/legacy/polymer-fn.js";import{html as t}from"../../../polymer/lib/utils/html-tag.js";import{IronResizableBehavior as i}from"../../iron-resizable-behavior.js";e({_template:t`
    <style>
      :host {
        display: inline-block;
        border: 3px solid lightblue;
      }
    </style>

    <b>I'm a resize-aware, thirdifying puck at (<span>{{x}}</span> x <span>{{y}}</span>).</b>
  `,is:"x-puck",behaviors:[i],properties:{x:{type:Number,value:0},y:{type:Number,value:0}},listeners:{"iron-resize":"_onIronResize"},attached:function(){this.async(this.notifyResize,1)},get parent(){return this.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?this.parentNode.host:this.parentNode},_onIronResize:function(){var e=this.x=Math.floor(this.parent.offsetWidth/3),t=this.y=Math.floor(this.parent.offsetHeight/3);this.translate3d(`${e}px`,`${t}px`,0)}});