diff --git a/CHANGELOG.md b/CHANGELOG.md index b00c5c3c..7f85a4d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## v4.2.0 +- Added the exit-clicks attribute to tangy-form and tangy-form-item, which is for the number of times a user must click the exit fullscreen button before that mode is deactivated. + ## v4.1.1 - Fix tangy-select test regression and work on EFTouch transition sound plays only on auto-progress [#137](https://github.com/Tangerine-Community/Tangerine/issues/1371) diff --git a/dist/bundle.js b/dist/bundle.js index e814d844..a9c0bd67 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -906,7 +906,7 @@ const l=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),c={"dom- * Google as part of the polymer project is also subject to an additional IP * rights grant found at http://polymer.github.io/PATENTS.txt */ -let g=0;const b={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},_=/[A-Z]/;function y(e,t){let i=e[t];if(i){if(!e.hasOwnProperty(t)){i=e[t]=Object.create(e[t]);for(let e in i){let t=i[e],n=i[e]=Array(t.length);for(let e=0;ed.source.length&&"property"==c.kind&&!c.isCompound&&l.__isPropertyEffectsClient&&l.__dataHasAccessor&&l.__dataHasAccessor[c.target]){let n=i[t];t=Object(a.i)(d.source,c.target,t),l._setPendingPropertyOrPath(t,n,!1,!0)&&e._enqueueClient(l)}else{!function(e,t,i,n,r){r=function(e,t,i,n){if(i.isCompound){let r=e.__dataCompoundStorage[i.target];r[n.compoundIndex]=t,t=r.join("")}"attribute"!==i.kind&&("textContent"!==i.target&&("value"!==i.target||"input"!==e.localName&&"textarea"!==e.localName)||(t=null==t?"":t));return t}(t,r,i,n),f.e&&(r=Object(f.e)(r,i.target,i.kind,t));if("attribute"==i.kind)e._valueToNodeAttribute(t,r,i.target);else{let n=i.target;t.__isPropertyEffectsClient&&t.__dataHasAccessor&&t.__dataHasAccessor[n]?t[b.READ_ONLY]&&t[b.READ_ONLY][n]||t._setPendingProperty(n,r)&&e._enqueueClient(t):e._setUnmanagedPropertyToNode(t,n,r)}}(e,l,c,d,r.evaluator._evaluateBinding(e,d,t,i,n,o))}}function L(e,t){if(t.isCompound){let i=e.__dataCompoundStorage||(e.__dataCompoundStorage={}),n=t.parts,r=new Array(n.length);for(let e=0;e="0"&&n<="9"&&(n="#"),n){case"'":case'"':i.value=t.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(t),i.literal=!0}return i.literal||(i.rootProperty=Object(a.g)(t),i.structured=Object(a.d)(t),i.structured&&(i.wildcard=".*"==t.slice(-2),i.wildcard&&(i.name=t.slice(0,-2)))),i}function F(e,t,i){let n=Object(a.a)(e,i);return void 0===n&&(n=t[i]),n}function $(e,t,i,n){e.notifyPath(i+".splices",{indexSplices:n}),e.notifyPath(i+".length",t.length)}function q(e,t,i,n,r,a){$(e,t,i,[{index:n,addedCount:r,removed:a,object:t,type:"splice"}])}const U=Object(r.a)(e=>{const t=v(Object(s.a)(e));return class extends t{constructor(){super(),this.__isPropertyEffectsClient=!0,this.__dataCounter=0,this.__dataClientsReady,this.__dataPendingClients,this.__dataToNotify,this.__dataLinkedPaths,this.__dataHasPaths,this.__dataCompoundStorage,this.__dataHost,this.__dataTemp,this.__dataClientsInitialized,this.__data,this.__dataPending,this.__dataOld,this.__computeEffects,this.__reflectEffects,this.__notifyEffects,this.__propagateEffects,this.__observeEffects,this.__readOnly,this.__templateInfo}get PROPERTY_EFFECT_TYPES(){return b}_initializeProperties(){super._initializeProperties(),K.registerHost(this),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_initializeProtoProperties(e){this.__data=Object.create(e),this.__dataPending=Object.create(e),this.__dataOld={}}_initializeInstanceProperties(e){let t=this[b.READ_ONLY];for(let i in e)t&&t[i]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=e[i])}_addPropertyEffect(e,t,i){this._createPropertyAccessor(e,t==b.READ_ONLY);let n=y(this,t)[e];n||(n=this[t][e]=[]),n.push(i)}_removePropertyEffect(e,t,i){let n=y(this,t)[e],r=n.indexOf(i);r>=0&&n.splice(r,1)}_hasPropertyEffect(e,t){let i=this[t];return Boolean(i&&i[e])}_hasReadOnlyEffect(e){return this._hasPropertyEffect(e,b.READ_ONLY)}_hasNotifyEffect(e){return this._hasPropertyEffect(e,b.NOTIFY)}_hasReflectEffect(e){return this._hasPropertyEffect(e,b.REFLECT)}_hasComputedEffect(e){return this._hasPropertyEffect(e,b.COMPUTE)}_setPendingPropertyOrPath(e,t,i,n){if(n||Object(a.g)(Array.isArray(e)?e[0]:e)!==e){if(!n){let i=Object(a.a)(this,e);if(!(e=Object(a.h)(this,e,t))||!super._shouldPropertyChange(e,t,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(e,t,i))return function(e,t,i){let n=e.__dataLinkedPaths;if(n){let r;for(let o in n){let s=n[o];Object(a.c)(o,t)?(r=Object(a.i)(o,s,t),e._setPendingPropertyOrPath(r,i,!0,!0)):Object(a.c)(s,t)&&(r=Object(a.i)(s,o,t),e._setPendingPropertyOrPath(r,i,!0,!0))}}}(this,e,t),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[e])return this._setPendingProperty(e,t,i);this[e]=t}return!1}_setUnmanagedPropertyToNode(e,t,i){i===e[t]&&"object"!=typeof i||(e[t]=i)}_setPendingProperty(e,t,i){let n=this.__dataHasPaths&&Object(a.d)(e),r=n?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(e,t,r[e])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),e in this.__dataOld||(this.__dataOld[e]=this.__data[e]),n?this.__dataTemp[e]=t:this.__data[e]=t,this.__dataPending[e]=t,(n||this[b.NOTIFY]&&this[b.NOTIFY][e])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[e]=i),!0)}_setProperty(e,t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(e){this.__dataPendingClients=this.__dataPendingClients||[],e!==this&&this.__dataPendingClients.push(e)}_flushProperties(){this.__dataCounter++,super._flushProperties(),this.__dataCounter--}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let e=this.__dataPendingClients;if(e){this.__dataPendingClients=null;for(let t=0;tr&&n.push({literal:e.slice(r,i.index)});let a=i[1][0],o=Boolean(i[2]),s=i[3].trim(),l=!1,c="",d=-1;"{"==a&&(d=s.indexOf("::"))>0&&(c=s.substring(d+2),s=s.substring(0,d),l=!0);let h=N(s),p=[];if(h){let{args:e,methodName:i}=h;for(let t=0;td.source.length&&"property"==c.kind&&!c.isCompound&&l.__isPropertyEffectsClient&&l.__dataHasAccessor&&l.__dataHasAccessor[c.target]){let n=i[t];t=Object(a.i)(d.source,c.target,t),l._setPendingPropertyOrPath(t,n,!1,!0)&&e._enqueueClient(l)}else{!function(e,t,i,n,r){r=function(e,t,i,n){if(i.isCompound){let r=e.__dataCompoundStorage[i.target];r[n.compoundIndex]=t,t=r.join("")}"attribute"!==i.kind&&("textContent"!==i.target&&("value"!==i.target||"input"!==e.localName&&"textarea"!==e.localName)||(t=null==t?"":t));return t}(t,r,i,n),f.e&&(r=Object(f.e)(r,i.target,i.kind,t));if("attribute"==i.kind)e._valueToNodeAttribute(t,r,i.target);else{let n=i.target;t.__isPropertyEffectsClient&&t.__dataHasAccessor&&t.__dataHasAccessor[n]?t[b.READ_ONLY]&&t[b.READ_ONLY][n]||t._setPendingProperty(n,r)&&e._enqueueClient(t):e._setUnmanagedPropertyToNode(t,n,r)}}(e,l,c,d,r.evaluator._evaluateBinding(e,d,t,i,n,o))}}function L(e,t){if(t.isCompound){let i=e.__dataCompoundStorage||(e.__dataCompoundStorage={}),n=t.parts,r=new Array(n.length);for(let e=0;e="0"&&n<="9"&&(n="#"),n){case"'":case'"':i.value=t.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(t),i.literal=!0}return i.literal||(i.rootProperty=Object(a.g)(t),i.structured=Object(a.d)(t),i.structured&&(i.wildcard=".*"==t.slice(-2),i.wildcard&&(i.name=t.slice(0,-2)))),i}function F(e,t,i){let n=Object(a.a)(e,i);return void 0===n&&(n=t[i]),n}function $(e,t,i,n){e.notifyPath(i+".splices",{indexSplices:n}),e.notifyPath(i+".length",t.length)}function q(e,t,i,n,r,a){$(e,t,i,[{index:n,addedCount:r,removed:a,object:t,type:"splice"}])}const U=Object(r.a)(e=>{const t=v(Object(s.a)(e));return class extends t{constructor(){super(),this.__isPropertyEffectsClient=!0,this.__dataCounter=0,this.__dataClientsReady,this.__dataPendingClients,this.__dataToNotify,this.__dataLinkedPaths,this.__dataHasPaths,this.__dataCompoundStorage,this.__dataHost,this.__dataTemp,this.__dataClientsInitialized,this.__data,this.__dataPending,this.__dataOld,this.__computeEffects,this.__reflectEffects,this.__notifyEffects,this.__propagateEffects,this.__observeEffects,this.__readOnly,this.__templateInfo}get PROPERTY_EFFECT_TYPES(){return b}_initializeProperties(){super._initializeProperties(),K.registerHost(this),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_initializeProtoProperties(e){this.__data=Object.create(e),this.__dataPending=Object.create(e),this.__dataOld={}}_initializeInstanceProperties(e){let t=this[b.READ_ONLY];for(let i in e)t&&t[i]||(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=e[i])}_addPropertyEffect(e,t,i){this._createPropertyAccessor(e,t==b.READ_ONLY);let n=y(this,t)[e];n||(n=this[t][e]=[]),n.push(i)}_removePropertyEffect(e,t,i){let n=y(this,t)[e],r=n.indexOf(i);r>=0&&n.splice(r,1)}_hasPropertyEffect(e,t){let i=this[t];return Boolean(i&&i[e])}_hasReadOnlyEffect(e){return this._hasPropertyEffect(e,b.READ_ONLY)}_hasNotifyEffect(e){return this._hasPropertyEffect(e,b.NOTIFY)}_hasReflectEffect(e){return this._hasPropertyEffect(e,b.REFLECT)}_hasComputedEffect(e){return this._hasPropertyEffect(e,b.COMPUTE)}_setPendingPropertyOrPath(e,t,i,n){if(n||Object(a.g)(Array.isArray(e)?e[0]:e)!==e){if(!n){let i=Object(a.a)(this,e);if(!(e=Object(a.h)(this,e,t))||!super._shouldPropertyChange(e,t,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(e,t,i))return function(e,t,i){let n=e.__dataLinkedPaths;if(n){let r;for(let o in n){let s=n[o];Object(a.c)(o,t)?(r=Object(a.i)(o,s,t),e._setPendingPropertyOrPath(r,i,!0,!0)):Object(a.c)(s,t)&&(r=Object(a.i)(s,o,t),e._setPendingPropertyOrPath(r,i,!0,!0))}}}(this,e,t),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[e])return this._setPendingProperty(e,t,i);this[e]=t}return!1}_setUnmanagedPropertyToNode(e,t,i){i===e[t]&&"object"!=typeof i||(e[t]=i)}_setPendingProperty(e,t,i){let n=this.__dataHasPaths&&Object(a.d)(e),r=n?this.__dataTemp:this.__data;return!!this._shouldPropertyChange(e,t,r[e])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),e in this.__dataOld||(this.__dataOld[e]=this.__data[e]),n?this.__dataTemp[e]=t:this.__data[e]=t,this.__dataPending[e]=t,(n||this[b.NOTIFY]&&this[b.NOTIFY][e])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[e]=i),!0)}_setProperty(e,t){this._setPendingProperty(e,t,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(e){this.__dataPendingClients=this.__dataPendingClients||[],e!==this&&this.__dataPendingClients.push(e)}_flushProperties(){this.__dataCounter++,super._flushProperties(),this.__dataCounter--}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let e=this.__dataPendingClients;if(e){this.__dataPendingClients=null;for(let t=0;tr&&n.push({literal:e.slice(r,i.index)});let a=i[1][0],o=Boolean(i[2]),s=i[3].trim(),l=!1,c="",d=-1;"{"==a&&(d=s.indexOf("::"))>0&&(c=s.substring(d+2),s=s.substring(0,d),l=!0);let h=N(s),p=[];if(h){let{args:e,methodName:i}=h;for(let t=0;t{q.transformCustomStyle(e)},this.customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{this.customStyleInterface.enqueued&&this.flushCustomStyles()})})}prepareTemplate(e,t){if(this.ensure(),x(e))return;O[t]=e;let i=q.transformTemplate(e,t);e._styleAst=i}flushCustomStyles(){if(this.ensure(),!this.customStyleInterface)return;let e=this.customStyleInterface.processStyles();if(this.customStyleInterface.enqueued){for(let t=0;t-1?i=t:(n=t,i=e.getAttribute&&e.getAttribute("is")||""):(i=e.is,n=e.extends),{is:i,typeExtension:n}}(e),i=O[t];if((!i||!x(i))&&i&&!j(i)){F(i)||(this.prepareTemplate(i,t),$(i));let n=e.shadowRoot;if(n){let e=n.querySelector("style");e&&(e.__cssRules=i._styleAst,e.textContent=_(i._styleAst))}}}styleDocument(e){this.ensure(),this.styleSubtree(document.body,e)}}if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){const e=new U;let t=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate(t,i,n){e.flushCustomStyles(),e.prepareTemplate(t,i)},prepareTemplateStyles(e,t,i){window.ShadyCSS.prepareTemplate(e,t,i)},prepareTemplateDom(e,t){},styleSubtree(t,i){e.flushCustomStyles(),e.styleSubtree(t,i)},styleElement(t){e.flushCustomStyles(),e.styleElement(t)},styleDocument(t){e.flushCustomStyles(),e.styleDocument(t)},getComputedStyleValue:(e,t)=>Object(M.b)(e,t),flushCustomStyles(){e.flushCustomStyles()},nativeCss:n.c,nativeShadow:n.d,cssBuild:n.a,disableRuntime:n.b},t&&(window.ShadyCSS.CustomStyleInterface=t)}window.ShadyCSS.ApplyShim=q;var K=i(33),Y=i(48),W=i(45),G=i(12); +*/const q=new V;class U{constructor(){this.customStyleInterface=null,q.invalidCallback=N}ensure(){this.customStyleInterface||window.ShadyCSS.CustomStyleInterface&&(this.customStyleInterface=window.ShadyCSS.CustomStyleInterface,this.customStyleInterface.transformCallback=e=>{q.transformCustomStyle(e)},this.customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{this.customStyleInterface.enqueued&&this.flushCustomStyles()})})}prepareTemplate(e,t){if(this.ensure(),x(e))return;T[t]=e;let i=q.transformTemplate(e,t);e._styleAst=i}flushCustomStyles(){if(this.ensure(),!this.customStyleInterface)return;let e=this.customStyleInterface.processStyles();if(this.customStyleInterface.enqueued){for(let t=0;t-1?i=t:(n=t,i=e.getAttribute&&e.getAttribute("is")||""):(i=e.is,n=e.extends),{is:i,typeExtension:n}}(e),i=T[t];if((!i||!x(i))&&i&&!j(i)){F(i)||(this.prepareTemplate(i,t),$(i));let n=e.shadowRoot;if(n){let e=n.querySelector("style");e&&(e.__cssRules=i._styleAst,e.textContent=_(i._styleAst))}}}styleDocument(e){this.ensure(),this.styleSubtree(document.body,e)}}if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){const e=new U;let t=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate(t,i,n){e.flushCustomStyles(),e.prepareTemplate(t,i)},prepareTemplateStyles(e,t,i){window.ShadyCSS.prepareTemplate(e,t,i)},prepareTemplateDom(e,t){},styleSubtree(t,i){e.flushCustomStyles(),e.styleSubtree(t,i)},styleElement(t){e.flushCustomStyles(),e.styleElement(t)},styleDocument(t){e.flushCustomStyles(),e.styleDocument(t)},getComputedStyleValue:(e,t)=>Object(M.b)(e,t),flushCustomStyles(){e.flushCustomStyles()},nativeCss:n.c,nativeShadow:n.d,cssBuild:n.a,disableRuntime:n.b},t&&(window.ShadyCSS.CustomStyleInterface=t)}window.ShadyCSS.ApplyShim=q;var K=i(33),Y=i(48),W=i(45),G=i(12); /** * @fileoverview * @suppress {checkPrototypalTypes} @@ -1063,7 +1063,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI 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 */ -const a="link[rel=import][type~=css]",o="include",s="shady-unscoped";function l(e){return n.a.import(e)}function c(e){let t=e.body?e.body:e;const i=Object(r.b)(t.textContent,e.baseURI),n=document.createElement("style");return n.textContent=i,n}function d(e){const t=e.trim().split(/\s+/),i=[];for(let e=0;e-1}let b=!1;function _(e){if(!g(e)&&"touchend"!==e)return s&&b&&a.c?{passive:!0}:void 0}!function(){try{let e=Object.defineProperty({},"passive",{get(){b=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();let y=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const z=[],w={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},k={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function C(e){let t=Array.prototype.slice.call(e.labels||[]);if(!t.length){t=[];let i=e.getRootNode();if(e.id){let n=i.querySelectorAll(`label[for = ${e.id}]`);for(let e=0;e-1}if(n[e]===S.mouse.target)return}if(t)return;e.preventDefault(),e.stopPropagation()}};function M(e){let t=y?["click"]:m;for(let i,n=0;ne.composedPath&&e.composedPath()||[],P={},L=[];function V(e){const t=A(e);return t.length>0?t[0]:e.target}function O(e){let t,i=e.type,n=e.currentTarget[l];if(!n)return;let r=n[i];if(r){if(!e[c]&&(e[c]={},"touch"===i.slice(0,5))){let t=(e=e).changedTouches[0];if("touchstart"===i&&1===e.touches.length&&(S.touch.id=t.identifier),S.touch.id!==t.identifier)return;s||"touchstart"!==i&&"touchmove"!==i||function(e){let t=e.changedTouches[0],i=e.type;if("touchstart"===i)S.touch.x=t.clientX,S.touch.y=t.clientY,S.touch.scrollDecided=!1;else if("touchmove"===i){if(S.touch.scrollDecided)return;S.touch.scrollDecided=!0;let i=function(e){let t="auto",i=A(e);for(let e,n=0;nr:"pan-y"===i&&(n=r>a)),n?e.preventDefault():j("track")}}(e)}if(!(t=e[c]).skip){for(let i,n=0;n-1&&i.reset&&i.reset();for(let n,a=0;a{e.style.touchAction=t}),e[d]=t}function N(e,t,i){let n=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(n.detail=i,Object(o.a)(e).dispatchEvent(n),n.defaultPrevented){let e=i.preventer||i.sourceEvent;e&&e.preventDefault&&e.preventDefault()}}function j(e){let t=function(e){for(let t,i=0;i=p||r>=p}function q(e,t,i){if(!t)return;let n,r=e.moves[e.moves.length-2],a=e.moves[e.moves.length-1],o=a.x-e.x,s=a.y-e.y,l=0;r&&(n=a.x-r.x,l=a.y-r.y),N(t,"track",{state:e.state,x:i.clientX,y:i.clientY,dx:o,dy:s,ddx:n,ddy:l,sourceEvent:i,hover:function(){return function(e,t){let i=document.elementFromPoint(e,t),n=i;for(;n&&n.shadowRoot&&!window.ShadyDOM;){if(n===(n=n.shadowRoot.elementFromPoint(e,t)))break;n&&(i=n)}return i}(i.clientX,i.clientY)}})}function U(e,t,i){let n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y),a=V(i||t);!a||k[a.localName]&&a.hasAttribute("disabled")||(isNaN(n)||isNaN(r)||n<=h&&r<=h||function(e){if("click"===e.type){if(0===e.detail)return!0;let t=V(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;let i=t.getBoundingClientRect(),n=e.pageX,r=e.pageY;return!(n>=i.left&&n<=i.right&&r>=i.top&&r<=i.bottom)}return!1}(t))&&(e.prevent||N(a,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:i}))}D({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){E(this.info)},mousedown:function(e){if(!B(e))return;let t=V(e),i=this;H(this.info,function(e){B(e)||(F("up",t,e),E(i.info))},function(e){B(e)&&F("up",t,e),E(i.info)}),F("down",t,e)},touchstart:function(e){F("down",V(e),e.changedTouches[0],e)},touchend:function(e){F("up",V(e),e.changedTouches[0],e)}}),D({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,E(this.info)},mousedown:function(e){if(!B(e))return;let t=V(e),i=this,n=function(e){let n=e.clientX,r=e.clientY;$(i.info,n,r)&&(i.info.state=i.info.started?"mouseup"===e.type?"end":"track":"start","start"===i.info.state&&j("tap"),i.info.addMove({x:n,y:r}),B(e)||(i.info.state="end",E(i.info)),t&&q(i.info,t,e),i.info.started=!0)};H(this.info,n,function(e){i.info.started&&n(e),E(i.info)}),this.info.x=e.clientX,this.info.y=e.clientY},touchstart:function(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){let t=V(e),i=e.changedTouches[0],n=i.clientX,r=i.clientY;$(this.info,n,r)&&("start"===this.info.state&&j("tap"),this.info.addMove({x:n,y:r}),q(this.info,t,i),this.info.state="track",this.info.started=!0)},touchend:function(e){let t=V(e),i=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),q(this.info,t,i))}}),D({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(e){B(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click:function(e){B(e)&&U(this.info,e)},touchstart:function(e){const t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend:function(e){U(this.info,e.changedTouches[0],e)}})},function(e,t,i){"use strict";i.d(t,"b",function(){return o}),i.d(t,"a",function(){return s});i(5);var n=i(22),r=i(19),a=i(26); +let s="string"==typeof document.head.style.touchAction,l="__polymerGestures",c="__polymerGesturesHandled",d="__polymerGesturesTouchAction",h=25,p=5,u=2500,m=["mousedown","mousemove","mouseup","click"],v=[0,1,4,2],f=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function g(e){return m.indexOf(e)>-1}let b=!1;function _(e){if(!g(e)&&"touchend"!==e)return s&&b&&a.c?{passive:!0}:void 0}!function(){try{let e=Object.defineProperty({},"passive",{get(){b=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}}();let y=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);const z=[],w={button:!0,input:!0,keygen:!0,meter:!0,output:!0,textarea:!0,progress:!0,select:!0},k={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function C(e){let t=Array.prototype.slice.call(e.labels||[]);if(!t.length){t=[];let i=e.getRootNode();if(e.id){let n=i.querySelectorAll(`label[for = ${e.id}]`);for(let e=0;e-1}if(n[e]===S.mouse.target)return}if(t)return;e.preventDefault(),e.stopPropagation()}};function M(e){let t=y?["click"]:m;for(let i,n=0;ne.composedPath&&e.composedPath()||[],P={},L=[];function V(e){const t=A(e);return t.length>0?t[0]:e.target}function T(e){let t,i=e.type,n=e.currentTarget[l];if(!n)return;let r=n[i];if(r){if(!e[c]&&(e[c]={},"touch"===i.slice(0,5))){let t=(e=e).changedTouches[0];if("touchstart"===i&&1===e.touches.length&&(S.touch.id=t.identifier),S.touch.id!==t.identifier)return;s||"touchstart"!==i&&"touchmove"!==i||function(e){let t=e.changedTouches[0],i=e.type;if("touchstart"===i)S.touch.x=t.clientX,S.touch.y=t.clientY,S.touch.scrollDecided=!1;else if("touchmove"===i){if(S.touch.scrollDecided)return;S.touch.scrollDecided=!0;let i=function(e){let t="auto",i=A(e);for(let e,n=0;nr:"pan-y"===i&&(n=r>a)),n?e.preventDefault():j("track")}}(e)}if(!(t=e[c]).skip){for(let i,n=0;n-1&&i.reset&&i.reset();for(let n,a=0;a{e.style.touchAction=t}),e[d]=t}function N(e,t,i){let n=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(n.detail=i,Object(o.a)(e).dispatchEvent(n),n.defaultPrevented){let e=i.preventer||i.sourceEvent;e&&e.preventDefault&&e.preventDefault()}}function j(e){let t=function(e){for(let t,i=0;i=p||r>=p}function q(e,t,i){if(!t)return;let n,r=e.moves[e.moves.length-2],a=e.moves[e.moves.length-1],o=a.x-e.x,s=a.y-e.y,l=0;r&&(n=a.x-r.x,l=a.y-r.y),N(t,"track",{state:e.state,x:i.clientX,y:i.clientY,dx:o,dy:s,ddx:n,ddy:l,sourceEvent:i,hover:function(){return function(e,t){let i=document.elementFromPoint(e,t),n=i;for(;n&&n.shadowRoot&&!window.ShadyDOM;){if(n===(n=n.shadowRoot.elementFromPoint(e,t)))break;n&&(i=n)}return i}(i.clientX,i.clientY)}})}function U(e,t,i){let n=Math.abs(t.clientX-e.x),r=Math.abs(t.clientY-e.y),a=V(i||t);!a||k[a.localName]&&a.hasAttribute("disabled")||(isNaN(n)||isNaN(r)||n<=h&&r<=h||function(e){if("click"===e.type){if(0===e.detail)return!0;let t=V(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;let i=t.getBoundingClientRect(),n=e.pageX,r=e.pageY;return!(n>=i.left&&n<=i.right&&r>=i.top&&r<=i.bottom)}return!1}(t))&&(e.prevent||N(a,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:i}))}D({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset:function(){E(this.info)},mousedown:function(e){if(!B(e))return;let t=V(e),i=this;H(this.info,function(e){B(e)||(F("up",t,e),E(i.info))},function(e){B(e)&&F("up",t,e),E(i.info)}),F("down",t,e)},touchstart:function(e){F("down",V(e),e.changedTouches[0],e)},touchend:function(e){F("up",V(e),e.changedTouches[0],e)}}),D({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove:function(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset:function(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,E(this.info)},mousedown:function(e){if(!B(e))return;let t=V(e),i=this,n=function(e){let n=e.clientX,r=e.clientY;$(i.info,n,r)&&(i.info.state=i.info.started?"mouseup"===e.type?"end":"track":"start","start"===i.info.state&&j("tap"),i.info.addMove({x:n,y:r}),B(e)||(i.info.state="end",E(i.info)),t&&q(i.info,t,e),i.info.started=!0)};H(this.info,n,function(e){i.info.started&&n(e),E(i.info)}),this.info.x=e.clientX,this.info.y=e.clientY},touchstart:function(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove:function(e){let t=V(e),i=e.changedTouches[0],n=i.clientX,r=i.clientY;$(this.info,n,r)&&("start"===this.info.state&&j("tap"),this.info.addMove({x:n,y:r}),q(this.info,t,i),this.info.state="track",this.info.started=!0)},touchend:function(e){let t=V(e),i=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),q(this.info,t,i))}}),D({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset:function(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown:function(e){B(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click:function(e){B(e)&&U(this.info,e)},touchstart:function(e){const t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend:function(e){U(this.info,e.changedTouches[0],e)}})},function(e,t,i){"use strict";i.d(t,"b",function(){return o}),i.d(t,"a",function(){return s});i(5);var n=i(22),r=i(19),a=i(26); /** @license Copyright (c) 2015 The Polymer Project Authors. All rights reserved. @@ -3613,7 +3613,7 @@ Object(n.a)({is:"paper-input",_template:r.a` - `,behaviors:[c.a,l.a],properties:{value:{type:String}},get _focusableElement(){return this.inputElement._inputElement},listeners:{"iron-input-ready":"_onIronInputReady"},_onIronInputReady:function(){this.$.nativeInput||(this.$.nativeInput=this.$$("input")),this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.$.nativeInput.type)&&(this.alwaysFloatLabel=!0),this.inputElement.bindValue&&this.$.container._handleValueAndAutoValidate(this.inputElement)}})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});const n={_id:"form-1",formId:"",collection:"TangyFormResponse",startDate:(new Date).toLocaleString(),items:[],inputs:[]},r=function(e=n,t){var i,r={},o=0;switch(t.type){case"FORM_OPEN":(i=Object.assign({},t.response)).items=t.itemsInDom.map(e=>{let t=i.items.find(t=>t.id===e.id),n={...e,...t};return t?n:e}),o=i.items.findIndex(e=>!1===e.disabled),i.items[o].hideBackButton=!0,-1!==i.items.findIndex(e=>!0===e.summary)&&(i.form.hasSummary=!0),i.form.complete||(i.form.linearMode=!0,i.form.hideClosedItems=!0);let n=i.items.length-([...i.items].reverse().findIndex(e=>!e.summary&&!e.disabled)+1);return i.items[n].hideNextButton=!0,i.items[n].showCompleteButton=!0,i.form.complete||i.items.find(e=>e.open)||(i.items[o].open=!0),!0===i.form.hideClosedItems&&i.items.forEach(e=>e.hidden=!e.open),!0===i.form.linearMode&&i.items.forEach(e=>e.hideButtons=!0),!0===i.form.fullscreen&&i.items.forEach(e=>e.fullscreen=!0),i;case"FORM_RESPONSE_COMPLETE":return Object.assign({},e,{complete:!0,form:Object.assign({},e.form,{complete:!0,linearMode:!1,fullscreen:!1,hideClosedItems:!1}),items:e.items.map(e=>{let t={};return e.disabled?t.hidden=!0:(t.hidden=!1,t.open=!1,t.hideButtons=!1),e.summary||(t.locked=!0),t.hideBackButton=!0,t.hideNextButton=!0,t.fullscreen=!1,t.inputs=e.inputs.map(e=>"TANGY-TIMED"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_TIMED_MODE_DISABLED"}):"TANGY-UNTIMED-GRID"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_UNTIMED_GRID_MODE_DISABLED"}):Object.assign({},e,{disabled:!0})),e.feedback&&(t.open=!0),Object.assign({},e,t)})});case"SHOW_RESPONSE":return Object.assign({},e,{form:Object.assign({},e.form,{tabIndex:1,showResponse:!0,showSummary:!1}),items:e.items.map(e=>e.summary?Object.assign({},e,{hidden:!0}):Object.assign({},e,{hidden:!1}))});case"SHOW_SUMMARY":return Object.assign({},e,{form:Object.assign({},e.form,{tabIndex:0,showResponse:!1,showSummary:!0}),items:e.items.map(e=>e.summary?Object.assign({},e,{open:!0,hidden:!1}):Object.assign({},e,{hidden:!0}))});case"ITEM_OPEN":return(i=Object.assign({},e)).focusIndex=i.items.findIndex(e=>e.id===t.itemId),Object.assign({},i,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{open:!0}):e)});case"ITEM_CHANGE":return i=Object.assign({},e),Object.assign({},i,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{isDirty:!0}):e)});case"ITEM_CLOSE":return r.itemIndex=e.items.findIndex(e=>e.id===t.itemId),i=Object.assign({},e),Object.assign(i,{progress:e.items.filter(e=>e.valid).length/e.items.length*100,items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{open:!1,isDirty:!1,valid:!0,hideButtons:!1}):Object.assign({},e))}),Object.assign(i,a(i)),i;case"ITEM_BACK":case"ITEM_NEXT":return r.itemIndex=e.items.findIndex(e=>e.id===t.itemId),i=Object.assign({},e),Object.assign(i,a(i)),Object.assign(i,{progress:e.items.filter(e=>e.valid).length/e.items.filter(e=>!e.disabled).length*100,items:i.items.map(e=>{let n={};return e.id==t.itemId&&(n.open=!1),"ITEM_BACK"===t.type&&i.previousItemId===e.id&&(n.open=!0),"ITEM_NEXT"===t.type&&i.nextItemId===e.id&&(n.open=!0),!0!==i.form.hideClosedItems||n.open?n.hidden=!1:n.hidden=!0,Object.assign({},e,n)})}),Object.assign(i,a(i)),i;case"ITEM_ENABLE":return a(i=Object.assign({},e,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{disabled:!1}):e)}));case"ITEM_SAVE":i=Object.assign({},e,{items:e.items.map(e=>e.id==t.item.id?Object.assign({},e,t.item,{isDirty:!1}):e)});const s=t.item.inputs.find(e=>"location"===e.name&&"TANGY-LOCATION"===e.tagName);if(s)for(const e of s.value)i.location={...i.location,[e.level]:e.value};return i;case"ITEM_DISABLE":return a(i=Object.assign({},e,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{disabled:!0}):e)}));case"ENABLE_ITEM_READONLY":return Object.assign({},e,{items:e.items.map(e=>{let t={locked:!0};return t.inputs=e.inputs.map(e=>"TANGY-TIMED"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_TIMED_MODE_DISABLED"}):"TANGY-UNTIMED-GRID"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_UNTIMED_GRID_MODE_DISABLED"}):Object.assign({},e,{disabled:!0})),Object.assign({},e,t)})});case"DISABLE_ITEM_READONLY":return Object.assign({},e,{items:e.items.map(e=>{let t={locked:!1};return t.inputs=e.inputs.map(e=>"TANGY-TIMED"===e.tagName?Object.assign({},e,{disabled:!1,mode:"TANGY_TIMED_MODE_DISABLED"}):"TANGY-UNTIMED-GRID"===e.tagName?Object.assign({},e,{disabled:!1,mode:"TANGY_UNTIMED_GRID_MODE_DISABLED"}):Object.assign({},e,{disabled:!1})),Object.assign({},e,t)})});case"HIDE_ITEM_BUTTONS":return i=Object.assign({},e,{items:e.items.map(e=>(e.hideButtons=!0,e))});case"SHOW_ITEM_BUTTONS":return i=Object.assign({},e,{items:e.items.map(e=>(e.hideButtons=!1,e))});case"ENTER_FULLSCREEN":return{...e,fullscreenEnabled:!0,items:e.items.map(e=>({...e,fullscreenEnabled:!0}))};case"EXIT_FULLSCREEN":return{...e,fullscreenEnabled:!1,items:e.items.map(e=>({...e,fullscreenEnabled:!1}))};default:return e}return e};function a(e){let t={},i=Object.assign({},e);i.focusIndex=i.items.findIndex(e=>e.open),i.nextFocusIndex=e.items.findIndex((e,t)=>t>i.focusIndex&&(!e.hasOwnProperty("disabled")||!1===e.disabled)),i.items.reverse(),t.focusIndexReversed=i.items.length-i.focusIndex-1,i.previousFocusIndex=i.items.findIndex((e,i)=>i>t.focusIndexReversed&&(!e.hasOwnProperty("disabled")||!1===e.disabled)),-1!==i.previousFocusIndex&&(i.previousFocusIndex=i.items.length-i.previousFocusIndex-1),i.items.reverse(),-1!==i.nextFocusIndex?i.nextItemId=i.items[i.nextFocusIndex].id:i.nextItemId=void 0,-1!==i.previousFocusIndex?i.previousItemId=i.items[i.previousFocusIndex].id:i.previousItemId=void 0;let n=i.items.length-([...i.items].reverse().findIndex(e=>!e.summary&&!e.disabled)+1);return i.items=i.items.map((e,t)=>Object.assign({},e,{showCompleteButton:n===t})),i}},function(e,t,i){"use strict";i.d(t,"a",function(){return n});class n{constructor(e){this._id=function(){var e,t,i="";for(e=0;e<32;e++)t=16*Math.random()|0,8!=e&&12!=e&&16!=e&&20!=e||(i+="-"),i+=(12==e?4:16==e?3&t|8:t).toString(16);return i}(),this.collection="TangyFormResponse",this.form={},this.items=[],this.complete=!1,this.focusIndex=0,this.nextFocusIndex=1,this.previousFocusIndex=-1,this.startDatetime=(new Date).toLocaleString(),this.startUnixtime=Date.now(),this.uploadDatetime="",this.location={},e&&e.hasOwnProperty("inputs")&&delete e.inputs,Object.assign(this,e)}get inputs(){return this.items.reduce((e,t)=>(t.inputs.forEach(t=>{"TANGY-CARDS"===t.tagName?t.value.forEach(t=>t.value.forEach(t=>e.push(t))):e.push(t)}),e),[])}get inputsByName(){return this.inputs.reduce((e,t)=>(e.hasOwnProperty(t.name)?Array.isArray(e[t.name])?e[t.name]=e[t.name].push(t):e[t.name]=[t,e[t.name]]:e[t.name]=t,e),{})}}},function(module,__webpack_exports__,__webpack_require__){"use strict";var _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_polymer_polymer_lib_utils_render_status_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(32),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(11),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(8),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_3__),_util_t_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1),_tangy_form_reducer_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(72),_tangy_form_response_model_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(73),_tangy_form_item_callback_helpers_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(47),_tangy_form_item_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(75),_tangy_complete_button_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(76),_tangy_overlay_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(77),_tangy_input_groups_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(78),_tangy_input_group_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(63),_tangy_list_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(91),_tangy_template_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(79),_polymer_paper_fab_paper_fab_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(80),_polymer_paper_icon_button_paper_icon_button_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(64),_polymer_paper_tabs_paper_tab_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(65),_polymer_paper_tabs_paper_tabs_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(90),translation_web_component_t_lang_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(81);class TangyForm extends _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.a{newResponse(){let e=new _tangy_form_response_model_js__WEBPACK_IMPORTED_MODULE_6__.a;e.form=this.getProps(),this.querySelectorAll("tangy-form-item").forEach(t=>{e.items.push(t.getProps())}),this.response=e}set response(e){this._responseHasBeenSet=!0,this.store.dispatch({type:"FORM_OPEN",response:e,itemsInDom:[...this.querySelectorAll("tangy-form-item")].map(e=>e.getProps())}),this.fireHook("on-open")}get response(){return this._responseHasBeenSet?this.store.getState():null}get inputs(){return this.response.items.reduce((e,t)=>[...e,...t.inputs],[])}get values(){return this.inputs.reduce((e,t)=>Object.assign({},e,{[t.name]:t.value}),{})}getValue(e){let t=this.store.getState(),i=[];t.items.forEach(e=>i=[...i,...e.inputs]);let n=i.find(t=>t.name===e&&t.value);if(n&&"object"==typeof n.value){let e=[];return n.value.forEach(t=>{t.value&&e.push(t.name)}),e}return n&&n.hasOwnProperty("value")?n.value:""}next(){this.querySelector('tangy-form-item[open=""]').next()}back(){this.querySelector('tangy-form-item[open=""]').back()}itemDisable(e){let t=this.store.getState().items.find(t=>e===t.id);t&&!t.disabled&&this.store.dispatch({type:"ITEM_DISABLE",itemId:e})}itemEnable(e){let t=this.store.getState().items.find(t=>e===t.id);t&&t.disabled&&this.store.dispatch({type:"ITEM_ENABLE",itemId:e})}enableItemReadOnly(){this.store.dispatch({type:"ENABLE_ITEM_READONLY"})}disableItemReadOnly(){this.store.dispatch({type:"DISABLE_ITEM_READONLY"})}hideItemButtons(){this.store.dispatch({type:"HIDE_ITEM_BUTTONS"})}showItemButtons(){this.store.dispatch({type:"SHOW_ITEM_BUTTONS"})}static get template(){return _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.b` + `,behaviors:[c.a,l.a],properties:{value:{type:String}},get _focusableElement(){return this.inputElement._inputElement},listeners:{"iron-input-ready":"_onIronInputReady"},_onIronInputReady:function(){this.$.nativeInput||(this.$.nativeInput=this.$$("input")),this.inputElement&&-1!==this._typesThatHaveText.indexOf(this.$.nativeInput.type)&&(this.alwaysFloatLabel=!0),this.inputElement.bindValue&&this.$.container._handleValueAndAutoValidate(this.inputElement)}})},function(e,t,i){"use strict";i.d(t,"a",function(){return r});const n={_id:"form-1",formId:"",collection:"TangyFormResponse",startDate:(new Date).toLocaleString(),items:[],inputs:[]},r=function(e=n,t){var i,r={},o=0;switch(t.type){case"FORM_OPEN":(i=Object.assign({},t.response)).items=t.itemsInDom.map(e=>{let t=i.items.find(t=>t.id===e.id),n={...e,...t};return t?n:e}),o=i.items.findIndex(e=>!1===e.disabled),i.items[o].hideBackButton=!0,-1!==i.items.findIndex(e=>!0===e.summary)&&(i.form.hasSummary=!0),i.form.complete||(i.form.linearMode=!0,i.form.hideClosedItems=!0);let n=i.items.length-([...i.items].reverse().findIndex(e=>!e.summary&&!e.disabled)+1);return i.items[n].hideNextButton=!0,i.items[n].showCompleteButton=!0,i.form.complete||i.items.find(e=>e.open)||(i.items[o].open=!0),!0===i.form.hideClosedItems&&i.items.forEach(e=>e.hidden=!e.open),!0===i.form.linearMode&&i.items.forEach(e=>e.hideButtons=!0),!0===i.form.fullscreen&&i.items.forEach(e=>e.fullscreen=!0),i;case"FORM_RESPONSE_COMPLETE":return Object.assign({},e,{complete:!0,form:Object.assign({},e.form,{complete:!0,linearMode:!1,fullscreen:!1,hideClosedItems:!1}),items:e.items.map(e=>{let t={};return e.disabled?t.hidden=!0:(t.hidden=!1,t.open=!1,t.hideButtons=!1),e.summary||(t.locked=!0),t.hideBackButton=!0,t.hideNextButton=!0,t.fullscreen=!1,t.inputs=e.inputs.map(e=>"TANGY-TIMED"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_TIMED_MODE_DISABLED"}):"TANGY-UNTIMED-GRID"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_UNTIMED_GRID_MODE_DISABLED"}):Object.assign({},e,{disabled:!0})),e.feedback&&(t.open=!0),Object.assign({},e,t)})});case"SHOW_RESPONSE":return Object.assign({},e,{form:Object.assign({},e.form,{tabIndex:1,showResponse:!0,showSummary:!1}),items:e.items.map(e=>e.summary?Object.assign({},e,{hidden:!0}):Object.assign({},e,{hidden:!1}))});case"SHOW_SUMMARY":return Object.assign({},e,{form:Object.assign({},e.form,{tabIndex:0,showResponse:!1,showSummary:!0}),items:e.items.map(e=>e.summary?Object.assign({},e,{open:!0,hidden:!1}):Object.assign({},e,{hidden:!0}))});case"ITEM_OPEN":return(i=Object.assign({},e)).focusIndex=i.items.findIndex(e=>e.id===t.itemId),Object.assign({},i,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{open:!0}):e)});case"ITEM_CHANGE":return i=Object.assign({},e),Object.assign({},i,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{isDirty:!0}):e)});case"ITEM_CLOSE":return r.itemIndex=e.items.findIndex(e=>e.id===t.itemId),i=Object.assign({},e),Object.assign(i,{progress:e.items.filter(e=>e.valid).length/e.items.length*100,items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{open:!1,isDirty:!1,valid:!0,hideButtons:!1}):Object.assign({},e))}),Object.assign(i,a(i)),i;case"ITEM_BACK":case"ITEM_NEXT":return r.itemIndex=e.items.findIndex(e=>e.id===t.itemId),i=Object.assign({},e),Object.assign(i,a(i)),Object.assign(i,{progress:e.items.filter(e=>e.valid).length/e.items.filter(e=>!e.disabled).length*100,items:i.items.map(e=>{let n={};return e.id==t.itemId&&(n.open=!1),"ITEM_BACK"===t.type&&i.previousItemId===e.id&&(n.open=!0),"ITEM_NEXT"===t.type&&i.nextItemId===e.id&&(n.open=!0),!0!==i.form.hideClosedItems||n.open?n.hidden=!1:n.hidden=!0,Object.assign({},e,n)})}),Object.assign(i,a(i)),i;case"ITEM_ENABLE":return a(i=Object.assign({},e,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{disabled:!1}):e)}));case"ITEM_SAVE":i=Object.assign({},e,{items:e.items.map(e=>e.id==t.item.id?Object.assign({},e,t.item,{isDirty:!1}):e)});const s=t.item.inputs.find(e=>"location"===e.name&&"TANGY-LOCATION"===e.tagName);if(s)for(const e of s.value)i.location={...i.location,[e.level]:e.value};return i;case"ITEM_DISABLE":return a(i=Object.assign({},e,{items:e.items.map(e=>e.id==t.itemId?Object.assign({},e,{disabled:!0}):e)}));case"ENABLE_ITEM_READONLY":return Object.assign({},e,{items:e.items.map(e=>{let t={locked:!0};return t.inputs=e.inputs.map(e=>"TANGY-TIMED"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_TIMED_MODE_DISABLED"}):"TANGY-UNTIMED-GRID"===e.tagName?Object.assign({},e,{disabled:!0,mode:"TANGY_UNTIMED_GRID_MODE_DISABLED"}):Object.assign({},e,{disabled:!0})),Object.assign({},e,t)})});case"DISABLE_ITEM_READONLY":return Object.assign({},e,{items:e.items.map(e=>{let t={locked:!1};return t.inputs=e.inputs.map(e=>"TANGY-TIMED"===e.tagName?Object.assign({},e,{disabled:!1,mode:"TANGY_TIMED_MODE_DISABLED"}):"TANGY-UNTIMED-GRID"===e.tagName?Object.assign({},e,{disabled:!1,mode:"TANGY_UNTIMED_GRID_MODE_DISABLED"}):Object.assign({},e,{disabled:!1})),Object.assign({},e,t)})});case"HIDE_ITEM_BUTTONS":return i=Object.assign({},e,{items:e.items.map(e=>(e.hideButtons=!0,e))});case"SHOW_ITEM_BUTTONS":return i=Object.assign({},e,{items:e.items.map(e=>(e.hideButtons=!1,e))});case"ENTER_FULLSCREEN":return{...e,fullscreenEnabled:!0,exitClicks:e.form.exitClicks,items:e.items.map(t=>({...t,fullscreenEnabled:!0,exitClicks:e.form.exitClicks}))};case"EXIT_FULLSCREEN":return{...e,fullscreenEnabled:!1,items:e.items.map(e=>({...e,fullscreenEnabled:!1}))};default:return e}return e};function a(e){let t={},i=Object.assign({},e);i.focusIndex=i.items.findIndex(e=>e.open),i.nextFocusIndex=e.items.findIndex((e,t)=>t>i.focusIndex&&(!e.hasOwnProperty("disabled")||!1===e.disabled)),i.items.reverse(),t.focusIndexReversed=i.items.length-i.focusIndex-1,i.previousFocusIndex=i.items.findIndex((e,i)=>i>t.focusIndexReversed&&(!e.hasOwnProperty("disabled")||!1===e.disabled)),-1!==i.previousFocusIndex&&(i.previousFocusIndex=i.items.length-i.previousFocusIndex-1),i.items.reverse(),-1!==i.nextFocusIndex?i.nextItemId=i.items[i.nextFocusIndex].id:i.nextItemId=void 0,-1!==i.previousFocusIndex?i.previousItemId=i.items[i.previousFocusIndex].id:i.previousItemId=void 0;let n=i.items.length-([...i.items].reverse().findIndex(e=>!e.summary&&!e.disabled)+1);return i.items=i.items.map((e,t)=>Object.assign({},e,{showCompleteButton:n===t})),i}},function(e,t,i){"use strict";i.d(t,"a",function(){return n});class n{constructor(e){this._id=function(){var e,t,i="";for(e=0;e<32;e++)t=16*Math.random()|0,8!=e&&12!=e&&16!=e&&20!=e||(i+="-"),i+=(12==e?4:16==e?3&t|8:t).toString(16);return i}(),this.collection="TangyFormResponse",this.form={},this.items=[],this.complete=!1,this.focusIndex=0,this.nextFocusIndex=1,this.previousFocusIndex=-1,this.startDatetime=(new Date).toLocaleString(),this.startUnixtime=Date.now(),this.uploadDatetime="",this.location={},e&&e.hasOwnProperty("inputs")&&delete e.inputs,Object.assign(this,e)}get inputs(){return this.items.reduce((e,t)=>(t.inputs.forEach(t=>{"TANGY-CARDS"===t.tagName?t.value.forEach(t=>t.value.forEach(t=>e.push(t))):e.push(t)}),e),[])}get inputsByName(){return this.inputs.reduce((e,t)=>(e.hasOwnProperty(t.name)?Array.isArray(e[t.name])?e[t.name]=e[t.name].push(t):e[t.name]=[t,e[t.name]]:e[t.name]=t,e),{})}}},function(module,__webpack_exports__,__webpack_require__){"use strict";var _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_polymer_polymer_lib_utils_render_status_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(32),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(11),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(8),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_3__),_util_t_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(1),_tangy_form_reducer_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(72),_tangy_form_response_model_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(73),_tangy_form_item_callback_helpers_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(47),_tangy_form_item_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(75),_tangy_complete_button_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(76),_tangy_overlay_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(77),_tangy_input_groups_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(78),_tangy_input_group_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(63),_tangy_list_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(91),_tangy_template_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(79),_polymer_paper_fab_paper_fab_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__(80),_polymer_paper_icon_button_paper_icon_button_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__(64),_polymer_paper_tabs_paper_tab_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__(65),_polymer_paper_tabs_paper_tabs_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__(90),translation_web_component_t_lang_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__(81);class TangyForm extends _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.a{newResponse(){let e=new _tangy_form_response_model_js__WEBPACK_IMPORTED_MODULE_6__.a;e.form=this.getProps(),this.querySelectorAll("tangy-form-item").forEach(t=>{e.items.push(t.getProps())}),this.response=e}set response(e){this._responseHasBeenSet=!0,this.store.dispatch({type:"FORM_OPEN",response:e,itemsInDom:[...this.querySelectorAll("tangy-form-item")].map(e=>e.getProps())}),this.fireHook("on-open")}get response(){return this._responseHasBeenSet?this.store.getState():null}get inputs(){return this.response.items.reduce((e,t)=>[...e,...t.inputs],[])}get values(){return this.inputs.reduce((e,t)=>Object.assign({},e,{[t.name]:t.value}),{})}getValue(e){let t=this.store.getState(),i=[];t.items.forEach(e=>i=[...i,...e.inputs]);let n=i.find(t=>t.name===e&&t.value);if(n&&"object"==typeof n.value){let e=[];return n.value.forEach(t=>{t.value&&e.push(t.name)}),e}return n&&n.hasOwnProperty("value")?n.value:""}next(){this.querySelector('tangy-form-item[open=""]').next()}back(){this.querySelector('tangy-form-item[open=""]').back()}itemDisable(e){let t=this.store.getState().items.find(t=>e===t.id);t&&!t.disabled&&this.store.dispatch({type:"ITEM_DISABLE",itemId:e})}itemEnable(e){let t=this.store.getState().items.find(t=>e===t.id);t&&t.disabled&&this.store.dispatch({type:"ITEM_ENABLE",itemId:e})}enableItemReadOnly(){this.store.dispatch({type:"ENABLE_ITEM_READONLY"})}disableItemReadOnly(){this.store.dispatch({type:"DISABLE_ITEM_READONLY"})}hideItemButtons(){this.store.dispatch({type:"HIDE_ITEM_BUTTONS"})}showItemButtons(){this.store.dispatch({type:"SHOW_ITEM_BUTTONS"})}static get template(){return _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.b` @@ -3732,7 +3732,7 @@ Object(n.a)({is:"paper-input",_template:r.a`
- `}onClickSummaryTab(){this.store.dispatch({type:"SHOW_SUMMARY"}),setTimeout(()=>{this.querySelector("[summary]").scrollIntoView({behavior:"smooth",block:"start"})},200)}onClickResponseTab(){this.store.dispatch({type:"SHOW_RESPONSE"}),this.querySelectorAll("tangy-form-item")[0].scrollIntoView({behavior:"smooth",block:"center"})}static get is(){return"tangy-form"}static get properties(){return{fullscreen:{type:Boolean,value:!1},title:{type:String,value:""},complete:{type:Boolean,value:!1,reflectToAttribute:!0},linearMode:{type:Boolean,value:!1,reflectToAttribute:!0},hideClosedItems:{type:Boolean,value:!1,reflectToAttribute:!0},hideCompleteFab:{type:Boolean,value:!1,reflectToAttribute:!0},tabIndex:{type:Number,value:0,reflectToAttribute:!0},showResponse:{type:Boolean,value:!1,reflectToAttribute:!0},showSummary:{type:Boolean,value:!1,reflectToAttribute:!0},hasSummary:{type:Boolean,value:!1,reflectToAttribute:!0}}}constructor(){super(),this.t={summary:"summary",response:"response"},this._responseHasBeenSet=!1,this.store=Redux.createStore(_tangy_form_reducer_js__WEBPACK_IMPORTED_MODULE_5__.a,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}ready(){super.ready(),this.fullscreen&&this.addEventListener("click",this.enableFullscreen,!0),this.hasLazyItems=!1,this.querySelectorAll("tangy-form-item").forEach(e=>{e.getAttribute("src")&&(this.hasLazyItems=!0),e.store=this.store,this.linearMode&&(e.noButtons=!0),e.addEventListener("change",this.onItemChange.bind(this)),e.addEventListener("ITEM_NEXT",this.onItemNext.bind(this)),e.addEventListener("ITEM_BACK",this.onItemBack.bind(this)),e.addEventListener("ITEM_CLOSED",this.onItemClosed.bind(this)),e.addEventListener("ITEM_OPENED",this.onItemOpened.bind(this)),e.addEventListener("FORM_RESPONSE_COMPLETE",this.onFormResponseComplete.bind(this)),e.addEventListener("FORM_RESPONSE_NO_CONSENT",this.onFormResponseNoConsent.bind(this)),e.addEventListener("logic-error",this.onItemError.bind(this))}),this.hasLazyItems?this.unsubscribe=this.store.subscribe(this.throttledReflect.bind(this)):this.unsubscribe=this.store.subscribe(this.reflect.bind(this)),this.store.subscribe(e=>{this.dispatchEvent(new CustomEvent("TANGY_FORM_UPDATE"))}),this.hasAttribute("on-submit")&&this.addEventListener("submit",e=>{this.fireHook("on-submit")}),Object(_polymer_polymer_lib_utils_render_status_js__WEBPACK_IMPORTED_MODULE_1__.a)(this,function(){!1===this._responseHasBeenSet&&this.newResponse()}),this.addEventListener("enter-fullscreen",()=>{this.store.dispatch({type:"ENTER_FULLSCREEN"})}),this.addEventListener("exit-fullscreen",()=>{this.store.dispatch({type:"EXIT_FULLSCREEN"})})}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}onFormResponseComplete(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),this.dispatchEvent(new CustomEvent("submit",{cancelable:!0}))&&(this.store.dispatch({type:"FORM_RESPONSE_COMPLETE"}),!this.dispatchEvent(new CustomEvent("tangy-form-complete",{cancelable:!0}))||(this.hasSummary?this.store.dispatch({type:"SHOW_SUMMARY"}):this.store.dispatch({type:"SHOW_RESPONSE"})))}onFormResponseNoConsent(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),!this.dispatchEvent(new CustomEvent("submit",{cancelable:!0}))||(this.store.dispatch({type:"FORM_RESPONSE_COMPLETE"}),this.hasSummary?this.store.dispatch({type:"SHOW_SUMMARY"}):this.store.dispatch({type:"SHOW_RESPONSE"}))}onItemChange(e){this.store.dispatch({type:"ITEM_CHANGE",itemId:e.target.id}),this.fireHook("on-change")}onItemNext(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),this.focusOnNextItem(),this.fireHook("on-change")}onItemBack(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),this.focusOnPreviousItem(),this.fireHook("on-change")}onItemOpened(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()})}onItemClosed(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()})}onItemError(e){this.errorMessage(e.detail)}throttledReflect(e=!1){this.reflectQueued&&!e||(this.reflectRunning?(this.reflectQueued=!0,setTimeout(()=>this.throttledReflect(!0),200)):(this.reflectRunning=!0,this.reflect(),this.reflectRunning=!1,e&&(this.reflectQueued=!1)))}reflect(){let e=this.store.getState();this.previousState||(this.previousState=e),this.setProps(e.form),e.form&&e.form.complete;let t=[].slice.call(this.querySelectorAll("tangy-form-item"));t.forEach(t=>{let i=e.items.findIndex(e=>t.id==e.id);-1!==i&&t.setProps(e.items[i])}),e.focusIndex!==this.previousState.focusIndex&&t[e.focusIndex]&&t[e.focusIndex].scrollIntoView({behavior:"smooth",block:"start"});let i=this.previousState.items.filter(e=>!e.open).length,n=e.items.filter(e=>!e.open).length;i!==n&&n===e.items.length&&this.dispatchEvent(new CustomEvent("ALL_ITEMS_CLOSED")),e.form.fullscreen&&(!this.previousState.fullscreenEnabled&&e.fullscreenEnabled?this.enableFullscreen():this.previousState.fullscreenEnabled&&!e.fullscreenEnabled&&this.disableFullscreen()),this.previousState=Object.assign({},e),this.complete||this.fireHook("on-change")}fireHook(hook,event){if(this.locked)return;if(!this.getAttribute(hook))return;let state=this.store.getState(),inputsArray=[];state.items.forEach(e=>inputsArray=[...inputsArray,...e.inputs]);let inputsKeyedByName={};inputsArray.forEach(e=>inputsKeyedByName[e.name]=e);let inputs=inputsKeyedByName,items={};state.items.forEach(e=>items[e.name]=e);let inputEls=this.shadowRoot.querySelectorAll("[name]"),tangyFormStore=this.store,itemEnable=e=>this.itemEnable(e),itemDisable=e=>this.itemDisable(e),sectionEnable=e=>this.itemEnable(e),sectionDisable=e=>this.itemDisable(e),helpers=new _tangy_form_item_callback_helpers_js__WEBPACK_IMPORTED_MODULE_7__.a(this),getValue=e=>this.getValue(e),inputHide=e=>helpers.inputHide(e),inputShow=e=>helpers.inputShow(e),inputDisable=e=>helpers.inputDisable(e),inputEnable=e=>helpers.inputEnable(e),itemsPerMinute=e=>helpers.itemsPerMinute(e),numberOfItemsAttempted=e=>helpers.numberOfItemsAttempted(e),numberOfCorrectItems=e=>helpers.numberOfCorrectItems(e),numberOfIncorrectItems=e=>helpers.numberOfIncorrectItems(e),gridAutoStopped=e=>helpers.gridAutoStopped(e),itemInputs=[...this.shadowRoot.querySelectorAll("[name]")].reduce((e,t)=>Object.assign({},e,{[t.name]:t}),{});try{eval(this.getAttribute(hook))}catch(e){this.errorMessage(`${Object(_util_t_js__WEBPACK_IMPORTED_MODULE_4__.a)("Error detected in the form's logic:")} ${hook}`)}}errorMessage(e){if(!this.hasAttribute("error-logging"))return;const t=document.createElement("div");t.innerHTML=e,t.classList.add("error"),this.shadowRoot.querySelector("#errors").appendChild(t),this.style.background="red",setTimeout(()=>{this.style.background="transparent"},400)}focusOnPreviousItem(e){let t=this.store.getState().items.find(e=>e.open);this.store.dispatch({type:"ITEM_BACK",itemId:t.id})}focusOnNextItem(e){let t=this.store.getState().items.find(e=>e.open);this.store.dispatch({type:"ITEM_NEXT",itemId:t.id})}disableFullscreen(){document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen(),this.removeEventListener("click",this.enableFullscreen,!0)}enableFullscreen(){this.requestFullscreen?this.requestFullscreen():this.mozRequestFullScreen?this.mozRequestFullScreen():this.webkitRequestFullscreen?this.webkitRequestFullscreen():this.msRequestFullscreen&&this.msRequestFullscreen()}}window.customElements.define(TangyForm.is,TangyForm)},function(module,__webpack_exports__,__webpack_require__){"use strict";var _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_util_t_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(11),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__),_polymer_paper_card_paper_card_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(59),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_4__),_tangy_form_item_callback_helpers_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(47);class TangyFormItem extends _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.a{static get is(){return"tangy-form-item"}connectedCallback(){this.querySelector("template")?this.template=this.querySelector("template").innerHTML:this.template=this.innerHTML,this.innerHTML="",super.connectedCallback(),this.t={open:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("open"),close:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("close"),save:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("save"),submit:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("submit")}}static get template(){return _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.b` + `}onClickSummaryTab(){this.store.dispatch({type:"SHOW_SUMMARY"}),setTimeout(()=>{this.querySelector("[summary]").scrollIntoView({behavior:"smooth",block:"start"})},200)}onClickResponseTab(){this.store.dispatch({type:"SHOW_RESPONSE"}),this.querySelectorAll("tangy-form-item")[0].scrollIntoView({behavior:"smooth",block:"center"})}static get is(){return"tangy-form"}static get properties(){return{fullscreen:{type:Boolean,value:!1},title:{type:String,value:""},complete:{type:Boolean,value:!1,reflectToAttribute:!0},linearMode:{type:Boolean,value:!1,reflectToAttribute:!0},hideClosedItems:{type:Boolean,value:!1,reflectToAttribute:!0},hideCompleteFab:{type:Boolean,value:!1,reflectToAttribute:!0},tabIndex:{type:Number,value:0,reflectToAttribute:!0},showResponse:{type:Boolean,value:!1,reflectToAttribute:!0},showSummary:{type:Boolean,value:!1,reflectToAttribute:!0},hasSummary:{type:Boolean,value:!1,reflectToAttribute:!0},fullScreenGranted:{type:Boolean,value:!1},exitClicks:{type:Number,value:void 0,reflectToAttribute:!0}}}constructor(){super(),this.t={summary:"summary",response:"response"},this._responseHasBeenSet=!1,this.store=Redux.createStore(_tangy_form_reducer_js__WEBPACK_IMPORTED_MODULE_5__.a,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}ready(){super.ready(),this.fullscreen&&this.addEventListener("click",this.enableFullscreen,!0),this.hasLazyItems=!1,this.querySelectorAll("tangy-form-item").forEach(e=>{e.getAttribute("src")&&(this.hasLazyItems=!0),e.store=this.store,this.linearMode&&(e.noButtons=!0),e.addEventListener("change",this.onItemChange.bind(this)),e.addEventListener("ITEM_NEXT",this.onItemNext.bind(this)),e.addEventListener("ITEM_BACK",this.onItemBack.bind(this)),e.addEventListener("ITEM_CLOSED",this.onItemClosed.bind(this)),e.addEventListener("ITEM_OPENED",this.onItemOpened.bind(this)),e.addEventListener("FORM_RESPONSE_COMPLETE",this.onFormResponseComplete.bind(this)),e.addEventListener("FORM_RESPONSE_NO_CONSENT",this.onFormResponseNoConsent.bind(this)),e.addEventListener("logic-error",this.onItemError.bind(this))}),this.hasLazyItems?this.unsubscribe=this.store.subscribe(this.throttledReflect.bind(this)):this.unsubscribe=this.store.subscribe(this.reflect.bind(this)),this.store.subscribe(e=>{this.dispatchEvent(new CustomEvent("TANGY_FORM_UPDATE"))}),this.hasAttribute("on-submit")&&this.addEventListener("submit",e=>{this.fireHook("on-submit")}),Object(_polymer_polymer_lib_utils_render_status_js__WEBPACK_IMPORTED_MODULE_1__.a)(this,function(){!1===this._responseHasBeenSet&&this.newResponse()}),this.addEventListener("enter-fullscreen",()=>{this.store.dispatch({type:"ENTER_FULLSCREEN"})}),this.addEventListener("exit-fullscreen",()=>{this.store.dispatch({type:"EXIT_FULLSCREEN"})})}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}onFormResponseComplete(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),this.dispatchEvent(new CustomEvent("submit",{cancelable:!0}))&&(this.store.dispatch({type:"FORM_RESPONSE_COMPLETE"}),!this.dispatchEvent(new CustomEvent("tangy-form-complete",{cancelable:!0}))||(this.hasSummary?this.store.dispatch({type:"SHOW_SUMMARY"}):this.store.dispatch({type:"SHOW_RESPONSE"})))}onFormResponseNoConsent(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),!this.dispatchEvent(new CustomEvent("submit",{cancelable:!0}))||(this.store.dispatch({type:"FORM_RESPONSE_COMPLETE"}),this.hasSummary?this.store.dispatch({type:"SHOW_SUMMARY"}):this.store.dispatch({type:"SHOW_RESPONSE"}))}onItemChange(e){this.store.dispatch({type:"ITEM_CHANGE",itemId:e.target.id}),this.fireHook("on-change")}onItemNext(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),this.focusOnNextItem(),this.fireHook("on-change")}onItemBack(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()}),this.focusOnPreviousItem(),this.fireHook("on-change")}onItemOpened(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()})}onItemClosed(e){this.store.dispatch({type:"ITEM_SAVE",item:e.target.getProps()})}onItemError(e){this.errorMessage(e.detail)}throttledReflect(e=!1){this.reflectQueued&&!e||(this.reflectRunning?(this.reflectQueued=!0,setTimeout(()=>this.throttledReflect(!0),200)):(this.reflectRunning=!0,this.reflect(),this.reflectRunning=!1,e&&(this.reflectQueued=!1)))}reflect(){let e=this.store.getState();this.previousState||(this.previousState=e),this.setProps(e.form),e.form&&e.form.complete;let t=[].slice.call(this.querySelectorAll("tangy-form-item"));t.forEach(t=>{let i=e.items.findIndex(e=>t.id==e.id);-1!==i&&t.setProps(e.items[i])}),e.focusIndex!==this.previousState.focusIndex&&t[e.focusIndex]&&t[e.focusIndex].scrollIntoView({behavior:"smooth",block:"start"});let i=this.previousState.items.filter(e=>!e.open).length,n=e.items.filter(e=>!e.open).length;i!==n&&n===e.items.length&&this.dispatchEvent(new CustomEvent("ALL_ITEMS_CLOSED")),e.form&&e.form.fullscreen&&(!this.previousState.fullscreenEnabled&&e.fullscreenEnabled?this.enableFullscreen():this.previousState.fullscreenEnabled&&!e.fullscreenEnabled&&this.disableFullscreen()),this.previousState=Object.assign({},e),this.complete||this.fireHook("on-change")}fireHook(hook,event){if(this.locked)return;if(!this.getAttribute(hook))return;let state=this.store.getState(),inputsArray=[];state.items.forEach(e=>inputsArray=[...inputsArray,...e.inputs]);let inputsKeyedByName={};inputsArray.forEach(e=>inputsKeyedByName[e.name]=e);let inputs=inputsKeyedByName,items={};state.items.forEach(e=>items[e.name]=e);let inputEls=this.shadowRoot.querySelectorAll("[name]"),tangyFormStore=this.store,itemEnable=e=>this.itemEnable(e),itemDisable=e=>this.itemDisable(e),sectionEnable=e=>this.itemEnable(e),sectionDisable=e=>this.itemDisable(e),helpers=new _tangy_form_item_callback_helpers_js__WEBPACK_IMPORTED_MODULE_7__.a(this),getValue=e=>this.getValue(e),inputHide=e=>helpers.inputHide(e),inputShow=e=>helpers.inputShow(e),inputDisable=e=>helpers.inputDisable(e),inputEnable=e=>helpers.inputEnable(e),itemsPerMinute=e=>helpers.itemsPerMinute(e),numberOfItemsAttempted=e=>helpers.numberOfItemsAttempted(e),numberOfCorrectItems=e=>helpers.numberOfCorrectItems(e),numberOfIncorrectItems=e=>helpers.numberOfIncorrectItems(e),gridAutoStopped=e=>helpers.gridAutoStopped(e),itemInputs=[...this.shadowRoot.querySelectorAll("[name]")].reduce((e,t)=>Object.assign({},e,{[t.name]:t}),{});try{eval(this.getAttribute(hook))}catch(e){this.errorMessage(`${Object(_util_t_js__WEBPACK_IMPORTED_MODULE_4__.a)("Error detected in the form's logic:")} ${hook}`)}}errorMessage(e){if(!this.hasAttribute("error-logging"))return;const t=document.createElement("div");t.innerHTML=e,t.classList.add("error"),this.shadowRoot.querySelector("#errors").appendChild(t),this.style.background="red",setTimeout(()=>{this.style.background="transparent"},400)}focusOnPreviousItem(e){let t=this.store.getState().items.find(e=>e.open);this.store.dispatch({type:"ITEM_BACK",itemId:t.id})}focusOnNextItem(e){let t=this.store.getState().items.find(e=>e.open);this.store.dispatch({type:"ITEM_NEXT",itemId:t.id})}disableFullscreen(){document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen(),this.removeEventListener("click",this.enableFullscreen,!0)}enableFullscreen(){this.requestFullscreen?this.requestFullscreen().then(e=>{this.fullScreenGranted=!0}).catch(e=>{console.log(`Error attempting to enable full-screen mode: ${e.message} (${e.name})`),this.fullScreenGranted=!1,this.dispatchEvent(new CustomEvent("fullscreen-rejected"))}):this.mozRequestFullScreen?this.mozRequestFullScreen():this.webkitRequestFullscreen?this.webkitRequestFullscreen():this.msRequestFullscreen&&this.msRequestFullscreen()}}window.customElements.define(TangyForm.is,TangyForm)},function(module,__webpack_exports__,__webpack_require__){"use strict";var _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),_util_t_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(1),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(11),_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_util_html_element_props_js__WEBPACK_IMPORTED_MODULE_2__),_polymer_paper_card_paper_card_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(59),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(8),_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_style_tangy_common_styles_js__WEBPACK_IMPORTED_MODULE_4__),_tangy_form_item_callback_helpers_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(47);class TangyFormItem extends _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.a{static get is(){return"tangy-form-item"}connectedCallback(){this.querySelector("template")?this.template=this.querySelector("template").innerHTML:this.template=this.innerHTML,this.innerHTML="",super.connectedCallback(),this.t={open:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("open"),close:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("close"),save:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("save"),submit:Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("submit")}}static get template(){return _polymer_polymer_polymer_element_js__WEBPACK_IMPORTED_MODULE_0__.b`
-`}static get properties(){return{name:{type:String,value:"location"},hintText:{type:String,value:""},value:{type:Array,value:[],observer:"render"},required:{type:Boolean,value:!1,observer:"render"},invalid:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"render"},showMetaData:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"render"},locationSrc:{type:String,value:"./assets/location-list.json",observer:"render"},showLevels:{type:String,value:"",observer:"render"},hidden:{type:Boolean,reflectToAttribute:!0,value:!1},disabled:{type:Boolean,value:!1,observer:"render"},filterBy:{type:String,value:"",observer:"render"},filterByGlobal:{type:Boolean,value:!1,observer:"render"}}}get locationList(){return this._locationList&&this.filterBy&&this.filterBy.length>0?_util_loc_js__WEBPACK_IMPORTED_MODULE_2__.a.filterById(this._locationList,this.filterBy.split(",")):this._locationList?this._locationList:void 0}set locationList(e){this._locationList=e,this._flatLocationList=_util_loc_js__WEBPACK_IMPORTED_MODULE_2__.a.flatten(e)}async connectedCallback(){super.connectedCallback(),this._template=this.innerHTML,this.filterByGlobal&&(this.filterBy=window.tangyLocationFilterBy),this.shadowRoot.addEventListener("change",this.onSelectionChange.bind(this));let e=this;const t=new XMLHttpRequest;t.onreadystatechange=function(){try{e.locationList=JSON.parse(this.responseText),e.render(),e.locationListLoaded=!0,e.dispatchEvent(new CustomEvent("location-list-loaded"))}catch(e){}},t.open("GET",this.locationSrc),t.send()}render(){if(!this.locationList)return this.$.container.innerHTML=Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("loading");this.$["hint-text"].innerHTML=this.hintText;let levels=[];""!==this.showLevels?this.showLevels.split(",").forEach(e=>levels.push(e)):this.locationList.locationsLevels.forEach(e=>levels.push(e));let selections=[...this.value];0===selections.length&&levels.forEach(e=>{selections=[...selections,{level:e,value:""}]});let options=this.calculateLevelOptions(selections,levels);this.$.container.innerHTML=`\n\n ${selections.map((selection,i)=>`\n \n
\n \n
\n \n
\n ${this.showMetaData&&selection.value?`\n
\n ${[this._flatLocationList.locations.find(e=>e.id===selection.value)].map(node=>this._template?eval(`\`${this._template}\``):Object.keys(node).map(e=>"parent"!==e&&"children"!==e?`${e}: ${node[e]}
`:"").join("")).join("")}\n
\n `:""}\n
\n
\n\n `).join("")}\n `}calculateLevelOptions(e,t){let i={},n={},r="",a=e.find(e=>""===e.value);return r=a?a.level:"",e.forEach((t,i)=>{if(""===t.value&&t.level!==r)return;let a=e.slice(0,i),o=a.map(e=>e.level),s={};a.forEach(e=>s[e.level]=e.value),n[t.level]={levels:o,criteria:s}}),e.forEach(e=>{if(n[e.level]){let r=n[e.level];_util_loc_js__WEBPACK_IMPORTED_MODULE_2__.a.query(t,r.criteria,this.locationList,t=>{i[e.level]=t})}else i[e.level]=[]}),i}onSelectionChange(e){let t=this.showLevels.split(","),i=[...this.value];0===i.length&&t.forEach(e=>{i=[...i,{level:e,value:""}]});let n=i.map(i=>i.level===e.target.name?{level:e.target.name,value:e.target.value}:t.indexOf(i.level)>t.indexOf(e.target.name)?{level:i.level,value:""}:i),r=!1;n.find(e=>""===e.value),this.value=n,this.dispatchEvent(new Event("change"))}validate(){if(this.required&&!this.locationListLoaded)return!1;let e=!1;return this.shadowRoot.querySelectorAll("select").forEach(t=>{t.value||(e=!0)}),this.required&&(!this.required||this.disabled||this.hidden||e)?(this.invalid=!0,!1):(this.invalid=!1,!0)}getSelectedLocation(){let e=!1;if(this.shadowRoot.querySelectorAll("select").forEach(t=>{t.value||(e=!0)}),e)return!1;let t=[...this.value],i=this.locationList.locations[t.shift().value];return t.forEach(e=>i=i.children[e.value]),i}}window.customElements.define(TangyLocation.is,TangyLocation)},function(e,t,i){(function(e,i){var n;!function(){var r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},a=r._,o=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=o.push,d=o.slice,h=s.toString,p=s.hasOwnProperty,u=Array.isArray,m=Object.keys,v=Object.create,f=function(){},g=function(e){return e instanceof g?e:this instanceof g?void(this._wrapped=e):new g(e)};t.nodeType?r._=g:(!i.nodeType&&i.exports&&(t=i.exports=g),t._=g),g.VERSION="1.9.1";var b,_=function(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 3:return function(i,n,r){return e.call(t,i,n,r)};case 4:return function(i,n,r,a){return e.call(t,i,n,r,a)}}return function(){return e.apply(t,arguments)}},y=function(e,t,i){return g.iteratee!==b?g.iteratee(e,t):null==e?g.identity:g.isFunction(e)?_(e,t,i):g.isObject(e)&&!g.isArray(e)?g.matcher(e):g.property(e)};g.iteratee=b=function(e,t){return y(e,t,1/0)};var z=function(e,t){return t=null==t?e.length-1:+t,function(){for(var i=Math.max(arguments.length-t,0),n=Array(i),r=0;r=0&&t<=M};g.each=g.forEach=function(e,t,i){var n,r;if(t=_(t,i),S(e))for(n=0,r=e.length;n0?0:o-1;for(r||(n=t[a?a[s]:s],s+=e);s>=0&&s=3;return t(e,_(i,r,4),n,a)}};g.reduce=g.foldl=g.inject=H(1),g.reduceRight=g.foldr=H(-1),g.find=g.detect=function(e,t,i){var n=(S(e)?g.findIndex:g.findKey)(e,t,i);if(void 0!==n&&-1!==n)return e[n]},g.filter=g.select=function(e,t,i){var n=[];return t=y(t,i),g.each(e,function(e,i,r){t(e,i,r)&&n.push(e)}),n},g.reject=function(e,t,i){return g.filter(e,g.negate(y(t)),i)},g.every=g.all=function(e,t,i){t=y(t,i);for(var n=!S(e)&&g.keys(e),r=(n||e).length,a=0;a=0},g.invoke=z(function(e,t,i){var n,r;return g.isFunction(t)?r=t:g.isArray(t)&&(n=t.slice(0,-1),t=t[t.length-1]),g.map(e,function(e){var a=r;if(!a){if(n&&n.length&&(e=x(e,n)),null==e)return;a=e[t]}return null==a?a:a.apply(e,i)})}),g.pluck=function(e,t){return g.map(e,g.property(t))},g.where=function(e,t){return g.filter(e,g.matcher(t))},g.findWhere=function(e,t){return g.find(e,g.matcher(t))},g.max=function(e,t,i){var n,r,a=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=S(e)?e:g.values(e)).length;sa&&(a=n);else t=y(t,i),g.each(e,function(e,i,n){((r=t(e,i,n))>o||r===-1/0&&a===-1/0)&&(a=e,o=r)});return a},g.min=function(e,t,i){var n,r,a=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=S(e)?e:g.values(e)).length;sn||void 0===i)return 1;if(i0?0:r-1;a>=0&&a0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(i&&a&&s)return n[a=i(n,r)]===r?a:-1;if(r!=r)return(a=t(d.call(n,o,s),g.isNaN))>=0?a+o:-1;for(a=e>0?o:s-1;a>=0&&at?(n&&(clearTimeout(n),n=null),s=c,o=e.apply(r,a),n||(r=a=null)):n||!1===i.trailing||(n=setTimeout(l,d)),o};return c.cancel=function(){clearTimeout(n),s=0,n=r=a=null},c},g.debounce=function(e,t,i){var n,r,a=function(t,i){n=null,i&&(r=e.apply(t,i))},o=z(function(o){if(n&&clearTimeout(n),i){var s=!n;n=setTimeout(a,t),s&&(r=e.apply(this,o))}else n=g.delay(a,t,this,o);return r});return o.cancel=function(){clearTimeout(n),n=null},o},g.wrap=function(e,t){return g.partial(t,e)},g.negate=function(e){return function(){return!e.apply(this,arguments)}},g.compose=function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},g.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},g.before=function(e,t){var i;return function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=null),i}},g.once=g.partial(g.before,2),g.restArguments=z;var T=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],D=function(e,t){var i=I.length,n=e.constructor,r=g.isFunction(n)&&n.prototype||s,a="constructor";for(C(e,a)&&!g.contains(t,a)&&t.push(a);i--;)(a=I[i])in e&&e[a]!==r[a]&&!g.contains(t,a)&&t.push(a)};g.keys=function(e){if(!g.isObject(e))return[];if(m)return m(e);var t=[];for(var i in e)C(e,i)&&t.push(i);return T&&D(e,t),t},g.allKeys=function(e){if(!g.isObject(e))return[];var t=[];for(var i in e)t.push(i);return T&&D(e,t),t},g.values=function(e){for(var t=g.keys(e),i=t.length,n=Array(i),r=0;r1&&(n=_(n,t[1])),t=g.allKeys(e)):(n=F,t=P(t,!1,!1),e=Object(e));for(var r=0,a=t.length;r1&&(i=t[1])):(t=g.map(P(t,!1,!1),String),n=function(e,i){return!g.contains(t,i)}),g.pick(e,n,i)}),g.defaults=R(g.allKeys,!0),g.create=function(e,t){var i=w(e);return t&&g.extendOwn(i,t),i},g.clone=function(e){return g.isObject(e)?g.isArray(e)?e.slice():g.extend({},e):e},g.tap=function(e,t){return t(e),e},g.isMatch=function(e,t){var i=g.keys(t),n=i.length;if(null==e)return!n;for(var r=Object(e),a=0;a":">",'"':""","'":"'","`":"`"},U=g.invert(q),K=function(e){var t=function(t){return e[t]},i="(?:"+g.keys(e).join("|")+")",n=RegExp(i),r=RegExp(i,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(r,t):e}};g.escape=K(q),g.unescape=K(U),g.result=function(e,t,i){g.isArray(t)||(t=[t]);var n=t.length;if(!n)return g.isFunction(i)?i.call(e):i;for(var r=0;r/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var W=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},X=/\\|'|\r|\n|\u2028|\u2029/g,J=function(e){return"\\"+G[e]};g.template=function(e,t,i){!t&&i&&(t=i),t=g.defaults({},t,g.templateSettings);var n,r=RegExp([(t.escape||W).source,(t.interpolate||W).source,(t.evaluate||W).source].join("|")+"|$","g"),a=0,o="__p+='";e.replace(r,function(t,i,n,r,s){return o+=e.slice(a,s).replace(X,J),a=s+t.length,i?o+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":r&&(o+="';\n"+r+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return n.call(this,e,g)},l=t.variable||"obj";return s.source="function("+l+"){\n"+o+"}",s},g.chain=function(e){var t=g(e);return t._chain=!0,t};var Z=function(e,t){return e._chain?g(t).chain():t};g.mixin=function(e){return g.each(g.functions(e),function(t){var i=g[t]=e[t];g.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),Z(this,i.apply(g,e))}}),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];g.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0],Z(this,i)}}),g.each(["concat","join","slice"],function(e){var t=o[e];g.prototype[e]=function(){return Z(this,t.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(n=function(){return g}.apply(t,[]))||(i.exports=n)}()}).call(this,i(84),i(85)(e))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,i){"use strict";(function(e){var t,n,r=i(0),a=(i(58),i(54),i(8),i(13),i(18),i(70),i(1));window.customElements.define("tangy-qr",class extends r.a{static get template(){return r.b` +`}static get properties(){return{name:{type:String,value:"location"},hintText:{type:String,value:""},value:{type:Array,value:[],observer:"render"},required:{type:Boolean,value:!1,observer:"render"},invalid:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"render"},showMetaData:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"render"},locationSrc:{type:String,value:"./assets/location-list.json",observer:"render"},showLevels:{type:String,value:"",observer:"render"},hidden:{type:Boolean,reflectToAttribute:!0,value:!1},disabled:{type:Boolean,value:!1,observer:"render"},filterBy:{type:String,value:"",observer:"render"},filterByGlobal:{type:Boolean,value:!1,observer:"render"}}}get locationList(){return this._locationList&&this.filterBy&&this.filterBy.length>0?_util_loc_js__WEBPACK_IMPORTED_MODULE_2__.a.filterById(this._locationList,this.filterBy.split(",")):this._locationList?this._locationList:void 0}set locationList(e){this._locationList=e,this._flatLocationList=_util_loc_js__WEBPACK_IMPORTED_MODULE_2__.a.flatten(e)}async connectedCallback(){super.connectedCallback(),this._template=this.innerHTML,this.filterByGlobal&&(this.filterBy=window.tangyLocationFilterBy),this.shadowRoot.addEventListener("change",this.onSelectionChange.bind(this));let e=this;const t=new XMLHttpRequest;t.onreadystatechange=function(){try{e.locationList=JSON.parse(this.responseText),e.render(),e.locationListLoaded=!0,e.dispatchEvent(new CustomEvent("location-list-loaded"))}catch(e){}},t.open("GET",this.locationSrc),t.send()}render(){if(!this.locationList)return this.$.container.innerHTML=Object(_util_t_js__WEBPACK_IMPORTED_MODULE_1__.a)("loading");this.$["hint-text"].innerHTML=this.hintText;let levels=[];""!==this.showLevels?this.showLevels.split(",").forEach(e=>levels.push(e)):this.locationList.locationsLevels.forEach(e=>levels.push(e));let selections=[...this.value];0===selections.length&&levels.forEach(e=>{selections=[...selections,{level:e,value:""}]});let options=this.calculateLevelOptions(selections,levels);this.$.container.innerHTML=`\n\n ${selections.map((selection,i)=>`\n \n
\n \n
\n \n
\n ${this.showMetaData&&selection.value?`\n
\n ${[this._flatLocationList.locations.find(e=>e.id===selection.value)].map(node=>this._template?eval(`\`${this._template}\``):Object.keys(node).map(e=>"parent"!==e&&"children"!==e?`${e}: ${node[e]}
`:"").join("")).join("")}\n
\n `:""}\n
\n
\n\n `).join("")}\n `}calculateLevelOptions(e,t){let i={},n={},r="",a=e.find(e=>""===e.value);return r=a?a.level:"",e.forEach((t,i)=>{if(""===t.value&&t.level!==r)return;let a=e.slice(0,i),o=a.map(e=>e.level),s={};a.forEach(e=>s[e.level]=e.value),n[t.level]={levels:o,criteria:s}}),e.forEach(e=>{if(n[e.level]){let r=n[e.level];_util_loc_js__WEBPACK_IMPORTED_MODULE_2__.a.query(t,r.criteria,this.locationList,t=>{i[e.level]=t})}else i[e.level]=[]}),i}onSelectionChange(e){let t=this.showLevels.split(","),i=[...this.value];0===i.length&&t.forEach(e=>{i=[...i,{level:e,value:""}]});let n=i.map(i=>i.level===e.target.name?{level:e.target.name,value:e.target.value}:t.indexOf(i.level)>t.indexOf(e.target.name)?{level:i.level,value:""}:i),r=!1;n.find(e=>""===e.value),this.value=n,this.dispatchEvent(new Event("change"))}validate(){if(this.required&&!this.locationListLoaded)return!1;let e=!1;return this.shadowRoot.querySelectorAll("select").forEach(t=>{t.value||(e=!0)}),this.required&&(!this.required||this.disabled||this.hidden||e)?(this.invalid=!0,!1):(this.invalid=!1,!0)}getSelectedLocation(){let e=!1;if(this.shadowRoot.querySelectorAll("select").forEach(t=>{t.value||(e=!0)}),e)return!1;let t=[...this.value],i=this.locationList.locations[t.shift().value];return t.forEach(e=>i=i.children[e.value]),i}}window.customElements.define(TangyLocation.is,TangyLocation)},function(e,t,i){(function(e,i){var n;!function(){var r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||this||{},a=r._,o=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=o.push,d=o.slice,h=s.toString,p=s.hasOwnProperty,u=Array.isArray,m=Object.keys,v=Object.create,f=function(){},g=function(e){return e instanceof g?e:this instanceof g?void(this._wrapped=e):new g(e)};t.nodeType?r._=g:(!i.nodeType&&i.exports&&(t=i.exports=g),t._=g),g.VERSION="1.9.1";var b,_=function(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 3:return function(i,n,r){return e.call(t,i,n,r)};case 4:return function(i,n,r,a){return e.call(t,i,n,r,a)}}return function(){return e.apply(t,arguments)}},y=function(e,t,i){return g.iteratee!==b?g.iteratee(e,t):null==e?g.identity:g.isFunction(e)?_(e,t,i):g.isObject(e)&&!g.isArray(e)?g.matcher(e):g.property(e)};g.iteratee=b=function(e,t){return y(e,t,1/0)};var z=function(e,t){return t=null==t?e.length-1:+t,function(){for(var i=Math.max(arguments.length-t,0),n=Array(i),r=0;r=0&&t<=M};g.each=g.forEach=function(e,t,i){var n,r;if(t=_(t,i),S(e))for(n=0,r=e.length;n0?0:o-1;for(r||(n=t[a?a[s]:s],s+=e);s>=0&&s=3;return t(e,_(i,r,4),n,a)}};g.reduce=g.foldl=g.inject=H(1),g.reduceRight=g.foldr=H(-1),g.find=g.detect=function(e,t,i){var n=(S(e)?g.findIndex:g.findKey)(e,t,i);if(void 0!==n&&-1!==n)return e[n]},g.filter=g.select=function(e,t,i){var n=[];return t=y(t,i),g.each(e,function(e,i,r){t(e,i,r)&&n.push(e)}),n},g.reject=function(e,t,i){return g.filter(e,g.negate(y(t)),i)},g.every=g.all=function(e,t,i){t=y(t,i);for(var n=!S(e)&&g.keys(e),r=(n||e).length,a=0;a=0},g.invoke=z(function(e,t,i){var n,r;return g.isFunction(t)?r=t:g.isArray(t)&&(n=t.slice(0,-1),t=t[t.length-1]),g.map(e,function(e){var a=r;if(!a){if(n&&n.length&&(e=x(e,n)),null==e)return;a=e[t]}return null==a?a:a.apply(e,i)})}),g.pluck=function(e,t){return g.map(e,g.property(t))},g.where=function(e,t){return g.filter(e,g.matcher(t))},g.findWhere=function(e,t){return g.find(e,g.matcher(t))},g.max=function(e,t,i){var n,r,a=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=S(e)?e:g.values(e)).length;sa&&(a=n);else t=y(t,i),g.each(e,function(e,i,n){((r=t(e,i,n))>o||r===-1/0&&a===-1/0)&&(a=e,o=r)});return a},g.min=function(e,t,i){var n,r,a=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=S(e)?e:g.values(e)).length;sn||void 0===i)return 1;if(i0?0:r-1;a>=0&&a0?o=a>=0?a:Math.max(a+s,o):s=a>=0?Math.min(a+1,s):a+s+1;else if(i&&a&&s)return n[a=i(n,r)]===r?a:-1;if(r!=r)return(a=t(d.call(n,o,s),g.isNaN))>=0?a+o:-1;for(a=e>0?o:s-1;a>=0&&at?(n&&(clearTimeout(n),n=null),s=c,o=e.apply(r,a),n||(r=a=null)):n||!1===i.trailing||(n=setTimeout(l,d)),o};return c.cancel=function(){clearTimeout(n),s=0,n=r=a=null},c},g.debounce=function(e,t,i){var n,r,a=function(t,i){n=null,i&&(r=e.apply(t,i))},o=z(function(o){if(n&&clearTimeout(n),i){var s=!n;n=setTimeout(a,t),s&&(r=e.apply(this,o))}else n=g.delay(a,t,this,o);return r});return o.cancel=function(){clearTimeout(n),n=null},o},g.wrap=function(e,t){return g.partial(t,e)},g.negate=function(e){return function(){return!e.apply(this,arguments)}},g.compose=function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},g.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},g.before=function(e,t){var i;return function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=null),i}},g.once=g.partial(g.before,2),g.restArguments=z;var O=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],D=function(e,t){var i=I.length,n=e.constructor,r=g.isFunction(n)&&n.prototype||s,a="constructor";for(C(e,a)&&!g.contains(t,a)&&t.push(a);i--;)(a=I[i])in e&&e[a]!==r[a]&&!g.contains(t,a)&&t.push(a)};g.keys=function(e){if(!g.isObject(e))return[];if(m)return m(e);var t=[];for(var i in e)C(e,i)&&t.push(i);return O&&D(e,t),t},g.allKeys=function(e){if(!g.isObject(e))return[];var t=[];for(var i in e)t.push(i);return O&&D(e,t),t},g.values=function(e){for(var t=g.keys(e),i=t.length,n=Array(i),r=0;r1&&(n=_(n,t[1])),t=g.allKeys(e)):(n=F,t=P(t,!1,!1),e=Object(e));for(var r=0,a=t.length;r1&&(i=t[1])):(t=g.map(P(t,!1,!1),String),n=function(e,i){return!g.contains(t,i)}),g.pick(e,n,i)}),g.defaults=R(g.allKeys,!0),g.create=function(e,t){var i=w(e);return t&&g.extendOwn(i,t),i},g.clone=function(e){return g.isObject(e)?g.isArray(e)?e.slice():g.extend({},e):e},g.tap=function(e,t){return t(e),e},g.isMatch=function(e,t){var i=g.keys(t),n=i.length;if(null==e)return!n;for(var r=Object(e),a=0;a":">",'"':""","'":"'","`":"`"},U=g.invert(q),K=function(e){var t=function(t){return e[t]},i="(?:"+g.keys(e).join("|")+")",n=RegExp(i),r=RegExp(i,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(r,t):e}};g.escape=K(q),g.unescape=K(U),g.result=function(e,t,i){g.isArray(t)||(t=[t]);var n=t.length;if(!n)return g.isFunction(i)?i.call(e):i;for(var r=0;r/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var W=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},X=/\\|'|\r|\n|\u2028|\u2029/g,J=function(e){return"\\"+G[e]};g.template=function(e,t,i){!t&&i&&(t=i),t=g.defaults({},t,g.templateSettings);var n,r=RegExp([(t.escape||W).source,(t.interpolate||W).source,(t.evaluate||W).source].join("|")+"|$","g"),a=0,o="__p+='";e.replace(r,function(t,i,n,r,s){return o+=e.slice(a,s).replace(X,J),a=s+t.length,i?o+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":r&&(o+="';\n"+r+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return n.call(this,e,g)},l=t.variable||"obj";return s.source="function("+l+"){\n"+o+"}",s},g.chain=function(e){var t=g(e);return t._chain=!0,t};var Z=function(e,t){return e._chain?g(t).chain():t};g.mixin=function(e){return g.each(g.functions(e),function(t){var i=g[t]=e[t];g.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),Z(this,i.apply(g,e))}}),g},g.mixin(g),g.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=o[e];g.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0],Z(this,i)}}),g.each(["concat","join","slice"],function(e){var t=o[e];g.prototype[e]=function(){return Z(this,t.apply(this._wrapped,arguments))}}),g.prototype.value=function(){return this._wrapped},g.prototype.valueOf=g.prototype.toJSON=g.prototype.value,g.prototype.toString=function(){return String(this._wrapped)},void 0===(n=function(){return g}.apply(t,[]))||(i.exports=n)}()}).call(this,i(84),i(85)(e))},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,i){"use strict";(function(e){var t,n,r=i(0),a=(i(58),i(54),i(8),i(13),i(18),i(70),i(1));window.customElements.define("tangy-qr",class extends r.a{static get template(){return r.b` @@ -5398,7 +5398,7 @@ const m=o.a`
- `}static get properties(){return{hideButtons:{type:Boolean,value:!1,reflectToAttribute:!0},hideHelpText:{type:Boolean,value:!1,reflectToAttribute:!0},name:{type:String,value:"",observer:"reflect",reflectToAttribute:!0},value:{type:Array,value:[],observer:"reflect",reflectToAttribute:!0},hintText:{type:String,value:""},required:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},disabled:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},label:{type:String,value:"",observer:"reflect",reflectToAttribute:!0},hidden:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},invalid:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},incomplete:{type:Boolean,value:!0,observer:"reflect",reflecttoattribute:!0},columns:{type:Number,value:0,observer:"render",reflectToAttribute:!0},noMargin:{type:Boolean,value:!1,observer:"reflect",reflecttoattribute:!0}}}connectedCallback(){super.connectedCallback(),this.render(),this.reflect()}reflect(){this.shadowRoot.querySelectorAll("tangy-radio-button").forEach(e=>{let t=this.value.find(t=>e.name==t.name);e.setProps(t),e.disabled=this.disabled,e.hidden=this.hidden})}render(){this.$.label.innerHTML=this.label,this.$["hint-text"].innerHTML=this.hintText,this.$.container.innerHTML="";let e=this.querySelectorAll("option"),t=0,i=document.createElement("table"),n=document.createElement("tr");for(let r of e){let a=document.createElement("tangy-radio-button");if(a.hideButton=!!this.hideButtons,a.name=r.value,a.innerHTML=r.innerHTML,this.columns>0){let r=document.createElement("td");r.style.width=`${Math.floor(1/this.columns*100)}%`,r.appendChild(a),(t+1)%this.columns==0?(n.appendChild(r),i.appendChild(n),n=document.createElement("tr")):n.appendChild(r),t+1===e.length&&this.$.container.appendChild(i),t++}else this.$.container.appendChild(a)}let r=[];this.shadowRoot.querySelectorAll("tangy-radio-button").forEach(e=>{e.addEventListener("change",this.onRadioButtonChange.bind(this)),r.push(e.getProps())}),(!this.value||"object"==typeof this.value&&this.value.length{e.name!==t.name&&"on"==t.value&&(e.value="")});let i=[];this.shadowRoot.querySelectorAll("tangy-radio-button").forEach(e=>i.push(e.getProps())),this.value=i,this.dispatchEvent(new CustomEvent("change"))}validate(){let e=!1;return this.shadowRoot.querySelectorAll("[name]").forEach(t=>{"on"===t.value&&(e=!0)}),!this.required||this.hidden||this.disabled||e?(this.invalid=!1,!0):(this.invalid=!0,!1)}}window.customElements.define(V.is,V);i(69);class O extends n.a{static get template(){return n.b` + `}static get properties(){return{hideButtons:{type:Boolean,value:!1,reflectToAttribute:!0},hideHelpText:{type:Boolean,value:!1,reflectToAttribute:!0},name:{type:String,value:"",observer:"reflect",reflectToAttribute:!0},value:{type:Array,value:[],observer:"reflect",reflectToAttribute:!0},hintText:{type:String,value:""},required:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},disabled:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},label:{type:String,value:"",observer:"reflect",reflectToAttribute:!0},hidden:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},invalid:{type:Boolean,value:!1,observer:"reflect",reflectToAttribute:!0},incomplete:{type:Boolean,value:!0,observer:"reflect",reflecttoattribute:!0},columns:{type:Number,value:0,observer:"render",reflectToAttribute:!0},noMargin:{type:Boolean,value:!1,observer:"reflect",reflecttoattribute:!0}}}connectedCallback(){super.connectedCallback(),this.render(),this.reflect()}reflect(){this.shadowRoot.querySelectorAll("tangy-radio-button").forEach(e=>{let t=this.value.find(t=>e.name==t.name);e.setProps(t),e.disabled=this.disabled,e.hidden=this.hidden})}render(){this.$.label.innerHTML=this.label,this.$["hint-text"].innerHTML=this.hintText,this.$.container.innerHTML="";let e=this.querySelectorAll("option"),t=0,i=document.createElement("table"),n=document.createElement("tr");for(let r of e){let a=document.createElement("tangy-radio-button");if(a.hideButton=!!this.hideButtons,a.name=r.value,a.innerHTML=r.innerHTML,this.columns>0){let r=document.createElement("td");r.style.width=`${Math.floor(1/this.columns*100)}%`,r.appendChild(a),(t+1)%this.columns==0?(n.appendChild(r),i.appendChild(n),n=document.createElement("tr")):n.appendChild(r),t+1===e.length&&this.$.container.appendChild(i),t++}else this.$.container.appendChild(a)}let r=[];this.shadowRoot.querySelectorAll("tangy-radio-button").forEach(e=>{e.addEventListener("change",this.onRadioButtonChange.bind(this)),r.push(e.getProps())}),(!this.value||"object"==typeof this.value&&this.value.length{e.name!==t.name&&"on"==t.value&&(e.value="")});let i=[];this.shadowRoot.querySelectorAll("tangy-radio-button").forEach(e=>i.push(e.getProps())),this.value=i,this.dispatchEvent(new CustomEvent("change"))}validate(){let e=!1;return this.shadowRoot.querySelectorAll("[name]").forEach(t=>{"on"===t.value&&(e=!0)}),!this.required||this.hidden||this.disabled||e?(this.invalid=!1,!0):(this.invalid=!0,!1)}}window.customElements.define(V.is,V);i(69);class T extends n.a{static get template(){return n.b` @@ -5408,7 +5408,7 @@ const m=o.a` }
- `}static get is(){return"tangy-select"}static get properties(){return{name:{type:String,value:""},value:{type:String,value:"",reflectToAttribute:!0},hintText:{type:String,value:"",reflectToAttribute:!0},required:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,value:"",reflectToAttribute:!0},optionSelectLabel:{type:String,value:Object(d.a)("----"),reflectToAttribute:!0},secondaryLabel:{type:String,value:"",reflectToAttribute:!0},hidden:{type:Boolean,value:!1},invalid:{type:Boolean,value:!1},incomplete:{type:Boolean,value:!0}}}connectedCallback(){super.connectedCallback(),new MutationObserver(this.render.bind(this)).observe(this,{attributes:!0,childList:!0,subtree:!0}),this.render()}render(){this.$.container.innerHTML="";let e=[];this.querySelectorAll("option").forEach(t=>e.push(t)),this.optionSelectLabel=""===this.secondaryLabel?this.optionSelectLabel:this.secondaryLabel,this.$.container.innerHTML=`\n \n \n
\n \n
\n
\n `,this._onChangeListener=this.shadowRoot.querySelector("select").addEventListener("change",this.onChange.bind(this)),this.dispatchEvent(new CustomEvent("render"))}onChange(e){this.value=e.target.value,this.dispatchEvent(new CustomEvent("change"))}validate(){return!this.required||this.hidden||this.disabled||this.value?(this.invalid=!1,this.shadowRoot.querySelector("select").classList.remove("mdc-error"),!0):(this.invalid=!0,this.shadowRoot.querySelector("select").classList.add("mdc-error"),!1)}}window.customElements.define(O.is,O);i(82);class T extends n.a{static get is(){return"tangy-gps"}constructor(){super(),this.t={searching:Object(d.a)("Searching"),latitude:Object(d.a)("Latitude"),longitude:Object(d.a)("Longitude"),accuracy:Object(d.a)("Accuracy"),accuracyLevel:Object(d.a)("Accuracy Level"),distanceFromReference:Object(d.a)("Distance from reference")}}static get template(){return n.b` + `}static get is(){return"tangy-select"}static get properties(){return{name:{type:String,value:""},value:{type:String,value:"",reflectToAttribute:!0},hintText:{type:String,value:"",reflectToAttribute:!0},required:{type:Boolean,value:!1},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,value:"",reflectToAttribute:!0},optionSelectLabel:{type:String,value:Object(d.a)("----"),reflectToAttribute:!0},secondaryLabel:{type:String,value:"",reflectToAttribute:!0},hidden:{type:Boolean,value:!1},invalid:{type:Boolean,value:!1},incomplete:{type:Boolean,value:!0}}}connectedCallback(){super.connectedCallback(),new MutationObserver(this.render.bind(this)).observe(this,{attributes:!0,childList:!0,subtree:!0}),this.render()}render(){this.$.container.innerHTML="";let e=[];this.querySelectorAll("option").forEach(t=>e.push(t)),this.optionSelectLabel=""===this.secondaryLabel?this.optionSelectLabel:this.secondaryLabel,this.$.container.innerHTML=`\n \n \n
\n \n
\n
\n `,this._onChangeListener=this.shadowRoot.querySelector("select").addEventListener("change",this.onChange.bind(this)),this.dispatchEvent(new CustomEvent("render"))}onChange(e){this.value=e.target.value,this.dispatchEvent(new CustomEvent("change"))}validate(){return!this.required||this.hidden||this.disabled||this.value?(this.invalid=!1,this.shadowRoot.querySelector("select").classList.remove("mdc-error"),!0):(this.invalid=!0,this.shadowRoot.querySelector("select").classList.add("mdc-error"),!1)}}window.customElements.define(T.is,T);i(82);class O extends n.a{static get is(){return"tangy-gps"}constructor(){super(),this.t={searching:Object(d.a)("Searching"),latitude:Object(d.a)("Latitude"),longitude:Object(d.a)("Longitude"),accuracy:Object(d.a)("Accuracy"),accuracyLevel:Object(d.a)("Accuracy Level"),distanceFromReference:Object(d.a)("Distance from reference")}}static get template(){return n.b` diff --git a/package.json b/package.json index 66337ce8..0670ddd8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tangy-form", "description": "A form element for lazy loaded multipage forms", - "version": "4.1.1", + "version": "4.2.0", "main": "tangy-form.js", "scripts": { "start": "polymer serve",