@wavemaker/app-runtime-wm-build 12.0.0-next.45752 → 12.0.0-rc.5849
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-runtime-wm-build/package.json +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-libs.js +3 -3
- app-runtime-wm-build/wmapp/scripts/wm-libs.min.js +3 -3
- app-runtime-wm-build/wmapp/scripts/wm-loader.js +1 -1
- app-runtime-wm-build/wmapp/scripts/wm-loader.min.js +1 -1
- app-runtime-wm-build/wmapp/styles/css/wm-style.css +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-libs.js +3 -3
- app-runtime-wm-build/wmmobile/scripts/wm-libs.min.js +3 -3
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.js +1 -1
- app-runtime-wm-build/wmmobile/scripts/wm-mobileloader.min.js +1 -1
- app-runtime-wm-build/wmmobile/styles/css/wm-style.css +1 -1
|
@@ -840,7 +840,7 @@ function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery",
|
|
|
840
840
|
* Released under the MIT license.
|
|
841
841
|
* https://jquery.org/license
|
|
842
842
|
*/
|
|
843
|
-
function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./draggable","./mouse","../version","../widget"],e):e(jQuery)}((function(e){"use strict";return e.widget("ui.droppable",{version:"1.13.3",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,t=this.options,n=t.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof n?n:function(e){return e.is(n)},this.proportions=function(){if(!arguments.length)return e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});e=arguments[0]},this._addToManager(t.scope),t.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,n){if("accept"===t)this.accept="function"==typeof n?n:function(e){return e.is(n)};else if("scope"===t){var r=e.ui.ddmanager.droppables[this.options.scope];this._splice(r),this._addToManager(n)}this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this._addActiveClass(),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this._removeActiveClass(),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return!(!r||(r.currentItem||r.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each((function(){var n=e(this).droppable("instance");if(n.options.greedy&&!n.options.disabled&&n.options.scope===r.options.scope&&n.accept.call(n.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(n,{offset:n.element.offset()}),n.options.tolerance,t))return i=!0,!1})),!i&&(!!this.accept.call(this.element[0],r.currentItem||r.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(r)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),e.ui.intersect=function(){function e(e,t,n){return e>=t&&e<t+n}return function(t,n,r,i){if(!n.offset)return!1;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,s=(t.positionAbs||t.position.absolute).top+t.margins.top,a=o+t.helperProportions.width,l=s+t.helperProportions.height,c=n.offset.left,u=n.offset.top,d=c+n.proportions().width,h=u+n.proportions().height;switch(r){case"fit":return c<=o&&a<=d&&u<=s&&l<=h;case"intersect":return c<o+t.helperProportions.width/2&&a-t.helperProportions.width/2<d&&u<s+t.helperProportions.height/2&&l-t.helperProportions.height/2<h;case"pointer":return e(i.pageY,u,n.proportions().height)&&e(i.pageX,c,n.proportions().width);case"touch":return(s>=u&&s<=h||l>=u&&l<=h||s<u&&l>h)&&(o>=c&&o<=d||a>=c&&a<=d||o<c&&a>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,n){var r,i,o=e.ui.ddmanager.droppables[t.options.scope]||[],s=n?n.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;r<o.length;r++)if(!(o[r].options.disabled||t&&!o[r].accept.call(o[r].element[0],t.currentItem||t.element))){for(i=0;i<a.length;i++)if(a[i]===o[r].element[0]){o[r].proportions().height=0;continue e}o[r].visible="none"!==o[r].element.css("display"),o[r].visible&&("mousedown"===s&&o[r]._activate.call(o[r],n),o[r].offset=o[r].element.offset(),o[r].proportions({width:o[r].element[0].offsetWidth,height:o[r].element[0].offsetHeight}))}},drop:function(t,n){var r=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),(function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,n)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n)))})),r},dragStart:function(t,n){t.element.parentsUntil("body").on("scroll.droppable",(function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}))},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],(function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,i,o,s=e.ui.intersect(t,this,this.options.tolerance,n),a=!s&&this.isover?"isout":s&&!this.isover?"isover":null;a&&(this.options.greedy&&(i=this.options.scope,(o=this.element.parents(":data(ui-droppable)").filter((function(){return e(this).droppable("instance").options.scope===i}))).length&&((r=e(o[0]).droppable("instance")).greedyChild="isover"===a)),r&&"isover"===a&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,n),r&&"isout"===a&&(r.isout=!1,r.isover=!0,r._over.call(r,n)))}}))},dragStop:function(t,n){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}},!1!==e.uiBackCompat&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),e.ui.droppable})),function(e,t,n,r){"use strict";function i(e,t,n){return setTimeout(c(e,n),t)}function o(e,t,n){return!!Array.isArray(e)&&(s(e,n[t],n),!0)}function s(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function a(t,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,i,r),t.apply(this,arguments)}}function l(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&re(r,n)}function c(e,t){return function(){return e.apply(t,arguments)}}function u(e,t){return typeof e==se?e.apply(t&&t[0]||r,t):e}function d(e,t){return e===r?t:e}function h(e,t,n){s(g(t),(function(t){e.addEventListener(t,n,!1)}))}function p(e,t,n){s(g(t),(function(t){e.removeEventListener(t,n,!1)}))}function f(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function g(e){return e.trim().split(/\s+/g)}function v(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function y(e){return Array.prototype.slice.call(e,0)}function b(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];v(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function _(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),s=0;s<ie.length;){if((i=(n=ie[s])?n+o:t)in e)return i;s++}return r}function w(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}function x(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){u(e.options.enable,[e])&&n.handler(t)},this.init()}function S(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=t&be&&r-i==0,s=t&(we|xe)&&r-i==0;n.isFirst=!!o,n.isFinal=!!s,o&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=E(t)),i>1&&!n.firstMultiple?n.firstMultiple=E(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,l=t.center=T(r);t.timeStamp=ce(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=A(a,l),t.distance=M(a,l),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==be&&o.eventType!==we||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=D(t.deltaX,t.deltaY);var c=C(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=c.x,t.overallVelocityY=c.y,t.overallVelocity=le(c.x)>le(c.y)?c.x:c.y,t.scale=s?function(e,t){return M(t[0],t[1],Le)/M(e[0],e[1],Le)}(s.pointers,r):1,t.rotation=s?function(e,t){return A(t[1],t[0],Le)+A(e[1],e[0],Le)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,k(n,t);var u=e.element;f(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function k(e,t){var n,i,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=xe&&(l>ye||a.velocity===r)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,d=C(l,c,u);i=d.x,o=d.y,n=le(d.x)>le(d.y)?d.x:d.y,s=D(c,u),e.lastInterval=t}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=s}function E(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:ae(e.pointers[n].clientX),clientY:ae(e.pointers[n].clientY)},n++;return{timeStamp:ce(),pointers:t,center:T(t),deltaX:e.deltaX,deltaY:e.deltaY}}function T(e){var t=e.length;if(1===t)return{x:ae(e[0].clientX),y:ae(e[0].clientY)};for(var n=0,r=0,i=0;t>i;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:ae(n/t),y:ae(r/t)}}function C(e,t,n){return{x:t/e||0,y:n/e||0}}function D(e,t){return e===t?Se:le(e)>=le(t)?0>e?ke:Ee:0>t?Te:Ce}function M(e,t,n){n||(n=Ie);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function A(e,t,n){n||(n=Ie);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function I(){this.evEl=Ne,this.evWin=Re,this.pressed=!1,x.apply(this,arguments)}function L(){this.evEl=je,this.evWin=Ye,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=He,this.evWin=Be,this.started=!1,x.apply(this,arguments)}function N(e,t){var n=y(e.touches),r=y(e.changedTouches);return t&(we|xe)&&(n=b(n.concat(r),"identifier",!0)),[n,r]}function R(){this.evTarget=ze,this.targetIds={},x.apply(this,arguments)}function P(e,t){var n=y(e.touches),r=this.targetIds;if(t&(be|_e)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=y(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return f(e.target,l)})),t===be)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(we|xe)&&delete r[s[i].identifier],i++;return a.length?[b(o.concat(a),"identifier",!0),a]:void 0}function F(){x.apply(this,arguments);var e=c(this.handler,this);this.touch=new R(this.manager,e),this.mouse=new I(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function j(e,t){e&be?(this.primaryTouch=t.changedPointers[0].identifier,Y.call(this,t)):e&(we|xe)&&Y.call(this,t)}function Y(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),qe)}}function V(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(We>=o&&We>=s)return!0}return!1}function H(e,t){this.manager=e,this.set(t)}function B(e){this.options=re({},this.defaults,e||{}),this.id=he++,this.manager=null,this.options.enable=d(this.options.enable,!0),this.state=nt,this.simultaneous={},this.requireFail=[]}function U(e){return e&at?"cancel":e&ot?"end":e&it?"move":e&rt?"start":""}function z(e){return e==Ce?"down":e==Te?"up":e==ke?"left":e==Ee?"right":""}function q(e,t){var n=t.manager;return n?n.get(e):e}function W(){B.apply(this,arguments)}function $(){W.apply(this,arguments),this.pX=null,this.pY=null}function G(){W.apply(this,arguments)}function K(){B.apply(this,arguments),this._timer=null,this._input=null}function Z(){W.apply(this,arguments)}function X(){W.apply(this,arguments)}function J(){B.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Q(e,t){return(t=t||{}).recognizers=d(t.recognizers,Q.defaults.preset),new ee(e,t)}function ee(e,t){this.options=re({},Q.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=function(e){var t=e.options.inputClass;return new(t||(fe?L:me?R:pe?F:I))(e,S)}(this),this.touchAction=new H(this,this.options.touchAction),te(this,!0),s(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function te(e,t){var n,r=e.element;r.style&&(s(e.options.cssProps,(function(i,o){n=_(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}function ne(e,n){var r=t.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=n,n.target.dispatchEvent(r)}var re,ie=["","webkit","Moz","MS","ms","o"],oe=t.createElement("div"),se="function",ae=Math.round,le=Math.abs,ce=Date.now;re="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var ue=a((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),de=a((function(e,t){return ue(e,t,!0)}),"merge","Use `assign`."),he=1,pe="ontouchstart"in e,fe=_(e,"PointerEvent")!==r,me=pe&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ge="touch",ve="mouse",ye=25,be=1,_e=2,we=4,xe=8,Se=1,ke=2,Ee=4,Te=8,Ce=16,De=ke|Ee,Me=Te|Ce,Ae=De|Me,Ie=["x","y"],Le=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&h(this.element,this.evEl,this.domHandler),this.evTarget&&h(this.target,this.evTarget,this.domHandler),this.evWin&&h(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&p(this.element,this.evEl,this.domHandler),this.evTarget&&p(this.target,this.evTarget,this.domHandler),this.evWin&&p(w(this.element),this.evWin,this.domHandler)}};var Oe={mousedown:be,mousemove:_e,mouseup:we},Ne="mousedown",Re="mousemove mouseup";l(I,x,{handler:function(e){var t=Oe[e.type];t&be&&0===e.button&&(this.pressed=!0),t&_e&&1!==e.which&&(t=we),this.pressed&&(t&we&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:ve,srcEvent:e}))}});var Pe={pointerdown:be,pointermove:_e,pointerup:we,pointercancel:xe,pointerout:xe},Fe={2:ge,3:"pen",4:ve,5:"kinect"},je="pointerdown",Ye="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(je="MSPointerDown",Ye="MSPointerMove MSPointerUp MSPointerCancel"),l(L,x,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Pe[r],o=Fe[e.pointerType]||e.pointerType,s=o==ge,a=v(t,e.pointerId,"pointerId");i&be&&(0===e.button||s)?0>a&&(t.push(e),a=t.length-1):i&(we|xe)&&(n=!0),0>a||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var Ve={touchstart:be,touchmove:_e,touchend:we,touchcancel:xe},He="touchstart",Be="touchstart touchmove touchend touchcancel";l(O,x,{handler:function(e){var t=Ve[e.type];if(t===be&&(this.started=!0),this.started){var n=N.call(this,e,t);t&(we|xe)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ge,srcEvent:e})}}});var Ue={touchstart:be,touchmove:_e,touchend:we,touchcancel:xe},ze="touchstart touchmove touchend touchcancel";l(R,x,{handler:function(e){var t=Ue[e.type],n=P.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ge,srcEvent:e})}});var qe=2500,We=25;l(F,x,{handler:function(e,t,n){var r=n.pointerType==ge,i=n.pointerType==ve;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)j.call(this,t,n);else if(i&&V.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var $e=_(oe.style,"touchAction"),Ge=$e!==r,Ke="compute",Ze="auto",Xe="manipulation",Je="none",Qe="pan-x",et="pan-y",tt=function(){if(!Ge)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){t[r]=!n||e.CSS.supports("touch-action",r)})),t}();H.prototype={set:function(e){e==Ke&&(e=this.compute()),Ge&&this.manager.element.style&&tt[e]&&(this.manager.element.style[$e]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return s(this.manager.recognizers,(function(t){u(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(m(e,Je))return Je;var t=m(e,Qe),n=m(e,et);return t&&n?Je:t||n?t?Qe:et:m(e,Xe)?Xe:Ze}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(!this.manager.session.prevented){var r=this.actions,i=m(r,Je)&&!tt[Je],o=m(r,et)&&!tt[et],s=m(r,Qe)&&!tt[Qe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}return s&&o?void 0:i||o&&n&De||s&&n&Me?this.preventSrc(t):void 0}t.preventDefault()},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var nt=1,rt=2,it=4,ot=8,st=ot,at=16,lt=32;B.prototype={defaults:{},set:function(e){return re(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(o(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=q(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return o(e,"dropRecognizeWith",this)||(e=q(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(o(e,"requireFailure",this))return this;var t=this.requireFail;return-1===v(t,e=q(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(o(e,"dropRequireFailure",this))return this;e=q(e,this);var t=v(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,r=this.state;ot>r&&t(n.options.event+U(r)),t(n.options.event),e.additionalEvent&&t(e.additionalEvent),r>=ot&&t(n.options.event+U(r))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=lt)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(lt|nt)))return!1;e++}return!0},recognize:function(e){var t=re({},e);return u(this.options.enable,[this,t])?(this.state&(st|at|lt)&&(this.state=nt),this.state=this.process(t),void(this.state&(rt|it|ot|at)&&this.tryEmit(t))):(this.reset(),void(this.state=lt))},process:function(e){},getTouchAction:function(){},reset:function(){}},l(W,B,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(rt|it),i=this.attrTest(e);return r&&(n&xe||!i)?t|at:r||i?n&we?t|ot:t&rt?t|it:rt:lt}}),l($,W,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ae},getTouchAction:function(){var e=this.options.direction,t=[];return e&De&&t.push(et),e&Me&&t.push(Qe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&De?(i=0===o?Se:0>o?ke:Ee,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?Se:0>s?Te:Ce,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return W.prototype.attrTest.call(this,e)&&(this.state&rt||!(this.state&rt)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=z(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),l(G,W,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&rt)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),l(K,B,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ze]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(we|xe)&&!o)this.reset();else if(e.eventType&be)this.reset(),this._timer=i((function(){this.state=st,this.tryEmit()}),t.time,this);else if(e.eventType&we)return st;return lt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===st&&(e&&e.eventType&we?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ce(),this.manager.emit(this.options.event,this._input)))}}),l(Z,W,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&rt)}}),l(X,W,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:De|Me,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(De|Me)?t=e.overallVelocity:n&De?t=e.overallVelocityX:n&Me&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&le(t)>this.options.velocity&&e.eventType&we},emit:function(e){var t=z(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),l(J,B,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime<t.time;if(this.reset(),e.eventType&be&&0===this.count)return this.failTimeout();if(r&&o&&n){if(e.eventType!=we)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||M(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&s?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=i((function(){this.state=st,this.tryEmit()}),t.interval,this),rt):st}return lt},failTimeout:function(){return this._timer=i((function(){this.state=lt}),this.options.interval,this),lt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==st&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Q.VERSION="2.0.7",Q.defaults={domEvents:!1,touchAction:Ke,enable:!0,inputTarget:null,inputClass:null,preset:[[Z,{enable:!1}],[G,{enable:!1},["rotate"]],[X,{direction:De}],[$,{direction:De},["swipe"]],[J],[J,{event:"doubletap",taps:2},["tap"]],[K]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};ee.prototype={set:function(e){return re(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&st)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&n.state&(rt|it|ot)&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof B)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(o(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(o(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=v(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return s(g(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return s(g(e),(function(e){t?n[e]&&n[e].splice(v(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&ne(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&te(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},re(Q,{INPUT_START:be,INPUT_MOVE:_e,INPUT_END:we,INPUT_CANCEL:xe,STATE_POSSIBLE:nt,STATE_BEGAN:rt,STATE_CHANGED:it,STATE_ENDED:ot,STATE_RECOGNIZED:st,STATE_CANCELLED:at,STATE_FAILED:lt,DIRECTION_NONE:Se,DIRECTION_LEFT:ke,DIRECTION_RIGHT:Ee,DIRECTION_UP:Te,DIRECTION_DOWN:Ce,DIRECTION_HORIZONTAL:De,DIRECTION_VERTICAL:Me,DIRECTION_ALL:Ae,Manager:ee,Input:x,TouchAction:H,TouchInput:R,MouseInput:I,PointerEventInput:L,TouchMouseInput:F,SingleTouchInput:O,Recognizer:B,AttrRecognizer:W,Tap:J,Pan:$,Swipe:X,Pinch:G,Rotate:Z,Press:K,on:h,off:p,each:s,merge:de,extend:ue,assign:re,inherit:l,bindFn:c,prefixed:_}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=Q,"function"==typeof define&&define.amd?define((function(){return Q})):"undefined"!=typeof module&&module.exports?module.exports=Q:e.Hammer=Q}(window,document),$.widget("wm.datatable",{options:{data:[],statusMsg:"",colDefs:[],rowActions:[],headerConfig:[],sortInfo:{field:"",direction:""},isMobile:!1,enableSort:!0,filtermode:"",filteronkeypress:!1,activeRow:void 0,height:"100%",showHeader:!0,selectFirstRow:!1,showNewRow:!0,showRowIndex:!1,enableRowSelection:!0,enableColumnSelection:!1,multiselect:!1,filterNullRecords:!0,navigation:"",isdynamictable:"",cssClassNames:{tableRow:"app-datagrid-row",headerCell:"app-datagrid-header-cell",groupHeaderCell:"app-datagrid-group-header-cell",tableCell:"app-datagrid-cell",grid:"",gridDefault:"table",gridBody:"app-datagrid-body",gridFooter:"app-datagrid-footer",deleteRow:"danger",ascIcon:"wi wi-long-arrow-up",descIcon:"wi wi-long-arrow-down",selectedColumn:"selected-column",rowExpandIcon:"wi wi-minus-square",rowCollapseIcon:"wi wi-plus-square",gridRowExpansionClass:"table-row-expansion",expandedRowClass:"expanded"},dataStates:{loading:"Loading...",ready:"",error:"An error occurred in loading the data.",nodata:"No data found."},messages:{selectField:"Select Field"},loadingicon:"",startRowIndex:1,editmode:"",actionsEnabled:{edit:!0,new:!0},rowExpansionEnabled:!1,rowDef:{position:"0",closeothers:!1,columnwidth:"30px"},summaryRow:!1,summaryRowDefs:[],summaryRowDefsObject:[],searchHandler:function(){},sortHandler:function(){}},customColumnDefs:{checkbox:{field:"checkbox",type:"custom",displayName:"",sortable:!1,searchable:!1,resizable:!1,selectable:!1,readonly:!0,style:"width: 50px; text-align: center;",textAlignment:"center",isMultiSelectCol:!0,show:!0},radio:{field:"radio",type:"custom",displayName:"",sortable:!1,searchable:!1,resizable:!1,selectable:!1,readonly:!0,style:"width: 50px; text-align: center;",textAlignment:"center",show:!0},__expand:{field:"__expand",type:"custom",displayName:"",sortable:!1,searchable:!1,resizable:!1,selectable:!1,readonly:!0,style:"text-align: center;",textAlignment:"center",show:!0,width:"30px"},rowIndex:{field:"rowIndex",type:"custom",displayName:"S. No.",sortable:!1,searchable:!1,selectable:!1,readonly:!0,style:"text-align: left;",textAlignment:"left",show:!0}},CONSTANTS:{QUICK_EDIT:"quickedit",INLINE:"inline",FORM:"form",DIALOG:"dialog",SEARCH:"search",MULTI_COLUMN:"multicolumn"},Utils:{random:function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},isDefined:function(e){return void 0!==e},isObject:function(e){return null!==e&&"object"==typeof e},getObjectIndex:function(e,t){var n=-1;return Array.isArray(e)?(e.some((function(e,r){if(_.isEqual(e,t))return n=r,!0})),n):-1},generateGuid:function(){var e=this.random;return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},isValidHtml:function(e){return/<[a-z][\s\S]*>/i.test(e)},isMac:function(){return navigator.platform.toUpperCase().indexOf("MAC")>=0},isDeleteKey:function(e){return this.isMac()&&8===e.which||46===e.which}},_setStyles:function(e,t){if(t)return t.split(";").forEach((function(t){var n,r,i=t.split(":");2===i.length&&(n=i[0].trim(),r=i[1].trim(),e.css(n,r))})),t},_getColumnSortDirection:function(e){var t=this.options.sortInfo;return e===t.field?t.direction:""},_toggleSpacingClasses:function(e){switch(e){case"normal":this.tableContainer.removeClass("table-condensed"),this.gridSearch&&(this.gridSearch.find(".form-group").removeClass("form-group-sm"),this.gridSearch.find("select").removeClass("input-sm"),this.gridSearch.find(".input-group").removeClass("input-group-sm"));break;case"condensed":this.tableContainer.addClass("table-condensed"),this.gridSearch&&(this.gridSearch.find(".form-group").addClass("form-group-sm"),this.gridSearch.find("select").addClass("input-sm"),this.gridSearch.find(".input-group").addClass("input-group-sm"))}},_getColSpan:function(e){var t=0,n=this;return _.forEach(e,(function(e){var r;e.isGroup?t+=n._getColSpan(e.columns):(r=_.find(n.preparedHeaderData,{field:e.field}),t=_.isUndefined(r.show)||r.show?t+1:t)})),t},_setColSpan:function(e){var t=this;_.forEach(e,(function(e){e.isGroup&&(e.colspan=t._getColSpan(e.columns),t.gridHeaderElement.find('th[data-col-group="'+e.field+'"]').attr("colspan",e.colspan),t._setColSpan(e.columns))}))},_getHeaderTemplate:function(){var e,t=$("<colgroup></colgroup>"),n=this.gridHeaderElement.empty(),r=this.Utils.isDefined,i=this.options.sortInfo,o=i.field,s=this,a=[],l=this.options.headerConfig,c=s.options.cssClassNames.groupHeaderCell;function u(e,n){var a,l,c,u,d,h=n,p=e.field,f=s.Utils.isDefined(e.displayName)?e.displayName:p||"",m=f,g=s.options.enableSort&&(_.isUndefined(e.show)||e.show)&&(_.isUndefined(e.sortable)||e.sortable),v=s.options.cssClassNames.headerCell,y="";return f=s.Utils.isDefined(f)&&""!==f?f:" ",c=$("<col/>"),e.style&&s._setStyles(c,e.style),t.append(c),r(e.class)&&(v+=" "+e.class),e.selected&&(v+=" "+s.options.cssClassNames.selectedColumn+" "),"checkbox"!==p&&"radio"!==p||(v+=" grid-col-small"),y+="<th",(_.isUndefined(e.resizable)||e.resizable)&&(_.isUndefined(e.show)||e.show)&&(y+=" data-col-resizable"),s.options.enableColumnSelection&&(_.isUndefined(e.selectable)||e.selectable)&&(y+=" data-col-selectable"),g&&(y+=" data-col-sortable"),y+="></th>",(l=$(y)).attr({"data-col-id":h,"data-col-field":p,title:m}),s._setStyles(l,"text-align: "+e.textAlignment),l.addClass(v),"checkbox"===p&&l.append('<input type="checkbox" />'),l.append('<span class="header-data">'+f+"</span>"),g&&(u=$('<span class="sort-buttons-container"></span>'),d=$('<i class="sort-icon"></i>'),o&&o===e.field&&i.direction&&(a="asc"===i.direction?s.options.cssClassNames.ascIcon:s.options.cssClassNames.descIcon,u.addClass("active"),d.addClass(a+" "+i.direction)),l.append(u.append(d))),l}return _.isEmpty(l)?(e=$("<tr></tr>"),s.preparedHeaderData.forEach((function(t,n){e.append(u(t,n))})),n.append(e)):(!function e(t,n){var r=[];_.forEach(t,(function(t){var i,o,a,l,d;t.columns&&t.columns.length?(d=$("<th></th>"),a=c+" "+(t.class||""),l="text-align: "+t.textAlignment+";background-color: "+(t.backgroundColor||"")+";",d.attr({"data-col-group":t.field,class:a,title:t.displayName}),s._setStyles(d,l),d.append('<span class="header-data">'+t.displayName+"</span>"),r.push(d),e(t.columns,n+1)):(i=_.findIndex(s.preparedHeaderData,{field:t.field}),(o=s.preparedHeaderData[i])&&r.push(u(o,i)))})),a[n]=a[n]||[],a[n]=a[n].concat(r)}(l,0),a.forEach((function(t,r){e=$('<tr role="row" tabindex="0"></tr>');var i=a.length-r;t.forEach((function(t){i>1&&t.hasClass("app-datagrid-header-cell")&&t.attr("rowspan",i),e.append(t)})),n.append(e)}))),{colgroup:t,header:n}},_getSearchEl:function(){var e='<select name="wm-datatable" data-element="dgFilterValue" class="form-control app-select"><option value="" selected class="placeholder">'+this.options.messages.selectField+"</option>",t=this.Utils.isDefined(this.options.searchLabel)&&this.options.searchLabel.length?this.options.searchLabel:"";this.options.colDefs.forEach((function(t,n){"none"!==t.field&&"rowOperations"!==t.field&&t.searchable&&"false"!==_.toString(t.showinfilter)&&(e+='<option value="'+t.field+'" data-coldef-index="'+n+'">'+(t.displayName||t.field)+"</option>")})),e+="</select>";var n=$('<form class="form-search form-inline" onsubmit="return false;"><div class="form-group"><input type="text" data-element="dgSearchText" class="form-control app-textbox" value="" placeholder="'+t+'"/></div><div class="input-append input-group">'+e+'<span class="input-group-addon"><button type="button" data-element="dgSearchButton" class="app-search-button" title="'+t+'"><i class="wi wi-search"></i></button></span></div></div></form>');return this._setStyles(n.find('[data-element="dgSearchText"]'),"display: inline-block;"),n},_appendRowExpansionButtons:function(e){var t=this;e.find("[data-identifier='rowExpansionButtons']").each((function(e){var n,r,i,o=e;r=$(this).closest("tr.app-datagrid-row"),i=parseInt(r.attr("data-row-id"),10),(n=_.clone(t.options.data[i])).$index=o+1,t.options.generateRowExpansionCell(n,o),$(this).empty().append(t.options.getRowExpansionAction(o))}))},setSummaryRowDef:function(e,t,n,r){this.options.summaryRow=!0,null==this.options.summaryRowDefs[n]&&(this.options.summaryRowDefs[n]={},this.options.summaryRowDefsObject[n]={}),this.options.summaryRowDefsObject[n][e]=t,this.options.summaryRowDefs[n][e]=t&&t.value?t.value:t,r&&this.refreshGridData()},_getSummaryRowTemplate:function(){var e=this,t=$('<tfoot class="'+this.options.cssClassNames.gridFooter+'"></tfoot>');return this._setStyles(t,"border-top: 3px solid #eee;"),_.forEach(this.options.summaryRowDefs,(function(n,r){n.$$pk=r,t.append(e._getRowTemplate(n,r,!0))})),t},getPageStartIndex:function(){var e=this.options.getCurrentPage(),t=this.options.getPageSize();return((this.options.actionRowPage<e?this.options.actionRowPage:e)-1)*t},_getPreparedDataForInfiniteScroll:function(e,t){return t=t.filter((function(t,n){if(!e.find("tr.app-datagrid-row[data-row-id="+t.$$pk+"]").length)return t}))},_updateTrData:function(e){var t,n,r=this;t=e.find("tr.app-datagrid-row[data-row-id="+r.options.actionRowIndex+"]"),n=r.preparedData[r.options.actionRowIndex],r.options.generateCustomExpressions(n,r.options.actionRowIndex);var i=r._getRowTemplate(n,r.options.actionRowIndex);t.replaceWith(i[0])},_handleCRUDForInfiniteScroll:function(e){var t=this;t.options.lastActionPerformed!==t.options.ACTIONS.SEARCH_OR_SORT&&t.options.lastActionPerformed!==t.options.ACTIONS.FILTER_CRITERIA&&t.options.lastActionPerformed!==t.options.ACTIONS.DATASET_UPDATE||!(t.options.isSearchTrigerred||t.options.isDatasetUpdated||t.options.isDataUpdatedByUser)?t.options.lastActionPerformed===t.options.ACTIONS.EDIT&&void 0!==t.options.actionRowIndex&&t.options.editmode!==this.CONSTANTS.QUICK_EDIT&&t._updateTrData(e):(e.html(""),"On-Demand"!==this.options.navigation||this.options.isLastPage||this.element.find(".on-demand-datagrid").show(),t.options.clearCustomExpression(),t.options.clearRowDetailExpression(),t.options.setIsSearchTrigerred(!1),t.options.setIsDatasetUpdated(!1))},_getGridTemplate:function(){var e,t,n=this,r=n.getPageStartIndex(),i=n.options.startRowIndex,o=n.options.isNavTypeScrollOrOndemand();return o?(t=this.gridElement,this.renderTableOnViewLess&&(t=this.gridElement.empty(),this.hideLoadingIndicator(),this.renderTableOnViewLess=!1)):t=this.gridElement.empty(),o?(this._handleCRUDForInfiniteScroll(t),n.options.lastActionPerformed===n.options.ACTIONS.DELETE&&(i=n.options.actionRowIndex+1),e=this._getPreparedDataForInfiniteScroll(t,this.preparedData.slice(r))):(this.options.clearCustomExpression(),this.options.clearRowDetailExpression(),e=this.preparedData),_.forEach(e,(function(e,r){var s,a=_.clone(e),l=o?i+r-1:r;if(a.$index=l+1,n.options.generateCustomExpressions(a,l),n.options.registerRowNgClassWatcher(a,l),s=n._getRowTemplate(e,l),t.append(s),n.options.rowExpansionEnabled){var c=n.options.rowDef.height,u=n.options.rowDef.position,d=_.filter(n.preparedHeaderData,(function(e){return e.show})).length-1,h=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+e.$$pk+'"><td></td><td colspan="'+d+'" class="app-datagrid-row-details-cell"><div class="row-overlay"><div class="row-status"><i class="'+n.options.loadingicon+'"></i></div></div><div class="details-section"></div></td></tr>');"-1"===u&&(h=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+e.$$pk+'"><td colspan="'+d+'" class="app-datagrid-row-details-cell"><div class="row-overlay"><div class="row-status"><i class="'+n.options.loadingicon+'"></i></div></div><div class="details-section"></div></td><td></td></tr>')),c&&h.find("div.row-overlay").css("min-height",c),h.css("display","none"),h.find(".details-section").css("display","none"),t.append(h)}})),this.options.isdynamictable||(this.options.setLastActionPerformed(this.options.ACTIONS.DEFAULT),this.options.setIsDataUpdatedByUser(!1),this.options.clearActionRowIndex()),t},_getRowTemplate:function(e,t,n){var r,i=this,o=i.options;return r=$('<tr role="row" tabindex="0" class="'+o.cssClassNames.tableRow+" "+(o.rowClass||"")+'" data-row-id="'+e.$$pk+'"></tr>'),this.preparedHeaderData.forEach((function(o,s){r.append(i._getColumnTemplate(e,s,o,t,n))})),r},_getRowActionsColumnDefIndex:function(){var e,t=this.preparedHeaderData.length;for(e=0;e<t;e+=1)if("rowOperations"===this.preparedHeaderData[e].field)return e;return-1},_getRowActionsColumnDef:function(){var e=this._getRowActionsColumnDefIndex();return-1!==e?this.preparedHeaderData[e]:null},_getCheckboxTemplate:function(e,t){return'<input name="'+(t?"gridMultiSelect":"")+'" type="checkbox"'+(!0===e._checked?" checked":"")+(e.disabed?" disabled":"")+"/>"},_getRadioTemplate:function(e){return'<input type="radio" rowSelectInput name="" value=""'+(!0===e._checked?" checked":"")+(e.disabed?" disabled":"")+"/>"},_getColumnTemplate:function(e,t,n,r,i){var o,s,a,l,c=this.options.cssClassNames.tableCell+" "+(n.class||""),u=n.customExpression,d="text-align: "+n.textAlignment+";position: relative;";if(o=$('<td class="'+c+'" data-col-id="'+t+'" role="cell"></td>'),this._setStyles(o,d),s=_.get(e,n.field),i)(a=this.options.summaryRowDefsObject[r][n.field])instanceof Object&&a.class&&o.addClass(a.class),s instanceof Promise?('<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>',o.html('<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>')):(l=_.isUndefined(s)||null===s?"":s,o.html(l));else if(u)o.html(this.options.getCustomExpression(n.field,r));else if("custom"!==n.type)s=_.get(e,n.field),(this.options.filterNullRecords&&null===s||_.isUndefined(s))&&(s=""),o.attr("title",s),o.text(""+s);else{switch(n.field){case"checkbox":l=this._getCheckboxTemplate(e,n.isMultiSelectCol);break;case"__expand":l='<span class="row-expansion-column" data-identifier="rowExpansionButtons"></span>';break;case"radio":l=this._getRadioTemplate(e);break;case"rowOperations":l='<span class="actions-column" data-identifier="actionButtons"></span>';break;case"rowIndex":l=e.$$index;break;case"none":l="";break;default:l=_.isUndefined(s)||null===s?"":s}o.html(l)}return e.$index=r+1,this.options.registerColNgClassWatcher(e,n,r,t,i),o},_getEventTemplate:function(e){var t,n=_.filter(_.keys(e),(function(e){return _.startsWith(e,"on")})),r="";return t="autocomplete"===e.editWidgetType?"onSubmit":"onChange",n=_.union(n,[t]),_.forEach(n,(function(t){r+=" "+_.kebabCase(t)+'="',"onSubmit"!==t&&"onChange"!==t||(r+="_"+t+"Field($event, $scope, newVal, oldVal);"),r+=(e[t]||"")+'" '})),r},_insertFieldInHeaderConfig:function(e,t,n){var r=_.findIndex(e,{field:n}),i=this;-1===r?_.forEach(e,(function(e){e.isGroup&&i._insertFieldInHeaderConfig(e.columns,t,n)})):e.splice(r+1,0,{field:t,isPredefined:!0})},setHeaderConfigForDefaultFields:function(e,t){if(!_.isEmpty(this.options.headerConfig)){var n=this.customColumnDefs[e].field;_.remove(this.options.headerConfig,{field:n}),"0"===t?this.options.headerConfig.unshift({field:n,isPredefined:!0}):"-1"===t?this.options.headerConfig.push({field:n,isPredefined:!0}):this._insertFieldInHeaderConfig(this.options.headerConfig,n,t)}},setDefaultColsData:function(e){if(!_.isEmpty(this.preparedHeaderData)){var t,n;if(this.options.rowExpansionEnabled){if(t=this.options.rowDef.position,(n=_.clone(this.customColumnDefs.__expand)).width=this.options.rowDef.columnwidth,e)if("-1"===t)this.preparedHeaderData.push(n);else if("0"===t)this.preparedHeaderData.unshift(n);else{var r=_.findIndex(this.preparedHeaderData,{field:t});this.preparedHeaderData.splice(r+1,0,n)}this.setHeaderConfigForDefaultFields("__expand",t)}this.options.showRowIndex&&(e&&this.preparedHeaderData.unshift(this.customColumnDefs.rowIndex),this.setHeaderConfigForDefaultFields("rowIndex","0")),this.options.multiselect&&(e&&this.preparedHeaderData.unshift(this.customColumnDefs.checkbox),this.setHeaderConfigForDefaultFields("checkbox","0")),!this.options.multiselect&&this.options.showRadioColumn&&(e&&this.preparedHeaderData.unshift(this.customColumnDefs.radio),this.setHeaderConfigForDefaultFields("radio","0"))}},_prepareHeaderData:function(){this.preparedHeaderData=[],$.extend(this.preparedHeaderData,this.options.colDefs),this.setDefaultColsData(!0)},_generateCustomColDefs:function(){var e=[],t={};function n(n){if(!t[n]){var r={type:"string",field:n};e.push(r),t[n]=!0}}this.options.data.forEach((function(e){_.keys(e).forEach(n)})),this.options.colDefs=e,this._prepareHeaderData()},_prepareData:function(){var e=[],t=this.options.colDefs,n=this,r=n.getPageStartIndex(),i=this.Utils.isObject,o=this.Utils.isDefined;!this.options.colDefs.length&&this.options.data.length&&this._generateCustomColDefs(),(this.options.isNavTypeScrollOrOndemand()?this.options.data.slice(r):this.options.data).forEach((function(s,a){var l=$.extend(!0,{},s);t.forEach((function(e){if(e.field){var t,n,r,a=e.field.split("."),c=s,u=a.length;for(t=0;t<u;t++)if(r=void 0,-1!==(n=a[t]).indexOf("[0]")&&(n=n.replace("[0]",""),r=!0),i(c)&&!r)c=_.get(c,n);else{if(!r){c=void 0;break}c=_.get(c,n+"[0]")}o(c)?l[e.field]=c:a.length>1&&_.has(s,e.field)&&(l[e.field]=s[e.field])}})),l.$$index=r+a+1,l.$$pk=n.options.isNavTypeScrollOrOndemand()?r+a:a,e.push(l)})),n.options.isNavTypeScrollOrOndemand()?n.options.isSearchTrigerred&&!n.emptySearch||n.options.isDatasetUpdated?n.preparedData=e:n.preparedData.length?e.forEach((function(e,t){var i=r+t;n.preparedData[i]&&e.$$index===n.preparedData[i].$$index?n.preparedData[i]=e:n.preparedData.push(e)})):n.preparedData.push(...e):n.preparedData=e},_reselectColumns:function(){var e=[],t=this;this.gridHeaderElement&&this.options.enableColumnSelection&&(e=this.gridHeaderElement.find("th."+this.options.cssClassNames.selectedColumn)).length&&e.each((function(){t.columnSelectionHandler(void 0,$(this))})),this.options.multiselect&&this.updateSelectAllCheckboxState()},_create:function(){$.extend(this,{dataStatus:{message:"",state:"ready"},preparedData:[],preparedHeaderData:[],dataStatusContainer:null,gridContainer:null,gridElement:null,gridHeader:null,gridBody:null,columnClickInfo:{},gridFooter:null,gridSearch:null,tableId:null,searchObj:{field:"",value:"",event:null},compiledCellTemplates:{}}),this._setStatus=_.debounce((function(e){this.__setStatus(e)}),100),this._debounceOnEnter=_.debounce((function(e,t,n,r){this._onEnter(e,t,n,r)}),150),this.options.summaryRow=!1,this.options.summaryRowDefs=[],this._prepareHeaderData(),this._prepareData(),this._render(!0)},_setGridEditMode:function(e){_.isFunction(this.options.setGridEditMode)&&this.options.setGridEditMode(e)},_refreshGrid:function(){this._prepareHeaderData(),this._prepareData(),this._render(),this.addOrRemoveScroll(),this._setGridEditMode(!1)},refreshGrid:function(){window.clearTimeout(this.refreshGridTimeout),this.refreshGridTimeout=window.setTimeout(this._refreshGrid.bind(this),50)},callRenderGridForInfiniteScroll:function(){this.gridFooter.remove();var e=this.gridElement.find("> tr.app-datagrid-row.always-new-row");e.length&&e.remove(),this._renderGrid(void 0)},refreshGridData:function(){this._prepareData(),this.options.isNavTypeScrollOrOndemand()?this.callRenderGridForInfiniteScroll():(this.gridFooter.remove(),this._renderGrid()),this._reselectColumns(),this.addOrRemoveScroll(),this._setGridEditMode(!1),this.toggleNewRowActions(!1)},setDefaultRowData:function(e){_.forEach(this.preparedHeaderData,(function(t){e[t.field]=t.defaultvalue}))},addNewRow:function(e,t){var n,r,i,o=this.gridElement.find("> tr.app-datagrid-row:visible").length||99999,s=this,a={};if(!t&&_.isFunction(this.options.beforeRowInsert)&&this.options.beforeRowInsert(),(i=(r=this.gridElement).find("> tr.app-datagrid-row.always-new-row")).length){if(this.setFocusOnElement(void 0,i),this.options.editmode===this.CONSTANTS.QUICK_EDIT){var l=i.find("input").length>0?$(i.find("input")[0]):null;if(null!==l){var c=$.Event("keydown");c.which=13,l.trigger(c)}}}else a.$index=o,a.$$pk=o,this.options.editmode!==this.CONSTANTS.FORM&&this.options.editmode!==this.CONSTANTS.DIALOG&&(n=$(this._getRowTemplate(a,a.$index)),this.preparedData.length||this.setStatus("ready",this.dataStatus.ready),"top"===this.options.formPosition?r.prepend(n):r.append(n),this._appendRowActions(n,!0,a),this.attachEventHandlers(n),(t||this.options.editmode!==this.CONSTANTS.QUICK_EDIT)&&(n.find(".delete-row-button").hide(),t&&n.find(".edit-row-button").hide()),this._findAndReplaceCompiledTemplates(),t?(this.setDefaultRowData(a),n.addClass("always-new-row").addClass("row-editing"),this.options.runInNgZone((function(){s.makeRowEditable(n,a,!0)}))):n.trigger("click",[void 0,{action:"edit",operation:"new",skipFocus:e}]),this.updateSelectAllCheckboxState(),this.addOrRemoveScroll(),this.options.timeoutCall((function(){s.setColGroupWidths()}),100))},addLoadMoreBtn:function(e,t,n,r){var i;if(!this.options.isLastPage||r){var o=this,s=$('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');(i=s.find("a")).append(e),this.element.find(".app-grid-header-inner").append(s),r&&this.element.find(".on-demand-load-btn").length&&this.element.find(".on-demand-load-btn").text(this.options.viewlessmessage),i.on("click",(function(e){var s=o.options.getCurrentPage()==o.options.getPageCount();s||o.showLoadingIndicator(t,!1),o.options.showviewlessbutton||i.hide(),r&&s&&o.element.find(".on-demand-datagrid").remove(),s&&o.options.showviewlessbutton&&(i.hide(),o.renderTableOnViewLess=!0,o.renderPaginationOnViewLess=!0,o.options.enableNavigation(),o._renderGrid()),n&&"function"==typeof n&&n(e)}))}},showLoadingIndicator:function(e,t){var n=this.element.find(".loading-data-msg"),r=this.element.find(".on-demand-datagrid");if(n.length&&!t)n.show();else if(t&&r.length)r.show();else{var i=$('<div class="loading-data-msg spin-icon-in-center"><span><i class="app-icon panel-icon fa-spin '+this.options.loadingicon+'"></i><span class="sr-only">Loading</span><span class="loading-text"></span></span></div>');if(i.find(".loading-text").html(e),r.length)r.append(i);else{var o=$('<div class="on-demand-datagrid">'+i[0].outerHTML+"</div>");this.element.find(".app-grid-header-inner").append(o)}}},hideLoadingIndicator:function(e,t){e||t?this.options.getCurrentPage()==this.options.getPageCount()&&this.options.showviewlessbutton?(this.element.find(".on-demand-load-btn").show().text(this.options.viewlessmessage),this.element.find(".loading-data-msg").hide(),t&&(this.element.find(".on-demand-load-btn").length||this.options.addLoadMoreBtn(),this.element.find(".loading-data-msg").hide())):this.element.find(".on-demand-datagrid").hide():(this.element.find(".loading-data-msg").hide(),this.element.find(".on-demand-load-btn").text(this.options.ondemandmessage),this.element.find(".on-demand-load-btn").show())},getSelectedRows:function(){this.getSelectedColumns();var e=[],t=this;return this.preparedData.forEach((function(n,r){n._selected&&e.push(t.options.data[r])})),e},selectRows:function(e){var t=this;t.gridElement.find("tr.app-datagrid-row").each((function(e){t.preparedData[e]&&!0===t.preparedData[e]._selected&&$(this).trigger("click",[$(this),{skipSingleCheck:!0}])})),_.isArray(e)?_.forEach(e,(function(e){t.selectRow(e,!0)})):t.selectRow(e,!0)},toggleRowFilter:function(e){this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&this.gridSearch&&(e?this.gridSearch.show():this.gridSearch.hide())},setColGroupWidths:function(){var e=this,t=(this.options.isMobile,this.tableContainer.find("col")),n=this.tableContainer.find("col"),r=this.options.showHeader?this.gridContainer.find("th.app-datagrid-header-cell"):this.gridElement.find("tr.app-datagrid-row").first().find("td"),i=this.preparedHeaderData.length,o=this.gridElement.parent().prop("scrollLeft");if(t.length||r.length){this._setColSpan(this.options.headerConfig),this.toggleRowFilter();var s=0,a=t.length;t.each((function(){var e=$(this).width();e&&(s+=e,a-=1)})),r.each((function(){var r,i,o=Number($(this).attr("data-col-id")),s=e.preparedHeaderData[o],a=e.gridContainer.find('th[data-col-id="'+o+'"]'),l=e.gridElement.find('td.app-datagrid-cell[data-col-id="'+o+'"]'),c=e.tableContainer.find('tfoot tr.app-datagrid-row td.app-datagrid-cell[data-col-id="'+o+'"]'),u=$(t[o]),d=$(n[o]);s&&(r=s.width,_.isUndefined(s.show)||s.show?(a.show(),l.show(),u.show(),d.show(),c.show()):(a.hide(),l.hide(),u.hide(),d.hide(),c.hide()),u.length&&"90px"===u[0].style.width&&(i=_.isUndefined(r)?"":r,u.css("width",i),d.css("width",i)))})),r.each((function(){var r,o,l,c,u=$(this),d=Number(u.attr("data-col-id")),h=e.preparedHeaderData[d];if(h){if(r=h.width,_.isUndefined(h.show)||h.show)if(u.hasClass("grid-col-small"))o=50;else if(_.isUndefined(r)||""===r||_.includes(r,"%")){if((c=$(t[d])).length)if(""===(l=c[0].style.width)||"0px"===l||"90px"===l||_.includes(l,"%"))if((o=u.width())<=0){for(var p=u,f=o,m=0;f<=0;)f=(p=p.parent()).width(),p.find("table").length&&p.prop("style")&&(m=m+parseFloat(p.css("padding-left"))+parseFloat(p.css("padding-right")));if(f>0)if(m&&(f-=m),_.includes(l,"%"))o=f*(parseInt(l)/100);else o=(o=(s&&s>0?f-s:f)/(a||t.length))>90?i===d+1?o-17:o:90;else o=o>90?i===d+1?o-17:o:90}else o=o>90?i===d+1?o-17:o:90;else o=l}else o=r;else o=0;$(t[d]).css("width",o),$(n[d]).css("width",o)}})),this.toggleRowFilter(!0),this.gridElement.parent().prop("scrollLeft",o),this.gridHeaderElement.parent().prop("scrollLeft",o)}},getSelectedColumns:function(){var e,t,n,r={},i=[],o=this;return $.extend(i,this.preparedHeaderData),this.options.multiselect?(i.some((function(t,n){if("checkbox"===t.field)return e=n,!0})),i.splice(e,1)):this.options.showRadioColumn&&(i.some((function(e,n){if("radio"===e.field)return t=n,!0})),i.splice(t,1)),this.options.showRowIndex&&(i.some((function(e,t){if("rowIndex"===e.field)return n=t,!0})),i.splice(n,1)),i.forEach((function(e){var t=e.field;e.selected&&(r[t]={colDef:e,colData:o.options.data.map((function(e){return e[t]}))})})),r},_setOption:function(e,t){switch(this._super(e,t),e){case"showHeader":this._toggleHeader(),this._toggleSearch(),this.setColGroupWidths(),this.addOrRemoveScroll();break;case"filtermode":this._toggleSearch();break;case"searchLabel":this.gridSearch&&(this.gridSearch.find('[data-element="dgSearchText"]').attr("placeholder",t),this.gridSearch.find('[data-element="dgSearchButton"]').attr("title",t));break;case"selectFirstRow":this.selectFirstRow(t);break;case"data":this.isResetSortIconsDone||this.setSortIconDefault(),this.refreshGridData();break;case"dataStates":"nodata"===this.dataStatus.state?this.setStatus("nodata",this.dataStatus.nodata):"loading"===this.dataStatus.state&&this.setStatus("loading");break;case"loadingicon":this.dataStatusContainer.find("i").removeClass().addClass(this.options.loadingicon);break;case"colDefs":if(this.options.isNavTypeScrollOrOndemand()&&this.options.isNextPageData){this.tableContainer.find("colgroup").remove(),this._prepareHeaderData(),this.setColGroupWidths(),this._renderHeader(),this._renderSearch(),this.attachEventHandlers(this.gridElement),this._reselectColumns(),this.addOrRemoveScroll();break}case"multiselect":case"showRadioColumn":case"rowActions":case"filterNullRecords":case"showRowIndex":this.refreshGrid();break;case"cssClassNames":var n=this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid;this.options.rowExpansionEnabled&&(n=n+" "+this.options.cssClassNames.gridRowExpansionClass),this.tableContainer.attr("class",n),"condensed"===this.options.spacing&&this._toggleSpacingClasses("condensed");break;case"spacing":this._toggleSpacingClasses(t);break;case"messages":this.gridSearch&&this.gridSearch.find("option.placeholder").text(t&&t.selectField)}},getOptions:function(){return this.options},_toggleHeader:function(){this.gridHeaderElement&&this.gridHeaderElement.empty(),this.tableContainer&&(this.tableContainer.find("colgroup").remove(),this.tableContainer.find("thead").remove()),this.setDefaultColsData(),this.options.showHeader&&this._renderHeader()},_toggleSearch:function(){this.gridSearch&&this.gridSearch.remove(),this.options.filtermode===this.CONSTANTS.SEARCH?this._renderSearch():this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&(this._renderRowFilter(),this.setColGroupWidths())},selectFirstRow:function(e,t){var n,r;t&&this.gridElement.find("tr").is(":visible")?(this.__setStatus(),n=this.gridElement.find("tr.app-datagrid-row:visible:not(.always-new-row)").first()):n=this.gridElement.find("tr.app-datagrid-row:not(.always-new-row)").first(),r=n.attr("data-row-id"),n.length&&this.preparedData.length&&(this.preparedData[r]._selected=!e,n[0].click())},selectRow:function(e,t){var n,r,i=_.isNumber(e)?e:this.Utils.getObjectIndex(this.options.data,e);-1!==i&&(n="tr.app-datagrid-row[data-row-id="+i+"]",(r=this.gridElement.find(n)).length&&(this.preparedData[i]._selected=!t),t?r.trigger("click"):(this.toggleRowSelection(r,t),this.options.callOnRowDeselectEvent(this.preparedData[i])))},deselectRow:function(e){this.selectRow(e,!1)},toggleRowSelection:function(e,t,n,r){if(e.length){var i=e.attr("data-row-id");this.preparedData[i]&&(this.preparedData[i]._selected=t,t?e.addClass("active"):e.removeClass("active"),this.options.showRadioColumn&&(e.find("td input[rowSelectInput]:radio:not(:disabled)").prop("checked",t),this.preparedData[i]._checked=t),this.options.multiselect?(e.find('td input[name="gridMultiSelect"]:checkbox:not(:disabled)').prop("checked",t),this.preparedData[i]._checked=t,r||this.updateSelectAllCheckboxState()):this._deselectPreviousSelection(e,n))}},updateSelectAllCheckboxState:function(){if(this.options.showHeader&&this.options.multiselect){this.__setStatus();var e=this.gridHeaderElement.find("th.app-datagrid-header-cell input:checkbox"),t=this.gridElement,n=t.find('tr.app-datagrid-row:visible input[name="gridMultiSelect"]:checkbox:checked').length,r=t.find("tr.app-datagrid-row:visible").length;r&&n===r?e.prop("checked",!0):e.prop("checked",!1)}},rowClickHandlerOnCapture:function(e,t,n){if(!this.getColInfo(e)||"checkbox"==e.target.type||"radio"==e.target.type){t=t||$(e.target).closest("tr.app-datagrid-row");var r=this.gridElement.find(t);if(r.length&&r.closest("tbody").attr("id")===this.gridElement.attr("id")){var i=t.attr("data-row-id"),o=this.preparedData[i],s=this.options.data[i];this.options.assignSelectedItems(s,e,{rowId:i,_selected:o?._selected})}}},rowSelectionHandler:function(e,t,n){if(!this.getColInfo(e)||"checkbox"==e.target.type||"radio"==e.target.type){var r,i,o,s,a=this,l=(n=n||{}).action,c=$(e.target),u=this.options.editmode===this.CONSTANTS.QUICK_EDIT;t=t||c.closest("tr.app-datagrid-row"),(l||u&&(c.hasClass("app-datagrid-cell")||c.closest("td.app-datagrid-cell").length)&&!t.hasClass("always-new-row"))&&(n.action=n.action||"edit",("new"===n.operation||a.options.actionsEnabled.edit)&&a.toggleEditRow(e,n),n.skipSelect)||(r=t.attr("data-row-id"),i=this.preparedData[r],o=this.options.data[r],s=i&&i._selected||!1,n.skipSingleCheck||(!t.hasClass("active")||this.options.multiselect)&&i?(this.options.callOnRowClickEvent(o,e),s=!s,this.options.assignSelectedItems(o,e,{rowId:r,_selected:s}),this.toggleRowSelection(t,s,e),d()):u||"new"===n.operation||d())}function d(){s&&_.isFunction(a.options.onRowSelect)&&a.options.onRowSelect(o,e),!s&&_.isFunction(a.options.onRowDeselect)&&a.options.onRowDeselect(o,e)}},rowDblClickHandler:function(e,t){e.stopPropagation();var n,r=(t=t||$(e.target).closest("tr.app-datagrid-row")).attr("data-row-id");(n=this.preparedData[r])&&_.isFunction(this.options.onRowDblClick)&&this.options.onRowDblClick(n,e)},closePopover:function(){this.options.closePopover(this.element)},headerClickHandler:function(e){var t=$(e.target).closest("th.app-datagrid-header-cell").attr("data-col-id");this.closePopover(),this.options.onHeaderClick(this.preparedHeaderData[t],e)},columnSelectionHandler:function(e,t){e&&e.stopImmediatePropagation();var n=e?$(e.target).closest("th.app-datagrid-header-cell"):t,r=n.attr("data-col-id"),i=this.preparedHeaderData[r],o=i.field,s='td[data-col-id="'+r+'"]',a=this.gridElement.find(s),l=a.data("selected")||!1,c={colDef:i,data:this.options.data.map((function(e){return e[o]})),sortDirection:this._getColumnSortDirection(i.field)},u=this.options.cssClassNames.selectedColumn;l=!l,i.selected=l,a.data("selected",l),l?(a.addClass(u),n.addClass(u),_.isFunction(this.options.onColumnSelect)&&e&&this.options.onColumnSelect(c,e)):(a.removeClass(u),n.removeClass(u),_.isFunction(this.options.onColumnDeselect)&&e&&this.options.onColumnDeselect(c,e))},getTextValue:function(e,t){return this.options.getFieldValue(t?e+"_new":e)},getUploadedFiles:function(e,t){return _.get(document.forms,[e.find("form").attr("name"),t,"files",0])},isDataModified:function(e,t,n){var r=!1,i=this;function o(e){return e?moment(e).valueOf():e}return e.each((function(){var e=$(this),s=e.attr("data-col-id"),a=i.preparedHeaderData[s],l=i.getTextValue(a.field,n),c=_.get(t,a.field);if(r="upload"===a.editWidgetType?i.getUploadedFiles(e,a.field)instanceof File:!(!i.Utils.isDefined(l)&&null==c)&&("datetime"===a.editWidgetType?!(o(c)===o(l)):!(c==l)))return!r})),r},focusActiveRow:function(){this.gridElement.find("tr.app-datagrid-row.active").focus()},focusNewRow:function(){var e=this.gridElement.find("tr.always-new-row"),t=e&&e.find("input")||[];t.length&&t[0].focus()},disableActions:function(e){var t=this.gridElement.find(".delete-row-button"),n=this.gridElement.find(".edit-row-button");e?(n.addClass("disabled-action"),t.addClass("disabled-action")):(n.removeClass("disabled-action"),t.removeClass("disabled-action"))},setFocusOnElement:function(e,t,n){var r,i,o=e&&$(e.target);o&&o.hasClass("app-datagrid-cell")?r=o.find("input"):(t?t.hasClass("app-datagrid-row")&&(t=t.find("td.cell-editing")):t=o.closest("tr.app-datagrid-row").find("td.cell-editing"),(r=$(t).first().find("input")).length||(r=$(t).first().find("textarea")),r.length||(r=$(t).first().find("select"))),r.length&&(i=r.first(),n?(i.focus(),i.select()):this.options.timeoutCall((function(){i.focus(),i.select()})))},removeNewRow:function(e){this.disableActions(!1),this._setGridEditMode(!1),e.hasClass("always-new-row")||(e.attr("data-removed",!0),e.remove(),this.preparedData.length||this.setStatus("nodata",this.dataStatus.nodata),this.addOrRemoveScroll(),this.toggleNewRowActions(!1))},saveRow:function(e){this.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").each((function(){$(this).trigger("click",[void 0,{action:"save",skipSelect:!0,noMsg:!0,success:e}])}))},makeRowEditable:function(e,t,n){var r,i=this,o=e.find("td.app-datagrid-cell"),s=parseInt(e.attr("data-row-id"),10),a=_.clone(t);a.$index=s+1,this.options.removeValidations(n),this.options.generateInlineEditRow(a,n),o.each((function(){var e,r,o=$(this),a=o.text(),l=o.attr("data-col-id"),c=i.preparedHeaderData[l];c.readonly||(e=_.get(t,c.field),r=i.options.getInlineEditWidget(c.field,e,n),c.customExpression||c.formatpattern&&"None"!==c.formatpattern?(o.addClass("cell-editing editable-expression").data("originalValue",{rowIndex:s,fieldName:c.field}),o.addClass("cell-editing editable-expression").html(r).data("originalText",a)):o.addClass("cell-editing").html(r).data("originalText",a),o.addClass("form-group"),"rowOperations"!==c.binding?i.options.timeoutCall((function(){i.options.applyValidations(c,n),c.required&&o.addClass("required-field")})):c.required&&o.addClass("required-field"))})),(r=e.find("td.cell-editing")).on("click",(function(e){e.stopPropagation()})),r.on("keydown",(function(e){38!==e.which&&40!==e.which||!e.currentTarget||e.currentTarget.closest(".always-new-row")||e.stopPropagation()}))},toggleNewRowActions:function(e){var t=this,n=$(this.element).siblings("div.panel-footer, div.panel-heading").find("div.app-datagrid-actions"),r=this.gridElement.find("tr.app-datagrid-row.row-editing"),i=n.find("i.wi-plus").closest(".app-button");this.options.editmode!==this.CONSTANTS.INLINE||0!==this.options.rowActions.length&&_.some(this.options.rowActions,{action:"editRow($event)"})||(e?(n.append('<button type="button" wmbutton="" class="btn app-button btn-default cancelNewRow" tabindex="0" accesskey="" title="Cancel"><i aria-hidden="true" class="app-icon wi wi-cancel"></i><span class="sr-only">Cancel Icon</span><span class="btn-caption">Cancel</span></button><button type="button" wmbutton="" class="btn app-button btn-primary saveNewRow" tabindex="0" accesskey="" title="Save"><i aria-hidden="true" class="app-icon wi wi-done"></i><span class="sr-only">Save Icon</span><span class="btn-caption">Save</span></button>'),n.find(".cancelNewRow").on("click",(function(e){t.toggleEditRow(e,{action:"cancel",$row:r})})),n.find(".saveNewRow").on("click",(function(e){t.toggleEditRow(e,{action:"save",$row:r})})),i.hide()):($("typeahead-container").removeClass("open"),n.find(".cancelNewRow").remove(),n.find(".saveNewRow").remove(),i.show()))},_isNewRow:function(e){return parseInt(e.attr("data-row-id"),10)>=this.preparedData.length||e.hasClass("always-new-row")},toggleEditRow:function(e,t){t=t||{},e&&e.stopPropagation(),this.closePopover();var n,r,i,o,s=t.$row||$(e.target).closest("tr.app-datagrid-row"),a=s.find(".edit-row-button"),l=s.find(".cancel-edit-row-button"),c=s.find(".save-edit-row-button"),u=s.find(".delete-row-button"),d=_.cloneDeep(this.options.data[s.attr("data-row-id")])||{},h=this,p=s.hasClass("always-new-row"),f=h.options.editmode===h.CONSTANTS.QUICK_EDIT,m={};function g(e,n){_.isFunction(t.success)&&t.success(e,n),f&&!h.options.actionsEnabled.edit||h.focusActiveRow()}if(this.options.setActionRowIndex(s.attr("data-row-id")),this.options.setLastActionPerformed(this.options.ACTIONS.EDIT),"true"!==s.attr("data-removed")){if(t.selectRow&&this.selectRow(d,!0),(e=e||{}).data=e.data||{},"edit"===(n=e.data.action||t.action)){if(this.options.editmode===this.CONSTANTS.INLINE&&this.options.callLoadInlineWidgetData(),f&&h.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").length)return void h.saveRow((function(t,n){h.editSuccessHandler(t,n,e,s,!0)}));if(s.addClass("row-editing"),_.isFunction(this.options.beforeRowUpdate)&&this.options.beforeRowUpdate(d,e),h.options.editmode===h.CONSTANTS.FORM||h.options.editmode===h.CONSTANTS.DIALOG)return;if("new"===t.operation&&(h.setDefaultRowData(d),h.toggleNewRowActions(!0)),_.isFunction(this.options.onBeforeFormRender)&&!1===this.options.onBeforeFormRender(d,e,t.operation||n))return;this._setGridEditMode(!0),this.disableActions(!0),u.removeClass("disabled-action"),this.options.runInNgZone((function(){h.makeRowEditable(s,d)})),a.addClass("hidden"),l.removeClass("hidden"),c.removeClass("hidden"),i=s.find("td.cell-editing"),!t.skipFocus&&i&&this.options.timeoutCall((function(){h.setFocusOnElement(e,i)})),_.isFunction(this.options.onFormRender)&&this.options.onFormRender(s,e,t.operation||n,s.hasClass("always-new-row"))}else if(i=s.find("td.cell-editing"),r=h._isNewRow(s),"save"===n)if(!!r||this.isDataModified(i,d,p)){if(i.each((function(){var e,t=$(this),n=t.attr("data-col-id"),i=h.preparedHeaderData[n],o=_.split(i.field,".");e=h.getTextValue(i.field,p),1===o.length&&"upload"===i.editWidgetType?_.set(d,i.field,h.getUploadedFiles(t,i.field)):(e=1!==o.length&&!r||""!==e?e:void 0,h.Utils.isDefined(e)?null===(e="null"===e?null:e)?o.length>1?_.set(d,o[0],e):r||_.set(d,i.field,""):_.set(d,i.field,e):1!==o.length||r||_.set(d,i.field,e))})),i.find(".ng-pending").length>0)return void setTimeout(this.toggleEditRow.bind(this,e,t),200);if((o=i.find(".ng-invalid")).length>0)return o.each((function(e){var t=$(this).closest("td.app-datagrid-cell");0===e&&t.find("[focus-target]").focus(),h.options.setTouched(t.find("[formcontrolname]").attr("formcontrolname"))})),void(_.isFunction(t.success)&&t.success(!1,!0));if(r&&f&&_.isEmpty(d))return h.removeNewRow(s),void(_.isFunction(t.success)&&t.success(!1,void 0,!0));if(r){if(_.isFunction(this.options.onBeforeRowInsert)&&!1===this.options.onBeforeRowInsert(d,e,m))return;this.options.onRowInsert(d,e,g,m),h.toggleNewRowActions(!1),!s.hasClass("always-new-row")&&h.options.isNavTypeScrollOrOndemand()&&h.removeNewRow(s)}else{if(_.isFunction(this.options.onBeforeRowUpdate)&&!1===this.options.onBeforeRowUpdate(d,e,m))return;this.options.afterRowUpdate(d,e,g,m)}}else this.cancelEdit(s),t.noMsg||this.options.noChangesDetected(),_.isFunction(t.success)&&t.success(!1);else{if(r)return void h.removeNewRow(s);this.cancelEdit(s)}this.addOrRemoveScroll()}},cancelEdit:function(e){var t=this,n=e.find("td.cell-editing"),r=e.find(".cancel-edit-row-button"),i=e.find(".save-edit-row-button"),o=e.find(".edit-row-button");this.options.clearActionRowIndex(),this.disableActions(!1),e.removeClass("row-editing"),n.off("click"),n.each((function(){var e=$(this),n=e.data("originalValue");e.removeClass("datetime-wrapper cell-editing required-field form-group"),n?e.html(t.options.getCustomExpression(n.fieldName,n.rowIndex)):e.text(e.data("originalText")||"")})),$("typeahead-container").removeClass("open"),o.removeClass("hidden"),r.addClass("hidden"),i.addClass("hidden"),this._setGridEditMode(!1)},closeEditedRow:function(){var e=this.gridElement.find("tr.app-datagrid-row.row-editing");e.length&&(this._isNewRow(e)?this.removeNewRow(e):this.cancelEdit(e))},hideRowEditMode:function(e){if(e.hasClass("always-new-row")&&this.options.isNavTypeScrollOrOndemand())this.resetNewRow(e);else{var t=e.find("td.cell-editing"),n=e.find(".edit-row-button"),r=e.find(".cancel-edit-row-button"),i=e.find(".save-edit-row-button"),o=this;e.removeClass("row-editing"),t.off("click"),this.disableActions(!1),this._setGridEditMode(!1),t.each((function(){var e,t,n=$(this),r=n.data("originalValue");n.removeClass("datetime-wrapper cell-editing required-field form-group"),r?n.html(o.options.getCustomExpression(r.fieldName,r.rowIndex)):(t=o.preparedHeaderData[n.attr("data-col-id")],e=o.getTextValue(t.field),n.text(o.Utils.isDefined(e)?e:""))})),n.removeClass("hidden"),r.addClass("hidden"),i.addClass("hidden"),this.addOrRemoveScroll()}},deleteRow:function(e){e.stopPropagation();var t,n,r=$(e.target).closest("tr.app-datagrid-row"),i=r.attr("data-row-id"),o=this.options.data[i],s=this._isNewRow(r),a={},l=this;if(this.options.setActionRowIndex(i),this.options.setLastActionPerformed(this.options.ACTIONS.DELETE),_.isFunction(this.options.beforeRowDelete)&&this.options.beforeRowDelete(o,e),s)return this.disableActions(!1),this._setGridEditMode(!1),r.attr("data-removed",!0),r.remove(),this.preparedData.length||this.setStatus("nodata",this.dataStatus.nodata),void this.addOrRemoveScroll();_.isFunction(this.options.onBeforeRowDelete)&&!1===this.options.onBeforeRowDelete(o,e,a)||_.isFunction(this.options.onRowDelete)&&(t=this.options.cssClassNames.deleteRow,(n=-1!==r.attr("class").indexOf("active"))&&r.removeClass("active"),r.addClass(t),this.options.onRowDelete(o,(function(){n&&r.addClass("active"),r.removeClass(t),l.addOrRemoveScroll()}),e,(function(t,n){if(l.options.isNavTypeScrollOrOndemand()){var r=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id"),i=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+r+'"]');l.options.setDeletedRowIndex(r),l.preparedData.splice(r,1),l.options.data.splice(r,1),l.gridElement.find("tr.app-datagrid-row:gt("+r+")").each((function(e,t){i.is(":last-child")||$(t).hasClass("always-new-row")||($(t).attr("data-row-id",r),l.preparedData[r].$$pk--,l.preparedData[r].$$index--,l.preparedData[r].$index--,r++)})),i.remove()}var o,s;l.options.editmode===l.CONSTANTS.QUICK_EDIT&&($(e.target).hasClass("delete-row-button")||l.Utils.isDeleteKey(e))&&(l.__setStatus(),n||(o=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id"),(s=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+o+'"]')).length||(s=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+(o-1)+'"]')),s.trigger("click",[void 0,{action:"edit",skipFocus:t}])))}),a))},deleteRowAndUpdateSelectAll:function(e){this.deleteRow(e),this.updateSelectAllCheckboxState()},_deselectPreviousSelection:function(e,t){var n=this.gridElement.find("tr.app-datagrid-row.active"),r=e.attr("data-row-id"),i=this;n.each((function(){var e=$(this).attr("data-row-id"),n=i.preparedData[e];e!==r&&n&&($(this).find("input[rowSelectInput]:radio").prop("checked",!1),n._selected=n._checked=!1,$(this).removeClass("active"),i.options.callOnRowDeselectEvent(n,t))}))},resetSortIcons:function(e){var t;this.isResetSortIconsDone=!0,!e&&this.gridHeaderElement&&(e=(t=this.gridHeaderElement.find(".sort-buttons-container.active")).find("i.sort-icon"),t.removeClass("active")),e.removeClass("desc asc").removeClass(this.options.cssClassNames.descIcon).removeClass(this.options.cssClassNames.ascIcon)},setSortIconDefault:function(){const e=this.options.sortInfo,t=this.tableContainer.find("[data-col-field='"+e.field+"']").find(".sort-buttons-container"),n=t.find("i.sort-icon"),r=e.direction;"asc"===r?(n.addClass(r+" "+this.options.cssClassNames.ascIcon),t.addClass("active")):"desc"===r&&(n.addClass(r+" "+this.options.cssClassNames.descIcon),t.addClass("active"))},sortHandler:function(e){e.stopImmediatePropagation(),$(e.target).hasClass("header-data")&&this.options.enableColumnSelection&&this.headerClickHandler(e);var t,n,r,i=$(e.target).closest("th.app-datagrid-header-cell"),o=i.attr("data-col-id"),s=i.find(".sort-buttons-container"),a=s.find("i.sort-icon"),l=a.hasClass("asc")?"desc":"asc",c=this.options.sortInfo,u=this.gridHeaderElement.find(".sort-buttons-container.active"),d=i.attr("data-col-field");this.resetSortIcons(a),a.addClass(l),"asc"===l?(a.addClass(this.options.cssClassNames.ascIcon),s.addClass("active")):"desc"===l&&(a.addClass(this.options.cssClassNames.descIcon),s.addClass("active")),u.length&&(n=u.closest("th.app-datagrid-header-cell").attr("data-col-id"),r=this.preparedHeaderData[n],t=u.find("i.sort-icon"),r.field!==d&&(u.removeClass("active"),this.resetSortIcons(t)),r.sortInfo={sorted:!1,direction:""}),c.direction=l,c.field=d,""!==l&&(this.preparedHeaderData[o].sortInfo={sorted:!0,direction:l}),this._setGridEditMode(!1),this.closeEditedRow(),this.options.sortHandler.call(this,this.options.sortInfo,e,"sort")},processUpDownKeys:function(e,t,n){var r=this,i=t.find("input").val();t.hasClass("row-editing")&&r.options.editmode===r.CONSTANTS.QUICK_EDIT&&i?r.toggleEditRow(e,{action:"save",noMsg:!0,success:function(i,o){r.editSuccessHandler(i,o,e,t,!0,n)}}):(t="down"===n?t.next():t.prev(),this.options.rowExpansionEnabled&&!t.is(":visible")&&(t="down"===n?t.next():t.prev()),t.focus())},resetNewRow:function(e){var t={},n=this;this.options.clearForm(!0),n.setDefaultRowData(t),e.find("[data-field-name]").each((function(){var e=$(this),r=e.attr("data-field-name")+"_new";n.options.setFieldValue(r,t[e.attr("data-field-name")]||"")})),n.options.safeApply(),n.setFocusOnElement(void 0,e,!0)},_onEnter:function(e,t,n,r){var i=this;e.is("button")||(n&&e.hasClass("app-datagrid-row")&&!e.hasClass("row-editing")?t.trigger("click",[void 0,{action:"edit"}]):t.hasClass("row-editing")&&e.closest("[data-field-name]").length?(e.blur(),i.toggleEditRow(r,{action:"save",success:function(t,n){n?e.focus():(i.focusActiveRow(),i.focusNewRow())}})):(t.trigger("click"),n&&e.hasClass("always-new-row")&&e.hasClass("row-editing")&&i.focusNewRow()),e.is("button")||r.stopPropagation())},onKeyDown:function(e){var t,n=$(e.target),r=n.closest("tr.app-datagrid-row"),i=this.options.editmode===this.CONSTANTS.QUICK_EDIT;if(this.options.rowExpansionEnabled&&!r.length&&(r=n.closest("tr.app-datagrid-detail-row")),!this.Utils.isDeleteKey(e))return 27===e.which?((t=this._isNewRow(r))&&r.hasClass("always-new-row")?(n.blur(),this.resetNewRow(r)):r.trigger("click",[void 0,{action:"cancel"}]),void(t||r.focus())):13===e.which?(e.stopPropagation(),void this._debounceOnEnter(n,r,i,e)):void(38!==e.which?40===e.which&&this.processUpDownKeys(e,r,"down"):this.processUpDownKeys(e,r,"up"));!this.options.actionsEnabled.delete||n.is("input")||n.hasClass("form-control")||this.deleteRow(e)},editSuccessHandler:function(e,t,n,r,i,o){var s,a,l=this;if(l.__setStatus(),t)l.setFocusOnElement(n);else{if(s=+r.attr("data-row-id"),o)return s="down"===o?++s:--s,void((a=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+s+'"]')).length?a.focus():r.focus());i||_.isUndefined(i)||s++,(a=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+s+'"]')).hasClass("always-new-row")?("top"!==l.options.formPosition||r.hasClass("always-new-row"))&&l.addNewRow(e):a.length?a.trigger("click",[void 0,{action:"edit",skipFocus:e,skipSelect:l.options.multiselect}]):l.options.actionsEnabled.new&&l.addNewRow(e)}},isLastColumn:function(e){var t,n=e.closest("td.app-datagrid-cell");return!!n.is(":last-child")||!!n.hasClass("cell-editing")&&(t=n.closest("tr.app-datagrid-row").find(".cell-editing").has('> :not([disabled="disabled"])'),n.attr("data-col-id")===t.last().attr("data-col-id"))},getColInfo:function(e){var t=$(e.target).closest("tr.app-datagrid-row").attr("data-row-id"),n=$(e.target).closest("td.app-datagrid-cell").attr("data-col-id");return!!(this.columnClickInfo&&this.columnClickInfo[t]&&this.columnClickInfo[t][n])&&this.columnClickInfo[t][n]},attachEventHandlers:function(e){var t=this.gridHeaderElement,n=this;this.options.enableRowSelection&&(e[0].removeEventListener("click",this.rowClickHandlerOnCapture.bind(this)),e.off(),e[0].addEventListener("click",this.rowClickHandlerOnCapture.bind(this)),e.on("click",this.rowSelectionHandler.bind(this)),e.on("click","td *",(function(e){if("checkbox"!=e.target.type){var t=$(e.target).closest("tr.app-datagrid-row").attr("data-row-id"),r=$(e.target).closest("td.app-datagrid-cell").attr("data-col-id"),i=Number(r),o=n.preparedHeaderData[i];o&&o.readonly&&"rowOperations"!==o.field&&(n.columnClickInfo[t]={},n.columnClickInfo[t][r]=!0)}})),e.on("dblclick",this.rowDblClickHandler.bind(this)),e.on("keydown",this.onKeyDown.bind(this))),t&&(this.options.enableColumnSelection?(t.find("th[data-col-selectable]").off("click",this.columnSelectionHandler.bind(this)),t.find("th[data-col-selectable]").on("click",this.columnSelectionHandler.bind(this))):t.find("th[data-col-selectable]").off("click"),this.options.enableSort?this.options.enableColumnSelection?(t.find("th[data-col-sortable] .header-data").off("click",this.sortHandler.bind(this)),t.find("th[data-col-sortable] .header-data").on("click",this.sortHandler.bind(this))):(t.find("th[data-col-sortable]").off("click",this.sortHandler.bind(this)),t.find("th[data-col-sortable]").on("click",this.sortHandler.bind(this))):this.options.enableColumnSelection?t.find("th[data-col-sortable] .header-data").off("click"):t.find("th[data-col-sortable]").off("click")),this.options.rowActions.length&&(e.find(".cancel-edit-row-button").off("click"),e.find(".save-edit-row-button").off("click"),e.find(".cancel-edit-row-button").on("click",{action:"cancel"},this.toggleEditRow.bind(this)),e.find(".save-edit-row-button").on("click",{action:"save"},this.toggleEditRow.bind(this))),n.options.editmode===n.CONSTANTS.QUICK_EDIT&&e.on("focusout","tr.app-datagrid-row",(function(e){var t=$(e.target),r=t.closest("tr.app-datagrid-row"),i=$(e.relatedTarget),o=n.isLastColumn(t,i),s=t.closest("span.actions-column").length>0,a=i.closest("span.actions-column").length>0,l=i.closest("div.app-datagrid-actions").length>0,c=i.closest("div.app-datagrid-actions").length>0;i.is("tr.app-datagrid-row")&&i.attr("data-row-id")===r.attr("data-row-id")||a||r.hasClass("danger")||c||s&&a||s&&null===e.relatedTarget||!i.closest(".app-grid").length||i.is('.row-editing:not(".always-new-row"), .row-action-button, .app-datagrid-cell, .caption, button.btn-time, button.btn-date')||""===i.attr("focus-target")||(l||s||!(!o||o&&null===e.relatedTarget||t.hasClass("file-upload")))&&n.options.timeoutCall((function(){n.toggleEditRow(e,{action:"save",noMsg:!0,success:function(t,i,o){o||n.editSuccessHandler(t,i,e,r)}})}))})),e.find('[data-identifier="rowExpansionButtons"]').off("click"),e.find('[data-identifier="rowExpansionButtons"]').on("click",(function(e){var t=$(e.target).closest("tr.app-datagrid-row");$(this).find(".app-button").attr("disabled")||n.toggleExpandRow(+t.attr("data-row-id"),void 0,e)}))},expandRow:function(e){this.toggleExpandRow(e,!0)},collapseRow:function(e){this.toggleExpandRow(e,!1)},hasAllClasses:function(e,t){return t&&t.every((t=>e.hasClass(t)))},_collapseRow:function(e,t,n,r,i){var o=this.gridElement,s=$(o.find('> tr.app-datagrid-row[data-row-id="'+n+'"]'));s.removeClass(this.options.cssClassNames.expandedRowClass),s.find("button, a").attr("aria-expanded","false").attr("aria-live","polite"),!1!==this.options.onBeforeRowCollapse(e,t,n)&&(i.length&&this.hasAllClasses(i,this.options.cssClassNames.rowExpandIcon?.split(" "))&&i.removeClass(this.options.cssClassNames.rowExpandIcon).addClass(this.options.cssClassNames.rowCollapseIcon),r.hide(),this.options.onRowCollapse(e,t))},toggleExpandRow:function(e,t,n){var r=this,i=r.gridElement,o=$(i.find('> tr.app-datagrid-row[data-row-id="'+e+'"]')),s=_.clone(r.options.data[e]),a=o.next("tr.app-datagrid-detail-row"),l=!a.is(":visible"),c=o.find('[data-identifier="rowExpansionButtons"] i.app-icon');s.$index=e+1,t&&!l||!1===t&&l||(l?(o.addClass(r.options.cssClassNames.expandedRowClass),o.find("button, a").attr("aria-expanded","true"),n&&r.preparedData[e]._selected&&n.stopPropagation(),r.options.rowDef.closeothers&&i.find("> tr.app-datagrid-detail-row:visible").each((function(){var e=$(this),t=e.prev("tr.app-datagrid-row").find('[data-identifier="rowExpansionButtons"] i.app-icon'),i=+e.attr("data-row-id"),o=r.options.data[i];e.hide(),r._collapseRow(n,o,i,e,t)})),r.options.generateRowDetailView(n,s,e,a.find("td.app-datagrid-row-details-cell .details-section"),a.find("td.app-datagrid-row-details-cell .row-overlay"),(function(){c.length&&r.hasAllClasses(c,r.options.cssClassNames.rowCollapseIcon?.split(" "))&&c.removeClass(r.options.cssClassNames.rowCollapseIcon).addClass(r.options.cssClassNames.rowExpandIcon),a.show()}))):r._collapseRow(n,s,e,a,c))},_findAndReplaceCompiledTemplates:function(){if(this.gridElement){var e=this.gridElement.find("td[data-compiled-template]"),t=this;e.each((function(){var e=$(this),n=e.attr("data-compiled-template");e.replaceWith(t.compiledCellTemplates[n])}))}},_renderSearch:function(){var e,t=$(this._getSearchEl()),n=this;function r(e){e.stopPropagation();var r=t.find('[data-element="dgSearchText"]')[0].value,i=t.find('[data-element="dgFilterValue"]')[0].value,o=t.find("option:selected").attr("data-coldef-index"),s=n.options.colDefs[o],a=s&&s.type?s.type:"";n.searchObj={field:i,value:r,type:a,event:e},n.options.searchHandler.call(n,n.searchObj,e,"search")}this.element.find(".form-search").remove(),t.insertBefore(this.gridContainer),this.gridSearch=this.element.find(".form-search"),e=this.gridSearch.find('[data-element="dgSearchText"]'),this.gridSearch.find(".app-search-button").on("click",r),this.gridSearch.find('[data-element="dgFilterValue"]').on("change",(function(e){n.dataStatusContainer.find(".status").text()===n.options.dataStates.nodata&&r(e)})),e.on("keyup",(function(e){e.stopPropagation(),$(this).val()?n.emptySearch=!1:(n.emptySearch=!0,n.searchObj.value&&(n.searchObj.value="",r(e))),(13===e.which||n.options.filteronkeypress)&&r(e)}))},_renderRowFilter:function(){var e=$('<tr class="filter-row"></tr>'),t=this,n=this.options.isMobile&&!this.options.showHeader?this.gridElement:this.gridHeaderElement;n.find(".filter-row").remove(),this.options.generateFilterRow(),this.preparedHeaderData.forEach((function(n,r){var i=n.field,o=$('<th data-col-id="'+r+'"></th>');n.searchable?(o.append(t.options.getFilterWidget(i)),e.append(o)):e.append(o)}),this),this.options.showHeader?this.gridHeaderElement.append(e):(this.options.isMobile,n.empty().append(e)),this.gridSearch=n.find(".filter-row")},_renderHeader:function(){var e,t=this._getHeaderTemplate(),n=t.colgroup,r=this;if(this.gridElement.parent().scroll((function(){r.gridHeaderElement.parent().prop("scrollLeft",this.scrollLeft)})),!this.options.showHeader)return this.tableContainer.append(n),void this.gridHeaderElement.hide();this.gridHeaderElement.show();var i=(e=t.header).find("th.app-datagrid-header-cell"),o=n.find("col");i.each((function(){var e=Number($(this).attr("data-col-id")),t=r.preparedHeaderData[e],n=$(o[e]);t&&(_.isUndefined(t.show)||t.show||($(this).hide(),n.hide()))})),this.options.isMobile,this.tableContainer.append(n),e.on("click",".app-datagrid-header-cell input:checkbox",(function(e){var t=$('tr.app-datagrid-row:not(.always-new-row):visible td input[name="gridMultiSelect"]:checkbox',r.gridElement),n=this.checked;t.prop("checked",n),t.each((function(){var t=$(this).closest("tr.app-datagrid-row"),i=t.attr("data-row-id"),o=r.options.data[i];r.toggleRowSelection(t,n,e,!0),r.options.assignSelectedItems(o,e,{rowId:i,_selected:r.preparedData[i]?._selected}),n&&_.isFunction(r.options.onRowSelect)&&r.options.onRowSelect(o,e),!n&&_.isFunction(r.options.onRowDeselect)&&r.options.onRowDeselect(o,e)}))})),_.isFunction(this.options.onHeaderClick)&&this.gridHeaderElement.find("th.app-datagrid-header-cell").on("click",this.headerClickHandler.bind(this)),!this.options.isMobile&&this.gridHeaderElement.length&&this.gridHeaderElement.find("th[data-col-resizable]").resizable({handles:"e",minWidth:50,resize:function(e,t){var n,i,o,s,a=+t.helper.attr("data-col-id")+1,l=t.helper.width(),c=t.size.width;i=r.tableContainer.find("colgroup > col:nth-child("+a+")"),n=r.tableContainer.find("colgroup > col:nth-child("+a+")"),o=r.gridElement.find("tr.app-datagrid-row > td:nth-child("+a+") > div"),n.width(c),i.width(c),o.width(c),$(this).css("height","auto"),c>t.originalSize.width&&(s=r.gridHeaderElement.width()+c-l,r.gridHeaderElement.width(s),r.gridElement.width(s)),r.addOrRemoveScroll(),r.options.redrawWidgets()}}),this.isResetSortIconsDone||this.setSortIconDefault()},addOrRemoveScroll:function(){var e=this.gridContainer.find("tbody"),t=this.gridContainer.find(".table-header");e.scrollHeight>e.clientHeight&&!this.Utils.isMac()?t.addClass("scroll-visible"):t.removeClass("scroll-visible")},_handleCustomEvents:function(e,t){this.options.handleCustomEvents(e,t)},_setActionsEnabled:function(){var e=this;_.forEach(this.options.rowActions,(function(t){_.includes(t.action,"editRow(")?e.options.actionsEnabled.edit=!0:_.includes(t.action,"deleteRow(")&&(e.options.actionsEnabled.delete=!0)}))},_appendRowActions:function(e,t,n){var r,i=this._getRowActionsColumnDef();(this.options.rowActions.length||i)&&(this._setActionsEnabled(),r=this,e.find("[data-identifier='actionButtons']").each((function(e){var i,o,s,a=e;t?i=n:(o=$(this).closest("tr.app-datagrid-row"),s=parseInt(o.attr("data-row-id"),10),(i=_.clone(r.options.data[s])).$index=a+1),r.options.generateRowActions(i,a),$(this).empty().append(r.options.getRowAction(a))})))},_renderGrid:function(e){var t,n=this.options.isNavTypeScrollOrOndemand();this.getPageStartIndex();if($("table.table-bordered").parents(".app-grid-header-inner").addClass("table_border"),n){var r=this.gridElement,i=this._getGridTemplate();t=$(i),i&&!r.length&&this.gridElement.append(t)}else{var o=this._getGridTemplate();t=$(o),o&&this.gridElement.append(t)}if(this.options.summaryRow){var s=$(this._getSummaryRowTemplate());this.tableContainer.find("tfoot").remove(),this.options.data.length&&this.tableContainer.append(s)}this.options.data.length||"nodata"!==this.dataStatus.state?(this.dataStatus.state=this.dataStatus.state||"loading",this.dataStatus.message=this.dataStatus.message||this.options.dataStates.loading,this.setStatus(this.dataStatus.state,this.dataStatus.message,e)):this.setStatus("nodata"),this.gridBody=this.gridElement.find("tbody"),this.gridFooter=this.tableContainer.find("tfoot"),this._findAndReplaceCompiledTemplates(),this.options.clearRowActions(),this._appendRowExpansionButtons(t),this._appendRowActions(t),this.attachEventHandlers(t),this.__setStatus(e),this.options.editmode===this.CONSTANTS.QUICK_EDIT&&this.options.showNewRow&&this.addNewRow(!1,!0),e&&this._setColSpan(this.options.headerConfig),_.isFunction(this.options.onDataRender)&&this.options.onDataRender(),!e&&this.options.selectFirstRow&&(this.options.multiselect&&(this.options.selectFirstRow=!1),this.gridElement.find("tr.app-datagrid-row.active").length<=0&&this.selectFirstRow(!0,!0))},_render:function(e){this.tableId||(this.tableId=this.Utils.generateGuid());!this.options.isNavTypeScrollOrOndemand()||"100%"!==this.options.height&&this.options.height;var t='<div class="overlay"><div class="status"><i class="'+this.options.loadingicon+'"></i><span class="message"></span></div></div>',n='<div class="table-container table-responsive"><div class="app-grid-header"><div class="app-grid-header-inner"><table tabindex="0" class="'+this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid+'"><thead tabindex="0" class="table-header thead-sticky" id="table_header_'+this.tableId+'"></thead><tbody class="app-grid-content app-datagrid-body" id="table_'+this.tableId+'"></tbody></table></div></div></div>',r=$(t),i=this.element.find(".table-container");this.gridContainer=$(n),this.gridHeaderElement=this.gridContainer.find(".table-header"),this._setStyles(r.find("div.overlay"),"display:none"),this._setStyles(this.gridContainer.find("div.app-grid-header-inner"),"height:"+this.options.height+"; overflow: auto;"),this.tableContainer=this.gridContainer.find("table"),this.gridElement=this.gridContainer.find(".app-grid-content"),(!this.options.isNavTypeScrollOrOndemand()||i.length&&this.options.isNextPageData)&&this.options.isNavTypeScrollOrOndemand()||(this.element.find(".table-container").remove(),this.element.append(this.gridContainer)),this.options.setIsNextPageData(!1),this.gridContainer.find(".overlay").length||(this.dataStatusContainer=$(t),this.gridContainer.append(this.dataStatusContainer)),this.gridHeaderElement&&(this.gridHeaderElement.empty(),this.gridElement.find("colgroup").remove()),this._renderHeader(),this.options.filtermode===this.CONSTANTS.SEARCH&&(_.isEmpty(this.searchObj)||this.searchObj&&!this.searchObj.field&&!this.searchObj.value)?this._renderSearch():this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&this._renderRowFilter(),"condensed"===this.options.spacing&&this._toggleSpacingClasses("condensed"),this._renderGrid(e),this.addNavigationControls()},addNavigationControls:function(){this.options.isdynamictable&&(this.element.find(".on-demand-datagrid").remove(),"On-Demand"!==this.options.navigation||this.element.find(".on-demand-datagrid").length?"Scroll"===this.options.navigation&&this.options.bindScrollEvt():this.options.addLoadMoreBtn())},__setStatus:function(e){var t=this.dataStatusContainer.find("i"),n=this.dataStatus.state,r=this.options.isNavTypeScrollOrOndemand();this.dataStatusContainer.find(".message").text(this.dataStatus.message),"loading"===n?t.removeClass("hidden"):t.addClass("hidden"),"ready"===n?this.dataStatusContainer.hide():(this.options.isNavTypeScrollOrOndemand()&&("nodata"===n||this.options.getCurrentPage()==this.options.getPageCount()&&!this.options.showviewlessbutton)&&this.element.find(".on-demand-datagrid a").hide(),this.dataStatusContainer.show()),"nodata"===n||"loading"===n||"error"===n?("100%"!==this.options.height&&"auto"!==this.options.height||("nodata"===n?(this.dataStatusContainer.css("height","auto"),this.dataStatus.contentHeight=0):this.options.isNavTypeScrollOrOndemand()&&this.options.getCurrentPage()>1?this.dataStatusContainer.hide():(this.dataStatus.height=this.dataStatus.height||this.dataStatusContainer.outerHeight(),this.dataStatus.contentHeight=this.gridElement.outerHeight()||this.dataStatus.contentHeight,this.dataStatusContainer.css("height",this.dataStatus.height>this.dataStatus.contentHeight?"auto":this.dataStatus.contentHeight))),(!r||r&&1===this.options.getCurrentPage())&&this.gridContainer.addClass("show-msg")):(this.gridContainer.removeClass("show-msg"),this.options.editmode===this.CONSTANTS.QUICK_EDIT&&(this.options.activeRow&&this.attachHandlersToActiveRow(this.options.activeRow),this.options.activeRow=void 0)),e||this.setColGroupWidths(),this.addOrRemoveScroll()},attachHandlersToActiveRow(e){var t=this.Utils.getObjectIndex(this.options.data,e),n=this.gridElement.find("tr.app-datagrid-row[data-row-id="+t+"]");n.length&&(n.hasClass("active")||n.addClass("active"),this.focusActiveRow(),this.attachEventHandlers(n))},setActiveRow(e){this.options.activeRow=e},setStatus:function(e,t,n){var r;"nodata"===e&&(e=(r=this.gridElement&&this.gridElement.find("tr.app-datagrid-row.always-new-row"))&&r.length?"ready":e),this.dataStatus.state=e,this.options.setGridState(e),this.dataStatus.message=t||this.options.dataStates[e],this._setStatusCalled?this._setStatus(n):(this.__setStatus(n),this._setStatusCalled=!0)},setGridDimensions:function(e,t){if(-1===t.indexOf("px")&&-1===t.indexOf("%")&&-1===t.indexOf("em")&&"auto"!=t&&(t+="px"),this.options[e]=t,"height"===e){this.gridHeaderElement.find("th");this.gridContainer.find(".app-grid-header-inner").css(e,t),this.options.isNavTypeScrollOrOndemand()&&"100%"!=this.options.height&&"auto"!=this.options.height&&this.gridContainer.find(".app-grid-header-inner").css("overflow","auto"),this.dataStatusContainer.css(e,t)}this.addOrRemoveScroll()},setColumnProp:function(e,t,n,r){var i;"displayName"===t&&((i=r?this.gridHeaderElement.find('th[data-col-group="'+e+'"]'):this.gridHeaderElement.find('th[data-col-field="'+e+'"]')).attr("title",n),i.find(".header-data").html(n),this.options.filtermode===this.CONSTANTS.SEARCH&&this.gridSearch&&this.gridSearch.find('select option[value="'+e+'"]').text(n))},applyRowNgClass:function(e,t){var n=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+t+'"]');n.removeClass(e.toRemove),n.addClass(e.toAdd)},applyColNgClass:function(e,t,n){var r=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+t+'"] td.app-datagrid-cell[data-col-id="'+n+'"]');r.removeClass(e.toRemove),r.addClass(e.toAdd)},_destroy:function(){this.element.text(""),window.clearTimeout(this.refreshGridTimeout)}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("rxjs")):"function"==typeof define&&define.amd?define(["exports","rxjs"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).awesomeCordova=e.awesomeCordova||{},e.awesomeCordova.core={}),e.rxjs)}(this,(function(e,t){"use strict";var n={error:"cordova_not_available"},r={error:"plugin_not_installed"};function i(e){if("undefined"!=typeof window&&window.angular){var t=window.document,n=window.angular.element(t.querySelector("[ng-app]")||t.body).injector();if(n)return n.get("$q")((function(t,n){e(t,n)}));console.warn("Angular 1 was detected but $q couldn't be retrieved. This is usually when the app is not bootstrapped on the html or body tag. Falling back to native promises which won't trigger an automatic digest when promises resolve.")}return function(){if(Promise)return new Promise((function(t,n){e(t,n)}));console.error("No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.")}()}function o(e,t,i){var o,s;"string"==typeof e?o=e:(o=e.constructor.getPluginRef(),i=e.constructor.getPluginName(),s=e.constructor.getPluginInstallName());var a=u(o);return!(!a||t&&void 0===a[t])||("undefined"!=typeof window&&window.cordova?(function(e,t,n){n?console.warn("Native: tried calling "+e+"."+n+", but the "+e+" plugin is not installed."):console.warn("Native: tried accessing the "+e+" plugin but it's not installed.");t&&console.warn("Install the "+e+" plugin: 'ionic cordova plugin add "+t+"'")}(i,s,t),r):(function(e,t){"undefined"==typeof process&&(t?console.warn("Native: tried calling "+e+"."+t+", but Cordova is not available. Make sure to include cordova.js or run in a device/simulator"):console.warn("Native: tried accessing the "+e+" plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator"))}(i,t),n))}function s(e,t){return e._objectInstance&&(!t||void 0!==e._objectInstance[t])}function a(e,t,n,r){if(void 0===t&&(t={}),t.sync)return e;if("reverse"===t.callbackOrder)e.unshift(r),e.unshift(n);else if("node"===t.callbackStyle)e.push((function(e,t){e?r(e):n(t)}));else if("object"===t.callbackStyle&&t.successName&&t.errorName){var i={};i[t.successName]=n,i[t.errorName]=r,e.push(i)}else if(void 0!==t.successIndex||void 0!==t.errorIndex){var o=function(){t.successIndex>e.length?e[t.successIndex]=n:e.splice(t.successIndex,0,n)},s=function(){t.errorIndex>e.length?e[t.errorIndex]=r:e.splice(t.errorIndex,0,r)};t.successIndex>t.errorIndex?(s(),o()):(o(),s())}else e.push(n),e.push(r);return e}function l(e,t,n,r,i,s){void 0===r&&(r={}),n=a(n,r,i,s);var l=o(e,t);if(!0===l){var c=u(e.constructor.getPluginRef());return c[t].apply(c,n)}return l}function c(e,t,n,r,i,o){if(void 0===r&&(r={}),n=a(n,r,i,o),s(e,t))return e._objectInstance[t].apply(e._objectInstance,n)}function u(e){return"undefined"!=typeof window?d(window,e):null}function d(e,t){for(var n=t.split("."),r=e,i=0;i<n.length;i++){if(!r)return null;r=r[n[i]]}return r}var h=function(e,n,r){return void 0===r&&(r={}),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return r.sync?l(e,n,o,r):r.observable?function(e,n,r,i){return void 0===i&&(i={}),new t.Observable((function(t){var o;return o=i.destruct?l(e,n,r,i,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(e)}),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.error(e)})):l(e,n,r,i,t.next.bind(t),t.error.bind(t)),o&&o.error&&(t.error(o.error),t.complete()),function(){try{if(i.clearFunction)return i.clearWithArgs?l(e,i.clearFunction,r,i,t.next.bind(t),t.error.bind(t)):l(e,i.clearFunction,[])}catch(t){console.warn("Unable to clear the previous observable watch for",e.constructor.getPluginName(),n),console.warn(t)}}}))}(e,n,o,r):r.eventObservable&&r.event?function(e,n){return n="undefined"!=typeof window&&n?d(window,n):n||("undefined"!=typeof window?window:{}),t.fromEvent(n,e)}(r.event,r.element):r.otherPromise?function(e,t,n,r){return void 0===r&&(r={}),i((function(i,o){var s=l(e,t,n,r);s?s.error?o(s.error):s.then&&s.then(i).catch(o):o({error:"unexpected_error"})}))}(e,n,o,r):function(e,t,n,r){var o,s;void 0===r&&(r={});var a=i((function(i,a){o=r.destruct?l(e,t,n,r,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(e)})):l(e,t,n,r,i,a),s=a}));return o&&o.error&&(a.catch((function(){})),"function"==typeof s&&s(o.error)),a}(e,n,o,r)}};var p=function(){function e(){}return e.installed=function(){return!0===o(this.pluginRef)},e.getPlugin=function(){return"undefined"!=typeof window?function(e,t){for(var n=t.split("."),r=e,i=0;i<n.length;i++){if(!r)return null;r=r[n[i]]}return r}(window,this.pluginRef):null},e.getPluginName=function(){return this.pluginName},e.getPluginRef=function(){return this.pluginRef},e.getPluginInstallName=function(){return this.plugin},e.getSupportedPlatforms=function(){return this.platforms},e.pluginName="",e.pluginRef="",e.plugin="",e.repo="",e.platforms=[],e.install="",e}();!function(){if("undefined"==typeof process){var e="undefined"!=typeof window?window:{},t=Date.now(),n=!1;e.document.addEventListener("deviceready",(function(){console.log("Ionic Native: deviceready event fired after "+(Date.now()-t)+" ms"),n=!0})),setTimeout((function(){!n&&e.cordova&&console.warn("Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.")}),5e3)}}(),window.rxjs._throw=window.rxjs.throwError,e.AwesomeCordovaNativePlugin=p,e.checkAvailability=o,e.cordova=function(e,t,n,r){return h(e,t,n).apply(this,r)},e.cordovaFunctionOverride=function(e,n,r){return function(e,n){return new t.Observable((function(t){var r=o(e,n);if(!0===r){var i=u(e.constructor.getPluginRef());return i[n]=t.next.bind(t),function(){return i[n]=function(){}}}t.error(r),t.complete()}))}(e,n)},e.cordovaInstance=function(e,n,r,o){return o=Array.from(o),function(e,n,r){return void 0===r&&(r={}),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(r.sync)return c(e,n,o,r);if(r.observable)return new t.Observable((function(t){var i;return i=r.destruct?c(e,n,o,r,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(e)}),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.error(e)})):c(e,n,o,r,t.next.bind(t),t.error.bind(t)),i&&i.error&&t.error(i.error),function(){try{return r.clearWithArgs?c(e,r.clearFunction,o,r,t.next.bind(t),t.error.bind(t)):c(e,r.clearFunction,[])}catch(t){console.warn("Unable to clear the previous observable watch for",e.constructor.getPluginName(),n),console.warn(t)}}}));if(r.otherPromise)return i((function(t,i){var s;s=r.destruct?c(e,n,o,r,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)})):c(e,n,o,r,t,i),s&&s.then?s.then(t,i):i()}));var a,l,u=i((function(t,i){a=r.destruct?c(e,n,o,r,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)})):c(e,n,o,r,t,i),l=i}));return a&&a.error&&(u.catch((function(){})),"function"==typeof l&&l(a.error)),u}}(e,n,r).apply(this,o)},e.cordovaPropertyGet=function(e,t){return!0===o(e,t)?u(e.constructor.getPluginRef())[t]:null},e.cordovaPropertySet=function(e,t,n){!0===o(e,t)&&(u(e.constructor.getPluginRef())[t]=n)},e.getPromise=i,e.instanceAvailability=s,e.instancePropertyGet=function(e,t){return e._objectInstance&&e._objectInstance[t]?e._objectInstance[t]:null},e.instancePropertySet=function(e,t,n){e._objectInstance&&(e._objectInstance[t]=n)},e.wrap=h})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("tslib"),require("@angular/core"),require("@awesome-cordova-plugins/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["tslib","@angular/core","@awesome-cordova-plugins/core","rxjs","rxjs/operators"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).awesomeCordova=e.awesomeCordova||{},e.awesomeCordova.plugins=t(e.tslib,e.ng.core,e.awesomeCordova.core,e.rxjs,e.rxjs.operators))}(this,(function(e,t,n,r,i){"use strict";var o,s,a,l,c,u,d=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.getAppName=function(){return n.cordova(this,"getAppName",{},arguments)},i.prototype.getPackageName=function(){return n.cordova(this,"getPackageName",{},arguments)},i.prototype.getVersionCode=function(){return n.cordova(this,"getVersionCode",{},arguments)},i.prototype.getVersionNumber=function(){return n.cordova(this,"getVersionNumber",{},arguments)},i.pluginName="AppVersion",i.plugin="cordova-plugin-app-version",i.pluginRef="cordova.getAppVersion",i.repo="https://github.com/whiteoctober/cordova-plugin-app-version",i.platforms=["Android","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),h=Object.freeze({__proto__:null,AppVersion:d}),p=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.Encode={TEXT_TYPE:"TEXT_TYPE",EMAIL_TYPE:"EMAIL_TYPE",PHONE_TYPE:"PHONE_TYPE",SMS_TYPE:"SMS_TYPE"},e}return e.__extends(i,r),i.prototype.scan=function(e){return n.cordova(this,"scan",{callbackOrder:"reverse"},arguments)},i.prototype.encode=function(e,t){return n.cordova(this,"encode",{},arguments)},i.pluginName="BarcodeScanner",i.plugin="phonegap-plugin-barcodescanner",i.pluginRef="cordova.plugins.barcodeScanner",i.repo="https://github.com/phonegap/phonegap-plugin-barcodescanner",i.platforms=["Android","BlackBerry 10","Browser","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),f=Object.freeze({__proto__:null,BarcodeScanner:p}),m=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.hasReadWritePermission=function(){return n.cordova(this,"hasReadWritePermission",{},arguments)},i.prototype.hasReadPermission=function(){return n.cordova(this,"hasReadPermission",{},arguments)},i.prototype.hasWritePermission=function(){return n.cordova(this,"hasWritePermission",{},arguments)},i.prototype.requestWritePermission=function(){return n.cordova(this,"requestWritePermission",{},arguments)},i.prototype.requestReadPermission=function(){return n.cordova(this,"requestReadPermission",{},arguments)},i.prototype.requestReadWritePermission=function(){return n.cordova(this,"requestReadWritePermission",{},arguments)},i.prototype.createCalendar=function(e){return n.cordova(this,"createCalendar",{},arguments)},i.prototype.deleteCalendar=function(e){return n.cordova(this,"deleteCalendar",{},arguments)},i.prototype.getCalendarOptions=function(){return n.cordova(this,"getCalendarOptions",{sync:!0},arguments)},i.prototype.getCreateCalendarOptions=function(){return n.cordova(this,"getCreateCalendarOptions",{sync:!0},arguments)},i.prototype.createEvent=function(e,t,r,i,o){return n.cordova(this,"createEvent",{},arguments)},i.prototype.createEventWithOptions=function(e,t,r,i,o,s){return n.cordova(this,"createEventWithOptions",{},arguments)},i.prototype.createEventInteractively=function(e,t,r,i,o){return n.cordova(this,"createEventInteractively",{},arguments)},i.prototype.createEventInteractivelyWithOptions=function(e,t,r,i,o,s){return n.cordova(this,"createEventInteractivelyWithOptions",{},arguments)},i.prototype.findEvent=function(e,t,r,i,o){return n.cordova(this,"findEvent",{},arguments)},i.prototype.findEventWithOptions=function(e,t,r,i,o,s){return n.cordova(this,"findEventWithOptions",{},arguments)},i.prototype.listEventsInRange=function(e,t){return n.cordova(this,"listEventsInRange",{platforms:["Android"]},arguments)},i.prototype.listCalendars=function(){return n.cordova(this,"listCalendars",{},arguments)},i.prototype.findAllEventsInNamedCalendar=function(e){return n.cordova(this,"findAllEventsInNamedCalendar",{platforms:["iOS"]},arguments)},i.prototype.modifyEvent=function(e,t,r,i,o,s,a,l,c,u){return n.cordova(this,"modifyEvent",{platforms:["iOS"]},arguments)},i.prototype.modifyEventWithOptions=function(e,t,r,i,o,s,a,l,c,u,d,h){return n.cordova(this,"modifyEventWithOptions",{platforms:["iOS"]},arguments)},i.prototype.deleteEvent=function(e,t,r,i,o){return n.cordova(this,"deleteEvent",{},arguments)},i.prototype.deleteEventFromNamedCalendar=function(e,t,r,i,o,s){return n.cordova(this,"deleteEventFromNamedCalendar",{platforms:["iOS"]},arguments)},i.prototype.deleteEventById=function(e,t){return n.cordova(this,"deleteEventById",{},arguments)},i.prototype.openCalendar=function(e){return n.cordova(this,"openCalendar",{},arguments)},i.pluginName="Calendar",i.plugin="cordova-plugin-calendar",i.pluginRef="plugins.calendar",i.repo="https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin",i.platforms=["Android","iOS"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),g=Object.freeze({__proto__:null,Calendar:m});!function(e){e[e.DATA_URL=0]="DATA_URL",e[e.FILE_URL=1]="FILE_URL",e[e.NATIVE_URI=2]="NATIVE_URI"}(o||(o={})),function(e){e[e.JPEG=0]="JPEG",e[e.PNG=1]="PNG"}(s||(s={})),function(e){e[e.PICTURE=0]="PICTURE",e[e.VIDEO=1]="VIDEO",e[e.ALLMEDIA=2]="ALLMEDIA"}(a||(a={})),function(e){e[e.PHOTOLIBRARY=0]="PHOTOLIBRARY",e[e.CAMERA=1]="CAMERA",e[e.SAVEDPHOTOALBUM=2]="SAVEDPHOTOALBUM"}(l||(l={})),function(e){e[e.ARROW_UP=1]="ARROW_UP",e[e.ARROW_DOWN=2]="ARROW_DOWN",e[e.ARROW_LEFT=3]="ARROW_LEFT",e[e.ARROW_RIGHT=4]="ARROW_RIGHT",e[e.ARROW_ANY=5]="ARROW_ANY"}(c||(c={})),function(e){e[e.BACK=0]="BACK",e[e.FRONT=1]="FRONT"}(u||(u={}));var v,y=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.DestinationType={DATA_URL:0,FILE_URI:1,NATIVE_URI:2},e.EncodingType={JPEG:0,PNG:1},e.MediaType={PICTURE:0,VIDEO:1,ALLMEDIA:2},e.PictureSourceType={PHOTOLIBRARY:0,CAMERA:1,SAVEDPHOTOALBUM:2},e.PopoverArrowDirection={ARROW_UP:1,ARROW_DOWN:2,ARROW_LEFT:4,ARROW_RIGHT:8,ARROW_ANY:15},e.Direction={BACK:0,FRONT:1},e}return e.__extends(i,r),i.prototype.getPicture=function(e){return n.cordova(this,"getPicture",{callbackOrder:"reverse"},arguments)},i.prototype.cleanup=function(){return n.cordova(this,"cleanup",{platforms:["iOS"]},arguments)},i.pluginName="Camera",i.plugin="cordova-plugin-camera",i.pluginRef="navigator.camera",i.repo="https://github.com/apache/cordova-plugin-camera",i.platforms=["Android","Browser","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),b=Object.freeze({__proto__:null,Camera:y,get DestinationType(){return o},get Direction(){return u},get EncodingType(){return s},get MediaType(){return a},get PictureSourceType(){return l},get PopoverArrowDirection(){return c}}),_=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),Object.defineProperty(i.prototype,"cordova",{get:function(){return n.cordovaPropertyGet(this,"cordova")},set:function(e){n.cordovaPropertySet(this,"cordova",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"model",{get:function(){return n.cordovaPropertyGet(this,"model")},set:function(e){n.cordovaPropertySet(this,"model",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"platform",{get:function(){return n.cordovaPropertyGet(this,"platform")},set:function(e){n.cordovaPropertySet(this,"platform",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"uuid",{get:function(){return n.cordovaPropertyGet(this,"uuid")},set:function(e){n.cordovaPropertySet(this,"uuid",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"version",{get:function(){return n.cordovaPropertyGet(this,"version")},set:function(e){n.cordovaPropertySet(this,"version",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"manufacturer",{get:function(){return n.cordovaPropertyGet(this,"manufacturer")},set:function(e){n.cordovaPropertySet(this,"manufacturer",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isVirtual",{get:function(){return n.cordovaPropertyGet(this,"isVirtual")},set:function(e){n.cordovaPropertySet(this,"isVirtual",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"serial",{get:function(){return n.cordovaPropertyGet(this,"serial")},set:function(e){n.cordovaPropertySet(this,"serial",e)},enumerable:!1,configurable:!0}),i.pluginName="Device",i.plugin="cordova-plugin-device",i.pluginRef="device",i.repo="https://github.com/apache/cordova-plugin-device",i.platforms=["Android","Browser","iOS","macOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),w=Object.freeze({__proto__:null,Device:_}),x=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.cordovaFileError={1:"NOT_FOUND_ERR",2:"SECURITY_ERR",3:"ABORT_ERR",4:"NOT_READABLE_ERR",5:"ENCODING_ERR",6:"NO_MODIFICATION_ALLOWED_ERR",7:"INVALID_STATE_ERR",8:"SYNTAX_ERR",9:"INVALID_MODIFICATION_ERR",10:"QUOTA_EXCEEDED_ERR",11:"TYPE_MISMATCH_ERR",12:"PATH_EXISTS_ERR",13:"WRONG_ENTRY_TYPE",14:"DIR_READ_ERR"},e}return e.__extends(i,r),i.prototype.getFreeDiskSpace=function(){var e=this;return function(){if(!0===n.checkAvailability(e))return n.getPromise((function(e,t){cordova.exec(e,t,"File","getFreeDiskSpace",[])}))}()},i.prototype.checkDir=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}var o=e+t;return r.resolveDirectoryUrl(o).then((function(){return!0}))}}()},i.prototype.createDir=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i)){if(/^\//.test(t)){var o=new FileError(5);return o.message="directory cannot start with /",Promise.reject(o)}var s={create:!0};return r||(s.exclusive=!0),i.resolveDirectoryUrl(e).then((function(e){return i.getDirectory(e,t,s)}))}}()},i.prototype.removeDir=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getDirectory(e,t,{create:!1})})).then((function(e){return r.remove(e)}))}}()},i.prototype.moveDir=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i=i||t)){var s=new FileError(5);return s.message="directory cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getDirectory(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.move(e,t,i)}))}))}}()},i.prototype.copyDir=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i)){var s=new FileError(5);return s.message="directory cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getDirectory(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.copy(e,t,i)}))}))}}()},i.prototype.listDir=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getDirectory(e,t,{create:!1,exclusive:!1})})).then((function(e){var t=e.createReader();return r.readEntries(t)}))}}()},i.prototype.removeRecursively=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getDirectory(e,t,{create:!1})})).then((function(e){return r.rimraf(e)}))}}()},i.prototype.checkFile=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="file cannot start with /",Promise.reject(i)}return r.resolveLocalFilesystemUrl(e+t).then((function(e){if(e.isFile)return!0;var t=new FileError(13);return t.message="input is not a file",Promise.reject(t)}))}}()},i.prototype.createFile=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i)){if(/^\//.test(t)){var o=new FileError(5);return o.message="file-name cannot start with /",Promise.reject(o)}var s={create:!0};return r||(s.exclusive=!0),i.resolveDirectoryUrl(e).then((function(e){return i.getFile(e,t,s)}))}}()},i.prototype.removeFile=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="file-name cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getFile(e,t,{create:!1})})).then((function(e){return r.remove(e)}))}}()},i.prototype.writeFile=function(e,t,r,i){var o=this;return void 0===i&&(i={}),function(){if(!0===n.checkAvailability(o)){if(/^\//.test(t)){var s=new FileError(5);return s.message="file-name cannot start with /",Promise.reject(s)}var a={create:!i.append,exclusive:!i.replace};return o.resolveDirectoryUrl(e).then((function(e){return o.getFile(e,t,a)})).then((function(e){return o.writeFileEntry(e,r,i)}))}}()},i.prototype.writeFileEntry=function(e,t,n){var r=this;return this.createWriter(e).then((function(e){return n.append&&e.seek(e.length),n.truncate&&e.truncate(n.truncate),r.write(e,t)})).then((function(){return e}))},i.prototype.writeExistingFile=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i))return i.writeFile(e,t,r,{replace:!0})}()},i.prototype.readAsText=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"Text")}()},i.prototype.readAsDataURL=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"DataURL")}()},i.prototype.readAsBinaryString=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"BinaryString")}()},i.prototype.readAsArrayBuffer=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"ArrayBuffer")}()},i.prototype.moveFile=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i=i||t)){var s=new FileError(5);return s.message="file name cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getFile(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.move(e,t,i)}))}))}}()},i.prototype.copyFile=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i=i||t)){var s=new FileError(5);return s.message="file name cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getFile(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.copy(e,t,i)}))}))}}()},i.prototype.fillErrorMessage=function(e){try{e.message=this.cordovaFileError[e.code]}catch(e){}},i.prototype.resolveLocalFilesystemUrl=function(e){var t=this;return function(){if(!0===n.checkAvailability(t))return n.getPromise((function(n,r){try{window.resolveLocalFileSystemURL(e,(function(e){n(e)}),(function(e){t.fillErrorMessage(e),r(e)}))}catch(e){t.fillErrorMessage(e),r(e)}}))}()},i.prototype.resolveDirectoryUrl=function(e){var t=this;return function(){if(!0===n.checkAvailability(t))return t.resolveLocalFilesystemUrl(e).then((function(e){if(e.isDirectory)return e;var t=new FileError(13);return t.message="input is not a directory",Promise.reject(t)}))}()},i.prototype.getDirectory=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i))return new Promise((function(n,o){try{e.getDirectory(t,r,(function(e){n(e)}),(function(e){i.fillErrorMessage(e),o(e)}))}catch(e){i.fillErrorMessage(e),o(e)}}))}()},i.prototype.getFile=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i))return new Promise((function(n,o){try{e.getFile(t,r,n,(function(e){i.fillErrorMessage(e),o(e)}))}catch(e){i.fillErrorMessage(e),o(e)}}))}()},i.prototype.readFile=function(e,t,r){var i=this;if(/^\//.test(t)){var o=new FileError(5);return o.message="file-name cannot start with /",Promise.reject(o)}return this.resolveDirectoryUrl(e).then((function(e){return i.getFile(e,t,{create:!1})})).then((function(e){var t=new FileReader;return n.getPromise((function(n,i){t.onloadend=function(){void 0!==t.result||null!==t.result?n(t.result):void 0!==t.error||null!==t.error?i(t.error):i({code:null,message:"READER_ONLOADEND_ERR"})},e.file((function(e){t["readAs"+r].call(t,e)}),(function(e){i(e)}))}))}))},i.prototype.remove=function(e){var t=this;return new Promise((function(n,r){e.remove((function(){n({success:!0,fileRemoved:e})}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.move=function(e,t,n){var r=this;return new Promise((function(i,o){e.moveTo(t,n,(function(e){i(e)}),(function(e){r.fillErrorMessage(e),o(e)}))}))},i.prototype.copy=function(e,t,n){var r=this;return new Promise((function(i,o){e.copyTo(t,n,(function(e){i(e)}),(function(e){r.fillErrorMessage(e),o(e)}))}))},i.prototype.readEntries=function(e){var t=this;return new Promise((function(n,r){e.readEntries((function(e){n(e)}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.rimraf=function(e){var t=this;return new Promise((function(n,r){e.removeRecursively((function(){n({success:!0,fileRemoved:e})}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.createWriter=function(e){var t=this;return new Promise((function(n,r){e.createWriter((function(e){n(e)}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.write=function(e,t){return t instanceof Blob?this.writeFileInChunks(e,t):new Promise((function(n,r){e.onwriteend=function(t){e.error?r(e.error):n(t)},e.write(t)}))},i.prototype.writeFileInChunks=function(e,t){var r=0;function i(){var n=Math.min(1048576,t.size-r),i=t.slice(r,r+n);r+=n,e.write(i)}return n.getPromise((function(n,o){e.onerror=o,e.onwrite=function(){r<t.size?i():n()},i()}))},Object.defineProperty(i.prototype,"applicationDirectory",{get:function(){return n.cordovaPropertyGet(this,"applicationDirectory")},set:function(e){n.cordovaPropertySet(this,"applicationDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"applicationStorageDirectory",{get:function(){return n.cordovaPropertyGet(this,"applicationStorageDirectory")},set:function(e){n.cordovaPropertySet(this,"applicationStorageDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dataDirectory",{get:function(){return n.cordovaPropertyGet(this,"dataDirectory")},set:function(e){n.cordovaPropertySet(this,"dataDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cacheDirectory",{get:function(){return n.cordovaPropertyGet(this,"cacheDirectory")},set:function(e){n.cordovaPropertySet(this,"cacheDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalApplicationStorageDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalApplicationStorageDirectory")},set:function(e){n.cordovaPropertySet(this,"externalApplicationStorageDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalDataDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalDataDirectory")},set:function(e){n.cordovaPropertySet(this,"externalDataDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalCacheDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalCacheDirectory")},set:function(e){n.cordovaPropertySet(this,"externalCacheDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalRootDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalRootDirectory")},set:function(e){n.cordovaPropertySet(this,"externalRootDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tempDirectory",{get:function(){return n.cordovaPropertyGet(this,"tempDirectory")},set:function(e){n.cordovaPropertySet(this,"tempDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"syncedDataDirectory",{get:function(){return n.cordovaPropertyGet(this,"syncedDataDirectory")},set:function(e){n.cordovaPropertySet(this,"syncedDataDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"documentsDirectory",{get:function(){return n.cordovaPropertyGet(this,"documentsDirectory")},set:function(e){n.cordovaPropertySet(this,"documentsDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sharedDirectory",{get:function(){return n.cordovaPropertyGet(this,"sharedDirectory")},set:function(e){n.cordovaPropertySet(this,"sharedDirectory",e)},enumerable:!1,configurable:!0}),i.pluginName="File",i.plugin="cordova-plugin-file",i.pluginRef="cordova.file",i.repo="https://github.com/apache/cordova-plugin-file",i.platforms=["Android","Browser","iOS","macOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),S=Object.freeze({__proto__:null,File:x}),k=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.open=function(e,t){return n.cordova(this,"open",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.prototype.uninstall=function(e){return n.cordova(this,"uninstall",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.prototype.appIsInstalled=function(e){return n.cordova(this,"appIsInstalled",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.prototype.showOpenWithDialog=function(e,t){return n.cordova(this,"showOpenWithDialog",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.pluginName="FileOpener",i.plugin="cordova-plugin-file-opener2",i.pluginRef="cordova.plugins.fileOpener2",i.repo="https://github.com/pwlin/cordova-plugin-file-opener2",i.platforms=["Android","iOS","Windows","Windows Phone 8"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),E=Object.freeze({__proto__:null,FileOpener:k}),T=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return e.__extends(o,i),o.prototype.getCurrentPosition=function(e){return n.cordova(this,"getCurrentPosition",{callbackOrder:"reverse"},arguments)},o.prototype.watchPosition=function(e){return new r.Observable((function(t){var n=navigator.geolocation.watchPosition(t.next.bind(t),t.next.bind(t),e);return function(){return navigator.geolocation.clearWatch(n)}}))},o.pluginName="Geolocation",o.plugin="cordova-plugin-geolocation",o.pluginRef="navigator.geolocation",o.repo="https://github.com/apache/cordova-plugin-geolocation",o.install='ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',o.installVariables=["GEOLOCATION_USAGE_DESCRIPTION"],o.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"],o.decorators=[{type:t.Injectable}],o}(n.AwesomeCordovaNativePlugin),C=Object.freeze({__proto__:null,Geolocation:T}),D=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.captureAudio=function(e){return n.cordova(this,"captureAudio",{callbackOrder:"reverse"},arguments)},i.prototype.captureImage=function(e){return n.cordova(this,"captureImage",{callbackOrder:"reverse"},arguments)},i.prototype.captureVideo=function(e){return n.cordova(this,"captureVideo",{callbackOrder:"reverse"},arguments)},i.prototype.onPendingCaptureResult=function(){return n.cordova(this,"onPendingCaptureResult",{eventObservable:!0,event:"pendingcaptureresult"},arguments)},i.prototype.onPendingCaptureError=function(){return n.cordova(this,"onPendingCaptureError",{eventObservable:!0,event:"pendingcaptureerror"},arguments)},Object.defineProperty(i.prototype,"supportedImageModes",{get:function(){return n.cordovaPropertyGet(this,"supportedImageModes")},set:function(e){n.cordovaPropertySet(this,"supportedImageModes",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supportedAudioModes",{get:function(){return n.cordovaPropertyGet(this,"supportedAudioModes")},set:function(e){n.cordovaPropertySet(this,"supportedAudioModes",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supportedVideoModes",{get:function(){return n.cordovaPropertyGet(this,"supportedVideoModes")},set:function(e){n.cordovaPropertySet(this,"supportedVideoModes",e)},enumerable:!1,configurable:!0}),i.pluginName="MediaCapture",i.plugin="cordova-plugin-media-capture",i.pluginRef="navigator.device.capture",i.repo="https://github.com/apache/cordova-plugin-media-capture",i.platforms=["Android","Browser","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),M=Object.freeze({__proto__:null,MediaCapture:D});!function(e){e.UNKNOWN="unknown",e.ETHERNET="ethernet",e.WIFI="wifi",e.CELL_2G="2g",e.CELL_3G="3g",e.CELL_4G="4g",e.CELL="cellular",e.NONE="none"}(v||(v={}));var A=function(o){function s(){var e=null!==o&&o.apply(this,arguments)||this;return e.Connection={UNKNOWN:"unknown",ETHERNET:"ethernet",WIFI:"wifi",CELL_2G:"2g",CELL_3G:"3g",CELL_4G:"4g",CELL:"cellular",NONE:"none"},e}return e.__extends(s,o),s.prototype.onChange=function(){var e=this;return function(){if(!0===n.checkAvailability(e))return r.merge(e.onConnect().pipe(i.mapTo("connected")),e.onDisconnect().pipe(i.mapTo("disconnected")))}()},s.prototype.onDisconnect=function(){return n.cordova(this,"onDisconnect",{eventObservable:!0,event:"offline",element:"document"},arguments)},s.prototype.onConnect=function(){return n.cordova(this,"onConnect",{eventObservable:!0,event:"online",element:"document"},arguments)},Object.defineProperty(s.prototype,"type",{get:function(){return n.cordovaPropertyGet(this,"type")},set:function(e){n.cordovaPropertySet(this,"type",e)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"downlinkMax",{get:function(){return n.cordovaPropertyGet(this,"downlinkMax")},set:function(e){n.cordovaPropertySet(this,"downlinkMax",e)},enumerable:!1,configurable:!0}),s.pluginName="Network",s.plugin="cordova-plugin-network-information",s.pluginRef="navigator.connection",s.repo="https://github.com/apache/cordova-plugin-network-information",s.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"],s.decorators=[{type:t.Injectable}],s}(n.AwesomeCordovaNativePlugin),I=Object.freeze({__proto__:null,get Connection(){return v},Network:A}),L=function(){function e(e){this._objectInstance=e}return e.prototype.addTransaction=function(e){return n.cordovaInstance(this,"addTransaction",{sync:!0},arguments)},e.prototype.transaction=function(e){return n.cordovaInstance(this,"transaction",{successIndex:2,errorIndex:1},arguments)},e.prototype.readTransaction=function(e){return n.cordovaInstance(this,"readTransaction",{},arguments)},e.prototype.startNextTransaction=function(){return n.cordovaInstance(this,"startNextTransaction",{sync:!0},arguments)},e.prototype.open=function(){return n.cordovaInstance(this,"open",{},arguments)},e.prototype.close=function(){return n.cordovaInstance(this,"close",{},arguments)},e.prototype.executeSql=function(e,t){return n.cordovaInstance(this,"executeSql",{},arguments)},e.prototype.sqlBatch=function(e){return n.cordovaInstance(this,"sqlBatch",{},arguments)},e.prototype.abortallPendingTransactions=function(){return n.cordovaInstance(this,"abortallPendingTransactions",{sync:!0},arguments)},Object.defineProperty(e.prototype,"databaseFeatures",{get:function(){return n.instancePropertyGet(this,"databaseFeatures")},set:function(e){n.instancePropertySet(this,"databaseFeatures",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"openDBs",{get:function(){return n.instancePropertyGet(this,"openDBs")},set:function(e){n.instancePropertySet(this,"openDBs",e)},enumerable:!1,configurable:!0}),e}(),O=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.create=function(e){var t=this;return function(){if(!0===n.checkAvailability(t))return new Promise((function(t,n){sqlitePlugin.openDatabase(e,(function(e){return t(new L(e))}),n)}))}()},i.prototype.echoTest=function(){return n.cordova(this,"echoTest",{},arguments)},i.prototype.selfTest=function(){return n.cordova(this,"selfTest",{},arguments)},i.prototype.deleteDatabase=function(e){return n.cordova(this,"deleteDatabase",{},arguments)},i.pluginName="SQLite",i.pluginRef="sqlitePlugin",i.plugin="cordova-sqlite-storage",i.repo="https://github.com/litehelpers/Cordova-sqlite-storage",i.platforms=["Android","iOS","macOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),N=Object.freeze({__proto__:null,SQLite:O,SQLiteObject:L}),R=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.vibrate=function(e){return n.cordova(this,"vibrate",{sync:!0},arguments)},i.pluginName="Vibration",i.plugin="cordova-plugin-vibration",i.pluginRef="navigator",i.repo="https://github.com/apache/cordova-plugin-vibration",i.platforms=["Android","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),P=Object.freeze({__proto__:null,Vibration:R}),F=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.REQUEST_PRIORITY_NO_POWER=0,e.REQUEST_PRIORITY_LOW_POWER=1,e.REQUEST_PRIORITY_BALANCED_POWER_ACCURACY=2,e.REQUEST_PRIORITY_HIGH_ACCURACY=3,e.SUCCESS_SETTINGS_SATISFIED=0,e.SUCCESS_USER_AGREED=1,e.ERROR_ALREADY_REQUESTING=-1,e.ERROR_INVALID_ACTION=0,e.ERROR_INVALID_ACCURACY=1,e.ERROR_EXCEPTION=1,e.ERROR_CANNOT_CHANGE_ACCURACY=3,e.ERROR_USER_DISAGREED=4,e.ERROR_GOOGLE_API_CONNECTION_FAILED=4,e}return e.__extends(i,r),i.prototype.canRequest=function(){return n.cordova(this,"canRequest",{},arguments)},i.prototype.isRequesting=function(){return n.cordova(this,"isRequesting",{},arguments)},i.prototype.request=function(e){return n.cordova(this,"request",{callbackOrder:"reverse"},arguments)},i.pluginName="LocationAccuracy",i.plugin="cordova-plugin-request-location-accuracy",i.pluginRef="cordova.plugins.locationAccuracy",i.repo="https://github.com/dpa99c/cordova-plugin-request-location-accuracy",i.platforms=["Android","iOS"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),j=Object.freeze({__proto__:null,LocationAccuracy:F}),Y=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.permission={READ_CALENDAR:"READ_CALENDAR",WRITE_CALENDAR:"WRITE_CALENDAR",CAMERA:"CAMERA",READ_CONTACTS:"READ_CONTACTS",WRITE_CONTACTS:"WRITE_CONTACTS",GET_ACCOUNTS:"GET_ACCOUNTS",ACCESS_FINE_LOCATION:"ACCESS_FINE_LOCATION",ACCESS_COARSE_LOCATION:"ACCESS_COARSE_LOCATION",RECORD_AUDIO:"RECORD_AUDIO",READ_PHONE_STATE:"READ_PHONE_STATE",CALL_PHONE:"CALL_PHONE",ADD_VOICEMAIL:"ADD_VOICEMAIL",USE_SIP:"USE_SIP",PROCESS_OUTGOING_CALLS:"PROCESS_OUTGOING_CALLS",READ_CALL_LOG:"READ_CALL_LOG",WRITE_CALL_LOG:"WRITE_CALL_LOG",SEND_SMS:"SEND_SMS",RECEIVE_SMS:"RECEIVE_SMS",READ_SMS:"READ_SMS",RECEIVE_WAP_PUSH:"RECEIVE_WAP_PUSH",RECEIVE_MMS:"RECEIVE_MMS",WRITE_EXTERNAL_STORAGE:"WRITE_EXTERNAL_STORAGE",READ_EXTERNAL_STORAGE:"READ_EXTERNAL_STORAGE",BODY_SENSORS:"BODY_SENSORS"},e.locationAuthorizationMode={ALWAYS:"always",WHEN_IN_USE:"when_in_use"},e.permissionGroups={CALENDAR:["READ_CALENDAR","WRITE_CALENDAR"],CAMERA:["CAMERA"],CONTACTS:["READ_CONTACTS","WRITE_CONTACTS","GET_ACCOUNTS"],LOCATION:["ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION"],MICROPHONE:["RECORD_AUDIO"],PHONE:["READ_PHONE_STATE","CALL_PHONE","ADD_VOICEMAIL","USE_SIP","PROCESS_OUTGOING_CALLS","READ_CALL_LOG","WRITE_CALL_LOG"],SENSORS:["BODY_SENSORS"],SMS:["SEND_SMS","RECEIVE_SMS","READ_SMS","RECEIVE_WAP_PUSH","RECEIVE_MMS"],STORAGE:["READ_EXTERNAL_STORAGE","WRITE_EXTERNAL_STORAGE"]},e.locationMode={HIGH_ACCURACY:"high_accuracy",DEVICE_ONLY:"device_only",BATTERY_SAVING:"battery_saving",LOCATION_OFF:"location_off"},e.bluetoothState={UNKNOWN:"unknown",RESETTING:"resetting",UNSUPPORTED:"unsupported",UNAUTHORIZED:"unauthorized",POWERED_OFF:"powered_off",POWERED_ON:"powered_on",POWERING_OFF:"powering_off",POWERING_ON:"powering_on"},e}return e.__extends(i,r),i.prototype.isLocationAvailable=function(){return n.cordova(this,"isLocationAvailable",{},arguments)},i.prototype.isWifiAvailable=function(){return n.cordova(this,"isWifiAvailable",{},arguments)},i.prototype.isCameraAvailable=function(e){return n.cordova(this,"isCameraAvailable",{callbackOrder:"reverse"},arguments)},i.prototype.isBluetoothAvailable=function(){return n.cordova(this,"isBluetoothAvailable",{},arguments)},i.prototype.switchToLocationSettings=function(){return n.cordova(this,"switchToLocationSettings",{sync:!0,platforms:["Android","Windows 10","iOS"]},arguments)},i.prototype.switchToMobileDataSettings=function(){return n.cordova(this,"switchToMobileDataSettings",{sync:!0,platforms:["Android","Windows 10"]},arguments)},i.prototype.switchToBluetoothSettings=function(){return n.cordova(this,"switchToBluetoothSettings",{sync:!0,platforms:["Android","Windows 10"]},arguments)},i.prototype.switchToWifiSettings=function(){return n.cordova(this,"switchToWifiSettings",{sync:!0,platforms:["Android","Windows 10"]},arguments)},i.prototype.isWifiEnabled=function(){return n.cordova(this,"isWifiEnabled",{platforms:["Android","Windows 10"]},arguments)},i.prototype.setWifiState=function(e){return n.cordova(this,"setWifiState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)},i.prototype.setBluetoothState=function(e){return n.cordova(this,"setBluetoothState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)},i.prototype.isLocationEnabled=function(){return n.cordova(this,"isLocationEnabled",{platforms:["Android","iOS"]},arguments)},i.prototype.isLocationAuthorized=function(){return n.cordova(this,"isLocationAuthorized",{},arguments)},i.prototype.getLocationAuthorizationStatus=function(){return n.cordova(this,"getLocationAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestLocationAuthorization=function(e){return n.cordova(this,"requestLocationAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.isCameraPresent=function(){return n.cordova(this,"isCameraPresent",{platforms:["Android","iOS"]},arguments)},i.prototype.isCameraAuthorized=function(e){return n.cordova(this,"isCameraAuthorized",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.getCameraAuthorizationStatus=function(e){return n.cordova(this,"getCameraAuthorizationStatus",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.requestCameraAuthorization=function(e){return n.cordova(this,"requestCameraAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.isMicrophoneAuthorized=function(){return n.cordova(this,"isMicrophoneAuthorized",{platforms:["Android","iOS"]},arguments)},i.prototype.getMicrophoneAuthorizationStatus=function(){return n.cordova(this,"getMicrophoneAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestMicrophoneAuthorization=function(){return n.cordova(this,"requestMicrophoneAuthorization",{platforms:["Android","iOS"]},arguments)},i.prototype.isContactsAuthorized=function(){return n.cordova(this,"isContactsAuthorized",{platforms:["Android","iOS"]},arguments)},i.prototype.getContactsAuthorizationStatus=function(){return n.cordova(this,"getContactsAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestContactsAuthorization=function(){return n.cordova(this,"requestContactsAuthorization",{platforms:["Android","iOS"]},arguments)},i.prototype.isCalendarAuthorized=function(){return n.cordova(this,"isCalendarAuthorized",{platforms:["Android","iOS"]},arguments)},i.prototype.getCalendarAuthorizationStatus=function(){return n.cordova(this,"getCalendarAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestCalendarAuthorization=function(){return n.cordova(this,"requestCalendarAuthorization",{platforms:["Android","iOS"]},arguments)},i.prototype.switchToSettings=function(){return n.cordova(this,"switchToSettings",{platforms:["Android","iOS"]},arguments)},i.prototype.getBluetoothState=function(){return n.cordova(this,"getBluetoothState",{platforms:["Android","iOS"]},arguments)},i.prototype.registerBluetoothStateChangeHandler=function(e){return n.cordova(this,"registerBluetoothStateChangeHandler",{platforms:["Android","iOS"],sync:!0},arguments)},i.prototype.registerLocationStateChangeHandler=function(e){return n.cordova(this,"registerLocationStateChangeHandler",{platforms:["Android","iOS"],sync:!0},arguments)},i.prototype.isGpsLocationAvailable=function(){return n.cordova(this,"isGpsLocationAvailable",{platforms:["Android"]},arguments)},i.prototype.isGpsLocationEnabled=function(){return n.cordova(this,"isGpsLocationEnabled",{platforms:["Android"]},arguments)},i.prototype.isNetworkLocationAvailable=function(){return n.cordova(this,"isNetworkLocationAvailable",{platforms:["Android"]},arguments)},i.prototype.isNetworkLocationEnabled=function(){return n.cordova(this,"isNetworkLocationEnabled",{platforms:["Android"]},arguments)},i.prototype.getLocationMode=function(){return n.cordova(this,"getLocationMode",{platforms:["Android"]},arguments)},i.prototype.getPermissionAuthorizationStatus=function(e){return n.cordova(this,"getPermissionAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.getPermissionsAuthorizationStatus=function(e){return n.cordova(this,"getPermissionsAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.requestRuntimePermission=function(e){return n.cordova(this,"requestRuntimePermission",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.requestRuntimePermissions=function(e){return n.cordova(this,"requestRuntimePermissions",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.isRequestingPermission=function(){return n.cordova(this,"isRequestingPermission",{sync:!0},arguments)},i.prototype.registerPermissionRequestCompleteHandler=function(e){return n.cordova(this,"registerPermissionRequestCompleteHandler",{sync:!0},arguments)},i.prototype.isBluetoothEnabled=function(){return n.cordova(this,"isBluetoothEnabled",{platforms:["Android"]},arguments)},i.prototype.hasBluetoothSupport=function(){return n.cordova(this,"hasBluetoothSupport",{platforms:["Android"]},arguments)},i.prototype.hasBluetoothLESupport=function(){return n.cordova(this,"hasBluetoothLESupport",{platforms:["Android"]},arguments)},i.prototype.hasBluetoothLEPeripheralSupport=function(){return n.cordova(this,"hasBluetoothLEPeripheralSupport",{platforms:["Android"]},arguments)},i.prototype.isExternalStorageAuthorized=function(){return n.cordova(this,"isExternalStorageAuthorized",{platforms:["Android"]},arguments)},i.prototype.getExternalStorageAuthorizationStatus=function(){return n.cordova(this,"getExternalStorageAuthorizationStatus",{platforms:["Android"]},arguments)},i.prototype.requestExternalStorageAuthorization=function(){return n.cordova(this,"requestExternalStorageAuthorization",{platforms:["Android"]},arguments)},i.prototype.getExternalSdCardDetails=function(){return n.cordova(this,"getExternalSdCardDetails",{platforms:["Android"]},arguments)},i.prototype.switchToWirelessSettings=function(){return n.cordova(this,"switchToWirelessSettings",{platforms:["Android"],sync:!0},arguments)},i.prototype.switchToNFCSettings=function(){return n.cordova(this,"switchToNFCSettings",{platforms:["Android"],sync:!0},arguments)},i.prototype.isNFCPresent=function(){return n.cordova(this,"isNFCPresent",{platforms:["Android"]},arguments)},i.prototype.isNFCEnabled=function(){return n.cordova(this,"isNFCEnabled",{platforms:["Android"]},arguments)},i.prototype.isNFCAvailable=function(){return n.cordova(this,"isNFCAvailable",{platforms:["Android"]},arguments)},i.prototype.registerNFCStateChangeHandler=function(e){return n.cordova(this,"registerNFCStateChangeHandler",{platforms:["Android"],sync:!0},arguments)},i.prototype.isDataRoamingEnabled=function(){return n.cordova(this,"isDataRoamingEnabled",{platforms:["Android"]},arguments)},i.prototype.isADBModeEnabled=function(){return n.cordova(this,"isADBModeEnabled",{platforms:["Android"]},arguments)},i.prototype.isDeviceRooted=function(){return n.cordova(this,"isDeviceRooted",{platforms:["Android"]},arguments)},i.prototype.isCameraRollAuthorized=function(){return n.cordova(this,"isCameraRollAuthorized",{platforms:["iOS"]},arguments)},i.prototype.getCameraRollAuthorizationStatus=function(){return n.cordova(this,"getCameraRollAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.requestCameraRollAuthorization=function(){return n.cordova(this,"requestCameraRollAuthorization",{platforms:["iOS"]},arguments)},i.prototype.isRemoteNotificationsEnabled=function(){return n.cordova(this,"isRemoteNotificationsEnabled",{platforms:["iOS","Android"]},arguments)},i.prototype.isRegisteredForRemoteNotifications=function(){return n.cordova(this,"isRegisteredForRemoteNotifications",{platforms:["iOS"]},arguments)},i.prototype.getRemoteNotificationsAuthorizationStatus=function(){return n.cordova(this,"getRemoteNotificationsAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.requestRemoteNotificationsAuthorization=function(e,t){return n.cordova(this,"requestRemoteNotificationsAuthorization",{platforms:["iOS"]},arguments)},i.prototype.getRemoteNotificationTypes=function(){return n.cordova(this,"getRemoteNotificationTypes",{platforms:["iOS"]},arguments)},i.prototype.isRemindersAuthorized=function(){return n.cordova(this,"isRemindersAuthorized",{platforms:["iOS"]},arguments)},i.prototype.getRemindersAuthorizationStatus=function(){return n.cordova(this,"getRemindersAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.requestRemindersAuthorization=function(){return n.cordova(this,"requestRemindersAuthorization",{platforms:["iOS"]},arguments)},i.prototype.isBackgroundRefreshAuthorized=function(){return n.cordova(this,"isBackgroundRefreshAuthorized",{platforms:["iOS"]},arguments)},i.prototype.getBackgroundRefreshStatus=function(){return n.cordova(this,"getBackgroundRefreshStatus",{platforms:["iOS"]},arguments)},i.prototype.requestBluetoothAuthorization=function(){return n.cordova(this,"requestBluetoothAuthorization",{platforms:["iOS"]},arguments)},i.prototype.isMotionAvailable=function(){return n.cordova(this,"isMotionAvailable",{platforms:["iOS"]},arguments)},i.prototype.isMotionRequestOutcomeAvailable=function(){return n.cordova(this,"isMotionRequestOutcomeAvailable",{platforms:["iOS"]},arguments)},i.prototype.requestMotionAuthorization=function(){return n.cordova(this,"requestMotionAuthorization",{platforms:["iOS"]},arguments)},i.prototype.getMotionAuthorizationStatus=function(){return n.cordova(this,"getMotionAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.getLocationAccuracyAuthorization=function(){return n.cordova(this,"getLocationAccuracyAuthorization",{platform:["iOS"]},arguments)},i.prototype.requestTemporaryFullAccuracyAuthorization=function(e){return n.cordova(this,"requestTemporaryFullAccuracyAuthorization",{platforms:["iOS"]},arguments)},i.prototype.registerLocationAccuracyAuthorizationChangeHandler=function(e){return n.cordova(this,"registerLocationAccuracyAuthorizationChangeHandler",{platforms:["iOS"],sync:!0},arguments)},Object.defineProperty(i.prototype,"permissionStatus",{get:function(){return n.cordovaPropertyGet(this,"permissionStatus")},set:function(e){n.cordovaPropertySet(this,"permissionStatus",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"NFCState",{get:function(){return n.cordovaPropertyGet(this,"NFCState")},set:function(e){n.cordovaPropertySet(this,"NFCState",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"motionStatus",{get:function(){return n.cordovaPropertyGet(this,"motionStatus")},set:function(e){n.cordovaPropertySet(this,"motionStatus",e)},enumerable:!1,configurable:!0}),i.pluginName="Diagnostic",i.plugin="cordova.plugins.diagnostic",i.pluginRef="cordova.plugins.diagnostic",i.repo="https://github.com/dpa99c/cordova-diagnostic-plugin",i.platforms=["Android","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin);return{...h,...f,...g,...b,...w,...S,...E,...C,...M,...I,...N,...P,...j,...Object.freeze({__proto__:null,Diagnostic:Y})}})),/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
|
|
843
|
+
function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./draggable","./mouse","../version","../widget"],e):e(jQuery)}((function(e){"use strict";return e.widget("ui.droppable",{version:"1.13.3",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,t=this.options,n=t.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof n?n:function(e){return e.is(n)},this.proportions=function(){if(!arguments.length)return e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});e=arguments[0]},this._addToManager(t.scope),t.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,n){if("accept"===t)this.accept="function"==typeof n?n:function(e){return e.is(n)};else if("scope"===t){var r=e.ui.ddmanager.droppables[this.options.scope];this._splice(r),this._addToManager(n)}this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this._addActiveClass(),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this._removeActiveClass(),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return!(!r||(r.currentItem||r.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each((function(){var n=e(this).droppable("instance");if(n.options.greedy&&!n.options.disabled&&n.options.scope===r.options.scope&&n.accept.call(n.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(n,{offset:n.element.offset()}),n.options.tolerance,t))return i=!0,!1})),!i&&(!!this.accept.call(this.element[0],r.currentItem||r.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(r)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),e.ui.intersect=function(){function e(e,t,n){return e>=t&&e<t+n}return function(t,n,r,i){if(!n.offset)return!1;var o=(t.positionAbs||t.position.absolute).left+t.margins.left,s=(t.positionAbs||t.position.absolute).top+t.margins.top,a=o+t.helperProportions.width,l=s+t.helperProportions.height,c=n.offset.left,u=n.offset.top,d=c+n.proportions().width,h=u+n.proportions().height;switch(r){case"fit":return c<=o&&a<=d&&u<=s&&l<=h;case"intersect":return c<o+t.helperProportions.width/2&&a-t.helperProportions.width/2<d&&u<s+t.helperProportions.height/2&&l-t.helperProportions.height/2<h;case"pointer":return e(i.pageY,u,n.proportions().height)&&e(i.pageX,c,n.proportions().width);case"touch":return(s>=u&&s<=h||l>=u&&l<=h||s<u&&l>h)&&(o>=c&&o<=d||a>=c&&a<=d||o<c&&a>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,n){var r,i,o=e.ui.ddmanager.droppables[t.options.scope]||[],s=n?n.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;r<o.length;r++)if(!(o[r].options.disabled||t&&!o[r].accept.call(o[r].element[0],t.currentItem||t.element))){for(i=0;i<a.length;i++)if(a[i]===o[r].element[0]){o[r].proportions().height=0;continue e}o[r].visible="none"!==o[r].element.css("display"),o[r].visible&&("mousedown"===s&&o[r]._activate.call(o[r],n),o[r].offset=o[r].element.offset(),o[r].proportions({width:o[r].element[0].offsetWidth,height:o[r].element[0].offsetHeight}))}},drop:function(t,n){var r=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),(function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,n)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n)))})),r},dragStart:function(t,n){t.element.parentsUntil("body").on("scroll.droppable",(function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}))},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],(function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,i,o,s=e.ui.intersect(t,this,this.options.tolerance,n),a=!s&&this.isover?"isout":s&&!this.isover?"isover":null;a&&(this.options.greedy&&(i=this.options.scope,(o=this.element.parents(":data(ui-droppable)").filter((function(){return e(this).droppable("instance").options.scope===i}))).length&&((r=e(o[0]).droppable("instance")).greedyChild="isover"===a)),r&&"isover"===a&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,n),r&&"isout"===a&&(r.isout=!1,r.isover=!0,r._over.call(r,n)))}}))},dragStop:function(t,n){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}},!1!==e.uiBackCompat&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),e.ui.droppable})),function(e,t,n,r){"use strict";function i(e,t,n){return setTimeout(c(e,n),t)}function o(e,t,n){return!!Array.isArray(e)&&(s(e,n[t],n),!0)}function s(e,t,n){var i;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==r)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function a(t,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,i,r),t.apply(this,arguments)}}function l(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&re(r,n)}function c(e,t){return function(){return e.apply(t,arguments)}}function u(e,t){return typeof e==se?e.apply(t&&t[0]||r,t):e}function d(e,t){return e===r?t:e}function h(e,t,n){s(g(t),(function(t){e.addEventListener(t,n,!1)}))}function p(e,t,n){s(g(t),(function(t){e.removeEventListener(t,n,!1)}))}function f(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function g(e){return e.trim().split(/\s+/g)}function v(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function y(e){return Array.prototype.slice.call(e,0)}function b(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];v(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function _(e,t){for(var n,i,o=t[0].toUpperCase()+t.slice(1),s=0;s<ie.length;){if((i=(n=ie[s])?n+o:t)in e)return i;s++}return r}function w(t){var n=t.ownerDocument||t;return n.defaultView||n.parentWindow||e}function x(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){u(e.options.enable,[e])&&n.handler(t)},this.init()}function S(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=t&be&&r-i==0,s=t&(we|xe)&&r-i==0;n.isFirst=!!o,n.isFinal=!!s,o&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=E(t)),i>1&&!n.firstMultiple?n.firstMultiple=E(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,l=t.center=T(r);t.timeStamp=ce(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=A(a,l),t.distance=M(a,l),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==be&&o.eventType!==we||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=D(t.deltaX,t.deltaY);var c=C(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=c.x,t.overallVelocityY=c.y,t.overallVelocity=le(c.x)>le(c.y)?c.x:c.y,t.scale=s?function(e,t){return M(t[0],t[1],Le)/M(e[0],e[1],Le)}(s.pointers,r):1,t.rotation=s?function(e,t){return A(t[1],t[0],Le)+A(e[1],e[0],Le)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,k(n,t);var u=e.element;f(t.srcEvent.target,u)&&(u=t.srcEvent.target),t.target=u}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function k(e,t){var n,i,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=xe&&(l>ye||a.velocity===r)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,d=C(l,c,u);i=d.x,o=d.y,n=le(d.x)>le(d.y)?d.x:d.y,s=D(c,u),e.lastInterval=t}else n=a.velocity,i=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=i,t.velocityY=o,t.direction=s}function E(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:ae(e.pointers[n].clientX),clientY:ae(e.pointers[n].clientY)},n++;return{timeStamp:ce(),pointers:t,center:T(t),deltaX:e.deltaX,deltaY:e.deltaY}}function T(e){var t=e.length;if(1===t)return{x:ae(e[0].clientX),y:ae(e[0].clientY)};for(var n=0,r=0,i=0;t>i;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:ae(n/t),y:ae(r/t)}}function C(e,t,n){return{x:t/e||0,y:n/e||0}}function D(e,t){return e===t?Se:le(e)>=le(t)?0>e?ke:Ee:0>t?Te:Ce}function M(e,t,n){n||(n=Ie);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function A(e,t,n){n||(n=Ie);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function I(){this.evEl=Ne,this.evWin=Re,this.pressed=!1,x.apply(this,arguments)}function L(){this.evEl=je,this.evWin=Ye,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=He,this.evWin=Be,this.started=!1,x.apply(this,arguments)}function N(e,t){var n=y(e.touches),r=y(e.changedTouches);return t&(we|xe)&&(n=b(n.concat(r),"identifier",!0)),[n,r]}function R(){this.evTarget=ze,this.targetIds={},x.apply(this,arguments)}function P(e,t){var n=y(e.touches),r=this.targetIds;if(t&(be|_e)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=y(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return f(e.target,l)})),t===be)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(we|xe)&&delete r[s[i].identifier],i++;return a.length?[b(o.concat(a),"identifier",!0),a]:void 0}function F(){x.apply(this,arguments);var e=c(this.handler,this);this.touch=new R(this.manager,e),this.mouse=new I(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function j(e,t){e&be?(this.primaryTouch=t.changedPointers[0].identifier,Y.call(this,t)):e&(we|xe)&&Y.call(this,t)}function Y(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),qe)}}function V(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(We>=o&&We>=s)return!0}return!1}function H(e,t){this.manager=e,this.set(t)}function B(e){this.options=re({},this.defaults,e||{}),this.id=he++,this.manager=null,this.options.enable=d(this.options.enable,!0),this.state=nt,this.simultaneous={},this.requireFail=[]}function U(e){return e&at?"cancel":e&ot?"end":e&it?"move":e&rt?"start":""}function z(e){return e==Ce?"down":e==Te?"up":e==ke?"left":e==Ee?"right":""}function q(e,t){var n=t.manager;return n?n.get(e):e}function W(){B.apply(this,arguments)}function $(){W.apply(this,arguments),this.pX=null,this.pY=null}function G(){W.apply(this,arguments)}function K(){B.apply(this,arguments),this._timer=null,this._input=null}function Z(){W.apply(this,arguments)}function X(){W.apply(this,arguments)}function J(){B.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Q(e,t){return(t=t||{}).recognizers=d(t.recognizers,Q.defaults.preset),new ee(e,t)}function ee(e,t){this.options=re({},Q.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=function(e){var t=e.options.inputClass;return new(t||(fe?L:me?R:pe?F:I))(e,S)}(this),this.touchAction=new H(this,this.options.touchAction),te(this,!0),s(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function te(e,t){var n,r=e.element;r.style&&(s(e.options.cssProps,(function(i,o){n=_(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}function ne(e,n){var r=t.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=n,n.target.dispatchEvent(r)}var re,ie=["","webkit","Moz","MS","ms","o"],oe=t.createElement("div"),se="function",ae=Math.round,le=Math.abs,ce=Date.now;re="function"!=typeof Object.assign?function(e){if(e===r||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(i!==r&&null!==i)for(var o in i)i.hasOwnProperty(o)&&(t[o]=i[o])}return t}:Object.assign;var ue=a((function(e,t,n){for(var i=Object.keys(t),o=0;o<i.length;)(!n||n&&e[i[o]]===r)&&(e[i[o]]=t[i[o]]),o++;return e}),"extend","Use `assign`."),de=a((function(e,t){return ue(e,t,!0)}),"merge","Use `assign`."),he=1,pe="ontouchstart"in e,fe=_(e,"PointerEvent")!==r,me=pe&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ge="touch",ve="mouse",ye=25,be=1,_e=2,we=4,xe=8,Se=1,ke=2,Ee=4,Te=8,Ce=16,De=ke|Ee,Me=Te|Ce,Ae=De|Me,Ie=["x","y"],Le=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&h(this.element,this.evEl,this.domHandler),this.evTarget&&h(this.target,this.evTarget,this.domHandler),this.evWin&&h(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&p(this.element,this.evEl,this.domHandler),this.evTarget&&p(this.target,this.evTarget,this.domHandler),this.evWin&&p(w(this.element),this.evWin,this.domHandler)}};var Oe={mousedown:be,mousemove:_e,mouseup:we},Ne="mousedown",Re="mousemove mouseup";l(I,x,{handler:function(e){var t=Oe[e.type];t&be&&0===e.button&&(this.pressed=!0),t&_e&&1!==e.which&&(t=we),this.pressed&&(t&we&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:ve,srcEvent:e}))}});var Pe={pointerdown:be,pointermove:_e,pointerup:we,pointercancel:xe,pointerout:xe},Fe={2:ge,3:"pen",4:ve,5:"kinect"},je="pointerdown",Ye="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(je="MSPointerDown",Ye="MSPointerMove MSPointerUp MSPointerCancel"),l(L,x,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Pe[r],o=Fe[e.pointerType]||e.pointerType,s=o==ge,a=v(t,e.pointerId,"pointerId");i&be&&(0===e.button||s)?0>a&&(t.push(e),a=t.length-1):i&(we|xe)&&(n=!0),0>a||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var Ve={touchstart:be,touchmove:_e,touchend:we,touchcancel:xe},He="touchstart",Be="touchstart touchmove touchend touchcancel";l(O,x,{handler:function(e){var t=Ve[e.type];if(t===be&&(this.started=!0),this.started){var n=N.call(this,e,t);t&(we|xe)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ge,srcEvent:e})}}});var Ue={touchstart:be,touchmove:_e,touchend:we,touchcancel:xe},ze="touchstart touchmove touchend touchcancel";l(R,x,{handler:function(e){var t=Ue[e.type],n=P.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:ge,srcEvent:e})}});var qe=2500,We=25;l(F,x,{handler:function(e,t,n){var r=n.pointerType==ge,i=n.pointerType==ve;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)j.call(this,t,n);else if(i&&V.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var $e=_(oe.style,"touchAction"),Ge=$e!==r,Ke="compute",Ze="auto",Xe="manipulation",Je="none",Qe="pan-x",et="pan-y",tt=function(){if(!Ge)return!1;var t={},n=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){t[r]=!n||e.CSS.supports("touch-action",r)})),t}();H.prototype={set:function(e){e==Ke&&(e=this.compute()),Ge&&this.manager.element.style&&tt[e]&&(this.manager.element.style[$e]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return s(this.manager.recognizers,(function(t){u(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(m(e,Je))return Je;var t=m(e,Qe),n=m(e,et);return t&&n?Je:t||n?t?Qe:et:m(e,Xe)?Xe:Ze}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(!this.manager.session.prevented){var r=this.actions,i=m(r,Je)&&!tt[Je],o=m(r,et)&&!tt[et],s=m(r,Qe)&&!tt[Qe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}return s&&o?void 0:i||o&&n&De||s&&n&Me?this.preventSrc(t):void 0}t.preventDefault()},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var nt=1,rt=2,it=4,ot=8,st=ot,at=16,lt=32;B.prototype={defaults:{},set:function(e){return re(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(o(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=q(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return o(e,"dropRecognizeWith",this)||(e=q(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(o(e,"requireFailure",this))return this;var t=this.requireFail;return-1===v(t,e=q(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(o(e,"dropRequireFailure",this))return this;e=q(e,this);var t=v(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,r=this.state;ot>r&&t(n.options.event+U(r)),t(n.options.event),e.additionalEvent&&t(e.additionalEvent),r>=ot&&t(n.options.event+U(r))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=lt)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(lt|nt)))return!1;e++}return!0},recognize:function(e){var t=re({},e);return u(this.options.enable,[this,t])?(this.state&(st|at|lt)&&(this.state=nt),this.state=this.process(t),void(this.state&(rt|it|ot|at)&&this.tryEmit(t))):(this.reset(),void(this.state=lt))},process:function(e){},getTouchAction:function(){},reset:function(){}},l(W,B,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(rt|it),i=this.attrTest(e);return r&&(n&xe||!i)?t|at:r||i?n&we?t|ot:t&rt?t|it:rt:lt}}),l($,W,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ae},getTouchAction:function(){var e=this.options.direction,t=[];return e&De&&t.push(et),e&Me&&t.push(Qe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&De?(i=0===o?Se:0>o?ke:Ee,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?Se:0>s?Te:Ce,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return W.prototype.attrTest.call(this,e)&&(this.state&rt||!(this.state&rt)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=z(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),l(G,W,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&rt)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),l(K,B,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ze]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(we|xe)&&!o)this.reset();else if(e.eventType&be)this.reset(),this._timer=i((function(){this.state=st,this.tryEmit()}),t.time,this);else if(e.eventType&we)return st;return lt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===st&&(e&&e.eventType&we?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ce(),this.manager.emit(this.options.event,this._input)))}}),l(Z,W,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Je]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&rt)}}),l(X,W,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:De|Me,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(De|Me)?t=e.overallVelocity:n&De?t=e.overallVelocityX:n&Me&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&le(t)>this.options.velocity&&e.eventType&we},emit:function(e){var t=z(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),l(J,B,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Xe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,o=e.deltaTime<t.time;if(this.reset(),e.eventType&be&&0===this.count)return this.failTimeout();if(r&&o&&n){if(e.eventType!=we)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||M(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&s?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=i((function(){this.state=st,this.tryEmit()}),t.interval,this),rt):st}return lt},failTimeout:function(){return this._timer=i((function(){this.state=lt}),this.options.interval,this),lt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==st&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Q.VERSION="2.0.7",Q.defaults={domEvents:!1,touchAction:Ke,enable:!0,inputTarget:null,inputClass:null,preset:[[Z,{enable:!1}],[G,{enable:!1},["rotate"]],[X,{direction:De}],[$,{direction:De},["swipe"]],[J],[J,{event:"doubletap",taps:2},["tap"]],[K]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};ee.prototype={set:function(e){return re(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&st)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&n.state&(rt|it|ot)&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof B)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(o(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(o(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=v(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==r&&t!==r){var n=this.handlers;return s(g(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==r){var n=this.handlers;return s(g(e),(function(e){t?n[e]&&n[e].splice(v(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&ne(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&te(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},re(Q,{INPUT_START:be,INPUT_MOVE:_e,INPUT_END:we,INPUT_CANCEL:xe,STATE_POSSIBLE:nt,STATE_BEGAN:rt,STATE_CHANGED:it,STATE_ENDED:ot,STATE_RECOGNIZED:st,STATE_CANCELLED:at,STATE_FAILED:lt,DIRECTION_NONE:Se,DIRECTION_LEFT:ke,DIRECTION_RIGHT:Ee,DIRECTION_UP:Te,DIRECTION_DOWN:Ce,DIRECTION_HORIZONTAL:De,DIRECTION_VERTICAL:Me,DIRECTION_ALL:Ae,Manager:ee,Input:x,TouchAction:H,TouchInput:R,MouseInput:I,PointerEventInput:L,TouchMouseInput:F,SingleTouchInput:O,Recognizer:B,AttrRecognizer:W,Tap:J,Pan:$,Swipe:X,Pinch:G,Rotate:Z,Press:K,on:h,off:p,each:s,merge:de,extend:ue,assign:re,inherit:l,bindFn:c,prefixed:_}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=Q,"function"==typeof define&&define.amd?define((function(){return Q})):"undefined"!=typeof module&&module.exports?module.exports=Q:e.Hammer=Q}(window,document),$.widget("wm.datatable",{options:{data:[],statusMsg:"",colDefs:[],rowActions:[],headerConfig:[],sortInfo:{field:"",direction:""},isMobile:!1,enableSort:!0,filtermode:"",filteronkeypress:!1,activeRow:void 0,isrowselectable:!1,height:"100%",showHeader:!0,selectFirstRow:!1,showNewRow:!0,showRowIndex:!1,enableRowSelection:!0,enableColumnSelection:!1,multiselect:!1,filterNullRecords:!0,navigation:"",isdynamictable:"",cssClassNames:{tableRow:"app-datagrid-row",headerCell:"app-datagrid-header-cell",groupHeaderCell:"app-datagrid-group-header-cell",tableCell:"app-datagrid-cell",grid:"",gridDefault:"table",gridBody:"app-datagrid-body",gridFooter:"app-datagrid-footer",deleteRow:"danger",ascIcon:"wi wi-long-arrow-up",descIcon:"wi wi-long-arrow-down",selectedColumn:"selected-column",rowExpandIcon:"wi wi-minus-square",rowCollapseIcon:"wi wi-plus-square",gridRowExpansionClass:"table-row-expansion",expandedRowClass:"expanded"},dataStates:{loading:"Loading...",ready:"",error:"An error occurred in loading the data.",nodata:"No data found."},messages:{selectField:"Select Field"},loadingicon:"",startRowIndex:1,editmode:"",actionsEnabled:{edit:!0,new:!0},rowExpansionEnabled:!1,rowDef:{position:"0",closeothers:!1,columnwidth:"30px"},summaryRow:!1,summaryRowDefs:[],summaryRowDefsObject:[],searchHandler:function(){},sortHandler:function(){}},customColumnDefs:{checkbox:{field:"checkbox",type:"custom",displayName:"",sortable:!1,searchable:!1,resizable:!1,selectable:!1,readonly:!0,style:"width: 50px; text-align: center;",textAlignment:"center",isMultiSelectCol:!0,show:!0},radio:{field:"radio",type:"custom",displayName:"",sortable:!1,searchable:!1,resizable:!1,selectable:!1,readonly:!0,style:"width: 50px; text-align: center;",textAlignment:"center",show:!0},__expand:{field:"__expand",type:"custom",displayName:"",sortable:!1,searchable:!1,resizable:!1,selectable:!1,readonly:!0,style:"text-align: center;",textAlignment:"center",show:!0,width:"30px"},rowIndex:{field:"rowIndex",type:"custom",displayName:"S. No.",sortable:!1,searchable:!1,selectable:!1,readonly:!0,style:"text-align: left;",textAlignment:"left",show:!0}},CONSTANTS:{QUICK_EDIT:"quickedit",INLINE:"inline",FORM:"form",DIALOG:"dialog",SEARCH:"search",MULTI_COLUMN:"multicolumn"},Utils:{random:function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)},isDefined:function(e){return void 0!==e},isObject:function(e){return null!==e&&"object"==typeof e},getObjectIndex:function(e,t){var n=-1;return Array.isArray(e)?(e.some((function(e,r){if(_.isEqual(e,t))return n=r,!0})),n):-1},generateGuid:function(){var e=this.random;return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},isValidHtml:function(e){return/<[a-z][\s\S]*>/i.test(e)},isMac:function(){return navigator.platform.toUpperCase().indexOf("MAC")>=0},isDeleteKey:function(e){return this.isMac()&&8===e.which||46===e.which}},_setStyles:function(e,t){if(t)return t.split(";").forEach((function(t){var n,r,i=t.split(":");2===i.length&&(n=i[0].trim(),r=i[1].trim(),e.css(n,r))})),t},_getColumnSortDirection:function(e){var t=this.options.sortInfo;return e===t.field?t.direction:""},_toggleSpacingClasses:function(e){switch(e){case"normal":this.tableContainer.removeClass("table-condensed"),this.gridSearch&&(this.gridSearch.find(".form-group").removeClass("form-group-sm"),this.gridSearch.find("select").removeClass("input-sm"),this.gridSearch.find(".input-group").removeClass("input-group-sm"));break;case"condensed":this.tableContainer.addClass("table-condensed"),this.gridSearch&&(this.gridSearch.find(".form-group").addClass("form-group-sm"),this.gridSearch.find("select").addClass("input-sm"),this.gridSearch.find(".input-group").addClass("input-group-sm"))}},_getColSpan:function(e){var t=0,n=this;return _.forEach(e,(function(e){var r;e.isGroup?t+=n._getColSpan(e.columns):(r=_.find(n.preparedHeaderData,{field:e.field}),t=_.isUndefined(r.show)||r.show?t+1:t)})),t},_setColSpan:function(e){var t=this;_.forEach(e,(function(e){e.isGroup&&(e.colspan=t._getColSpan(e.columns),t.gridHeaderElement.find('th[data-col-group="'+e.field+'"]').attr("colspan",e.colspan),t._setColSpan(e.columns))}))},_getHeaderTemplate:function(){var e,t=$("<colgroup></colgroup>"),n=this.gridHeaderElement.empty(),r=this.Utils.isDefined,i=this.options.sortInfo,o=i.field,s=this,a=[],l=this.options.headerConfig,c=s.options.cssClassNames.groupHeaderCell;function u(e,n){var a,l,c,u,d,h=n,p=e.field,f=s.Utils.isDefined(e.displayName)?e.displayName:p||"",m=f,g=s.options.enableSort&&(_.isUndefined(e.show)||e.show)&&(_.isUndefined(e.sortable)||e.sortable),v=s.options.cssClassNames.headerCell,y="";return f=s.Utils.isDefined(f)&&""!==f?f:" ",c=$("<col/>"),e.style&&s._setStyles(c,e.style),t.append(c),r(e.class)&&(v+=" "+e.class),e.selected&&(v+=" "+s.options.cssClassNames.selectedColumn+" "),"checkbox"!==p&&"radio"!==p||(v+=" grid-col-small"),y+="<th",(_.isUndefined(e.resizable)||e.resizable)&&(_.isUndefined(e.show)||e.show)&&(y+=" data-col-resizable"),s.options.enableColumnSelection&&(_.isUndefined(e.selectable)||e.selectable)&&(y+=" data-col-selectable"),g&&(y+=" data-col-sortable"),y+="></th>",(l=$(y)).attr({"data-col-id":h,"data-col-field":p,title:m}),s._setStyles(l,"text-align: "+e.textAlignment),l.addClass(v),"checkbox"===p&&l.append('<input type="checkbox" />'),l.append('<span class="header-data">'+f+"</span>"),g&&(u=$('<span class="sort-buttons-container"></span>'),d=$('<i class="sort-icon"></i>'),o&&o===e.field&&i.direction&&(a="asc"===i.direction?s.options.cssClassNames.ascIcon:s.options.cssClassNames.descIcon,u.addClass("active"),d.addClass(a+" "+i.direction)),l.append(u.append(d))),l}return _.isEmpty(l)?(e=$("<tr></tr>"),s.preparedHeaderData.forEach((function(t,n){e.append(u(t,n))})),n.append(e)):(!function e(t,n){var r=[];_.forEach(t,(function(t){var i,o,a,l,d;t.columns&&t.columns.length?(d=$("<th></th>"),a=c+" "+(t.class||""),l="text-align: "+t.textAlignment+";background-color: "+(t.backgroundColor||"")+";",d.attr({"data-col-group":t.field,class:a,title:t.displayName}),s._setStyles(d,l),d.append('<span class="header-data">'+t.displayName+"</span>"),r.push(d),e(t.columns,n+1)):(i=_.findIndex(s.preparedHeaderData,{field:t.field}),(o=s.preparedHeaderData[i])&&r.push(u(o,i)))})),a[n]=a[n]||[],a[n]=a[n].concat(r)}(l,0),a.forEach((function(t,r){e=$('<tr role="row" tabindex="0"></tr>');var i=a.length-r;t.forEach((function(t){i>1&&t.hasClass("app-datagrid-header-cell")&&t.attr("rowspan",i),e.append(t)})),n.append(e)}))),{colgroup:t,header:n}},_getSearchEl:function(){var e='<select name="wm-datatable" data-element="dgFilterValue" class="form-control app-select"><option value="" selected class="placeholder">'+this.options.messages.selectField+"</option>",t=this.Utils.isDefined(this.options.searchLabel)&&this.options.searchLabel.length?this.options.searchLabel:"";this.options.colDefs.forEach((function(t,n){"none"!==t.field&&"rowOperations"!==t.field&&t.searchable&&"false"!==_.toString(t.showinfilter)&&(e+='<option value="'+t.field+'" data-coldef-index="'+n+'">'+(t.displayName||t.field)+"</option>")})),e+="</select>";var n=$('<form class="form-search form-inline" onsubmit="return false;"><div class="form-group"><input type="text" data-element="dgSearchText" class="form-control app-textbox" value="" placeholder="'+t+'"/></div><div class="input-append input-group">'+e+'<span class="input-group-addon"><button type="button" data-element="dgSearchButton" class="app-search-button" title="'+t+'"><i class="wi wi-search"></i></button></span></div></div></form>');return this._setStyles(n.find('[data-element="dgSearchText"]'),"display: inline-block;"),n},_appendRowExpansionButtons:function(e){var t=this;e.find("[data-identifier='rowExpansionButtons']").each((function(e){var n,r,i,o=e;r=$(this).closest("tr.app-datagrid-row"),i=parseInt(r.attr("data-row-id"),10),(n=_.clone(t.options.data[i])).$index=o+1,t.options.generateRowExpansionCell(n,o),$(this).empty().append(t.options.getRowExpansionAction(o))}))},setSummaryRowDef:function(e,t,n,r){this.options.summaryRow=!0,null==this.options.summaryRowDefs[n]&&(this.options.summaryRowDefs[n]={},this.options.summaryRowDefsObject[n]={}),this.options.summaryRowDefsObject[n][e]=t,this.options.summaryRowDefs[n][e]=t&&t.value?t.value:t,r&&this.refreshGridData()},_getSummaryRowTemplate:function(){var e=this,t=$('<tfoot class="'+this.options.cssClassNames.gridFooter+'"></tfoot>');return this._setStyles(t,"border-top: 3px solid #eee;"),_.forEach(this.options.summaryRowDefs,(function(n,r){n.$$pk=r,t.append(e._getRowTemplate(n,r,!0))})),t},getPageStartIndex:function(){var e=this.options.getCurrentPage(),t=this.options.getPageSize();return((this.options.actionRowPage<e?this.options.actionRowPage:e)-1)*t},_getPreparedDataForInfiniteScroll:function(e,t){return t=t.filter((function(t,n){if(!e.find("tr.app-datagrid-row[data-row-id="+t.$$pk+"]").length)return t}))},_updateTrData:function(e){var t,n,r=this;t=e.find("tr.app-datagrid-row[data-row-id="+r.options.actionRowIndex+"]"),n=r.preparedData[r.options.actionRowIndex],r.options.generateCustomExpressions(n,r.options.actionRowIndex);var i=r._getRowTemplate(n,r.options.actionRowIndex);t.replaceWith(i[0])},_handleCRUDForInfiniteScroll:function(e){var t=this;t.options.lastActionPerformed!==t.options.ACTIONS.SEARCH_OR_SORT&&t.options.lastActionPerformed!==t.options.ACTIONS.FILTER_CRITERIA&&t.options.lastActionPerformed!==t.options.ACTIONS.DATASET_UPDATE||!(t.options.isSearchTrigerred||t.options.isDatasetUpdated||t.options.isDataUpdatedByUser)?t.options.lastActionPerformed===t.options.ACTIONS.EDIT&&void 0!==t.options.actionRowIndex&&t.options.editmode!==this.CONSTANTS.QUICK_EDIT&&t._updateTrData(e):(e.html(""),"On-Demand"!==this.options.navigation||this.options.isLastPage||this.element.find(".on-demand-datagrid").show(),t.options.clearCustomExpression(),t.options.clearRowDetailExpression(),t.options.setIsSearchTrigerred(!1),t.options.setIsDatasetUpdated(!1))},_getGridTemplate:function(){var e,t,n=this,r=n.getPageStartIndex(),i=n.options.startRowIndex,o=n.options.isNavTypeScrollOrOndemand();return o?(t=this.gridElement,this.renderTableOnViewLess&&(t=this.gridElement.empty(),this.hideLoadingIndicator(),this.renderTableOnViewLess=!1)):t=this.gridElement.empty(),o?(this._handleCRUDForInfiniteScroll(t),n.options.lastActionPerformed===n.options.ACTIONS.DELETE&&(i=n.options.actionRowIndex+1),e=this._getPreparedDataForInfiniteScroll(t,this.preparedData.slice(r))):(this.options.clearCustomExpression(),this.options.clearRowDetailExpression(),e=this.preparedData),_.forEach(e,(function(e,r){var s,a=_.clone(e),l=o?i+r-1:r;if(a.$index=l+1,n.options.generateCustomExpressions(a,l),n.options.registerRowNgClassWatcher(a,l),s=n._getRowTemplate(e,l),t.append(s),n.options.rowExpansionEnabled){var c=n.options.rowDef.height,u=n.options.rowDef.position,d=_.filter(n.preparedHeaderData,(function(e){return e.show})).length-1,h=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+e.$$pk+'"><td></td><td colspan="'+d+'" class="app-datagrid-row-details-cell"><div class="row-overlay"><div class="row-status"><i class="'+n.options.loadingicon+'"></i></div></div><div class="details-section"></div></td></tr>');"-1"===u&&(h=$('<tr class="app-datagrid-detail-row" tabindex="0" role="row" data-row-id="'+e.$$pk+'"><td colspan="'+d+'" class="app-datagrid-row-details-cell"><div class="row-overlay"><div class="row-status"><i class="'+n.options.loadingicon+'"></i></div></div><div class="details-section"></div></td><td></td></tr>')),c&&h.find("div.row-overlay").css("min-height",c),h.css("display","none"),h.find(".details-section").css("display","none"),t.append(h)}})),this.options.isdynamictable||(this.options.setLastActionPerformed(this.options.ACTIONS.DEFAULT),this.options.setIsDataUpdatedByUser(!1),this.options.clearActionRowIndex()),t},_getRowTemplate:function(e,t,n){var r,i=this,o=i.options;return r=$('<tr role="row" tabindex="0" class="'+o.cssClassNames.tableRow+" "+(o.rowClass||"")+'" data-row-id="'+e.$$pk+'"></tr>'),this.preparedHeaderData.forEach((function(o,s){r.append(i._getColumnTemplate(e,s,o,t,n))})),r},_getRowActionsColumnDefIndex:function(){var e,t=this.preparedHeaderData.length;for(e=0;e<t;e+=1)if("rowOperations"===this.preparedHeaderData[e].field)return e;return-1},_getRowActionsColumnDef:function(){var e=this._getRowActionsColumnDefIndex();return-1!==e?this.preparedHeaderData[e]:null},_getCheckboxTemplate:function(e,t){return'<input name="'+(t?"gridMultiSelect":"")+'" type="checkbox"'+(!0===e._checked?" checked":"")+(e.disabed?" disabled":"")+"/>"},_getRadioTemplate:function(e){return'<input type="radio" rowSelectInput name="" value=""'+(!0===e._checked?" checked":"")+(e.disabed?" disabled":"")+"/>"},_getColumnTemplate:function(e,t,n,r,i){var o,s,a,l,c=this.options.cssClassNames.tableCell+" "+(n.class||""),u=n.customExpression,d="text-align: "+n.textAlignment+";position: relative;";if(o=$('<td class="'+c+'" data-col-id="'+t+'" role="cell"></td>'),this._setStyles(o,d),s=_.get(e,n.field),i)(a=this.options.summaryRowDefsObject[r][n.field])instanceof Object&&a.class&&o.addClass(a.class),s instanceof Promise?('<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>',o.html('<div class="overlay"><span aria-hidden="true" class="form-field-spinner fa fa-circle-o-notch fa-spin form-control-feedback"></span></div>')):(l=_.isUndefined(s)||null===s?"":s,o.html(l));else if(u)o.html(this.options.getCustomExpression(n.field,r));else if("custom"!==n.type)s=_.get(e,n.field),(this.options.filterNullRecords&&null===s||_.isUndefined(s))&&(s=""),o.attr("title",s),o.text(""+s);else{switch(n.field){case"checkbox":l=this._getCheckboxTemplate(e,n.isMultiSelectCol);break;case"__expand":l='<span class="row-expansion-column" data-identifier="rowExpansionButtons"></span>';break;case"radio":l=this._getRadioTemplate(e);break;case"rowOperations":l='<span class="actions-column" data-identifier="actionButtons"></span>';break;case"rowIndex":l=e.$$index;break;case"none":l="";break;default:l=_.isUndefined(s)||null===s?"":s}o.html(l)}return e.$index=r+1,this.options.registerColNgClassWatcher(e,n,r,t,i),o},_getEventTemplate:function(e){var t,n=_.filter(_.keys(e),(function(e){return _.startsWith(e,"on")})),r="";return t="autocomplete"===e.editWidgetType?"onSubmit":"onChange",n=_.union(n,[t]),_.forEach(n,(function(t){r+=" "+_.kebabCase(t)+'="',"onSubmit"!==t&&"onChange"!==t||(r+="_"+t+"Field($event, $scope, newVal, oldVal);"),r+=(e[t]||"")+'" '})),r},_insertFieldInHeaderConfig:function(e,t,n){var r=_.findIndex(e,{field:n}),i=this;-1===r?_.forEach(e,(function(e){e.isGroup&&i._insertFieldInHeaderConfig(e.columns,t,n)})):e.splice(r+1,0,{field:t,isPredefined:!0})},setHeaderConfigForDefaultFields:function(e,t){if(!_.isEmpty(this.options.headerConfig)){var n=this.customColumnDefs[e].field;_.remove(this.options.headerConfig,{field:n}),"0"===t?this.options.headerConfig.unshift({field:n,isPredefined:!0}):"-1"===t?this.options.headerConfig.push({field:n,isPredefined:!0}):this._insertFieldInHeaderConfig(this.options.headerConfig,n,t)}},setDefaultColsData:function(e){if(!_.isEmpty(this.preparedHeaderData)){var t,n;if(this.options.rowExpansionEnabled){if(t=this.options.rowDef.position,(n=_.clone(this.customColumnDefs.__expand)).width=this.options.rowDef.columnwidth,e)if("-1"===t)this.preparedHeaderData.push(n);else if("0"===t)this.preparedHeaderData.unshift(n);else{var r=_.findIndex(this.preparedHeaderData,{field:t});this.preparedHeaderData.splice(r+1,0,n)}this.setHeaderConfigForDefaultFields("__expand",t)}this.options.showRowIndex&&(e&&this.preparedHeaderData.unshift(this.customColumnDefs.rowIndex),this.setHeaderConfigForDefaultFields("rowIndex","0")),this.options.multiselect&&(e&&this.preparedHeaderData.unshift(this.customColumnDefs.checkbox),this.setHeaderConfigForDefaultFields("checkbox","0")),!this.options.multiselect&&this.options.showRadioColumn&&(e&&this.preparedHeaderData.unshift(this.customColumnDefs.radio),this.setHeaderConfigForDefaultFields("radio","0"))}},_prepareHeaderData:function(){this.preparedHeaderData=[],$.extend(this.preparedHeaderData,this.options.colDefs),this.setDefaultColsData(!0)},_generateCustomColDefs:function(){var e=[],t={};function n(n){if(!t[n]){var r={type:"string",field:n};e.push(r),t[n]=!0}}this.options.data.forEach((function(e){_.keys(e).forEach(n)})),this.options.colDefs=e,this._prepareHeaderData()},_prepareData:function(){var e=[],t=this.options.colDefs,n=this,r=n.getPageStartIndex(),i=this.Utils.isObject,o=this.Utils.isDefined;!this.options.colDefs.length&&this.options.data.length&&this._generateCustomColDefs(),(this.options.isNavTypeScrollOrOndemand()?this.options.data.slice(r):this.options.data).forEach((function(s,a){var l=$.extend(!0,{},s);t.forEach((function(e){if(e.field){var t,n,r,a=e.field.split("."),c=s,u=a.length;for(t=0;t<u;t++)if(r=void 0,-1!==(n=a[t]).indexOf("[0]")&&(n=n.replace("[0]",""),r=!0),i(c)&&!r)c=_.get(c,n);else{if(!r){c=void 0;break}c=_.get(c,n+"[0]")}o(c)?l[e.field]=c:a.length>1&&_.has(s,e.field)&&(l[e.field]=s[e.field])}})),l.$$index=r+a+1,l.$$pk=n.options.isNavTypeScrollOrOndemand()?r+a:a,e.push(l)})),n.options.isNavTypeScrollOrOndemand()?n.options.isSearchTrigerred&&!n.emptySearch||n.options.isDatasetUpdated?n.preparedData=e:n.preparedData.length?e.forEach((function(e,t){var i=r+t;n.preparedData[i]&&e.$$index===n.preparedData[i].$$index?n.preparedData[i]=e:n.preparedData.push(e)})):n.preparedData.push(...e):n.preparedData=e},_reselectColumns:function(){var e=[],t=this;this.gridHeaderElement&&this.options.enableColumnSelection&&(e=this.gridHeaderElement.find("th."+this.options.cssClassNames.selectedColumn)).length&&e.each((function(){t.columnSelectionHandler(void 0,$(this))})),this.options.multiselect&&this.updateSelectAllCheckboxState()},_create:function(){$.extend(this,{dataStatus:{message:"",state:"ready"},preparedData:[],preparedHeaderData:[],dataStatusContainer:null,gridContainer:null,gridElement:null,gridHeader:null,gridBody:null,columnClickInfo:{},gridFooter:null,gridSearch:null,tableId:null,searchObj:{field:"",value:"",event:null},compiledCellTemplates:{}}),this._setStatus=_.debounce((function(e){this.__setStatus(e)}),100),this._debounceOnEnter=_.debounce((function(e,t,n,r){this._onEnter(e,t,n,r)}),150),this.options.summaryRow=!1,this.options.summaryRowDefs=[],this._prepareHeaderData(),this._prepareData(),this._render(!0)},_setGridEditMode:function(e){_.isFunction(this.options.setGridEditMode)&&this.options.setGridEditMode(e)},_refreshGrid:function(){this._prepareHeaderData(),this._prepareData(),this._render(),this.addOrRemoveScroll(),this._setGridEditMode(!1)},refreshGrid:function(){window.clearTimeout(this.refreshGridTimeout),this.refreshGridTimeout=window.setTimeout(this._refreshGrid.bind(this),50)},callRenderGridForInfiniteScroll:function(){this.gridFooter.remove();var e=this.gridElement.find("> tr.app-datagrid-row.always-new-row");e.length&&e.remove(),this._renderGrid(void 0)},refreshGridData:function(){this._prepareData(),this.options.isNavTypeScrollOrOndemand()?this.callRenderGridForInfiniteScroll():(this.gridFooter.remove(),this._renderGrid()),this._reselectColumns(),this.addOrRemoveScroll(),this._setGridEditMode(!1),this.toggleNewRowActions(!1)},setDefaultRowData:function(e){_.forEach(this.preparedHeaderData,(function(t){e[t.field]=t.defaultvalue}))},addNewRow:function(e,t){var n,r,i,o=this.gridElement.find("> tr.app-datagrid-row:visible").length||99999,s=this,a={};if(!t&&_.isFunction(this.options.beforeRowInsert)&&this.options.beforeRowInsert(),(i=(r=this.gridElement).find("> tr.app-datagrid-row.always-new-row")).length){if(this.setFocusOnElement(void 0,i),this.options.editmode===this.CONSTANTS.QUICK_EDIT){var l=i.find("input").length>0?$(i.find("input")[0]):null;if(null!==l){var c=$.Event("keydown");c.which=13,l.trigger(c)}}}else a.$index=o,a.$$pk=o,this.options.editmode!==this.CONSTANTS.FORM&&this.options.editmode!==this.CONSTANTS.DIALOG&&(n=$(this._getRowTemplate(a,a.$index)),this.preparedData.length||this.setStatus("ready",this.dataStatus.ready),"top"===this.options.formPosition?r.prepend(n):r.append(n),this._appendRowActions(n,!0,a),this.attachEventHandlers(n),(t||this.options.editmode!==this.CONSTANTS.QUICK_EDIT)&&(n.find(".delete-row-button").hide(),t&&n.find(".edit-row-button").hide()),this._findAndReplaceCompiledTemplates(),t?(this.setDefaultRowData(a),n.addClass("always-new-row").addClass("row-editing"),this.options.runInNgZone((function(){s.makeRowEditable(n,a,!0)}))):n.trigger("click",[void 0,{action:"edit",operation:"new",skipFocus:e}]),this.updateSelectAllCheckboxState(),this.addOrRemoveScroll(),this.options.timeoutCall((function(){s.setColGroupWidths()}),100))},addLoadMoreBtn:function(e,t,n,r){var i;if(!this.options.isLastPage||r){var o=this,s=$('<div class="on-demand-datagrid"><a class="app-button btn btn-block on-demand-load-btn"></a></div>');(i=s.find("a")).append(e),this.element.find(".app-grid-header-inner").append(s),r&&this.element.find(".on-demand-load-btn").length&&this.element.find(".on-demand-load-btn").text(this.options.viewlessmessage),i.on("click",(function(e){var s=o.options.getCurrentPage()==o.options.getPageCount();s||o.showLoadingIndicator(t,!1),o.options.showviewlessbutton||i.hide(),r&&s&&o.element.find(".on-demand-datagrid").remove(),s&&o.options.showviewlessbutton&&(i.hide(),o.renderTableOnViewLess=!0,o.renderPaginationOnViewLess=!0,o.options.enableNavigation(),o._renderGrid()),n&&"function"==typeof n&&n(e)}))}},showLoadingIndicator:function(e,t){var n=this.element.find(".loading-data-msg"),r=this.element.find(".on-demand-datagrid");if(n.length&&!t)n.show();else if(t&&r.length)r.show();else{var i=$('<div class="loading-data-msg spin-icon-in-center"><span><i class="app-icon panel-icon fa-spin '+this.options.loadingicon+'"></i><span class="sr-only">Loading</span><span class="loading-text"></span></span></div>');if(i.find(".loading-text").html(e),r.length)r.append(i);else{var o=$('<div class="on-demand-datagrid">'+i[0].outerHTML+"</div>");this.element.find(".app-grid-header-inner").append(o)}}},hideLoadingIndicator:function(e,t){e||t?this.options.getCurrentPage()==this.options.getPageCount()&&this.options.showviewlessbutton?(this.element.find(".on-demand-load-btn").show().text(this.options.viewlessmessage),this.element.find(".loading-data-msg").hide(),t&&(this.element.find(".on-demand-load-btn").length||this.options.addLoadMoreBtn(),this.element.find(".loading-data-msg").hide())):this.element.find(".on-demand-datagrid").hide():(this.element.find(".loading-data-msg").hide(),this.element.find(".on-demand-load-btn").text(this.options.ondemandmessage),this.element.find(".on-demand-load-btn").show())},getSelectedRows:function(){this.getSelectedColumns();var e=[],t=this;return this.preparedData.forEach((function(n,r){n._selected&&e.push(t.options.data[r])})),e},selectRows:function(e){var t=this;t.gridElement.find("tr.app-datagrid-row").each((function(e){t.preparedData[e]&&!0===t.preparedData[e]._selected&&$(this).trigger("click",[$(this),{skipSingleCheck:!0}])})),_.isArray(e)?_.forEach(e,(function(e){t.selectRow(e,!0)})):t.selectRow(e,!0)},toggleRowFilter:function(e){this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&this.gridSearch&&(e?this.gridSearch.show():this.gridSearch.hide())},setColGroupWidths:function(){var e=this,t=(this.options.isMobile,this.tableContainer.find("col")),n=this.tableContainer.find("col"),r=this.options.showHeader?this.gridContainer.find("th.app-datagrid-header-cell"):this.gridElement.find("tr.app-datagrid-row").first().find("td"),i=this.preparedHeaderData.length,o=this.gridElement.parent().prop("scrollLeft");if(t.length||r.length){this._setColSpan(this.options.headerConfig),this.toggleRowFilter();var s=0,a=t.length;t.each((function(){var e=$(this).width();e&&(s+=e,a-=1)})),r.each((function(){var r,i,o=Number($(this).attr("data-col-id")),s=e.preparedHeaderData[o],a=e.gridContainer.find('th[data-col-id="'+o+'"]'),l=e.gridElement.find('td.app-datagrid-cell[data-col-id="'+o+'"]'),c=e.tableContainer.find('tfoot tr.app-datagrid-row td.app-datagrid-cell[data-col-id="'+o+'"]'),u=$(t[o]),d=$(n[o]);s&&(r=s.width,_.isUndefined(s.show)||s.show?(a.show(),l.show(),u.show(),d.show(),c.show()):(a.hide(),l.hide(),u.hide(),d.hide(),c.hide()),u.length&&"90px"===u[0].style.width&&(i=_.isUndefined(r)?"":r,u.css("width",i),d.css("width",i)))})),r.each((function(){var r,o,l,c,u=$(this),d=Number(u.attr("data-col-id")),h=e.preparedHeaderData[d];if(h){if(r=h.width,_.isUndefined(h.show)||h.show)if(u.hasClass("grid-col-small"))o=50;else if(_.isUndefined(r)||""===r||_.includes(r,"%")){if((c=$(t[d])).length)if(""===(l=c[0].style.width)||"0px"===l||"90px"===l||_.includes(l,"%"))if((o=u.width())<=0){for(var p=u,f=o,m=0;f<=0;)f=(p=p.parent()).width(),p.find("table").length&&p.prop("style")&&(m=m+parseFloat(p.css("padding-left"))+parseFloat(p.css("padding-right")));if(f>0)if(m&&(f-=m),_.includes(l,"%"))o=f*(parseInt(l)/100);else o=(o=(s&&s>0?f-s:f)/(a||t.length))>90?i===d+1?o-17:o:90;else o=o>90?i===d+1?o-17:o:90}else o=o>90?i===d+1?o-17:o:90;else o=l}else o=r;else o=0;$(t[d]).css("width",o),$(n[d]).css("width",o)}})),this.toggleRowFilter(!0),this.gridElement.parent().prop("scrollLeft",o),this.gridHeaderElement.parent().prop("scrollLeft",o)}},getSelectedColumns:function(){var e,t,n,r={},i=[],o=this;return $.extend(i,this.preparedHeaderData),this.options.multiselect?(i.some((function(t,n){if("checkbox"===t.field)return e=n,!0})),i.splice(e,1)):this.options.showRadioColumn&&(i.some((function(e,n){if("radio"===e.field)return t=n,!0})),i.splice(t,1)),this.options.showRowIndex&&(i.some((function(e,t){if("rowIndex"===e.field)return n=t,!0})),i.splice(n,1)),i.forEach((function(e){var t=e.field;e.selected&&(r[t]={colDef:e,colData:o.options.data.map((function(e){return e[t]}))})})),r},_setOption:function(e,t){switch(this._super(e,t),e){case"showHeader":this._toggleHeader(),this._toggleSearch(),this.setColGroupWidths(),this.addOrRemoveScroll();break;case"filtermode":this._toggleSearch();break;case"searchLabel":this.gridSearch&&(this.gridSearch.find('[data-element="dgSearchText"]').attr("placeholder",t),this.gridSearch.find('[data-element="dgSearchButton"]').attr("title",t));break;case"selectFirstRow":this.selectFirstRow(t);break;case"data":this.isResetSortIconsDone||this.setSortIconDefault(),this.refreshGridData();break;case"dataStates":"nodata"===this.dataStatus.state?this.setStatus("nodata",this.dataStatus.nodata):"loading"===this.dataStatus.state&&this.setStatus("loading");break;case"loadingicon":this.dataStatusContainer.find("i").removeClass().addClass(this.options.loadingicon);break;case"colDefs":if(this.options.isNavTypeScrollOrOndemand()&&this.options.isNextPageData){this.tableContainer.find("colgroup").remove(),this._prepareHeaderData(),this.setColGroupWidths(),this._renderHeader(),this._renderSearch(),this.attachEventHandlers(this.gridElement),this._reselectColumns(),this.addOrRemoveScroll();break}case"multiselect":case"showRadioColumn":case"isrowselectable":case"rowActions":case"filterNullRecords":case"showRowIndex":this.refreshGrid();break;case"cssClassNames":var n=this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid;this.options.rowExpansionEnabled&&(n=n+" "+this.options.cssClassNames.gridRowExpansionClass),this.tableContainer.attr("class",n),"condensed"===this.options.spacing&&this._toggleSpacingClasses("condensed");break;case"spacing":this._toggleSpacingClasses(t);break;case"messages":this.gridSearch&&this.gridSearch.find("option.placeholder").text(t&&t.selectField)}},getOptions:function(){return this.options},_toggleHeader:function(){this.gridHeaderElement&&this.gridHeaderElement.empty(),this.tableContainer&&(this.tableContainer.find("colgroup").remove(),this.tableContainer.find("thead").remove()),this.setDefaultColsData(),this.options.showHeader&&this._renderHeader()},_toggleSearch:function(){this.gridSearch&&this.gridSearch.remove(),this.options.filtermode===this.CONSTANTS.SEARCH?this._renderSearch():this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&(this._renderRowFilter(),this.setColGroupWidths())},selectFirstRow:function(e,t){var n,r;t&&this.gridElement.find("tr").is(":visible")?(this.__setStatus(),n=this.gridElement.find("tr.app-datagrid-row:visible:not(.always-new-row)").first()):n=this.gridElement.find("tr.app-datagrid-row:not(.always-new-row)").first(),r=n.attr("data-row-id"),n.length&&this.preparedData.length&&(this.preparedData[r]._selected=!e,n[0].click())},selectRow:function(e,t){var n,r,i=_.isNumber(e)?e:this.Utils.getObjectIndex(this.options.data,e);-1!==i&&(n="tr.app-datagrid-row[data-row-id="+i+"]",(r=this.gridElement.find(n)).length&&(this.preparedData[i]._selected=!t),t?r.trigger("click"):(this.toggleRowSelection(r,t),this.options.callOnRowDeselectEvent(this.preparedData[i])))},deselectRow:function(e){this.selectRow(e,!1)},toggleRowSelection:function(e,t,n,r){if(e.length){var i=e.attr("data-row-id");this.preparedData[i]&&(this.preparedData[i]._selected=t,t?e.addClass("active"):e.removeClass("active"),this.options.showRadioColumn&&(e.find("td input[rowSelectInput]:radio:not(:disabled)").prop("checked",t),this.preparedData[i]._checked=t),this.options.multiselect?(e.find('td input[name="gridMultiSelect"]:checkbox:not(:disabled)').prop("checked",t),this.preparedData[i]._checked=t,r||this.updateSelectAllCheckboxState()):this._deselectPreviousSelection(e,n))}},updateSelectAllCheckboxState:function(){if(this.options.showHeader&&this.options.multiselect){this.__setStatus();var e=this.gridHeaderElement.find("th.app-datagrid-header-cell input:checkbox"),t=this.gridElement,n=t.find('tr.app-datagrid-row:visible input[name="gridMultiSelect"]:checkbox:checked').length,r=t.find("tr.app-datagrid-row:visible").length;r&&n===r?e.prop("checked",!0):e.prop("checked",!1)}},rowClickHandlerOnCapture:function(e,t,n){if(this.options.editmode===this.CONSTANTS.QUICK_EDIT||!this.options.multiselect&&!this.options.showRadioColumn||this.options.isrowselectable||!Number(this.getColInfo(e))){t=t||$(e.target).closest("tr.app-datagrid-row");var r=this.gridElement.find(t);if(r.length&&r.closest("tbody").attr("id")===this.gridElement.attr("id")){var i=t.attr("data-row-id"),o=this.preparedData[i],s=this.options.data[i];this.options.assignSelectedItems(s,e,{rowId:i,_selected:o?._selected})}}else e.stopPropagation()},rowSelectionHandler:function(e,t,n){if(this.options.editmode===this.CONSTANTS.QUICK_EDIT||!this.options.multiselect&&!this.options.showRadioColumn||this.options.isrowselectable||!Number(this.getColInfo(e))){var r,i,o,s,a=this,l=(n=n||{}).action,c=$(e.target),u=this.options.editmode===this.CONSTANTS.QUICK_EDIT;t=t||c.closest("tr.app-datagrid-row"),(l||u&&(c.hasClass("app-datagrid-cell")||c.closest("td.app-datagrid-cell").length)&&!t.hasClass("always-new-row"))&&(n.action=n.action||"edit",("new"===n.operation||a.options.actionsEnabled.edit)&&a.toggleEditRow(e,n),n.skipSelect)||(r=t.attr("data-row-id"),i=this.preparedData[r],o=this.options.data[r],s=i&&i._selected||!1,n.skipSingleCheck||(!t.hasClass("active")||this.options.multiselect)&&i?(this.options.callOnRowClickEvent(o,e),s=!s,this.options.assignSelectedItems(o,e,{rowId:r,_selected:s}),this.toggleRowSelection(t,s,e),d()):u||"new"===n.operation||d())}else e.stopPropagation();function d(){s&&_.isFunction(a.options.onRowSelect)&&a.options.onRowSelect(o,e),!s&&_.isFunction(a.options.onRowDeselect)&&a.options.onRowDeselect(o,e)}},rowDblClickHandler:function(e,t){e.stopPropagation();var n,r=(t=t||$(e.target).closest("tr.app-datagrid-row")).attr("data-row-id");(n=this.preparedData[r])&&_.isFunction(this.options.onRowDblClick)&&this.options.onRowDblClick(n,e)},closePopover:function(){this.options.closePopover(this.element)},headerClickHandler:function(e){var t=$(e.target).closest("th.app-datagrid-header-cell").attr("data-col-id");this.closePopover(),this.options.onHeaderClick(this.preparedHeaderData[t],e)},columnSelectionHandler:function(e,t){e&&e.stopImmediatePropagation();var n=e?$(e.target).closest("th.app-datagrid-header-cell"):t,r=n.attr("data-col-id"),i=this.preparedHeaderData[r],o=i.field,s='td[data-col-id="'+r+'"]',a=this.gridElement.find(s),l=a.data("selected")||!1,c={colDef:i,data:this.options.data.map((function(e){return e[o]})),sortDirection:this._getColumnSortDirection(i.field)},u=this.options.cssClassNames.selectedColumn;l=!l,i.selected=l,a.data("selected",l),l?(a.addClass(u),n.addClass(u),_.isFunction(this.options.onColumnSelect)&&e&&this.options.onColumnSelect(c,e)):(a.removeClass(u),n.removeClass(u),_.isFunction(this.options.onColumnDeselect)&&e&&this.options.onColumnDeselect(c,e))},getTextValue:function(e,t){return this.options.getFieldValue(t?e+"_new":e)},getUploadedFiles:function(e,t){return _.get(document.forms,[e.find("form").attr("name"),t,"files",0])},isDataModified:function(e,t,n){var r=!1,i=this;function o(e){return e?moment(e).valueOf():e}return e.each((function(){var e=$(this),s=e.attr("data-col-id"),a=i.preparedHeaderData[s],l=i.getTextValue(a.field,n),c=_.get(t,a.field);if(r="upload"===a.editWidgetType?i.getUploadedFiles(e,a.field)instanceof File:!(!i.Utils.isDefined(l)&&null==c)&&("datetime"===a.editWidgetType?!(o(c)===o(l)):!(c==l)))return!r})),r},focusActiveRow:function(){this.gridElement.find("tr.app-datagrid-row.active").focus()},focusNewRow:function(){var e=this.gridElement.find("tr.always-new-row"),t=e&&e.find("input")||[];t.length&&t[0].focus()},disableActions:function(e){var t=this.gridElement.find(".delete-row-button"),n=this.gridElement.find(".edit-row-button");e?(n.addClass("disabled-action"),t.addClass("disabled-action")):(n.removeClass("disabled-action"),t.removeClass("disabled-action"))},setFocusOnElement:function(e,t,n){var r,i,o=e&&$(e.target);o&&o.hasClass("app-datagrid-cell")?r=o.find("input"):(t?t.hasClass("app-datagrid-row")&&(t=t.find("td.cell-editing")):t=o.closest("tr.app-datagrid-row").find("td.cell-editing"),(r=$(t).first().find("input")).length||(r=$(t).first().find("textarea")),r.length||(r=$(t).first().find("select"))),r.length&&(i=r.first(),n?(i.focus(),i.select()):this.options.timeoutCall((function(){i.focus(),i.select()})))},removeNewRow:function(e){this.disableActions(!1),this._setGridEditMode(!1),e.hasClass("always-new-row")||(e.attr("data-removed",!0),e.remove(),this.preparedData.length||this.setStatus("nodata",this.dataStatus.nodata),this.addOrRemoveScroll(),this.toggleNewRowActions(!1))},saveRow:function(e){this.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").each((function(){$(this).trigger("click",[void 0,{action:"save",skipSelect:!0,noMsg:!0,success:e}])}))},makeRowEditable:function(e,t,n){var r,i=this,o=e.find("td.app-datagrid-cell"),s=parseInt(e.attr("data-row-id"),10),a=_.clone(t);a.$index=s+1,this.options.removeValidations(n),this.options.generateInlineEditRow(a,n),o.each((function(){var e,r,o=$(this),a=o.text(),l=o.attr("data-col-id"),c=i.preparedHeaderData[l];c.readonly||(e=_.get(t,c.field),r=i.options.getInlineEditWidget(c.field,e,n),c.customExpression||c.formatpattern&&"None"!==c.formatpattern?(o.addClass("cell-editing editable-expression").data("originalValue",{rowIndex:s,fieldName:c.field}),o.addClass("cell-editing editable-expression").html(r).data("originalText",a)):o.addClass("cell-editing").html(r).data("originalText",a),o.addClass("form-group"),"rowOperations"!==c.binding?i.options.timeoutCall((function(){i.options.applyValidations(c,n),c.required&&o.addClass("required-field")})):c.required&&o.addClass("required-field"))})),(r=e.find("td.cell-editing")).on("click",(function(e){e.stopPropagation()})),r.on("keydown",(function(e){38!==e.which&&40!==e.which||!e.currentTarget||e.currentTarget.closest(".always-new-row")||e.stopPropagation()}))},toggleNewRowActions:function(e){var t=this,n=$(this.element).siblings("div.panel-footer, div.panel-heading").find("div.app-datagrid-actions"),r=this.gridElement.find("tr.app-datagrid-row.row-editing"),i=n.find("i.wi-plus").closest(".app-button");this.options.editmode!==this.CONSTANTS.INLINE||0!==this.options.rowActions.length&&_.some(this.options.rowActions,{action:"editRow($event)"})||(e?(n.append('<button type="button" wmbutton="" class="btn app-button btn-default cancelNewRow" tabindex="0" accesskey="" title="Cancel"><i aria-hidden="true" class="app-icon wi wi-cancel"></i><span class="sr-only">Cancel Icon</span><span class="btn-caption">Cancel</span></button><button type="button" wmbutton="" class="btn app-button btn-primary saveNewRow" tabindex="0" accesskey="" title="Save"><i aria-hidden="true" class="app-icon wi wi-done"></i><span class="sr-only">Save Icon</span><span class="btn-caption">Save</span></button>'),n.find(".cancelNewRow").on("click",(function(e){t.toggleEditRow(e,{action:"cancel",$row:r})})),n.find(".saveNewRow").on("click",(function(e){t.toggleEditRow(e,{action:"save",$row:r})})),i.hide()):($("typeahead-container").removeClass("open"),n.find(".cancelNewRow").remove(),n.find(".saveNewRow").remove(),i.show()))},_isNewRow:function(e){return parseInt(e.attr("data-row-id"),10)>=this.preparedData.length||e.hasClass("always-new-row")},toggleEditRow:function(e,t){t=t||{},e&&e.stopPropagation(),this.closePopover();var n,r,i,o,s=t.$row||$(e.target).closest("tr.app-datagrid-row"),a=s.find(".edit-row-button"),l=s.find(".cancel-edit-row-button"),c=s.find(".save-edit-row-button"),u=s.find(".delete-row-button"),d=_.cloneDeep(this.options.data[s.attr("data-row-id")])||{},h=this,p=s.hasClass("always-new-row"),f=h.options.editmode===h.CONSTANTS.QUICK_EDIT,m={};function g(e,n){_.isFunction(t.success)&&t.success(e,n),f&&!h.options.actionsEnabled.edit||h.focusActiveRow()}if(this.options.setActionRowIndex(s.attr("data-row-id")),this.options.setLastActionPerformed(this.options.ACTIONS.EDIT),"true"!==s.attr("data-removed")){if(t.selectRow&&this.selectRow(d,!0),(e=e||{}).data=e.data||{},"edit"===(n=e.data.action||t.action)){if(this.options.editmode===this.CONSTANTS.INLINE&&this.options.callLoadInlineWidgetData(),f&&h.gridElement.find("tr.app-datagrid-row.row-editing:not(.always-new-row)").length)return void h.saveRow((function(t,n){h.editSuccessHandler(t,n,e,s,!0)}));if(s.addClass("row-editing"),_.isFunction(this.options.beforeRowUpdate)&&this.options.beforeRowUpdate(d,e),h.options.editmode===h.CONSTANTS.FORM||h.options.editmode===h.CONSTANTS.DIALOG)return;if("new"===t.operation&&(h.setDefaultRowData(d),h.toggleNewRowActions(!0)),_.isFunction(this.options.onBeforeFormRender)&&!1===this.options.onBeforeFormRender(d,e,t.operation||n))return;this._setGridEditMode(!0),this.disableActions(!0),u.removeClass("disabled-action"),this.options.runInNgZone((function(){h.makeRowEditable(s,d)})),a.addClass("hidden"),l.removeClass("hidden"),c.removeClass("hidden"),i=s.find("td.cell-editing"),!t.skipFocus&&i&&this.options.timeoutCall((function(){h.setFocusOnElement(e,i)})),_.isFunction(this.options.onFormRender)&&this.options.onFormRender(s,e,t.operation||n,s.hasClass("always-new-row"))}else if(i=s.find("td.cell-editing"),r=h._isNewRow(s),"save"===n)if(!!r||this.isDataModified(i,d,p)){if(i.each((function(){var e,t=$(this),n=t.attr("data-col-id"),i=h.preparedHeaderData[n],o=_.split(i.field,".");e=h.getTextValue(i.field,p),1===o.length&&"upload"===i.editWidgetType?_.set(d,i.field,h.getUploadedFiles(t,i.field)):(e=1!==o.length&&!r||""!==e?e:void 0,h.Utils.isDefined(e)?null===(e="null"===e?null:e)?o.length>1?_.set(d,o[0],e):r||_.set(d,i.field,""):_.set(d,i.field,e):1!==o.length||r||_.set(d,i.field,e))})),i.find(".ng-pending").length>0)return void setTimeout(this.toggleEditRow.bind(this,e,t),200);if((o=i.find(".ng-invalid")).length>0)return o.each((function(e){var t=$(this).closest("td.app-datagrid-cell");0===e&&t.find("[focus-target]").focus(),h.options.setTouched(t.find("[formcontrolname]").attr("formcontrolname"))})),void(_.isFunction(t.success)&&t.success(!1,!0));if(r&&f&&_.isEmpty(d))return h.removeNewRow(s),void(_.isFunction(t.success)&&t.success(!1,void 0,!0));if(r){if(_.isFunction(this.options.onBeforeRowInsert)&&!1===this.options.onBeforeRowInsert(d,e,m))return;this.options.onRowInsert(d,e,g,m),h.toggleNewRowActions(!1),!s.hasClass("always-new-row")&&h.options.isNavTypeScrollOrOndemand()&&h.removeNewRow(s)}else{if(_.isFunction(this.options.onBeforeRowUpdate)&&!1===this.options.onBeforeRowUpdate(d,e,m))return;this.options.afterRowUpdate(d,e,g,m)}}else this.cancelEdit(s),t.noMsg||this.options.noChangesDetected(),_.isFunction(t.success)&&t.success(!1);else{if(r)return void h.removeNewRow(s);this.cancelEdit(s)}this.addOrRemoveScroll()}},cancelEdit:function(e){var t=this,n=e.find("td.cell-editing"),r=e.find(".cancel-edit-row-button"),i=e.find(".save-edit-row-button"),o=e.find(".edit-row-button");this.options.clearActionRowIndex(),this.disableActions(!1),e.removeClass("row-editing"),n.off("click"),n.each((function(){var e=$(this),n=e.data("originalValue");e.removeClass("datetime-wrapper cell-editing required-field form-group"),n?e.html(t.options.getCustomExpression(n.fieldName,n.rowIndex)):e.text(e.data("originalText")||"")})),$("typeahead-container").removeClass("open"),o.removeClass("hidden"),r.addClass("hidden"),i.addClass("hidden"),this._setGridEditMode(!1)},closeEditedRow:function(){var e=this.gridElement.find("tr.app-datagrid-row.row-editing");e.length&&(this._isNewRow(e)?this.removeNewRow(e):this.cancelEdit(e))},hideRowEditMode:function(e){if(e.hasClass("always-new-row")&&this.options.isNavTypeScrollOrOndemand())this.resetNewRow(e);else{var t=e.find("td.cell-editing"),n=e.find(".edit-row-button"),r=e.find(".cancel-edit-row-button"),i=e.find(".save-edit-row-button"),o=this;e.removeClass("row-editing"),t.off("click"),this.disableActions(!1),this._setGridEditMode(!1),t.each((function(){var e,t,n=$(this),r=n.data("originalValue");n.removeClass("datetime-wrapper cell-editing required-field form-group"),r?n.html(o.options.getCustomExpression(r.fieldName,r.rowIndex)):(t=o.preparedHeaderData[n.attr("data-col-id")],e=o.getTextValue(t.field),n.text(o.Utils.isDefined(e)?e:""))})),n.removeClass("hidden"),r.addClass("hidden"),i.addClass("hidden"),this.addOrRemoveScroll()}},deleteRow:function(e){e.stopPropagation();var t,n,r=$(e.target).closest("tr.app-datagrid-row"),i=r.attr("data-row-id"),o=this.options.data[i],s=this._isNewRow(r),a={},l=this;if(this.options.setActionRowIndex(i),this.options.setLastActionPerformed(this.options.ACTIONS.DELETE),_.isFunction(this.options.beforeRowDelete)&&this.options.beforeRowDelete(o,e),s)return this.disableActions(!1),this._setGridEditMode(!1),r.attr("data-removed",!0),r.remove(),this.preparedData.length||this.setStatus("nodata",this.dataStatus.nodata),void this.addOrRemoveScroll();_.isFunction(this.options.onBeforeRowDelete)&&!1===this.options.onBeforeRowDelete(o,e,a)||_.isFunction(this.options.onRowDelete)&&(t=this.options.cssClassNames.deleteRow,(n=-1!==r.attr("class").indexOf("active"))&&r.removeClass("active"),r.addClass(t),this.options.onRowDelete(o,(function(){n&&r.addClass("active"),r.removeClass(t),l.addOrRemoveScroll()}),e,(function(t,n){if(l.options.isNavTypeScrollOrOndemand()){var r=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id"),i=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+r+'"]');l.options.setDeletedRowIndex(r),l.preparedData.splice(r,1),l.options.data.splice(r,1),l.gridElement.find("tr.app-datagrid-row:gt("+r+")").each((function(e,t){i.is(":last-child")||$(t).hasClass("always-new-row")||($(t).attr("data-row-id",r),l.preparedData[r].$$pk--,l.preparedData[r].$$index--,l.preparedData[r].$index--,r++)})),i.remove()}var o,s;l.options.editmode===l.CONSTANTS.QUICK_EDIT&&($(e.target).hasClass("delete-row-button")||l.Utils.isDeleteKey(e))&&(l.__setStatus(),n||(o=+$(e.target).closest("tr.app-datagrid-row").attr("data-row-id"),(s=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+o+'"]')).length||(s=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+(o-1)+'"]')),s.trigger("click",[void 0,{action:"edit",skipFocus:t}])))}),a))},deleteRowAndUpdateSelectAll:function(e){this.deleteRow(e),this.updateSelectAllCheckboxState()},_deselectPreviousSelection:function(e,t){var n=this.gridElement.find("tr.app-datagrid-row.active"),r=e.attr("data-row-id"),i=this;n.each((function(){var e=$(this).attr("data-row-id"),n=i.preparedData[e];e!==r&&n&&($(this).find("input[rowSelectInput]:radio").prop("checked",!1),n._selected=n._checked=!1,$(this).removeClass("active"),i.options.callOnRowDeselectEvent(n,t))}))},resetSortIcons:function(e){var t;this.isResetSortIconsDone=!0,!e&&this.gridHeaderElement&&(e=(t=this.gridHeaderElement.find(".sort-buttons-container.active")).find("i.sort-icon"),t.removeClass("active")),e.removeClass("desc asc").removeClass(this.options.cssClassNames.descIcon).removeClass(this.options.cssClassNames.ascIcon)},setSortIconDefault:function(){const e=this.options.sortInfo,t=this.tableContainer.find("[data-col-field='"+e.field+"']").find(".sort-buttons-container"),n=t.find("i.sort-icon"),r=e.direction;"asc"===r?(n.addClass(r+" "+this.options.cssClassNames.ascIcon),t.addClass("active")):"desc"===r&&(n.addClass(r+" "+this.options.cssClassNames.descIcon),t.addClass("active"))},sortHandler:function(e){e.stopImmediatePropagation(),$(e.target).hasClass("header-data")&&this.options.enableColumnSelection&&this.headerClickHandler(e);var t,n,r,i=$(e.target).closest("th.app-datagrid-header-cell"),o=i.attr("data-col-id"),s=i.find(".sort-buttons-container"),a=s.find("i.sort-icon"),l=a.hasClass("asc")?"desc":"asc",c=this.options.sortInfo,u=this.gridHeaderElement.find(".sort-buttons-container.active"),d=i.attr("data-col-field");this.resetSortIcons(a),a.addClass(l),"asc"===l?(a.addClass(this.options.cssClassNames.ascIcon),s.addClass("active")):"desc"===l&&(a.addClass(this.options.cssClassNames.descIcon),s.addClass("active")),u.length&&(n=u.closest("th.app-datagrid-header-cell").attr("data-col-id"),r=this.preparedHeaderData[n],t=u.find("i.sort-icon"),r.field!==d&&(u.removeClass("active"),this.resetSortIcons(t)),r.sortInfo={sorted:!1,direction:""}),c.direction=l,c.field=d,""!==l&&(this.preparedHeaderData[o].sortInfo={sorted:!0,direction:l}),this._setGridEditMode(!1),this.closeEditedRow(),this.options.sortHandler.call(this,this.options.sortInfo,e,"sort")},processUpDownKeys:function(e,t,n){var r=this,i=t.find("input").val();t.hasClass("row-editing")&&r.options.editmode===r.CONSTANTS.QUICK_EDIT&&i?r.toggleEditRow(e,{action:"save",noMsg:!0,success:function(i,o){r.editSuccessHandler(i,o,e,t,!0,n)}}):(t="down"===n?t.next():t.prev(),this.options.rowExpansionEnabled&&!t.is(":visible")&&(t="down"===n?t.next():t.prev()),t.focus())},resetNewRow:function(e){var t={},n=this;this.options.clearForm(!0),n.setDefaultRowData(t),e.find("[data-field-name]").each((function(){var e=$(this),r=e.attr("data-field-name")+"_new";n.options.setFieldValue(r,t[e.attr("data-field-name")]||"")})),n.options.safeApply(),n.setFocusOnElement(void 0,e,!0)},_onEnter:function(e,t,n,r){var i=this;e.is("button")||(n&&e.hasClass("app-datagrid-row")&&!e.hasClass("row-editing")?t.trigger("click",[void 0,{action:"edit"}]):t.hasClass("row-editing")&&e.closest("[data-field-name]").length?(e.blur(),i.toggleEditRow(r,{action:"save",success:function(t,n){n?e.focus():(i.focusActiveRow(),i.focusNewRow())}})):(t.trigger("click"),n&&e.hasClass("always-new-row")&&e.hasClass("row-editing")&&i.focusNewRow()),e.is("button")||r.stopPropagation())},onKeyDown:function(e){var t,n=$(e.target),r=n.closest("tr.app-datagrid-row"),i=this.options.editmode===this.CONSTANTS.QUICK_EDIT;if(this.options.rowExpansionEnabled&&!r.length&&(r=n.closest("tr.app-datagrid-detail-row")),!this.Utils.isDeleteKey(e))return 27===e.which?((t=this._isNewRow(r))&&r.hasClass("always-new-row")?(n.blur(),this.resetNewRow(r)):r.trigger("click",[void 0,{action:"cancel"}]),void(t||r.focus())):13===e.which?(e.stopPropagation(),void this._debounceOnEnter(n,r,i,e)):void(38!==e.which?40===e.which&&this.processUpDownKeys(e,r,"down"):this.processUpDownKeys(e,r,"up"));!this.options.actionsEnabled.delete||n.is("input")||n.hasClass("form-control")||this.deleteRow(e)},editSuccessHandler:function(e,t,n,r,i,o){var s,a,l=this;if(l.__setStatus(),t)l.setFocusOnElement(n);else{if(s=+r.attr("data-row-id"),o)return s="down"===o?++s:--s,void((a=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+s+'"]')).length?a.focus():r.focus());i||_.isUndefined(i)||s++,(a=l.gridElement.find('tr.app-datagrid-row[data-row-id="'+s+'"]')).hasClass("always-new-row")?("top"!==l.options.formPosition||r.hasClass("always-new-row"))&&l.addNewRow(e):a.length?a.trigger("click",[void 0,{action:"edit",skipFocus:e,skipSelect:l.options.multiselect}]):l.options.actionsEnabled.new&&l.addNewRow(e)}},isLastColumn:function(e){var t,n=e.closest("td.app-datagrid-cell");return!!n.is(":last-child")||!!n.hasClass("cell-editing")&&(t=n.closest("tr.app-datagrid-row").find(".cell-editing").has('> :not([disabled="disabled"])'),n.attr("data-col-id")===t.last().attr("data-col-id"))},getColInfo:function(e){return $(e.target).closest("td.app-datagrid-cell").attr("data-col-id")},attachEventHandlers:function(e){var t=this.gridHeaderElement,n=this;this.options.enableRowSelection&&(e[0].removeEventListener("click",this.rowClickHandlerOnCapture.bind(this)),e.off(),e[0].addEventListener("click",this.rowClickHandlerOnCapture.bind(this)),e.on("click",this.rowSelectionHandler.bind(this)),e.on("dblclick",this.rowDblClickHandler.bind(this)),e.on("keydown",this.onKeyDown.bind(this))),t&&(this.options.enableColumnSelection?(t.find("th[data-col-selectable]").off("click",this.columnSelectionHandler.bind(this)),t.find("th[data-col-selectable]").on("click",this.columnSelectionHandler.bind(this))):t.find("th[data-col-selectable]").off("click"),this.options.enableSort?this.options.enableColumnSelection?(t.find("th[data-col-sortable] .header-data").off("click",this.sortHandler.bind(this)),t.find("th[data-col-sortable] .header-data").on("click",this.sortHandler.bind(this))):(t.find("th[data-col-sortable]").off("click",this.sortHandler.bind(this)),t.find("th[data-col-sortable]").on("click",this.sortHandler.bind(this))):this.options.enableColumnSelection?t.find("th[data-col-sortable] .header-data").off("click"):t.find("th[data-col-sortable]").off("click")),this.options.rowActions.length&&(e.find(".cancel-edit-row-button").off("click"),e.find(".save-edit-row-button").off("click"),e.find(".cancel-edit-row-button").on("click",{action:"cancel"},this.toggleEditRow.bind(this)),e.find(".save-edit-row-button").on("click",{action:"save"},this.toggleEditRow.bind(this))),n.options.editmode===n.CONSTANTS.QUICK_EDIT&&e.on("focusout","tr.app-datagrid-row",(function(e){var t=$(e.target),r=t.closest("tr.app-datagrid-row"),i=$(e.relatedTarget),o=n.isLastColumn(t,i),s=t.closest("span.actions-column").length>0,a=i.closest("span.actions-column").length>0,l=i.closest("div.app-datagrid-actions").length>0,c=i.closest("div.app-datagrid-actions").length>0;i.is("tr.app-datagrid-row")&&i.attr("data-row-id")===r.attr("data-row-id")||a||r.hasClass("danger")||c||s&&a||s&&null===e.relatedTarget||!i.closest(".app-grid").length||i.is('.row-editing:not(".always-new-row"), .row-action-button, .app-datagrid-cell, .caption, button.btn-time, button.btn-date')||""===i.attr("focus-target")||(l||s||!(!o||o&&null===e.relatedTarget||t.hasClass("file-upload")))&&n.options.timeoutCall((function(){n.toggleEditRow(e,{action:"save",noMsg:!0,success:function(t,i,o){o||n.editSuccessHandler(t,i,e,r)}})}))})),e.find('[data-identifier="rowExpansionButtons"]').off("click"),e.find('[data-identifier="rowExpansionButtons"]').on("click",(function(e){var t=$(e.target).closest("tr.app-datagrid-row");$(this).find(".app-button").attr("disabled")||n.toggleExpandRow(+t.attr("data-row-id"),void 0,e)}))},expandRow:function(e){this.toggleExpandRow(e,!0)},collapseRow:function(e){this.toggleExpandRow(e,!1)},hasAllClasses:function(e,t){return t&&t.every((t=>e.hasClass(t)))},_collapseRow:function(e,t,n,r,i){var o=this.gridElement,s=$(o.find('> tr.app-datagrid-row[data-row-id="'+n+'"]'));s.removeClass(this.options.cssClassNames.expandedRowClass),s.find("button, a").attr("aria-expanded","false").attr("aria-live","polite"),!1!==this.options.onBeforeRowCollapse(e,t,n)&&(i.length&&this.hasAllClasses(i,this.options.cssClassNames.rowExpandIcon?.split(" "))&&i.removeClass(this.options.cssClassNames.rowExpandIcon).addClass(this.options.cssClassNames.rowCollapseIcon),r.hide(),this.options.onRowCollapse(e,t))},toggleExpandRow:function(e,t,n){var r=this,i=r.gridElement,o=$(i.find('> tr.app-datagrid-row[data-row-id="'+e+'"]')),s=_.clone(r.options.data[e]),a=o.next("tr.app-datagrid-detail-row"),l=!a.is(":visible"),c=o.find('[data-identifier="rowExpansionButtons"] i.app-icon');s.$index=e+1,t&&!l||!1===t&&l||(l?(o.addClass(r.options.cssClassNames.expandedRowClass),o.find("button, a").attr("aria-expanded","true"),n&&r.preparedData[e]._selected&&n.stopPropagation(),r.options.rowDef.closeothers&&i.find("> tr.app-datagrid-detail-row:visible").each((function(){var e=$(this),t=e.prev("tr.app-datagrid-row").find('[data-identifier="rowExpansionButtons"] i.app-icon'),i=+e.attr("data-row-id"),o=r.options.data[i];e.hide(),r._collapseRow(n,o,i,e,t)})),r.options.generateRowDetailView(n,s,e,a.find("td.app-datagrid-row-details-cell .details-section"),a.find("td.app-datagrid-row-details-cell .row-overlay"),(function(){c.length&&r.hasAllClasses(c,r.options.cssClassNames.rowCollapseIcon?.split(" "))&&c.removeClass(r.options.cssClassNames.rowCollapseIcon).addClass(r.options.cssClassNames.rowExpandIcon),a.show()}))):r._collapseRow(n,s,e,a,c))},_findAndReplaceCompiledTemplates:function(){if(this.gridElement){var e=this.gridElement.find("td[data-compiled-template]"),t=this;e.each((function(){var e=$(this),n=e.attr("data-compiled-template");e.replaceWith(t.compiledCellTemplates[n])}))}},_renderSearch:function(){var e,t=$(this._getSearchEl()),n=this;function r(e){e.stopPropagation();var r=t.find('[data-element="dgSearchText"]')[0].value,i=t.find('[data-element="dgFilterValue"]')[0].value,o=t.find("option:selected").attr("data-coldef-index"),s=n.options.colDefs[o],a=s&&s.type?s.type:"";n.searchObj={field:i,value:r,type:a,event:e},n.options.searchHandler.call(n,n.searchObj,e,"search")}this.element.find(".form-search").remove(),t.insertBefore(this.gridContainer),this.gridSearch=this.element.find(".form-search"),e=this.gridSearch.find('[data-element="dgSearchText"]'),this.gridSearch.find(".app-search-button").on("click",r),this.gridSearch.find('[data-element="dgFilterValue"]').on("change",(function(e){n.dataStatusContainer.find(".status").text()===n.options.dataStates.nodata&&r(e)})),e.on("keyup",(function(e){e.stopPropagation(),$(this).val()?n.emptySearch=!1:(n.emptySearch=!0,n.searchObj.value&&(n.searchObj.value="",r(e))),(13===e.which||n.options.filteronkeypress)&&r(e)}))},_renderRowFilter:function(){var e=$('<tr class="filter-row"></tr>'),t=this,n=this.options.isMobile&&!this.options.showHeader?this.gridElement:this.gridHeaderElement;n.find(".filter-row").remove(),this.options.generateFilterRow(),this.preparedHeaderData.forEach((function(n,r){var i=n.field,o=$('<th data-col-id="'+r+'"></th>');n.searchable?(o.append(t.options.getFilterWidget(i)),e.append(o)):e.append(o)}),this),this.options.showHeader?this.gridHeaderElement.append(e):(this.options.isMobile,n.empty().append(e)),this.gridSearch=n.find(".filter-row")},_renderHeader:function(){var e,t=this._getHeaderTemplate(),n=t.colgroup,r=this;if(this.gridElement.parent().scroll((function(){r.gridHeaderElement.parent().prop("scrollLeft",this.scrollLeft)})),!this.options.showHeader)return this.tableContainer.append(n),void this.gridHeaderElement.hide();this.gridHeaderElement.show();var i=(e=t.header).find("th.app-datagrid-header-cell"),o=n.find("col");i.each((function(){var e=Number($(this).attr("data-col-id")),t=r.preparedHeaderData[e],n=$(o[e]);t&&(_.isUndefined(t.show)||t.show||($(this).hide(),n.hide()))})),this.options.isMobile,this.tableContainer.append(n),e.on("click",".app-datagrid-header-cell input:checkbox",(function(e){var t=$('tr.app-datagrid-row:not(.always-new-row):visible td input[name="gridMultiSelect"]:checkbox',r.gridElement),n=this.checked;t.prop("checked",n),t.each((function(){var t=$(this).closest("tr.app-datagrid-row"),i=t.attr("data-row-id"),o=r.options.data[i];r.toggleRowSelection(t,n,e,!0),r.options.assignSelectedItems(o,e,{rowId:i,_selected:r.preparedData[i]?._selected}),n&&_.isFunction(r.options.onRowSelect)&&r.options.onRowSelect(o,e),!n&&_.isFunction(r.options.onRowDeselect)&&r.options.onRowDeselect(o,e)}))})),_.isFunction(this.options.onHeaderClick)&&this.gridHeaderElement.find("th.app-datagrid-header-cell").on("click",this.headerClickHandler.bind(this)),!this.options.isMobile&&this.gridHeaderElement.length&&this.gridHeaderElement.find("th[data-col-resizable]").resizable({handles:"e",minWidth:50,resize:function(e,t){var n,i,o,s,a=+t.helper.attr("data-col-id")+1,l=t.helper.width(),c=t.size.width;i=r.tableContainer.find("colgroup > col:nth-child("+a+")"),n=r.tableContainer.find("colgroup > col:nth-child("+a+")"),o=r.gridElement.find("tr.app-datagrid-row > td:nth-child("+a+") > div"),n.width(c),i.width(c),o.width(c),$(this).css("height","auto"),c>t.originalSize.width&&(s=r.gridHeaderElement.width()+c-l,r.gridHeaderElement.width(s),r.gridElement.width(s)),r.addOrRemoveScroll(),r.options.redrawWidgets()}}),this.isResetSortIconsDone||this.setSortIconDefault()},addOrRemoveScroll:function(){var e=this.gridContainer.find("tbody"),t=this.gridContainer.find(".table-header");e.scrollHeight>e.clientHeight&&!this.Utils.isMac()?t.addClass("scroll-visible"):t.removeClass("scroll-visible")},_handleCustomEvents:function(e,t){this.options.handleCustomEvents(e,t)},_setActionsEnabled:function(){var e=this;_.forEach(this.options.rowActions,(function(t){_.includes(t.action,"editRow(")?e.options.actionsEnabled.edit=!0:_.includes(t.action,"deleteRow(")&&(e.options.actionsEnabled.delete=!0)}))},_appendRowActions:function(e,t,n){var r,i=this._getRowActionsColumnDef();(this.options.rowActions.length||i)&&(this._setActionsEnabled(),r=this,e.find("[data-identifier='actionButtons']").each((function(e){var i,o,s,a=e;t?i=n:(o=$(this).closest("tr.app-datagrid-row"),s=parseInt(o.attr("data-row-id"),10),(i=_.clone(r.options.data[s])).$index=a+1),r.options.generateRowActions(i,a),$(this).empty().append(r.options.getRowAction(a))})))},_renderGrid:function(e){var t,n=this.options.isNavTypeScrollOrOndemand();this.getPageStartIndex();if($("table.table-bordered").parents(".app-grid-header-inner").addClass("table_border"),n){var r=this.gridElement,i=this._getGridTemplate();t=$(i),i&&!r.length&&this.gridElement.append(t)}else{var o=this._getGridTemplate();t=$(o),o&&this.gridElement.append(t)}if(this.options.summaryRow){var s=$(this._getSummaryRowTemplate());this.tableContainer.find("tfoot").remove(),this.options.data.length&&this.tableContainer.append(s)}this.options.data.length||"nodata"!==this.dataStatus.state?(this.dataStatus.state=this.dataStatus.state||"loading",this.dataStatus.message=this.dataStatus.message||this.options.dataStates.loading,this.setStatus(this.dataStatus.state,this.dataStatus.message,e)):this.setStatus("nodata"),this.gridBody=this.gridElement.find("tbody"),this.gridFooter=this.tableContainer.find("tfoot"),this._findAndReplaceCompiledTemplates(),this.options.clearRowActions(),this._appendRowExpansionButtons(t),this._appendRowActions(t),this.attachEventHandlers(t),this.__setStatus(e),this.options.editmode===this.CONSTANTS.QUICK_EDIT&&this.options.showNewRow&&this.addNewRow(!1,!0),e&&this._setColSpan(this.options.headerConfig),_.isFunction(this.options.onDataRender)&&this.options.onDataRender(),!e&&this.options.selectFirstRow&&(this.options.multiselect&&(this.options.selectFirstRow=!1),this.gridElement.find("tr.app-datagrid-row.active").length<=0&&this.selectFirstRow(!0,!0))},_render:function(e){this.tableId||(this.tableId=this.Utils.generateGuid());!this.options.isNavTypeScrollOrOndemand()||"100%"!==this.options.height&&this.options.height;var t='<div class="overlay"><div class="status"><i class="'+this.options.loadingicon+'"></i><span class="message"></span></div></div>',n='<div class="table-container table-responsive"><div class="app-grid-header"><div class="app-grid-header-inner"><table tabindex="0" class="'+this.options.cssClassNames.gridDefault+" "+this.options.cssClassNames.grid+'"><thead tabindex="0" class="table-header thead-sticky" id="table_header_'+this.tableId+'"></thead><tbody class="app-grid-content app-datagrid-body" id="table_'+this.tableId+'"></tbody></table></div></div></div>',r=$(t),i=this.element.find(".table-container");this.gridContainer=$(n),this.gridHeaderElement=this.gridContainer.find(".table-header"),this._setStyles(r.find("div.overlay"),"display:none"),this._setStyles(this.gridContainer.find("div.app-grid-header-inner"),"height:"+this.options.height+"; overflow: auto;"),this.tableContainer=this.gridContainer.find("table"),this.gridElement=this.gridContainer.find(".app-grid-content"),(!this.options.isNavTypeScrollOrOndemand()||i.length&&this.options.isNextPageData)&&this.options.isNavTypeScrollOrOndemand()||(this.element.find(".table-container").remove(),this.element.append(this.gridContainer)),this.options.setIsNextPageData(!1),this.gridContainer.find(".overlay").length||(this.dataStatusContainer=$(t),this.gridContainer.append(this.dataStatusContainer)),this.gridHeaderElement&&(this.gridHeaderElement.empty(),this.gridElement.find("colgroup").remove()),this._renderHeader(),this.options.filtermode===this.CONSTANTS.SEARCH&&(_.isEmpty(this.searchObj)||this.searchObj&&!this.searchObj.field&&!this.searchObj.value)?this._renderSearch():this.options.filtermode===this.CONSTANTS.MULTI_COLUMN&&this._renderRowFilter(),"condensed"===this.options.spacing&&this._toggleSpacingClasses("condensed"),this._renderGrid(e),this.addNavigationControls()},addNavigationControls:function(){this.options.isdynamictable&&(this.element.find(".on-demand-datagrid").remove(),"On-Demand"!==this.options.navigation||this.element.find(".on-demand-datagrid").length?"Scroll"===this.options.navigation&&this.options.bindScrollEvt():this.options.addLoadMoreBtn())},__setStatus:function(e){var t=this.dataStatusContainer.find("i"),n=this.dataStatus.state,r=this.options.isNavTypeScrollOrOndemand();this.dataStatusContainer.find(".message").text(this.dataStatus.message),"loading"===n?t.removeClass("hidden"):t.addClass("hidden"),"ready"===n?this.dataStatusContainer.hide():(this.options.isNavTypeScrollOrOndemand()&&("nodata"===n||this.options.getCurrentPage()==this.options.getPageCount()&&!this.options.showviewlessbutton)&&this.element.find(".on-demand-datagrid a").hide(),this.dataStatusContainer.show()),"nodata"===n||"loading"===n||"error"===n?("100%"!==this.options.height&&"auto"!==this.options.height||("nodata"===n?(this.dataStatusContainer.css("height","auto"),this.dataStatus.contentHeight=0):this.options.isNavTypeScrollOrOndemand()&&this.options.getCurrentPage()>1?this.dataStatusContainer.hide():(this.dataStatus.height=this.dataStatus.height||this.dataStatusContainer.outerHeight(),this.dataStatus.contentHeight=this.gridElement.outerHeight()||this.dataStatus.contentHeight,this.dataStatusContainer.css("height",this.dataStatus.height>this.dataStatus.contentHeight?"auto":this.dataStatus.contentHeight))),(!r||r&&1===this.options.getCurrentPage())&&this.gridContainer.addClass("show-msg")):(this.gridContainer.removeClass("show-msg"),this.options.editmode===this.CONSTANTS.QUICK_EDIT&&(this.options.activeRow&&this.attachHandlersToActiveRow(this.options.activeRow),this.options.activeRow=void 0)),e||this.setColGroupWidths(),this.addOrRemoveScroll()},attachHandlersToActiveRow(e){var t=this.Utils.getObjectIndex(this.options.data,e),n=this.gridElement.find("tr.app-datagrid-row[data-row-id="+t+"]");n.length&&(n.hasClass("active")||n.addClass("active"),this.focusActiveRow(),this.attachEventHandlers(n))},setActiveRow(e){this.options.activeRow=e},setStatus:function(e,t,n){var r;"nodata"===e&&(e=(r=this.gridElement&&this.gridElement.find("tr.app-datagrid-row.always-new-row"))&&r.length?"ready":e),this.dataStatus.state=e,this.options.setGridState(e),this.dataStatus.message=t||this.options.dataStates[e],this._setStatusCalled?this._setStatus(n):(this.__setStatus(n),this._setStatusCalled=!0)},setGridDimensions:function(e,t){if(-1===t.indexOf("px")&&-1===t.indexOf("%")&&-1===t.indexOf("em")&&"auto"!=t&&(t+="px"),this.options[e]=t,"height"===e){this.gridHeaderElement.find("th");this.gridContainer.find(".app-grid-header-inner").css(e,t),this.options.isNavTypeScrollOrOndemand()&&"100%"!=this.options.height&&"auto"!=this.options.height&&this.gridContainer.find(".app-grid-header-inner").css("overflow","auto"),this.dataStatusContainer.css(e,t)}this.addOrRemoveScroll()},setColumnProp:function(e,t,n,r){var i;"displayName"===t&&((i=r?this.gridHeaderElement.find('th[data-col-group="'+e+'"]'):this.gridHeaderElement.find('th[data-col-field="'+e+'"]')).attr("title",n),i.find(".header-data").html(n),this.options.filtermode===this.CONSTANTS.SEARCH&&this.gridSearch&&this.gridSearch.find('select option[value="'+e+'"]').text(n))},applyRowNgClass:function(e,t){var n=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+t+'"]');n.removeClass(e.toRemove),n.addClass(e.toAdd)},applyColNgClass:function(e,t,n){var r=this.gridElement.find('tr.app-datagrid-row[data-row-id="'+t+'"] td.app-datagrid-cell[data-col-id="'+n+'"]');r.removeClass(e.toRemove),r.addClass(e.toAdd)},_destroy:function(){this.element.text(""),window.clearTimeout(this.refreshGridTimeout)}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("rxjs")):"function"==typeof define&&define.amd?define(["exports","rxjs"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).awesomeCordova=e.awesomeCordova||{},e.awesomeCordova.core={}),e.rxjs)}(this,(function(e,t){"use strict";var n={error:"cordova_not_available"},r={error:"plugin_not_installed"};function i(e){if("undefined"!=typeof window&&window.angular){var t=window.document,n=window.angular.element(t.querySelector("[ng-app]")||t.body).injector();if(n)return n.get("$q")((function(t,n){e(t,n)}));console.warn("Angular 1 was detected but $q couldn't be retrieved. This is usually when the app is not bootstrapped on the html or body tag. Falling back to native promises which won't trigger an automatic digest when promises resolve.")}return function(){if(Promise)return new Promise((function(t,n){e(t,n)}));console.error("No Promise support or polyfill found. To enable Ionic Native support, please add the es6-promise polyfill before this script, or run with a library like Angular or on a recent browser.")}()}function o(e,t,i){var o,s;"string"==typeof e?o=e:(o=e.constructor.getPluginRef(),i=e.constructor.getPluginName(),s=e.constructor.getPluginInstallName());var a=u(o);return!(!a||t&&void 0===a[t])||("undefined"!=typeof window&&window.cordova?(function(e,t,n){n?console.warn("Native: tried calling "+e+"."+n+", but the "+e+" plugin is not installed."):console.warn("Native: tried accessing the "+e+" plugin but it's not installed.");t&&console.warn("Install the "+e+" plugin: 'ionic cordova plugin add "+t+"'")}(i,s,t),r):(function(e,t){"undefined"==typeof process&&(t?console.warn("Native: tried calling "+e+"."+t+", but Cordova is not available. Make sure to include cordova.js or run in a device/simulator"):console.warn("Native: tried accessing the "+e+" plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator"))}(i,t),n))}function s(e,t){return e._objectInstance&&(!t||void 0!==e._objectInstance[t])}function a(e,t,n,r){if(void 0===t&&(t={}),t.sync)return e;if("reverse"===t.callbackOrder)e.unshift(r),e.unshift(n);else if("node"===t.callbackStyle)e.push((function(e,t){e?r(e):n(t)}));else if("object"===t.callbackStyle&&t.successName&&t.errorName){var i={};i[t.successName]=n,i[t.errorName]=r,e.push(i)}else if(void 0!==t.successIndex||void 0!==t.errorIndex){var o=function(){t.successIndex>e.length?e[t.successIndex]=n:e.splice(t.successIndex,0,n)},s=function(){t.errorIndex>e.length?e[t.errorIndex]=r:e.splice(t.errorIndex,0,r)};t.successIndex>t.errorIndex?(s(),o()):(o(),s())}else e.push(n),e.push(r);return e}function l(e,t,n,r,i,s){void 0===r&&(r={}),n=a(n,r,i,s);var l=o(e,t);if(!0===l){var c=u(e.constructor.getPluginRef());return c[t].apply(c,n)}return l}function c(e,t,n,r,i,o){if(void 0===r&&(r={}),n=a(n,r,i,o),s(e,t))return e._objectInstance[t].apply(e._objectInstance,n)}function u(e){return"undefined"!=typeof window?d(window,e):null}function d(e,t){for(var n=t.split("."),r=e,i=0;i<n.length;i++){if(!r)return null;r=r[n[i]]}return r}var h=function(e,n,r){return void 0===r&&(r={}),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return r.sync?l(e,n,o,r):r.observable?function(e,n,r,i){return void 0===i&&(i={}),new t.Observable((function(t){var o;return o=i.destruct?l(e,n,r,i,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(e)}),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.error(e)})):l(e,n,r,i,t.next.bind(t),t.error.bind(t)),o&&o.error&&(t.error(o.error),t.complete()),function(){try{if(i.clearFunction)return i.clearWithArgs?l(e,i.clearFunction,r,i,t.next.bind(t),t.error.bind(t)):l(e,i.clearFunction,[])}catch(t){console.warn("Unable to clear the previous observable watch for",e.constructor.getPluginName(),n),console.warn(t)}}}))}(e,n,o,r):r.eventObservable&&r.event?function(e,n){return n="undefined"!=typeof window&&n?d(window,n):n||("undefined"!=typeof window?window:{}),t.fromEvent(n,e)}(r.event,r.element):r.otherPromise?function(e,t,n,r){return void 0===r&&(r={}),i((function(i,o){var s=l(e,t,n,r);s?s.error?o(s.error):s.then&&s.then(i).catch(o):o({error:"unexpected_error"})}))}(e,n,o,r):function(e,t,n,r){var o,s;void 0===r&&(r={});var a=i((function(i,a){o=r.destruct?l(e,t,n,r,(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return a(e)})):l(e,t,n,r,i,a),s=a}));return o&&o.error&&(a.catch((function(){})),"function"==typeof s&&s(o.error)),a}(e,n,o,r)}};var p=function(){function e(){}return e.installed=function(){return!0===o(this.pluginRef)},e.getPlugin=function(){return"undefined"!=typeof window?function(e,t){for(var n=t.split("."),r=e,i=0;i<n.length;i++){if(!r)return null;r=r[n[i]]}return r}(window,this.pluginRef):null},e.getPluginName=function(){return this.pluginName},e.getPluginRef=function(){return this.pluginRef},e.getPluginInstallName=function(){return this.plugin},e.getSupportedPlatforms=function(){return this.platforms},e.pluginName="",e.pluginRef="",e.plugin="",e.repo="",e.platforms=[],e.install="",e}();!function(){if("undefined"==typeof process){var e="undefined"!=typeof window?window:{},t=Date.now(),n=!1;e.document.addEventListener("deviceready",(function(){console.log("Ionic Native: deviceready event fired after "+(Date.now()-t)+" ms"),n=!0})),setTimeout((function(){!n&&e.cordova&&console.warn("Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.")}),5e3)}}(),window.rxjs._throw=window.rxjs.throwError,e.AwesomeCordovaNativePlugin=p,e.checkAvailability=o,e.cordova=function(e,t,n,r){return h(e,t,n).apply(this,r)},e.cordovaFunctionOverride=function(e,n,r){return function(e,n){return new t.Observable((function(t){var r=o(e,n);if(!0===r){var i=u(e.constructor.getPluginRef());return i[n]=t.next.bind(t),function(){return i[n]=function(){}}}t.error(r),t.complete()}))}(e,n)},e.cordovaInstance=function(e,n,r,o){return o=Array.from(o),function(e,n,r){return void 0===r&&(r={}),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(r.sync)return c(e,n,o,r);if(r.observable)return new t.Observable((function(t){var i;return i=r.destruct?c(e,n,o,r,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(e)}),(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.error(e)})):c(e,n,o,r,t.next.bind(t),t.error.bind(t)),i&&i.error&&t.error(i.error),function(){try{return r.clearWithArgs?c(e,r.clearFunction,o,r,t.next.bind(t),t.error.bind(t)):c(e,r.clearFunction,[])}catch(t){console.warn("Unable to clear the previous observable watch for",e.constructor.getPluginName(),n),console.warn(t)}}}));if(r.otherPromise)return i((function(t,i){var s;s=r.destruct?c(e,n,o,r,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)})):c(e,n,o,r,t,i),s&&s.then?s.then(t,i):i()}));var a,l,u=i((function(t,i){a=r.destruct?c(e,n,o,r,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t(e)}),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)})):c(e,n,o,r,t,i),l=i}));return a&&a.error&&(u.catch((function(){})),"function"==typeof l&&l(a.error)),u}}(e,n,r).apply(this,o)},e.cordovaPropertyGet=function(e,t){return!0===o(e,t)?u(e.constructor.getPluginRef())[t]:null},e.cordovaPropertySet=function(e,t,n){!0===o(e,t)&&(u(e.constructor.getPluginRef())[t]=n)},e.getPromise=i,e.instanceAvailability=s,e.instancePropertyGet=function(e,t){return e._objectInstance&&e._objectInstance[t]?e._objectInstance[t]:null},e.instancePropertySet=function(e,t,n){e._objectInstance&&(e._objectInstance[t]=n)},e.wrap=h})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("tslib"),require("@angular/core"),require("@awesome-cordova-plugins/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define(["tslib","@angular/core","@awesome-cordova-plugins/core","rxjs","rxjs/operators"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).awesomeCordova=e.awesomeCordova||{},e.awesomeCordova.plugins=t(e.tslib,e.ng.core,e.awesomeCordova.core,e.rxjs,e.rxjs.operators))}(this,(function(e,t,n,r,i){"use strict";var o,s,a,l,c,u,d=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.getAppName=function(){return n.cordova(this,"getAppName",{},arguments)},i.prototype.getPackageName=function(){return n.cordova(this,"getPackageName",{},arguments)},i.prototype.getVersionCode=function(){return n.cordova(this,"getVersionCode",{},arguments)},i.prototype.getVersionNumber=function(){return n.cordova(this,"getVersionNumber",{},arguments)},i.pluginName="AppVersion",i.plugin="cordova-plugin-app-version",i.pluginRef="cordova.getAppVersion",i.repo="https://github.com/whiteoctober/cordova-plugin-app-version",i.platforms=["Android","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),h=Object.freeze({__proto__:null,AppVersion:d}),p=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.Encode={TEXT_TYPE:"TEXT_TYPE",EMAIL_TYPE:"EMAIL_TYPE",PHONE_TYPE:"PHONE_TYPE",SMS_TYPE:"SMS_TYPE"},e}return e.__extends(i,r),i.prototype.scan=function(e){return n.cordova(this,"scan",{callbackOrder:"reverse"},arguments)},i.prototype.encode=function(e,t){return n.cordova(this,"encode",{},arguments)},i.pluginName="BarcodeScanner",i.plugin="phonegap-plugin-barcodescanner",i.pluginRef="cordova.plugins.barcodeScanner",i.repo="https://github.com/phonegap/phonegap-plugin-barcodescanner",i.platforms=["Android","BlackBerry 10","Browser","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),f=Object.freeze({__proto__:null,BarcodeScanner:p}),m=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.hasReadWritePermission=function(){return n.cordova(this,"hasReadWritePermission",{},arguments)},i.prototype.hasReadPermission=function(){return n.cordova(this,"hasReadPermission",{},arguments)},i.prototype.hasWritePermission=function(){return n.cordova(this,"hasWritePermission",{},arguments)},i.prototype.requestWritePermission=function(){return n.cordova(this,"requestWritePermission",{},arguments)},i.prototype.requestReadPermission=function(){return n.cordova(this,"requestReadPermission",{},arguments)},i.prototype.requestReadWritePermission=function(){return n.cordova(this,"requestReadWritePermission",{},arguments)},i.prototype.createCalendar=function(e){return n.cordova(this,"createCalendar",{},arguments)},i.prototype.deleteCalendar=function(e){return n.cordova(this,"deleteCalendar",{},arguments)},i.prototype.getCalendarOptions=function(){return n.cordova(this,"getCalendarOptions",{sync:!0},arguments)},i.prototype.getCreateCalendarOptions=function(){return n.cordova(this,"getCreateCalendarOptions",{sync:!0},arguments)},i.prototype.createEvent=function(e,t,r,i,o){return n.cordova(this,"createEvent",{},arguments)},i.prototype.createEventWithOptions=function(e,t,r,i,o,s){return n.cordova(this,"createEventWithOptions",{},arguments)},i.prototype.createEventInteractively=function(e,t,r,i,o){return n.cordova(this,"createEventInteractively",{},arguments)},i.prototype.createEventInteractivelyWithOptions=function(e,t,r,i,o,s){return n.cordova(this,"createEventInteractivelyWithOptions",{},arguments)},i.prototype.findEvent=function(e,t,r,i,o){return n.cordova(this,"findEvent",{},arguments)},i.prototype.findEventWithOptions=function(e,t,r,i,o,s){return n.cordova(this,"findEventWithOptions",{},arguments)},i.prototype.listEventsInRange=function(e,t){return n.cordova(this,"listEventsInRange",{platforms:["Android"]},arguments)},i.prototype.listCalendars=function(){return n.cordova(this,"listCalendars",{},arguments)},i.prototype.findAllEventsInNamedCalendar=function(e){return n.cordova(this,"findAllEventsInNamedCalendar",{platforms:["iOS"]},arguments)},i.prototype.modifyEvent=function(e,t,r,i,o,s,a,l,c,u){return n.cordova(this,"modifyEvent",{platforms:["iOS"]},arguments)},i.prototype.modifyEventWithOptions=function(e,t,r,i,o,s,a,l,c,u,d,h){return n.cordova(this,"modifyEventWithOptions",{platforms:["iOS"]},arguments)},i.prototype.deleteEvent=function(e,t,r,i,o){return n.cordova(this,"deleteEvent",{},arguments)},i.prototype.deleteEventFromNamedCalendar=function(e,t,r,i,o,s){return n.cordova(this,"deleteEventFromNamedCalendar",{platforms:["iOS"]},arguments)},i.prototype.deleteEventById=function(e,t){return n.cordova(this,"deleteEventById",{},arguments)},i.prototype.openCalendar=function(e){return n.cordova(this,"openCalendar",{},arguments)},i.pluginName="Calendar",i.plugin="cordova-plugin-calendar",i.pluginRef="plugins.calendar",i.repo="https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin",i.platforms=["Android","iOS"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),g=Object.freeze({__proto__:null,Calendar:m});!function(e){e[e.DATA_URL=0]="DATA_URL",e[e.FILE_URL=1]="FILE_URL",e[e.NATIVE_URI=2]="NATIVE_URI"}(o||(o={})),function(e){e[e.JPEG=0]="JPEG",e[e.PNG=1]="PNG"}(s||(s={})),function(e){e[e.PICTURE=0]="PICTURE",e[e.VIDEO=1]="VIDEO",e[e.ALLMEDIA=2]="ALLMEDIA"}(a||(a={})),function(e){e[e.PHOTOLIBRARY=0]="PHOTOLIBRARY",e[e.CAMERA=1]="CAMERA",e[e.SAVEDPHOTOALBUM=2]="SAVEDPHOTOALBUM"}(l||(l={})),function(e){e[e.ARROW_UP=1]="ARROW_UP",e[e.ARROW_DOWN=2]="ARROW_DOWN",e[e.ARROW_LEFT=3]="ARROW_LEFT",e[e.ARROW_RIGHT=4]="ARROW_RIGHT",e[e.ARROW_ANY=5]="ARROW_ANY"}(c||(c={})),function(e){e[e.BACK=0]="BACK",e[e.FRONT=1]="FRONT"}(u||(u={}));var v,y=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.DestinationType={DATA_URL:0,FILE_URI:1,NATIVE_URI:2},e.EncodingType={JPEG:0,PNG:1},e.MediaType={PICTURE:0,VIDEO:1,ALLMEDIA:2},e.PictureSourceType={PHOTOLIBRARY:0,CAMERA:1,SAVEDPHOTOALBUM:2},e.PopoverArrowDirection={ARROW_UP:1,ARROW_DOWN:2,ARROW_LEFT:4,ARROW_RIGHT:8,ARROW_ANY:15},e.Direction={BACK:0,FRONT:1},e}return e.__extends(i,r),i.prototype.getPicture=function(e){return n.cordova(this,"getPicture",{callbackOrder:"reverse"},arguments)},i.prototype.cleanup=function(){return n.cordova(this,"cleanup",{platforms:["iOS"]},arguments)},i.pluginName="Camera",i.plugin="cordova-plugin-camera",i.pluginRef="navigator.camera",i.repo="https://github.com/apache/cordova-plugin-camera",i.platforms=["Android","Browser","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),b=Object.freeze({__proto__:null,Camera:y,get DestinationType(){return o},get Direction(){return u},get EncodingType(){return s},get MediaType(){return a},get PictureSourceType(){return l},get PopoverArrowDirection(){return c}}),_=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),Object.defineProperty(i.prototype,"cordova",{get:function(){return n.cordovaPropertyGet(this,"cordova")},set:function(e){n.cordovaPropertySet(this,"cordova",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"model",{get:function(){return n.cordovaPropertyGet(this,"model")},set:function(e){n.cordovaPropertySet(this,"model",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"platform",{get:function(){return n.cordovaPropertyGet(this,"platform")},set:function(e){n.cordovaPropertySet(this,"platform",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"uuid",{get:function(){return n.cordovaPropertyGet(this,"uuid")},set:function(e){n.cordovaPropertySet(this,"uuid",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"version",{get:function(){return n.cordovaPropertyGet(this,"version")},set:function(e){n.cordovaPropertySet(this,"version",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"manufacturer",{get:function(){return n.cordovaPropertyGet(this,"manufacturer")},set:function(e){n.cordovaPropertySet(this,"manufacturer",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isVirtual",{get:function(){return n.cordovaPropertyGet(this,"isVirtual")},set:function(e){n.cordovaPropertySet(this,"isVirtual",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"serial",{get:function(){return n.cordovaPropertyGet(this,"serial")},set:function(e){n.cordovaPropertySet(this,"serial",e)},enumerable:!1,configurable:!0}),i.pluginName="Device",i.plugin="cordova-plugin-device",i.pluginRef="device",i.repo="https://github.com/apache/cordova-plugin-device",i.platforms=["Android","Browser","iOS","macOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),w=Object.freeze({__proto__:null,Device:_}),x=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.cordovaFileError={1:"NOT_FOUND_ERR",2:"SECURITY_ERR",3:"ABORT_ERR",4:"NOT_READABLE_ERR",5:"ENCODING_ERR",6:"NO_MODIFICATION_ALLOWED_ERR",7:"INVALID_STATE_ERR",8:"SYNTAX_ERR",9:"INVALID_MODIFICATION_ERR",10:"QUOTA_EXCEEDED_ERR",11:"TYPE_MISMATCH_ERR",12:"PATH_EXISTS_ERR",13:"WRONG_ENTRY_TYPE",14:"DIR_READ_ERR"},e}return e.__extends(i,r),i.prototype.getFreeDiskSpace=function(){var e=this;return function(){if(!0===n.checkAvailability(e))return n.getPromise((function(e,t){cordova.exec(e,t,"File","getFreeDiskSpace",[])}))}()},i.prototype.checkDir=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}var o=e+t;return r.resolveDirectoryUrl(o).then((function(){return!0}))}}()},i.prototype.createDir=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i)){if(/^\//.test(t)){var o=new FileError(5);return o.message="directory cannot start with /",Promise.reject(o)}var s={create:!0};return r||(s.exclusive=!0),i.resolveDirectoryUrl(e).then((function(e){return i.getDirectory(e,t,s)}))}}()},i.prototype.removeDir=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getDirectory(e,t,{create:!1})})).then((function(e){return r.remove(e)}))}}()},i.prototype.moveDir=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i=i||t)){var s=new FileError(5);return s.message="directory cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getDirectory(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.move(e,t,i)}))}))}}()},i.prototype.copyDir=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i)){var s=new FileError(5);return s.message="directory cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getDirectory(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.copy(e,t,i)}))}))}}()},i.prototype.listDir=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getDirectory(e,t,{create:!1,exclusive:!1})})).then((function(e){var t=e.createReader();return r.readEntries(t)}))}}()},i.prototype.removeRecursively=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="directory cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getDirectory(e,t,{create:!1})})).then((function(e){return r.rimraf(e)}))}}()},i.prototype.checkFile=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="file cannot start with /",Promise.reject(i)}return r.resolveLocalFilesystemUrl(e+t).then((function(e){if(e.isFile)return!0;var t=new FileError(13);return t.message="input is not a file",Promise.reject(t)}))}}()},i.prototype.createFile=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i)){if(/^\//.test(t)){var o=new FileError(5);return o.message="file-name cannot start with /",Promise.reject(o)}var s={create:!0};return r||(s.exclusive=!0),i.resolveDirectoryUrl(e).then((function(e){return i.getFile(e,t,s)}))}}()},i.prototype.removeFile=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r)){if(/^\//.test(t)){var i=new FileError(5);return i.message="file-name cannot start with /",Promise.reject(i)}return r.resolveDirectoryUrl(e).then((function(e){return r.getFile(e,t,{create:!1})})).then((function(e){return r.remove(e)}))}}()},i.prototype.writeFile=function(e,t,r,i){var o=this;return void 0===i&&(i={}),function(){if(!0===n.checkAvailability(o)){if(/^\//.test(t)){var s=new FileError(5);return s.message="file-name cannot start with /",Promise.reject(s)}var a={create:!i.append,exclusive:!i.replace};return o.resolveDirectoryUrl(e).then((function(e){return o.getFile(e,t,a)})).then((function(e){return o.writeFileEntry(e,r,i)}))}}()},i.prototype.writeFileEntry=function(e,t,n){var r=this;return this.createWriter(e).then((function(e){return n.append&&e.seek(e.length),n.truncate&&e.truncate(n.truncate),r.write(e,t)})).then((function(){return e}))},i.prototype.writeExistingFile=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i))return i.writeFile(e,t,r,{replace:!0})}()},i.prototype.readAsText=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"Text")}()},i.prototype.readAsDataURL=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"DataURL")}()},i.prototype.readAsBinaryString=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"BinaryString")}()},i.prototype.readAsArrayBuffer=function(e,t){var r=this;return function(){if(!0===n.checkAvailability(r))return r.readFile(e,t,"ArrayBuffer")}()},i.prototype.moveFile=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i=i||t)){var s=new FileError(5);return s.message="file name cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getFile(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.move(e,t,i)}))}))}}()},i.prototype.copyFile=function(e,t,r,i){var o=this;return function(){if(!0===n.checkAvailability(o)){if(/^\//.test(i=i||t)){var s=new FileError(5);return s.message="file name cannot start with /",Promise.reject(s)}return o.resolveDirectoryUrl(e).then((function(e){return o.getFile(e,t,{create:!1})})).then((function(e){return o.resolveDirectoryUrl(r).then((function(t){return o.copy(e,t,i)}))}))}}()},i.prototype.fillErrorMessage=function(e){try{e.message=this.cordovaFileError[e.code]}catch(e){}},i.prototype.resolveLocalFilesystemUrl=function(e){var t=this;return function(){if(!0===n.checkAvailability(t))return n.getPromise((function(n,r){try{window.resolveLocalFileSystemURL(e,(function(e){n(e)}),(function(e){t.fillErrorMessage(e),r(e)}))}catch(e){t.fillErrorMessage(e),r(e)}}))}()},i.prototype.resolveDirectoryUrl=function(e){var t=this;return function(){if(!0===n.checkAvailability(t))return t.resolveLocalFilesystemUrl(e).then((function(e){if(e.isDirectory)return e;var t=new FileError(13);return t.message="input is not a directory",Promise.reject(t)}))}()},i.prototype.getDirectory=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i))return new Promise((function(n,o){try{e.getDirectory(t,r,(function(e){n(e)}),(function(e){i.fillErrorMessage(e),o(e)}))}catch(e){i.fillErrorMessage(e),o(e)}}))}()},i.prototype.getFile=function(e,t,r){var i=this;return function(){if(!0===n.checkAvailability(i))return new Promise((function(n,o){try{e.getFile(t,r,n,(function(e){i.fillErrorMessage(e),o(e)}))}catch(e){i.fillErrorMessage(e),o(e)}}))}()},i.prototype.readFile=function(e,t,r){var i=this;if(/^\//.test(t)){var o=new FileError(5);return o.message="file-name cannot start with /",Promise.reject(o)}return this.resolveDirectoryUrl(e).then((function(e){return i.getFile(e,t,{create:!1})})).then((function(e){var t=new FileReader;return n.getPromise((function(n,i){t.onloadend=function(){void 0!==t.result||null!==t.result?n(t.result):void 0!==t.error||null!==t.error?i(t.error):i({code:null,message:"READER_ONLOADEND_ERR"})},e.file((function(e){t["readAs"+r].call(t,e)}),(function(e){i(e)}))}))}))},i.prototype.remove=function(e){var t=this;return new Promise((function(n,r){e.remove((function(){n({success:!0,fileRemoved:e})}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.move=function(e,t,n){var r=this;return new Promise((function(i,o){e.moveTo(t,n,(function(e){i(e)}),(function(e){r.fillErrorMessage(e),o(e)}))}))},i.prototype.copy=function(e,t,n){var r=this;return new Promise((function(i,o){e.copyTo(t,n,(function(e){i(e)}),(function(e){r.fillErrorMessage(e),o(e)}))}))},i.prototype.readEntries=function(e){var t=this;return new Promise((function(n,r){e.readEntries((function(e){n(e)}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.rimraf=function(e){var t=this;return new Promise((function(n,r){e.removeRecursively((function(){n({success:!0,fileRemoved:e})}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.createWriter=function(e){var t=this;return new Promise((function(n,r){e.createWriter((function(e){n(e)}),(function(e){t.fillErrorMessage(e),r(e)}))}))},i.prototype.write=function(e,t){return t instanceof Blob?this.writeFileInChunks(e,t):new Promise((function(n,r){e.onwriteend=function(t){e.error?r(e.error):n(t)},e.write(t)}))},i.prototype.writeFileInChunks=function(e,t){var r=0;function i(){var n=Math.min(1048576,t.size-r),i=t.slice(r,r+n);r+=n,e.write(i)}return n.getPromise((function(n,o){e.onerror=o,e.onwrite=function(){r<t.size?i():n()},i()}))},Object.defineProperty(i.prototype,"applicationDirectory",{get:function(){return n.cordovaPropertyGet(this,"applicationDirectory")},set:function(e){n.cordovaPropertySet(this,"applicationDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"applicationStorageDirectory",{get:function(){return n.cordovaPropertyGet(this,"applicationStorageDirectory")},set:function(e){n.cordovaPropertySet(this,"applicationStorageDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dataDirectory",{get:function(){return n.cordovaPropertyGet(this,"dataDirectory")},set:function(e){n.cordovaPropertySet(this,"dataDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cacheDirectory",{get:function(){return n.cordovaPropertyGet(this,"cacheDirectory")},set:function(e){n.cordovaPropertySet(this,"cacheDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalApplicationStorageDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalApplicationStorageDirectory")},set:function(e){n.cordovaPropertySet(this,"externalApplicationStorageDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalDataDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalDataDirectory")},set:function(e){n.cordovaPropertySet(this,"externalDataDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalCacheDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalCacheDirectory")},set:function(e){n.cordovaPropertySet(this,"externalCacheDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"externalRootDirectory",{get:function(){return n.cordovaPropertyGet(this,"externalRootDirectory")},set:function(e){n.cordovaPropertySet(this,"externalRootDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tempDirectory",{get:function(){return n.cordovaPropertyGet(this,"tempDirectory")},set:function(e){n.cordovaPropertySet(this,"tempDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"syncedDataDirectory",{get:function(){return n.cordovaPropertyGet(this,"syncedDataDirectory")},set:function(e){n.cordovaPropertySet(this,"syncedDataDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"documentsDirectory",{get:function(){return n.cordovaPropertyGet(this,"documentsDirectory")},set:function(e){n.cordovaPropertySet(this,"documentsDirectory",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sharedDirectory",{get:function(){return n.cordovaPropertyGet(this,"sharedDirectory")},set:function(e){n.cordovaPropertySet(this,"sharedDirectory",e)},enumerable:!1,configurable:!0}),i.pluginName="File",i.plugin="cordova-plugin-file",i.pluginRef="cordova.file",i.repo="https://github.com/apache/cordova-plugin-file",i.platforms=["Android","Browser","iOS","macOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),S=Object.freeze({__proto__:null,File:x}),k=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.open=function(e,t){return n.cordova(this,"open",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.prototype.uninstall=function(e){return n.cordova(this,"uninstall",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.prototype.appIsInstalled=function(e){return n.cordova(this,"appIsInstalled",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.prototype.showOpenWithDialog=function(e,t){return n.cordova(this,"showOpenWithDialog",{callbackStyle:"object",successName:"success",errorName:"error"},arguments)},i.pluginName="FileOpener",i.plugin="cordova-plugin-file-opener2",i.pluginRef="cordova.plugins.fileOpener2",i.repo="https://github.com/pwlin/cordova-plugin-file-opener2",i.platforms=["Android","iOS","Windows","Windows Phone 8"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),E=Object.freeze({__proto__:null,FileOpener:k}),T=function(i){function o(){return null!==i&&i.apply(this,arguments)||this}return e.__extends(o,i),o.prototype.getCurrentPosition=function(e){return n.cordova(this,"getCurrentPosition",{callbackOrder:"reverse"},arguments)},o.prototype.watchPosition=function(e){return new r.Observable((function(t){var n=navigator.geolocation.watchPosition(t.next.bind(t),t.next.bind(t),e);return function(){return navigator.geolocation.clearWatch(n)}}))},o.pluginName="Geolocation",o.plugin="cordova-plugin-geolocation",o.pluginRef="navigator.geolocation",o.repo="https://github.com/apache/cordova-plugin-geolocation",o.install='ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"',o.installVariables=["GEOLOCATION_USAGE_DESCRIPTION"],o.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"],o.decorators=[{type:t.Injectable}],o}(n.AwesomeCordovaNativePlugin),C=Object.freeze({__proto__:null,Geolocation:T}),D=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.captureAudio=function(e){return n.cordova(this,"captureAudio",{callbackOrder:"reverse"},arguments)},i.prototype.captureImage=function(e){return n.cordova(this,"captureImage",{callbackOrder:"reverse"},arguments)},i.prototype.captureVideo=function(e){return n.cordova(this,"captureVideo",{callbackOrder:"reverse"},arguments)},i.prototype.onPendingCaptureResult=function(){return n.cordova(this,"onPendingCaptureResult",{eventObservable:!0,event:"pendingcaptureresult"},arguments)},i.prototype.onPendingCaptureError=function(){return n.cordova(this,"onPendingCaptureError",{eventObservable:!0,event:"pendingcaptureerror"},arguments)},Object.defineProperty(i.prototype,"supportedImageModes",{get:function(){return n.cordovaPropertyGet(this,"supportedImageModes")},set:function(e){n.cordovaPropertySet(this,"supportedImageModes",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supportedAudioModes",{get:function(){return n.cordovaPropertyGet(this,"supportedAudioModes")},set:function(e){n.cordovaPropertySet(this,"supportedAudioModes",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supportedVideoModes",{get:function(){return n.cordovaPropertyGet(this,"supportedVideoModes")},set:function(e){n.cordovaPropertySet(this,"supportedVideoModes",e)},enumerable:!1,configurable:!0}),i.pluginName="MediaCapture",i.plugin="cordova-plugin-media-capture",i.pluginRef="navigator.device.capture",i.repo="https://github.com/apache/cordova-plugin-media-capture",i.platforms=["Android","Browser","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),M=Object.freeze({__proto__:null,MediaCapture:D});!function(e){e.UNKNOWN="unknown",e.ETHERNET="ethernet",e.WIFI="wifi",e.CELL_2G="2g",e.CELL_3G="3g",e.CELL_4G="4g",e.CELL="cellular",e.NONE="none"}(v||(v={}));var A=function(o){function s(){var e=null!==o&&o.apply(this,arguments)||this;return e.Connection={UNKNOWN:"unknown",ETHERNET:"ethernet",WIFI:"wifi",CELL_2G:"2g",CELL_3G:"3g",CELL_4G:"4g",CELL:"cellular",NONE:"none"},e}return e.__extends(s,o),s.prototype.onChange=function(){var e=this;return function(){if(!0===n.checkAvailability(e))return r.merge(e.onConnect().pipe(i.mapTo("connected")),e.onDisconnect().pipe(i.mapTo("disconnected")))}()},s.prototype.onDisconnect=function(){return n.cordova(this,"onDisconnect",{eventObservable:!0,event:"offline",element:"document"},arguments)},s.prototype.onConnect=function(){return n.cordova(this,"onConnect",{eventObservable:!0,event:"online",element:"document"},arguments)},Object.defineProperty(s.prototype,"type",{get:function(){return n.cordovaPropertyGet(this,"type")},set:function(e){n.cordovaPropertySet(this,"type",e)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"downlinkMax",{get:function(){return n.cordovaPropertyGet(this,"downlinkMax")},set:function(e){n.cordovaPropertySet(this,"downlinkMax",e)},enumerable:!1,configurable:!0}),s.pluginName="Network",s.plugin="cordova-plugin-network-information",s.pluginRef="navigator.connection",s.repo="https://github.com/apache/cordova-plugin-network-information",s.platforms=["Amazon Fire OS","Android","Browser","iOS","Windows"],s.decorators=[{type:t.Injectable}],s}(n.AwesomeCordovaNativePlugin),I=Object.freeze({__proto__:null,get Connection(){return v},Network:A}),L=function(){function e(e){this._objectInstance=e}return e.prototype.addTransaction=function(e){return n.cordovaInstance(this,"addTransaction",{sync:!0},arguments)},e.prototype.transaction=function(e){return n.cordovaInstance(this,"transaction",{successIndex:2,errorIndex:1},arguments)},e.prototype.readTransaction=function(e){return n.cordovaInstance(this,"readTransaction",{},arguments)},e.prototype.startNextTransaction=function(){return n.cordovaInstance(this,"startNextTransaction",{sync:!0},arguments)},e.prototype.open=function(){return n.cordovaInstance(this,"open",{},arguments)},e.prototype.close=function(){return n.cordovaInstance(this,"close",{},arguments)},e.prototype.executeSql=function(e,t){return n.cordovaInstance(this,"executeSql",{},arguments)},e.prototype.sqlBatch=function(e){return n.cordovaInstance(this,"sqlBatch",{},arguments)},e.prototype.abortallPendingTransactions=function(){return n.cordovaInstance(this,"abortallPendingTransactions",{sync:!0},arguments)},Object.defineProperty(e.prototype,"databaseFeatures",{get:function(){return n.instancePropertyGet(this,"databaseFeatures")},set:function(e){n.instancePropertySet(this,"databaseFeatures",e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"openDBs",{get:function(){return n.instancePropertyGet(this,"openDBs")},set:function(e){n.instancePropertySet(this,"openDBs",e)},enumerable:!1,configurable:!0}),e}(),O=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.create=function(e){var t=this;return function(){if(!0===n.checkAvailability(t))return new Promise((function(t,n){sqlitePlugin.openDatabase(e,(function(e){return t(new L(e))}),n)}))}()},i.prototype.echoTest=function(){return n.cordova(this,"echoTest",{},arguments)},i.prototype.selfTest=function(){return n.cordova(this,"selfTest",{},arguments)},i.prototype.deleteDatabase=function(e){return n.cordova(this,"deleteDatabase",{},arguments)},i.pluginName="SQLite",i.pluginRef="sqlitePlugin",i.plugin="cordova-sqlite-storage",i.repo="https://github.com/litehelpers/Cordova-sqlite-storage",i.platforms=["Android","iOS","macOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),N=Object.freeze({__proto__:null,SQLite:O,SQLiteObject:L}),R=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return e.__extends(i,r),i.prototype.vibrate=function(e){return n.cordova(this,"vibrate",{sync:!0},arguments)},i.pluginName="Vibration",i.plugin="cordova-plugin-vibration",i.pluginRef="navigator",i.repo="https://github.com/apache/cordova-plugin-vibration",i.platforms=["Android","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),P=Object.freeze({__proto__:null,Vibration:R}),F=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.REQUEST_PRIORITY_NO_POWER=0,e.REQUEST_PRIORITY_LOW_POWER=1,e.REQUEST_PRIORITY_BALANCED_POWER_ACCURACY=2,e.REQUEST_PRIORITY_HIGH_ACCURACY=3,e.SUCCESS_SETTINGS_SATISFIED=0,e.SUCCESS_USER_AGREED=1,e.ERROR_ALREADY_REQUESTING=-1,e.ERROR_INVALID_ACTION=0,e.ERROR_INVALID_ACCURACY=1,e.ERROR_EXCEPTION=1,e.ERROR_CANNOT_CHANGE_ACCURACY=3,e.ERROR_USER_DISAGREED=4,e.ERROR_GOOGLE_API_CONNECTION_FAILED=4,e}return e.__extends(i,r),i.prototype.canRequest=function(){return n.cordova(this,"canRequest",{},arguments)},i.prototype.isRequesting=function(){return n.cordova(this,"isRequesting",{},arguments)},i.prototype.request=function(e){return n.cordova(this,"request",{callbackOrder:"reverse"},arguments)},i.pluginName="LocationAccuracy",i.plugin="cordova-plugin-request-location-accuracy",i.pluginRef="cordova.plugins.locationAccuracy",i.repo="https://github.com/dpa99c/cordova-plugin-request-location-accuracy",i.platforms=["Android","iOS"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin),j=Object.freeze({__proto__:null,LocationAccuracy:F}),Y=function(r){function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.permission={READ_CALENDAR:"READ_CALENDAR",WRITE_CALENDAR:"WRITE_CALENDAR",CAMERA:"CAMERA",READ_CONTACTS:"READ_CONTACTS",WRITE_CONTACTS:"WRITE_CONTACTS",GET_ACCOUNTS:"GET_ACCOUNTS",ACCESS_FINE_LOCATION:"ACCESS_FINE_LOCATION",ACCESS_COARSE_LOCATION:"ACCESS_COARSE_LOCATION",RECORD_AUDIO:"RECORD_AUDIO",READ_PHONE_STATE:"READ_PHONE_STATE",CALL_PHONE:"CALL_PHONE",ADD_VOICEMAIL:"ADD_VOICEMAIL",USE_SIP:"USE_SIP",PROCESS_OUTGOING_CALLS:"PROCESS_OUTGOING_CALLS",READ_CALL_LOG:"READ_CALL_LOG",WRITE_CALL_LOG:"WRITE_CALL_LOG",SEND_SMS:"SEND_SMS",RECEIVE_SMS:"RECEIVE_SMS",READ_SMS:"READ_SMS",RECEIVE_WAP_PUSH:"RECEIVE_WAP_PUSH",RECEIVE_MMS:"RECEIVE_MMS",WRITE_EXTERNAL_STORAGE:"WRITE_EXTERNAL_STORAGE",READ_EXTERNAL_STORAGE:"READ_EXTERNAL_STORAGE",BODY_SENSORS:"BODY_SENSORS"},e.locationAuthorizationMode={ALWAYS:"always",WHEN_IN_USE:"when_in_use"},e.permissionGroups={CALENDAR:["READ_CALENDAR","WRITE_CALENDAR"],CAMERA:["CAMERA"],CONTACTS:["READ_CONTACTS","WRITE_CONTACTS","GET_ACCOUNTS"],LOCATION:["ACCESS_FINE_LOCATION","ACCESS_COARSE_LOCATION"],MICROPHONE:["RECORD_AUDIO"],PHONE:["READ_PHONE_STATE","CALL_PHONE","ADD_VOICEMAIL","USE_SIP","PROCESS_OUTGOING_CALLS","READ_CALL_LOG","WRITE_CALL_LOG"],SENSORS:["BODY_SENSORS"],SMS:["SEND_SMS","RECEIVE_SMS","READ_SMS","RECEIVE_WAP_PUSH","RECEIVE_MMS"],STORAGE:["READ_EXTERNAL_STORAGE","WRITE_EXTERNAL_STORAGE"]},e.locationMode={HIGH_ACCURACY:"high_accuracy",DEVICE_ONLY:"device_only",BATTERY_SAVING:"battery_saving",LOCATION_OFF:"location_off"},e.bluetoothState={UNKNOWN:"unknown",RESETTING:"resetting",UNSUPPORTED:"unsupported",UNAUTHORIZED:"unauthorized",POWERED_OFF:"powered_off",POWERED_ON:"powered_on",POWERING_OFF:"powering_off",POWERING_ON:"powering_on"},e}return e.__extends(i,r),i.prototype.isLocationAvailable=function(){return n.cordova(this,"isLocationAvailable",{},arguments)},i.prototype.isWifiAvailable=function(){return n.cordova(this,"isWifiAvailable",{},arguments)},i.prototype.isCameraAvailable=function(e){return n.cordova(this,"isCameraAvailable",{callbackOrder:"reverse"},arguments)},i.prototype.isBluetoothAvailable=function(){return n.cordova(this,"isBluetoothAvailable",{},arguments)},i.prototype.switchToLocationSettings=function(){return n.cordova(this,"switchToLocationSettings",{sync:!0,platforms:["Android","Windows 10","iOS"]},arguments)},i.prototype.switchToMobileDataSettings=function(){return n.cordova(this,"switchToMobileDataSettings",{sync:!0,platforms:["Android","Windows 10"]},arguments)},i.prototype.switchToBluetoothSettings=function(){return n.cordova(this,"switchToBluetoothSettings",{sync:!0,platforms:["Android","Windows 10"]},arguments)},i.prototype.switchToWifiSettings=function(){return n.cordova(this,"switchToWifiSettings",{sync:!0,platforms:["Android","Windows 10"]},arguments)},i.prototype.isWifiEnabled=function(){return n.cordova(this,"isWifiEnabled",{platforms:["Android","Windows 10"]},arguments)},i.prototype.setWifiState=function(e){return n.cordova(this,"setWifiState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)},i.prototype.setBluetoothState=function(e){return n.cordova(this,"setBluetoothState",{callbackOrder:"reverse",platforms:["Android","Windows 10"]},arguments)},i.prototype.isLocationEnabled=function(){return n.cordova(this,"isLocationEnabled",{platforms:["Android","iOS"]},arguments)},i.prototype.isLocationAuthorized=function(){return n.cordova(this,"isLocationAuthorized",{},arguments)},i.prototype.getLocationAuthorizationStatus=function(){return n.cordova(this,"getLocationAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestLocationAuthorization=function(e){return n.cordova(this,"requestLocationAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.isCameraPresent=function(){return n.cordova(this,"isCameraPresent",{platforms:["Android","iOS"]},arguments)},i.prototype.isCameraAuthorized=function(e){return n.cordova(this,"isCameraAuthorized",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.getCameraAuthorizationStatus=function(e){return n.cordova(this,"getCameraAuthorizationStatus",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.requestCameraAuthorization=function(e){return n.cordova(this,"requestCameraAuthorization",{platforms:["Android","iOS"],callbackOrder:"reverse"},arguments)},i.prototype.isMicrophoneAuthorized=function(){return n.cordova(this,"isMicrophoneAuthorized",{platforms:["Android","iOS"]},arguments)},i.prototype.getMicrophoneAuthorizationStatus=function(){return n.cordova(this,"getMicrophoneAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestMicrophoneAuthorization=function(){return n.cordova(this,"requestMicrophoneAuthorization",{platforms:["Android","iOS"]},arguments)},i.prototype.isContactsAuthorized=function(){return n.cordova(this,"isContactsAuthorized",{platforms:["Android","iOS"]},arguments)},i.prototype.getContactsAuthorizationStatus=function(){return n.cordova(this,"getContactsAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestContactsAuthorization=function(){return n.cordova(this,"requestContactsAuthorization",{platforms:["Android","iOS"]},arguments)},i.prototype.isCalendarAuthorized=function(){return n.cordova(this,"isCalendarAuthorized",{platforms:["Android","iOS"]},arguments)},i.prototype.getCalendarAuthorizationStatus=function(){return n.cordova(this,"getCalendarAuthorizationStatus",{platforms:["Android","iOS"]},arguments)},i.prototype.requestCalendarAuthorization=function(){return n.cordova(this,"requestCalendarAuthorization",{platforms:["Android","iOS"]},arguments)},i.prototype.switchToSettings=function(){return n.cordova(this,"switchToSettings",{platforms:["Android","iOS"]},arguments)},i.prototype.getBluetoothState=function(){return n.cordova(this,"getBluetoothState",{platforms:["Android","iOS"]},arguments)},i.prototype.registerBluetoothStateChangeHandler=function(e){return n.cordova(this,"registerBluetoothStateChangeHandler",{platforms:["Android","iOS"],sync:!0},arguments)},i.prototype.registerLocationStateChangeHandler=function(e){return n.cordova(this,"registerLocationStateChangeHandler",{platforms:["Android","iOS"],sync:!0},arguments)},i.prototype.isGpsLocationAvailable=function(){return n.cordova(this,"isGpsLocationAvailable",{platforms:["Android"]},arguments)},i.prototype.isGpsLocationEnabled=function(){return n.cordova(this,"isGpsLocationEnabled",{platforms:["Android"]},arguments)},i.prototype.isNetworkLocationAvailable=function(){return n.cordova(this,"isNetworkLocationAvailable",{platforms:["Android"]},arguments)},i.prototype.isNetworkLocationEnabled=function(){return n.cordova(this,"isNetworkLocationEnabled",{platforms:["Android"]},arguments)},i.prototype.getLocationMode=function(){return n.cordova(this,"getLocationMode",{platforms:["Android"]},arguments)},i.prototype.getPermissionAuthorizationStatus=function(e){return n.cordova(this,"getPermissionAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.getPermissionsAuthorizationStatus=function(e){return n.cordova(this,"getPermissionsAuthorizationStatus",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.requestRuntimePermission=function(e){return n.cordova(this,"requestRuntimePermission",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.requestRuntimePermissions=function(e){return n.cordova(this,"requestRuntimePermissions",{platforms:["Android"],callbackOrder:"reverse"},arguments)},i.prototype.isRequestingPermission=function(){return n.cordova(this,"isRequestingPermission",{sync:!0},arguments)},i.prototype.registerPermissionRequestCompleteHandler=function(e){return n.cordova(this,"registerPermissionRequestCompleteHandler",{sync:!0},arguments)},i.prototype.isBluetoothEnabled=function(){return n.cordova(this,"isBluetoothEnabled",{platforms:["Android"]},arguments)},i.prototype.hasBluetoothSupport=function(){return n.cordova(this,"hasBluetoothSupport",{platforms:["Android"]},arguments)},i.prototype.hasBluetoothLESupport=function(){return n.cordova(this,"hasBluetoothLESupport",{platforms:["Android"]},arguments)},i.prototype.hasBluetoothLEPeripheralSupport=function(){return n.cordova(this,"hasBluetoothLEPeripheralSupport",{platforms:["Android"]},arguments)},i.prototype.isExternalStorageAuthorized=function(){return n.cordova(this,"isExternalStorageAuthorized",{platforms:["Android"]},arguments)},i.prototype.getExternalStorageAuthorizationStatus=function(){return n.cordova(this,"getExternalStorageAuthorizationStatus",{platforms:["Android"]},arguments)},i.prototype.requestExternalStorageAuthorization=function(){return n.cordova(this,"requestExternalStorageAuthorization",{platforms:["Android"]},arguments)},i.prototype.getExternalSdCardDetails=function(){return n.cordova(this,"getExternalSdCardDetails",{platforms:["Android"]},arguments)},i.prototype.switchToWirelessSettings=function(){return n.cordova(this,"switchToWirelessSettings",{platforms:["Android"],sync:!0},arguments)},i.prototype.switchToNFCSettings=function(){return n.cordova(this,"switchToNFCSettings",{platforms:["Android"],sync:!0},arguments)},i.prototype.isNFCPresent=function(){return n.cordova(this,"isNFCPresent",{platforms:["Android"]},arguments)},i.prototype.isNFCEnabled=function(){return n.cordova(this,"isNFCEnabled",{platforms:["Android"]},arguments)},i.prototype.isNFCAvailable=function(){return n.cordova(this,"isNFCAvailable",{platforms:["Android"]},arguments)},i.prototype.registerNFCStateChangeHandler=function(e){return n.cordova(this,"registerNFCStateChangeHandler",{platforms:["Android"],sync:!0},arguments)},i.prototype.isDataRoamingEnabled=function(){return n.cordova(this,"isDataRoamingEnabled",{platforms:["Android"]},arguments)},i.prototype.isADBModeEnabled=function(){return n.cordova(this,"isADBModeEnabled",{platforms:["Android"]},arguments)},i.prototype.isDeviceRooted=function(){return n.cordova(this,"isDeviceRooted",{platforms:["Android"]},arguments)},i.prototype.isCameraRollAuthorized=function(){return n.cordova(this,"isCameraRollAuthorized",{platforms:["iOS"]},arguments)},i.prototype.getCameraRollAuthorizationStatus=function(){return n.cordova(this,"getCameraRollAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.requestCameraRollAuthorization=function(){return n.cordova(this,"requestCameraRollAuthorization",{platforms:["iOS"]},arguments)},i.prototype.isRemoteNotificationsEnabled=function(){return n.cordova(this,"isRemoteNotificationsEnabled",{platforms:["iOS","Android"]},arguments)},i.prototype.isRegisteredForRemoteNotifications=function(){return n.cordova(this,"isRegisteredForRemoteNotifications",{platforms:["iOS"]},arguments)},i.prototype.getRemoteNotificationsAuthorizationStatus=function(){return n.cordova(this,"getRemoteNotificationsAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.requestRemoteNotificationsAuthorization=function(e,t){return n.cordova(this,"requestRemoteNotificationsAuthorization",{platforms:["iOS"]},arguments)},i.prototype.getRemoteNotificationTypes=function(){return n.cordova(this,"getRemoteNotificationTypes",{platforms:["iOS"]},arguments)},i.prototype.isRemindersAuthorized=function(){return n.cordova(this,"isRemindersAuthorized",{platforms:["iOS"]},arguments)},i.prototype.getRemindersAuthorizationStatus=function(){return n.cordova(this,"getRemindersAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.requestRemindersAuthorization=function(){return n.cordova(this,"requestRemindersAuthorization",{platforms:["iOS"]},arguments)},i.prototype.isBackgroundRefreshAuthorized=function(){return n.cordova(this,"isBackgroundRefreshAuthorized",{platforms:["iOS"]},arguments)},i.prototype.getBackgroundRefreshStatus=function(){return n.cordova(this,"getBackgroundRefreshStatus",{platforms:["iOS"]},arguments)},i.prototype.requestBluetoothAuthorization=function(){return n.cordova(this,"requestBluetoothAuthorization",{platforms:["iOS"]},arguments)},i.prototype.isMotionAvailable=function(){return n.cordova(this,"isMotionAvailable",{platforms:["iOS"]},arguments)},i.prototype.isMotionRequestOutcomeAvailable=function(){return n.cordova(this,"isMotionRequestOutcomeAvailable",{platforms:["iOS"]},arguments)},i.prototype.requestMotionAuthorization=function(){return n.cordova(this,"requestMotionAuthorization",{platforms:["iOS"]},arguments)},i.prototype.getMotionAuthorizationStatus=function(){return n.cordova(this,"getMotionAuthorizationStatus",{platforms:["iOS"]},arguments)},i.prototype.getLocationAccuracyAuthorization=function(){return n.cordova(this,"getLocationAccuracyAuthorization",{platform:["iOS"]},arguments)},i.prototype.requestTemporaryFullAccuracyAuthorization=function(e){return n.cordova(this,"requestTemporaryFullAccuracyAuthorization",{platforms:["iOS"]},arguments)},i.prototype.registerLocationAccuracyAuthorizationChangeHandler=function(e){return n.cordova(this,"registerLocationAccuracyAuthorizationChangeHandler",{platforms:["iOS"],sync:!0},arguments)},Object.defineProperty(i.prototype,"permissionStatus",{get:function(){return n.cordovaPropertyGet(this,"permissionStatus")},set:function(e){n.cordovaPropertySet(this,"permissionStatus",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"NFCState",{get:function(){return n.cordovaPropertyGet(this,"NFCState")},set:function(e){n.cordovaPropertySet(this,"NFCState",e)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"motionStatus",{get:function(){return n.cordovaPropertyGet(this,"motionStatus")},set:function(e){n.cordovaPropertySet(this,"motionStatus",e)},enumerable:!1,configurable:!0}),i.pluginName="Diagnostic",i.plugin="cordova.plugins.diagnostic",i.pluginRef="cordova.plugins.diagnostic",i.repo="https://github.com/dpa99c/cordova-diagnostic-plugin",i.platforms=["Android","iOS","Windows"],i.decorators=[{type:t.Injectable}],i}(n.AwesomeCordovaNativePlugin);return{...h,...f,...g,...b,...w,...S,...E,...C,...M,...I,...N,...P,...j,...Object.freeze({__proto__:null,Diagnostic:Y})}})),/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */
|
|
844
844
|
function(e,t,n){var r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){e.setTimeout(t,1e3/60)},i=function(){var r={},i=t.createElement("div").style,o=function(){for(var e=["t","webkitT","MozT","msT","OT"],t=0,n=e.length;t<n;t++)if(e[t]+"ransform"in i)return e[t].substr(0,e[t].length-1);return!1}();function s(e){return!1!==o&&(""===o?e:o+e.charAt(0).toUpperCase()+e.substr(1))}r.getTime=Date.now||function(){return(new Date).getTime()},r.extend=function(e,t){for(var n in t)e[n]=t[n]},r.addEvent=function(e,t,n,r){e.addEventListener(t,n,!!r)},r.removeEvent=function(e,t,n,r){e.removeEventListener(t,n,!!r)},r.prefixPointerEvent=function(t){return e.MSPointerEvent?"MSPointer"+t.charAt(7).toUpperCase()+t.substr(8):t},r.momentum=function(e,t,r,i,o,s){var a,l,c=e-t,u=n.abs(c)/r;return l=u/(s=void 0===s?6e-4:s),(a=e+u*u/(2*s)*(c<0?-1:1))<i?(a=o?i-o/2.5*(u/8):i,l=(c=n.abs(a-e))/u):a>0&&(a=o?o/2.5*(u/8):0,l=(c=n.abs(e)+a)/u),{destination:n.round(a),duration:l}};var a=s("transform");return r.extend(r,{hasTransform:!1!==a,hasPerspective:s("perspective")in i,hasTouch:"ontouchstart"in e,hasPointer:!(!e.PointerEvent&&!e.MSPointerEvent),hasTransition:s("transition")in i}),r.isBadAndroid=function(){var t=e.navigator.appVersion;if(/Android/.test(t)&&!/Chrome\/\d/.test(t)){var n=t.match(/Safari\/(\d+.\d)/);return!(n&&"object"==typeof n&&n.length>=2)||parseFloat(n[1])<535.19}return!1}(),r.extend(r.style={},{transform:a,transitionTimingFunction:s("transitionTimingFunction"),transitionDuration:s("transitionDuration"),transitionDelay:s("transitionDelay"),transformOrigin:s("transformOrigin")}),r.hasClass=function(e,t){return new RegExp("(^|\\s)"+t+"(\\s|$)").test(e.className)},r.addClass=function(e,t){if(!r.hasClass(e,t)){var n=e.className.split(" ");n.push(t),e.className=n.join(" ")}},r.removeClass=function(e,t){if(r.hasClass(e,t)){var n=new RegExp("(^|\\s)"+t+"(\\s|$)","g");e.className=e.className.replace(n," ")}},r.offset=function(e){for(var t=-e.offsetLeft,n=-e.offsetTop;e=e.offsetParent;)t-=e.offsetLeft,n-=e.offsetTop;return{left:t,top:n}},r.preventDefaultException=function(e,t){for(var n in t)if(t[n].test(e[n]))return!0;return!1},r.extend(r.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3}),r.extend(r.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(e){return e*(2-e)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(e){return n.sqrt(1- --e*e)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(e){return(e-=1)*e*(5*e+4)+1}},bounce:{style:"",fn:function(e){return(e/=1)<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}},elastic:{style:"",fn:function(e){return 0===e?0:1==e?1:.4*n.pow(2,-10*e)*n.sin((e-.055)*(2*n.PI)/.22)+1}}}),r.tap=function(e,n){var r=t.createEvent("Event");r.initEvent(n,!0,!0),r.pageX=e.pageX,r.pageY=e.pageY,e.target.dispatchEvent(r)},r.click=function(e){var n,r=e.target;/(SELECT|INPUT|TEXTAREA)/i.test(r.tagName)||((n=t.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,e.view,1,r.screenX,r.screenY,r.clientX,r.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null),n._constructed=!0,r.dispatchEvent(n))},r}();function o(n,r){for(var o in this.wrapper="string"==typeof n?t.querySelector(n):n,this.scroller=this.wrapper.children[0],this.scrollerStyle=this.scroller.style,this.options={resizeScrollbars:!0,mouseWheelSpeed:20,snapThreshold:.334,disablePointer:!i.hasPointer,disableTouch:i.hasPointer||!i.hasTouch,disableMouse:i.hasPointer||i.hasTouch,startX:0,startY:0,scrollY:!0,directionLockThreshold:5,momentum:!0,bounce:!0,bounceTime:600,bounceEasing:"",preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:void 0===e.onmousedown},r)this.options[o]=r[o];this.translateZ=this.options.HWCompositing&&i.hasPerspective?" translateZ(0)":"",this.options.useTransition=i.hasTransition&&this.options.useTransition,this.options.useTransform=i.hasTransform&&this.options.useTransform,this.options.eventPassthrough=!0===this.options.eventPassthrough?"vertical":this.options.eventPassthrough,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollY="vertical"!=this.options.eventPassthrough&&this.options.scrollY,this.options.scrollX="horizontal"!=this.options.eventPassthrough&&this.options.scrollX,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,this.options.bounceEasing="string"==typeof this.options.bounceEasing?i.ease[this.options.bounceEasing]||i.ease.circular:this.options.bounceEasing,this.options.resizePolling=void 0===this.options.resizePolling?60:this.options.resizePolling,!0===this.options.tap&&(this.options.tap="tap"),"scale"==this.options.shrinkScrollbars&&(this.options.useTransition=!1),this.options.invertWheelDirection=this.options.invertWheelDirection?-1:1,this.x=0,this.y=0,this.directionX=0,this.directionY=0,this._events={},this._init(),this.refresh(),this.scrollTo(this.options.startX,this.options.startY),this.enable()}function s(e,n,r){var i=t.createElement("div"),o=t.createElement("div");return!0===r&&(i.style.cssText="position:absolute;z-index:9999",o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px"),o.className="iScrollIndicator","h"==e?(!0===r&&(i.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",o.style.height="100%"),i.className="iScrollHorizontalScrollbar"):(!0===r&&(i.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",o.style.width="100%"),i.className="iScrollVerticalScrollbar"),i.style.cssText+=";overflow:hidden",n||(i.style.pointerEvents="none"),i.appendChild(o),i}function a(n,o){for(var s in this.wrapper="string"==typeof o.el?t.querySelector(o.el):o.el,this.wrapperStyle=this.wrapper.style,this.indicator=this.wrapper.children[0],this.indicatorStyle=this.indicator.style,this.scroller=n,this.options={listenX:!0,listenY:!0,interactive:!1,resize:!0,defaultScrollbars:!1,shrink:!1,fade:!1,speedRatioX:0,speedRatioY:0},o)this.options[s]=o[s];if(this.sizeRatioX=1,this.sizeRatioY=1,this.maxPosX=0,this.maxPosY=0,this.options.interactive&&(this.options.disableTouch||(i.addEvent(this.indicator,"touchstart",this),i.addEvent(e,"touchend",this)),this.options.disablePointer||(i.addEvent(this.indicator,i.prefixPointerEvent("pointerdown"),this),i.addEvent(e,i.prefixPointerEvent("pointerup"),this)),this.options.disableMouse||(i.addEvent(this.indicator,"mousedown",this),i.addEvent(e,"mouseup",this))),this.options.fade){this.wrapperStyle[i.style.transform]=this.scroller.translateZ;var a=i.style.transitionDuration;this.wrapperStyle[a]=i.isBadAndroid?"0.0001ms":"0ms";var l=this;i.isBadAndroid&&r((function(){"0.0001ms"===l.wrapperStyle[a]&&(l.wrapperStyle[a]="0s")})),this.wrapperStyle.opacity="0"}}o.prototype={version:"5.2.0",_init:function(){this._initEvents(),(this.options.scrollbars||this.options.indicators)&&this._initIndicators(),this.options.mouseWheel&&this._initWheel(),this.options.snap&&this._initSnap(),this.options.keyBindings&&this._initKeys()},destroy:function(){this._initEvents(!0),clearTimeout(this.resizeTimeout),this.resizeTimeout=null,this._execEvent("destroy")},_transitionEnd:function(e){e.target==this.scroller&&this.isInTransition&&(this._transitionTime(),this.resetPosition(this.options.bounceTime)||(this.isInTransition=!1,this._execEvent("scrollEnd")))},_start:function(e){if(1!=i.eventType[e.type]&&0!==(e.which?e.button:e.button<2?0:4==e.button?1:2))return;if(this.enabled&&(!this.initiated||i.eventType[e.type]===this.initiated)){!this.options.preventDefault||i.isBadAndroid||i.preventDefaultException(e.target,this.options.preventDefaultException)||e.preventDefault();var t,r=e.touches?e.touches[0]:e;this.initiated=i.eventType[e.type],this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.directionLocked=0,this.startTime=i.getTime(),this.options.useTransition&&this.isInTransition?(this._transitionTime(),this.isInTransition=!1,t=this.getComputedPosition(),this._translate(n.round(t.x),n.round(t.y)),this._execEvent("scrollEnd")):!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,this._execEvent("scrollEnd")),this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=r.pageX,this.pointY=r.pageY,this._execEvent("beforeScrollStart")}},_move:function(e){if(this.enabled&&i.eventType[e.type]===this.initiated){this.options.preventDefault&&e.preventDefault();var t,r,o,s,a=e.touches?e.touches[0]:e,l=a.pageX-this.pointX,c=a.pageY-this.pointY,u=i.getTime();if(this.pointX=a.pageX,this.pointY=a.pageY,this.distX+=l,this.distY+=c,o=n.abs(this.distX),s=n.abs(this.distY),!(u-this.endTime>300&&o<10&&s<10)){if(this.directionLocked||this.options.freeScroll||(o>s+this.options.directionLockThreshold?this.directionLocked="h":s>=o+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)e.preventDefault();else if("horizontal"==this.options.eventPassthrough)return void(this.initiated=!1);c=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)e.preventDefault();else if("vertical"==this.options.eventPassthrough)return void(this.initiated=!1);l=0}l=this.hasHorizontalScroll?l:0,c=this.hasVerticalScroll?c:0,t=this.x+l,r=this.y+c,(t>0||t<this.maxScrollX)&&(t=this.options.bounce?this.x+l/3:t>0?0:this.maxScrollX),(r>0||r<this.maxScrollY)&&(r=this.options.bounce?this.y+c/3:r>0?0:this.maxScrollY),this.directionX=l>0?-1:l<0?1:0,this.directionY=c>0?-1:c<0?1:0,this.moved||this._execEvent("scrollStart"),this.moved=!0,this._translate(t,r),u-this.startTime>300&&(this.startTime=u,this.startX=this.x,this.startY=this.y)}}},_end:function(e){if(this.enabled&&i.eventType[e.type]===this.initiated){this.options.preventDefault&&!i.preventDefaultException(e.target,this.options.preventDefaultException)&&e.preventDefault();e.changedTouches&&e.changedTouches[0];var t,r,o=i.getTime()-this.startTime,s=n.round(this.x),a=n.round(this.y),l=n.abs(s-this.startX),c=n.abs(a-this.startY),u=0,d="";if(this.isInTransition=0,this.initiated=0,this.endTime=i.getTime(),!this.resetPosition(this.options.bounceTime)){if(this.scrollTo(s,a),!this.moved)return this.options.tap&&i.tap(e,this.options.tap),this.options.click&&i.click(e),void this._execEvent("scrollCancel");if(this._events.flick&&o<200&&l<100&&c<100)this._execEvent("flick");else{if(this.options.momentum&&o<300&&(t=this.hasHorizontalScroll?i.momentum(this.x,this.startX,o,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:s,duration:0},r=this.hasVerticalScroll?i.momentum(this.y,this.startY,o,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:a,duration:0},s=t.destination,a=r.destination,u=n.max(t.duration,r.duration),this.isInTransition=1),this.options.snap){var h=this._nearestSnap(s,a);this.currentPage=h,u=this.options.snapSpeed||n.max(n.max(n.min(n.abs(s-h.x),1e3),n.min(n.abs(a-h.y),1e3)),300),s=h.x,a=h.y,this.directionX=0,this.directionY=0,d=this.options.bounceEasing}if(s!=this.x||a!=this.y)return(s>0||s<this.maxScrollX||a>0||a<this.maxScrollY)&&(d=i.ease.quadratic),void this.scrollTo(s,a,u,d);this._execEvent("scrollEnd")}}}},_resize:function(){var e=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){e.refresh()}),this.options.resizePolling)},resetPosition:function(e){var t=this.x,n=this.y;return e=e||0,!this.hasHorizontalScroll||this.x>0?t=0:this.x<this.maxScrollX&&(t=this.maxScrollX),!this.hasVerticalScroll||this.y>0?n=0:this.y<this.maxScrollY&&(n=this.maxScrollY),(t!=this.x||n!=this.y)&&(this.scrollTo(t,n,e,this.options.bounceEasing),!0)},disable:function(){this.enabled=!1},enable:function(){this.enabled=!0},refresh:function(){this.wrapper.offsetHeight;this.wrapperWidth=this.wrapper.clientWidth,this.wrapperHeight=this.wrapper.clientHeight,this.scrollerWidth=this.scroller.offsetWidth,this.scrollerHeight=this.scroller.offsetHeight,this.maxScrollX=this.wrapperWidth-this.scrollerWidth,this.maxScrollY=this.wrapperHeight-this.scrollerHeight,this.hasHorizontalScroll=this.options.scrollX&&this.maxScrollX<0,this.hasVerticalScroll=this.options.scrollY&&this.maxScrollY<0,this.hasHorizontalScroll||(this.maxScrollX=0,this.scrollerWidth=this.wrapperWidth),this.hasVerticalScroll||(this.maxScrollY=0,this.scrollerHeight=this.wrapperHeight),this.endTime=0,this.directionX=0,this.directionY=0,this.wrapperOffset=i.offset(this.wrapper),this._execEvent("refresh"),this.resetPosition()},on:function(e,t){this._events[e]||(this._events[e]=[]),this._events[e].push(t)},off:function(e,t){if(this._events[e]){var n=this._events[e].indexOf(t);n>-1&&this._events[e].splice(n,1)}},_execEvent:function(e){if(this._events[e]){var t=0,n=this._events[e].length;if(n)for(;t<n;t++)this._events[e][t].apply(this,[].slice.call(arguments,1))}},scrollBy:function(e,t,n,r){e=this.x+e,t=this.y+t,n=n||0,this.scrollTo(e,t,n,r)},scrollTo:function(e,t,n,r){r=r||i.ease.circular,this.isInTransition=this.options.useTransition&&n>0;var o=this.options.useTransition&&r.style;!n||o?(o&&(this._transitionTimingFunction(r.style),this._transitionTime(n)),this._translate(e,t)):this._animate(e,t,n,r.fn)},scrollToElement:function(e,t,r,o,s){if(e=e.nodeType?e:this.scroller.querySelector(e)){var a=i.offset(e);a.left-=this.wrapperOffset.left,a.top-=this.wrapperOffset.top,!0===r&&(r=n.round(e.offsetWidth/2-this.wrapper.offsetWidth/2)),!0===o&&(o=n.round(e.offsetHeight/2-this.wrapper.offsetHeight/2)),a.left-=r||0,a.top-=o||0,a.left=a.left>0?0:a.left<this.maxScrollX?this.maxScrollX:a.left,a.top=a.top>0?0:a.top<this.maxScrollY?this.maxScrollY:a.top,t=null==t||"auto"===t?n.max(n.abs(this.x-a.left),n.abs(this.y-a.top)):t,this.scrollTo(a.left,a.top,t,s)}},_transitionTime:function(e){e=e||0;var t=i.style.transitionDuration;if(this.scrollerStyle[t]=e+"ms",!e&&i.isBadAndroid){this.scrollerStyle[t]="0.0001ms";var n=this;r((function(){"0.0001ms"===n.scrollerStyle[t]&&(n.scrollerStyle[t]="0s")}))}if(this.indicators)for(var o=this.indicators.length;o--;)this.indicators[o].transitionTime(e)},_transitionTimingFunction:function(e){if(this.scrollerStyle[i.style.transitionTimingFunction]=e,this.indicators)for(var t=this.indicators.length;t--;)this.indicators[t].transitionTimingFunction(e)},_translate:function(e,t){if(this.options.useTransform?this.scrollerStyle[i.style.transform]="translate("+e+"px,"+t+"px)"+this.translateZ:(e=n.round(e),t=n.round(t),this.scrollerStyle.left=e+"px",this.scrollerStyle.top=t+"px"),this.x=e,this.y=t,this.indicators)for(var r=this.indicators.length;r--;)this.indicators[r].updatePosition()},_initEvents:function(t){var n=t?i.removeEvent:i.addEvent,r=this.options.bindToWrapper?this.wrapper:e;n(e,"orientationchange",this),n(e,"resize",this),this.options.click&&n(this.wrapper,"click",this,!0),this.options.disableMouse||(n(this.wrapper,"mousedown",this),n(r,"mousemove",this),n(r,"mousecancel",this),n(r,"mouseup",this)),i.hasPointer&&!this.options.disablePointer&&(n(this.wrapper,i.prefixPointerEvent("pointerdown"),this),n(r,i.prefixPointerEvent("pointermove"),this),n(r,i.prefixPointerEvent("pointercancel"),this),n(r,i.prefixPointerEvent("pointerup"),this)),i.hasTouch&&!this.options.disableTouch&&(n(this.wrapper,"touchstart",this),n(r,"touchmove",this),n(r,"touchcancel",this),n(r,"touchend",this)),n(this.scroller,"transitionend",this),n(this.scroller,"webkitTransitionEnd",this),n(this.scroller,"oTransitionEnd",this),n(this.scroller,"MSTransitionEnd",this)},getComputedPosition:function(){var t,n,r=e.getComputedStyle(this.scroller,null);return this.options.useTransform?(t=+((r=r[i.style.transform].split(")")[0].split(", "))[12]||r[4]),n=+(r[13]||r[5])):(t=+r.left.replace(/[^-\d.]/g,""),n=+r.top.replace(/[^-\d.]/g,"")),{x:t,y:n}},_initIndicators:function(){var e,t=this.options.interactiveScrollbars,n="string"!=typeof this.options.scrollbars,r=[],i=this;this.indicators=[],this.options.scrollbars&&(this.options.scrollY&&(e={el:s("v",t,this.options.scrollbars),interactive:t,defaultScrollbars:!0,customStyle:n,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenX:!1},this.wrapper.appendChild(e.el),r.push(e)),this.options.scrollX&&(e={el:s("h",t,this.options.scrollbars),interactive:t,defaultScrollbars:!0,customStyle:n,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenY:!1},this.wrapper.appendChild(e.el),r.push(e))),this.options.indicators&&(r=r.concat(this.options.indicators));for(var o=r.length;o--;)this.indicators.push(new a(this,r[o]));function l(e){if(i.indicators)for(var t=i.indicators.length;t--;)e.call(i.indicators[t])}this.options.fadeScrollbars&&(this.on("scrollEnd",(function(){l((function(){this.fade()}))})),this.on("scrollCancel",(function(){l((function(){this.fade()}))})),this.on("scrollStart",(function(){l((function(){this.fade(1)}))})),this.on("beforeScrollStart",(function(){l((function(){this.fade(1,!0)}))}))),this.on("refresh",(function(){l((function(){this.refresh()}))})),this.on("destroy",(function(){l((function(){this.destroy()})),delete this.indicators}))},_initWheel:function(){i.addEvent(this.wrapper,"wheel",this),i.addEvent(this.wrapper,"mousewheel",this),i.addEvent(this.wrapper,"DOMMouseScroll",this),this.on("destroy",(function(){clearTimeout(this.wheelTimeout),this.wheelTimeout=null,i.removeEvent(this.wrapper,"wheel",this),i.removeEvent(this.wrapper,"mousewheel",this),i.removeEvent(this.wrapper,"DOMMouseScroll",this)}))},_wheel:function(e){if(this.enabled){e.preventDefault();var t,r,i,o,s=this;if(void 0===this.wheelTimeout&&s._execEvent("scrollStart"),clearTimeout(this.wheelTimeout),this.wheelTimeout=setTimeout((function(){s.options.snap||s._execEvent("scrollEnd"),s.wheelTimeout=void 0}),400),"deltaX"in e)1===e.deltaMode?(t=-e.deltaX*this.options.mouseWheelSpeed,r=-e.deltaY*this.options.mouseWheelSpeed):(t=-e.deltaX,r=-e.deltaY);else if("wheelDeltaX"in e)t=e.wheelDeltaX/120*this.options.mouseWheelSpeed,r=e.wheelDeltaY/120*this.options.mouseWheelSpeed;else if("wheelDelta"in e)t=r=e.wheelDelta/120*this.options.mouseWheelSpeed;else{if(!("detail"in e))return;t=r=-e.detail/3*this.options.mouseWheelSpeed}if(t*=this.options.invertWheelDirection,r*=this.options.invertWheelDirection,this.hasVerticalScroll||(t=r,r=0),this.options.snap)return i=this.currentPage.pageX,o=this.currentPage.pageY,t>0?i--:t<0&&i++,r>0?o--:r<0&&o++,void this.goToPage(i,o);i=this.x+n.round(this.hasHorizontalScroll?t:0),o=this.y+n.round(this.hasVerticalScroll?r:0),this.directionX=t>0?-1:t<0?1:0,this.directionY=r>0?-1:r<0?1:0,i>0?i=0:i<this.maxScrollX&&(i=this.maxScrollX),o>0?o=0:o<this.maxScrollY&&(o=this.maxScrollY),this.scrollTo(i,o,0)}},_initSnap:function(){this.currentPage={},"string"==typeof this.options.snap&&(this.options.snap=this.scroller.querySelectorAll(this.options.snap)),this.on("refresh",(function(){var e,t,r,i,o,s,a=0,l=0,c=0,u=this.options.snapStepX||this.wrapperWidth,d=this.options.snapStepY||this.wrapperHeight;if(this.pages=[],this.wrapperWidth&&this.wrapperHeight&&this.scrollerWidth&&this.scrollerHeight){if(!0===this.options.snap)for(r=n.round(u/2),i=n.round(d/2);c>-this.scrollerWidth;){for(this.pages[a]=[],e=0,o=0;o>-this.scrollerHeight;)this.pages[a][e]={x:n.max(c,this.maxScrollX),y:n.max(o,this.maxScrollY),width:u,height:d,cx:c-r,cy:o-i},o-=d,e++;c-=u,a++}else for(e=(s=this.options.snap).length,t=-1;a<e;a++)(0===a||s[a].offsetLeft<=s[a-1].offsetLeft)&&(l=0,t++),this.pages[l]||(this.pages[l]=[]),c=n.max(-s[a].offsetLeft,this.maxScrollX),o=n.max(-s[a].offsetTop,this.maxScrollY),r=c-n.round(s[a].offsetWidth/2),i=o-n.round(s[a].offsetHeight/2),this.pages[l][t]={x:c,y:o,width:s[a].offsetWidth,height:s[a].offsetHeight,cx:r,cy:i},c>this.maxScrollX&&l++;this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0),this.options.snapThreshold%1==0?(this.snapThresholdX=this.options.snapThreshold,this.snapThresholdY=this.options.snapThreshold):(this.snapThresholdX=n.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold),this.snapThresholdY=n.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold))}})),this.on("flick",(function(){var e=this.options.snapSpeed||n.max(n.max(n.min(n.abs(this.x-this.startX),1e3),n.min(n.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,e)}))},_nearestSnap:function(e,t){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var r=0,i=this.pages.length,o=0;if(n.abs(e-this.absStartX)<this.snapThresholdX&&n.abs(t-this.absStartY)<this.snapThresholdY)return this.currentPage;for(e>0?e=0:e<this.maxScrollX&&(e=this.maxScrollX),t>0?t=0:t<this.maxScrollY&&(t=this.maxScrollY);r<i;r++)if(e>=this.pages[r][0].cx){e=this.pages[r][0].x;break}for(i=this.pages[r].length;o<i;o++)if(t>=this.pages[0][o].cy){t=this.pages[0][o].y;break}return r==this.currentPage.pageX&&((r+=this.directionX)<0?r=0:r>=this.pages.length&&(r=this.pages.length-1),e=this.pages[r][0].x),o==this.currentPage.pageY&&((o+=this.directionY)<0?o=0:o>=this.pages[0].length&&(o=this.pages[0].length-1),t=this.pages[0][o].y),{x:e,y:t,pageX:r,pageY:o}},goToPage:function(e,t,r,i){i=i||this.options.bounceEasing,e>=this.pages.length?e=this.pages.length-1:e<0&&(e=0),t>=this.pages[e].length?t=this.pages[e].length-1:t<0&&(t=0);var o=this.pages[e][t].x,s=this.pages[e][t].y;r=void 0===r?this.options.snapSpeed||n.max(n.max(n.min(n.abs(o-this.x),1e3),n.min(n.abs(s-this.y),1e3)),300):r,this.currentPage={x:o,y:s,pageX:e,pageY:t},this.scrollTo(o,s,r,i)},next:function(e,t){var n=this.currentPage.pageX,r=this.currentPage.pageY;++n>=this.pages.length&&this.hasVerticalScroll&&(n=0,r++),this.goToPage(n,r,e,t)},prev:function(e,t){var n=this.currentPage.pageX,r=this.currentPage.pageY;--n<0&&this.hasVerticalScroll&&(n=0,r--),this.goToPage(n,r,e,t)},_initKeys:function(t){var n,r={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};if("object"==typeof this.options.keyBindings)for(n in this.options.keyBindings)"string"==typeof this.options.keyBindings[n]&&(this.options.keyBindings[n]=this.options.keyBindings[n].toUpperCase().charCodeAt(0));else this.options.keyBindings={};for(n in r)this.options.keyBindings[n]=this.options.keyBindings[n]||r[n];i.addEvent(e,"keydown",this),this.on("destroy",(function(){i.removeEvent(e,"keydown",this)}))},_key:function(e){if(this.enabled){var t,r=this.options.snap,o=r?this.currentPage.pageX:this.x,s=r?this.currentPage.pageY:this.y,a=i.getTime(),l=this.keyTime||0;switch(this.options.useTransition&&this.isInTransition&&(t=this.getComputedPosition(),this._translate(n.round(t.x),n.round(t.y)),this.isInTransition=!1),this.keyAcceleration=a-l<200?n.min(this.keyAcceleration+.25,50):0,e.keyCode){case this.options.keyBindings.pageUp:this.hasHorizontalScroll&&!this.hasVerticalScroll?o+=r?1:this.wrapperWidth:s+=r?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:this.hasHorizontalScroll&&!this.hasVerticalScroll?o-=r?1:this.wrapperWidth:s-=r?1:this.wrapperHeight;break;case this.options.keyBindings.end:o=r?this.pages.length-1:this.maxScrollX,s=r?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:o=0,s=0;break;case this.options.keyBindings.left:o+=r?-1:5+this.keyAcceleration|0;break;case this.options.keyBindings.up:s+=r?1:5+this.keyAcceleration|0;break;case this.options.keyBindings.right:o-=r?-1:5+this.keyAcceleration|0;break;case this.options.keyBindings.down:s-=r?1:5+this.keyAcceleration|0;break;default:return}r?this.goToPage(o,s):(o>0?(o=0,this.keyAcceleration=0):o<this.maxScrollX&&(o=this.maxScrollX,this.keyAcceleration=0),s>0?(s=0,this.keyAcceleration=0):s<this.maxScrollY&&(s=this.maxScrollY,this.keyAcceleration=0),this.scrollTo(o,s,0),this.keyTime=a)}},_animate:function(e,t,n,o){var s=this,a=this.x,l=this.y,c=i.getTime(),u=c+n;this.isAnimating=!0,function d(){var h,p,f,m=i.getTime();if(m>=u)return s.isAnimating=!1,s._translate(e,t),void(s.resetPosition(s.options.bounceTime)||s._execEvent("scrollEnd"));f=o(m=(m-c)/n),h=(e-a)*f+a,p=(t-l)*f+l,s._translate(h,p),s.isAnimating&&r(d)}()},handleEvent:function(e){switch(e.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(e);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(e);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(e);break;case"keydown":this._key(e);break;case"click":this.enabled&&!e._constructed&&(e.preventDefault(),e.stopPropagation())}}},a.prototype={handleEvent:function(e){switch(e.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(e);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(e);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(e)}},destroy:function(){this.options.fadeScrollbars&&(clearTimeout(this.fadeTimeout),this.fadeTimeout=null),this.options.interactive&&(i.removeEvent(this.indicator,"touchstart",this),i.removeEvent(this.indicator,i.prefixPointerEvent("pointerdown"),this),i.removeEvent(this.indicator,"mousedown",this),i.removeEvent(e,"touchmove",this),i.removeEvent(e,i.prefixPointerEvent("pointermove"),this),i.removeEvent(e,"mousemove",this),i.removeEvent(e,"touchend",this),i.removeEvent(e,i.prefixPointerEvent("pointerup"),this),i.removeEvent(e,"mouseup",this)),this.options.defaultScrollbars&&this.wrapper.parentNode.removeChild(this.wrapper)},_start:function(t){var n=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=n.pageX,this.lastPointY=n.pageY,this.startTime=i.getTime(),this.options.disableTouch||i.addEvent(e,"touchmove",this),this.options.disablePointer||i.addEvent(e,i.prefixPointerEvent("pointermove"),this),this.options.disableMouse||i.addEvent(e,"mousemove",this),this.scroller._execEvent("beforeScrollStart")},_move:function(e){var t,n,r,o,s=e.touches?e.touches[0]:e;i.getTime();this.moved||this.scroller._execEvent("scrollStart"),this.moved=!0,t=s.pageX-this.lastPointX,this.lastPointX=s.pageX,n=s.pageY-this.lastPointY,this.lastPointY=s.pageY,r=this.x+t,o=this.y+n,this._pos(r,o),e.preventDefault(),e.stopPropagation()},_end:function(t){if(this.initiated){if(this.initiated=!1,t.preventDefault(),t.stopPropagation(),i.removeEvent(e,"touchmove",this),i.removeEvent(e,i.prefixPointerEvent("pointermove"),this),i.removeEvent(e,"mousemove",this),this.scroller.options.snap){var r=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),o=this.options.snapSpeed||n.max(n.max(n.min(n.abs(this.scroller.x-r.x),1e3),n.min(n.abs(this.scroller.y-r.y),1e3)),300);this.scroller.x==r.x&&this.scroller.y==r.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=r,this.scroller.scrollTo(r.x,r.y,o,this.scroller.options.bounceEasing))}this.moved&&this.scroller._execEvent("scrollEnd")}},transitionTime:function(e){e=e||0;var t=i.style.transitionDuration;if(this.indicatorStyle[t]=e+"ms",!e&&i.isBadAndroid){this.indicatorStyle[t]="0.0001ms";var n=this;r((function(){"0.0001ms"===n.indicatorStyle[t]&&(n.indicatorStyle[t]="0s")}))}},transitionTimingFunction:function(e){this.indicatorStyle[i.style.transitionTimingFunction]=e},refresh:function(){this.transitionTime(),this.options.listenX&&!this.options.listenY?this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none":this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none",this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll?(i.addClass(this.wrapper,"iScrollBothScrollbars"),i.removeClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="8px":this.wrapper.style.bottom="8px")):(i.removeClass(this.wrapper,"iScrollBothScrollbars"),i.addClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="2px":this.wrapper.style.bottom="2px"));this.wrapper.offsetHeight;this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.options.resize?(this.indicatorWidth=n.max(n.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px"):this.indicatorWidth=this.indicator.clientWidth,this.maxPosX=this.wrapperWidth-this.indicatorWidth,"clip"==this.options.shrink?(this.minBoundaryX=8-this.indicatorWidth,this.maxBoundaryX=this.wrapperWidth-8):(this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX),this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX),this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.options.resize?(this.indicatorHeight=n.max(n.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px"):this.indicatorHeight=this.indicator.clientHeight,this.maxPosY=this.wrapperHeight-this.indicatorHeight,"clip"==this.options.shrink?(this.minBoundaryY=8-this.indicatorHeight,this.maxBoundaryY=this.wrapperHeight-8):(this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY),this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY),this.updatePosition()},updatePosition:function(){var e=this.options.listenX&&n.round(this.sizeRatioX*this.scroller.x)||0,t=this.options.listenY&&n.round(this.sizeRatioY*this.scroller.y)||0;this.options.ignoreBoundaries||(e<this.minBoundaryX?("scale"==this.options.shrink&&(this.width=n.max(this.indicatorWidth+e,8),this.indicatorStyle.width=this.width+"px"),e=this.minBoundaryX):e>this.maxBoundaryX?"scale"==this.options.shrink?(this.width=n.max(this.indicatorWidth-(e-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",e=this.maxPosX+this.indicatorWidth-this.width):e=this.maxBoundaryX:"scale"==this.options.shrink&&this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),t<this.minBoundaryY?("scale"==this.options.shrink&&(this.height=n.max(this.indicatorHeight+3*t,8),this.indicatorStyle.height=this.height+"px"),t=this.minBoundaryY):t>this.maxBoundaryY?"scale"==this.options.shrink?(this.height=n.max(this.indicatorHeight-3*(t-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",t=this.maxPosY+this.indicatorHeight-this.height):t=this.maxBoundaryY:"scale"==this.options.shrink&&this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px")),this.x=e,this.y=t,this.scroller.options.useTransform?this.indicatorStyle[i.style.transform]="translate("+e+"px,"+t+"px)"+this.scroller.translateZ:(this.indicatorStyle.left=e+"px",this.indicatorStyle.top=t+"px")},_pos:function(e,t){e<0?e=0:e>this.maxPosX&&(e=this.maxPosX),t<0?t=0:t>this.maxPosY&&(t=this.maxPosY),e=this.options.listenX?n.round(e/this.sizeRatioX):this.scroller.x,t=this.options.listenY?n.round(t/this.sizeRatioY):this.scroller.y,this.scroller.scrollTo(e,t)},fade:function(e,t){if(!t||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var n=e?250:500,r=e?0:300;e=e?"1":"0",this.wrapperStyle[i.style.transitionDuration]=n+"ms",this.fadeTimeout=setTimeout(function(e){this.wrapperStyle.opacity=e,this.visible=+e}.bind(this,e),r)}}},o.utils=i,"undefined"!=typeof module&&module.exports?module.exports=o:"function"==typeof define&&define.amd?define((function(){return o})):e.IScroll=o}(window,document,Math),function(e){var t=!1;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,r=window.Cookies=e();r.noConflict=function(){return window.Cookies=n,r}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}return function t(n){function r(t,i,o){var s;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(o=e({path:"/"},r.defaults,o)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}o.expires=o.expires?o.expires.toUTCString():"";try{s=JSON.stringify(i),/^[\{\[]/.test(s)&&(i=s)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var l="";for(var c in o)o[c]&&(l+="; "+c,!0!==o[c]&&(l+="="+o[c]));return document.cookie=t+"="+i+l}t||(s={});for(var u=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,h=0;h<u.length;h++){var p=u[h].split("="),f=p.slice(1).join("=");this.json||'"'!==f.charAt(0)||(f=f.slice(1,-1));try{var m=p[0].replace(d,decodeURIComponent);if(f=n.read?n.read(f,m):n(f,m)||f.replace(d,decodeURIComponent),this.json)try{f=JSON.parse(f)}catch(e){}if(t===m){s=f;break}t||(s[m]=f)}catch(e){}}return s}}return r.set=r,r.get=function(e){return r.call(r,e)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}((function(){}))})),window.requestAnimationFrame=function(){"use strict";return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimaitonFrame||function(e){window.setTimeout(e,1e3/60)}}(),function(e){"use strict";var t,n,r={NONE:0,HORIZONTAL:1,LEFT_TO_RIGHT:2,RIGHT_TO_LEFT:3,VERTICAL:4,TOP_TO_DOWN:5,DOWN_TO_TOP:6},i=Math.abs,o=Math.max,s=["INPUT","SELECT","OPTION"],a=e("<div></div>");a.css({"background-color":"rgba(0, 0, 0, 0)",position:"fixed",top:0,width:"100vw",height:"100vh","z-index":1e5});var l=[],c=[],u=null,d=function(t){t&&(t.pointerId&&t.pointerId!==u||t.touches&&t.touches.length>1)&&h(t),e.each(l,(function(e,n){return n(t)}))},h=function(t){u=null,e.each(c,(function(e,n){return n(t)})),l.length=0,c.length=0};function p(e,t,n){(e.__zone_symbol__addEventListener||e.addEventListener).call(e,t,n,{passive:!0})}function f(t,n,r){var i=function(t){for(var r=n;r;)t.push({$ele:e(r),last:{scrollLeft:r.iscroll?r.iscroll.x:r.scrollLeft,scrollTop:r.iscroll?r.iscroll.y:r.scrollTop}}),r=r.parentElement;return t}([]);this.hasSrcolled=function(){return r===e.fn.swipey.DIRECTIONS.VERTICAL?(e.each(i,(function(){this.$ele[0].iscroll?isNaN(this.$ele[0].iscroll.y)||0===this.$ele[0].iscroll.y||(t=!0):0!==this.$ele[0].scrollTop&&(t=!0)})),t):r===e.fn.swipey.DIRECTIONS.HORIZONTAL?function(){var t;return e.each(i,(function(){this.$ele[0].iscroll?isNaN(this.$ele[0].iscroll.x)||0===this.$ele[0].iscroll.x||(t=!0):0!==this.$ele[0].scrollLeft&&(t=!0)})),t}():void 0;var t}}function m(e){return e.originalEvent&&"mouse"!==e.originalEvent.pointerType?e.originalEvent:e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]||e&&e.touches&&e.touches[0]||e}function g(e,t,n){var s,a,l=0;return n===r.HORIZONTAL?l=t.x-e.x:n===r.LEFT_TO_RIGHT?l=o(t.x-e.x,0):n===r.RIGHT_TO_LEFT?l=o(e.x-t.x,0):n===r.VERTICAL?l=t.y-e.y:n===r.TOP_TO_DOWN?l=o(t.y-e.y,0):n===r.DOWN_TO_TOP?l=o(e.y-t.y,0):(s=t.x-e.x,a=t.y-e.y,l=o(i(s),i(a)),(s<0&&i(s)===l||a<0&&i(a)===l)&&(l=-l)),l}function v(e,r){var i=m(e);i&&r.data.path.push({x:i.pageX,y:i.pageY}),n.push((function(){t.onSwipeEnd(e,r.data),r.onSwipeEnd.call(r.target,e,r.data)})),n.process()}function y(r,o){var s,u,d,h=m(r),p=o.data.path[0],f={x:h.pageX,y:h.pageY};return d=g(p,f,o.direction),o.data.length=d<0?-1:1,o.lastDistance=o.data.length,o.data.path=[f],o.data.totalLength=i(o.data.length),o.data.startTime=Date.now(),!1!==o.onSwipeStart.call(o.target,r,o.data)&&(a.appendTo(e("body")),s=function(r){!function(r,o){var s,a,l=m(r),c=o.data.path[0],u={x:l.pageX,y:l.pageY},d=g(c,u,o.direction),h=[];if(o.renderInProgress=!1,d!==o.lastDistance){s=30*(d<o.lastDistance?-1:1),a=d-o.lastDistance;for(var p=s;s>0&&p<=a||s<0&&p>=a;p+=s)h.push(p+o.lastDistance);a%s!=0&&h.push(a%i(s)+(0===h.length?o.lastDistance:h[h.length-1])),o.lastDistance=d,e.each(h,(function(){var e=this;n.push((function(){o.data.length=e,o.data.totalLength+=i(e),o.data.velocity=i(o.data.totalLength/(Date.now()-o.data.startTime)),o.data.path.push(u),!1===o.onSwipe.call(o.target,r,o.data)&&v(r,o),t.onSwipe(r,o.data)}))})),n.process()}}(r,o)},u=function(e){a.remove(),v(e,o)},(l=[]).push(s),(c=[]).push(u),t.onSwipeStart(r,o.data),!0)}function b(e,t){var n=t.data.path[0],o={x:e.pageX,y:e.pageY},s=g(n,o,t.direction);return i(s)>t.threshold&&function(e,t,n){if(n===r.HORIZONTAL){if(Math.abs((t.y-e.y)/(t.x-e.x))<=.36397023426)return!0}else if(n===r.VERTICAL&&Math.abs((t.y-e.y)/(t.x-e.x))>=2.74747741945)return!0;return!1}(n,o,t.direction)}function w(e){var t=e.bindEvents,n="";_.includes(t,"touch")?n+="touchstart":_.includes(t,"mouse")?n+="mousedown":_.includes(t,"pointer")&&(n+="pointerdown"),n&&p(e.target[0],n,(function(t){if(!e.disableMouse||"mouse"!==t.pointerType){if("mouse"!==t.pointerType&&t.MSPOINTER_TYPE_MOUSE&&t.pointerType!==t.MSPOINTER_TYPE_MOUSE){if(!(s.indexOf(t.target.tagName)<0))return;t.preventDefault()}var n=m(t);n&&function(e,t){var n;t.scrollObserver=new f(event.currentTarget,event.target,t.direction),n=function(e){if(b(m(e),t)&&(t.scrollObserver.hasSrcolled()||y(e,t)))return!1},l.push(n),t.data={path:[{x:e.pageX,y:e.pageY}]}}(n,e)}}))}window.PointerEvent&&function(){if(/iP(hone|od|ad)/.test(navigator.platform)){var e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return parseInt(e[1],10)}}()>=13?(p(document,"pointerdown",(function(e){u&&u!==e.pointerId?h(e):u=e.pointerId})),p(document,"pointermove",d),p(document,"pointerup",h),p(document,"pointercancel",h)):(p(document,"mousemove",d),p(document,"touchmove",d),p(document,"mouseup",h),p(document,"touchcancel",h),p(document,"touchend",h)),n=new function(){var e=[],t=!1;function n(){if(e.length>0){try{e.shift()()}catch(e){console.error("Function invocation failed",e)}window.requestAnimationFrame(n)}else t=!1}this.push=function(t){e.push(t)},this.process=function(){t||(t=!0,n())}},e.fn.swipey=function(t){return this.each((function(){w(e.extend({direction:r.NONE,target:e(this),bindEvents:["touch","mouse"],swipeTarget:document,threshold:30,onSwipeStart:e.noop,onSwipe:e.noop,onSwipeEnd:e.noop,disableMouse:!0},t))})),this},t={onSwipeStart:function(t,n){if(e.fn.swipey.trace){var r='<svg height="100vh" width="100vw" id ="canvas"> <path stroke="rgba(0, 0, 0, 0.5)" stroke-linecap="round" stroke-width="20" fill-opacity="0" stroke-opacity="0.8" d="M'+n.path[0].x+" "+n.path[0].y+' " /> </svg>';r.css({position:"fixed",top:0,left:0,width:"100vw",height:"100vh","z-index":1e4}),e("body").append(r),n.tracer={pathd:e("#canvas path")}}},onSwipe:function(e,t){if(t.tracer){var n=t.tracer.pathd.attr("d"),r=t.path[t.path.length-1];t.tracer.pathd.attr("d",n+" L"+r.x+" "+r.y+" ")}},onSwipeEnd:function(t,n){if(n.tracer){var r=n.path[0],i=[r,{y:r.y-50},{x:r.x+50},{y:r.y+50}],o=0;_.forEach(n.path,(function(e){var t;o!==i.length&&(!(t=i[o]).x||t.x<=e.x)&&(!t.y||t.y<=e.y)&&o++})),setTimeout((function(){e("body >#canvas").remove()}),500)}}},e.fn.swipey.DIRECTIONS=r}(jQuery),function(e){var t,n=/\$\{\{[a-zA-Z\+-/%\.\*\s\(\)\d,\\'"\$_]*\}\}/;function r(r){var i,o=[];if(t=t||(e.fn.swipeAnimation.expressionEvaluator?e.fn.swipeAnimation.expressionEvaluator:window.exprEval&&window.exprEval.Parser?function(e){var t=(new window.exprEval.Parser).parse(e);return function(e){return t.evaluate(e)}}:void 0),_.isFunction(r))return r;if(t){for(;null!==(i=n.exec(r));){var s=i[0],a=r.substring(0,i.index);r=r.substring(i.index+s.length),s=s.substring(3,s.length-2),o.push(a),o.push(t(s).bind({}))}return o.push(r),function(){var e=arguments;return _.map(o,(function(t){return _.isFunction(t)?t.apply(void 0,e):t})).join("")}}}function i(e,t,n){return _.isFunction(e)?e.apply(t,n):e}function o(e,t,n){var r=0,o=i(t.bounds,e,n);return _.isUndefined(o.center)||(r=o.center),_.isUndefined(o.lower)||(o.lower=o.lower+r),_.isUndefined(o.upper)||(o.upper=o.upper+r),o}function s(e){_.forEach(e.animation,(function(e){(_.isFunction(e.target)||e.targetFn)&&(e.targetFn=_.isUndefined(e.targetFn)?e.target:e.targetFn,e.target=e.targetFn())}))}function a(){this.setSettings=function(e,t){t.data("swipeAnimationDefaults",e)},this.getSettings=function(e){return e.data("swipeAnimationDefaults")}}function l(t,n,r,i,o,s){_.forEach(t.animation,(function(t){t.target&&(t.target.length>1?t.target.each((function(r){n.$i=r,e(this).css(_.mapValues(t.css,(function(e,t){return e(n)})))})):(n.$i=0,t.target.css(_.mapValues(t.css,(function(e,t){return e(n)})))),t.target.css({transition:"all ease-out "+r+"ms"}),t.target.one("webkitTransitionEnd transitionend",(function(){t.target.css({transition:""})})))})),setTimeout((function(){window.requestAnimationFrame((function(){n.$D===n.bounds.lower?t.onLower.call(i,s):n.$D===n.bounds.upper&&t.onUpper.call(i,s),t.onAnimation(s,o)}))}),r)}var c={gotoUpper:function(){u(this,"upper",arguments[1])},gotoLower:function(e){u(this,"lower",arguments[1])}};function u(e,t,n){var r,c=(new a).getSettings(e),u={},d=o(e,c);s(c),n=n||300,r=i(c.context,e),(u=_.extend({},r)).$d=0,u.$D="lower"===t?d.lower:d.upper,u.bounds=d,l(c,u,n,e)}function d(t,n){var c={$D:0},u={max:Math.max,min:Math.min,abs:Math.abs};if(!_.isArray(n.animation)){var d=n.animation.target||t,h=n.animation.css||n.animation;delete h[t],n.animation=[{target:d,css:h}]}_.forEach(n.animation,(function(e){e.css=_.mapValues(e.css,(function(e,t){return r(e)}))})),(new a).setSettings(n,t),t.swipey({direction:n.direction,threshold:n.threshold,bindEvents:n.bindEvents,target:n.target,onSwipeStart:function(e,r){var a,l,d,h;if(c.$d=0,c.bounds=o(this,n,[e,r.length]),_.isUndefined(c.bounds.center)?c.$D=0:c.$D=c.bounds.center,a=c.$D+r.length,c.bounds.strictLower=!(!1===c.bounds.strict||!1===c.bounds.strictLower),c.bounds.strictUpper=!(!1===c.bounds.strict||!1===c.bounds.strictUpper),!n.enableGestures()||c.bounds.strictLower&&(_.isUndefined(c.bounds.lower)&&r.length<0||!_.isUndefined(c.bounds.lower)&&c.bounds.lower>a)||c.bounds.strictUpper&&(_.isUndefined(c.bounds.upper)&&r.length>0||!_.isUndefined(c.bounds.upper)&&c.bounds.upper<a))return!1;c.vc=(l=0,d=0,h=0,{addDistance:function(e){var t=Date.now();return Math.abs(e-l)>10&&t!==d&&(h=(e-l)/(t-d),l=e,d=t),h=h<0?Math.min(h,-1):Math.max(h,1),this},getVelocity:function(){return h},getTime:function(e){return Math.abs(e/h)}}),c.context=_.extend(u,i(n.context,t)),c.localState=_.extend({},c.context),s(n),_.forEach(n.animation,(function(e){e.target&&e.target.css({transition:"none"})}))},onSwipe:function(t,r){var i=c.localState,o=c.$D+r.length;i.$d=r.length,i.$D=c.$D,c.bounds.strictLower&&!_.isUndefined(c.bounds.lower)&&c.bounds.lower>o?i.$d=c.bounds.lower-c.$D:c.bounds.strictUpper&&!_.isUndefined(c.bounds.upper)&&c.bounds.upper<o&&(i.$d=c.bounds.upper-c.$D),c.vc.addDistance(r.length),_.forEach(n.animation,(function(t){t.target&&(t.target.length>1?t.target.each((function(n){i.$i=n,e(this).css(_.mapValues(t.css,(function(e,t){return e(i)})))})):(i.$i=0,t.target.css(_.mapValues(t.css,(function(e,t){return e(i)})))))}))},onSwipeEnd:function(e,r){var i,o=c.localState,s=c.$D+r.length,a=c.vc.getVelocity();o.$d=r.length,o.$D=c.$D,!_.isUndefined(c.bounds.lower)&&a<=0&&c.$D>s?o.$D=c.bounds.lower:!_.isUndefined(c.bounds.upper)&&a>=0&&c.$D<s&&(o.$D=c.bounds.upper),o.$d=0,o.bounds=c.bounds,c.$D=o.$D,i=c.vc.getTime(o.$D-s),l(n,o,i,t,s,e)}})}e.fn.swipeAnimation=function(t){return c[t]?c[t].apply(this,arguments):(this.each((function(){d(e(this),e.extend({direction:e.fn.swipey.DIRECTIONS.HORIZONTAL,target:e(this),threshold:30,enableGestures:function(){return!0},bindEvents:["touch"],bounds:{},context:{},animation:{},onLower:e.noop,onUpper:e.noop,onAnimation:e.noop},t))})),this)}}(jQuery),function(e){function t(e,t){if(!(e.originalEvent.touches.length>1)){$(e.target).is("input")||$(e.target).is("textarea")||$(e.target).is("select")||$(e.target).is("button")||$(e.target).is("option")?e.stopPropagation():e.preventDefault();var n=e.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(r)}}if(e.support.touch="ontouchend"in document,e.support.touch){var n,r=e.ui.mouse.prototype,i=r._mouseInit,o=r._mouseDestroy;r._touchStart=function(e){!n&&this._mouseCapture(e.originalEvent.changedTouches[0])&&(n=!0,this._touchMoved=!1,t(e,"mouseover"),t(e,"mousemove"),t(e,"mousedown"))},r._touchMove=function(e){n&&(this._touchMoved=!0,t(e,"mousemove"))},r._touchEnd=function(e){n&&(t(e,"mouseup"),t(e,"mouseout"),this._touchMoved||t(e,"click"),n=!1)},r._mouseInit=function(){var t=this;t.element.bind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),i.call(t)},r._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),o.call(t)}}}(jQuery),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IMask={})}(this,(function(e){"use strict";function t(e){return"string"==typeof e||e instanceof String}function n(e){var t;return"object"==typeof e&&null!=e&&"Object"===(null==e||null==(t=e.constructor)?void 0:t.name)}function r(e,t){return Array.isArray(t)?r(e,((e,n)=>t.includes(n))):Object.entries(e).reduce(((e,n)=>{let[r,i]=n;return t(i,r)&&(e[r]=i),e}),{})}const i={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function o(e){switch(e){case i.LEFT:return i.FORCE_LEFT;case i.RIGHT:return i.FORCE_RIGHT;default:return e}}function s(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function a(e,t){if(t===e)return!0;const n=Array.isArray(t),r=Array.isArray(e);let i;if(n&&r){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!a(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){const n=t instanceof Date,r=e instanceof Date;if(n&&r)return t.getTime()==e.getTime();if(n!=r)return!1;const o=t instanceof RegExp,s=e instanceof RegExp;if(o&&s)return t.toString()==e.toString();if(o!=s)return!1;const l=Object.keys(t);for(i=0;i<l.length;i++)if(!Object.prototype.hasOwnProperty.call(e,l[i]))return!1;for(i=0;i<l.length;i++)if(!a(e[l[i]],t[l[i]]))return!1;return!0}return!(!t||!e||"function"!=typeof t||"function"!=typeof e)&&t.toString()===e.toString()}class l{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?i.NONE:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?i.LEFT:i.RIGHT}}function c(e,t){return new c.InputMask(e,t)}function u(e){if(null==e)throw new Error("mask property should be defined");return e instanceof RegExp?c.MaskedRegExp:t(e)?c.MaskedPattern:e===Date?c.MaskedDate:e===Number?c.MaskedNumber:Array.isArray(e)||e===Array?c.MaskedDynamic:c.Masked&&e.prototype instanceof c.Masked?e:c.Masked&&e instanceof c.Masked?e.constructor:e instanceof Function?c.MaskedFunction:(console.warn("Mask not found for mask",e),c.Masked)}function d(e){if(!e)throw new Error("Options in not defined");if(c.Masked){if(e.prototype instanceof c.Masked)return{mask:e};const{mask:t,...i}=e instanceof c.Masked?{mask:e}:n(e)&&e.mask instanceof c.Masked?e:{};if(t){const e=t.mask;return{...r(t,((e,t)=>!t.startsWith("_"))),mask:t.constructor,_mask:e,...i}}}return n(e)?{...e}:{mask:e}}function h(e){if(c.Masked&&e instanceof c.Masked)return e;const t=d(e),n=u(t.mask);if(!n)throw new Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}c.createMask=h;class p{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}c.MaskElement=p;class f extends p{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,n;return null!=(e=null==(t=(n=this.input).getRootNode)?void 0:t.call(n))?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(90===e.keyCode&&e.shiftKey&&(e.metaKey||e.ctrlKey)||89===e.keyCode&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&90===e.keyCode&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(e.isComposing||this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}c.HTMLMaskElement=f;class m extends f{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}c.HTMLMaskElement=f;class g extends f{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return null==r||null==n||n<r?n:r}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return null==r||null==n||n>r?n:r}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);const r=this.rootElement,i=r.getSelection&&r.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}c.HTMLContenteditableMaskElement=g;class v{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>v.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}v.MAX_LENGTH=100;class y{constructor(e,t){this.el=e instanceof p?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new g(e):new m(e),this.masked=h(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new v,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof c.Masked)&&this.masked.constructor===u(e))return void this.masked.updateOptions({mask:e});const t=e instanceof c.Masked?e:h({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const n=this._listeners[e];n&&n.forEach((e=>e(t)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,n=this.masked.value,r=this.masked.rawInputValue,i=this.displayValue,o=this.unmaskedValue!==t||this.value!==n||this._rawInputValue!==r;this._unmaskedValue=t,this._value=n,this._rawInputValue=r,this.el.value!==i&&(this.el.value=i),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),o&&this._fireChangeEvents(),this._historyChanging||!o&&!this.history.isEmpty||this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...n}=e,r=!this.maskEquals(t),i=this.masked.optionsIsChanged(n);r&&(this.mask=t),i&&this.masked.updateOptions(n),(r||i)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,i.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new l({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,r=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,o=n===this.masked.rawInputValue?t.removeDirection:i.NONE;let s=this.masked.nearestInputPos(t.startChangePos+r,o);o!==i.NONE&&(s=this.masked.nearestInputPos(s,i.NONE)),this.updateControl(s),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}c.InputMask=y;class b{static normalize(e){return Array.isArray(e)?e:[e,new b]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}c.ChangeDetails=b;class _{constructor(e,t,n){void 0===e&&(e=""),void 0===t&&(t=0),this.value=e,this.from=t,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class w{constructor(e){this._value="",this._update({...w.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new _(this.extractInput(e,t),e)}appendTail(e){return t(e)&&(e=new _(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new b({inserted:e,rawInserted:e})):new b}_appendChar(e,t,n){void 0===t&&(t={});const r=this.state;let i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&"pad"===this.autofix)){const n=this.state;this.state=r;let o=this.pad(t);const s=this._appendCharRaw(e,t);o=o.aggregate(s),s.rawInserted||o.equals(i)?i=o:this.state=n}if(i.inserted){let e,o=!1!==this.doValidate(t);if(o&&null!=n){const t=this.state;if(!0===this.overwrite){e=n.state;for(let e=0;e<i.rawInserted.length;++e)n.unshift(this.displayValue.length-i.tailShift)}let r=this.appendTail(n);if(o=r.rawInserted.length===n.toString().length,!(o&&r.inserted||"shift"!==this.overwrite)){this.state=t,e=n.state;for(let e=0;e<i.rawInserted.length;++e)n.shift();r=this.appendTail(n),o=r.rawInserted.length===n.toString().length}o&&r.inserted&&(this.state=t)}o||(i=new b,this.state=r,n&&e&&(n.state=e))}return i}_appendPlaceholder(){return new b}_appendEager(){return new b}append(e,n,r){if(!t(e))throw new Error("value should be string");const i=t(r)?new _(String(r)):r;let o;null!=n&&n.tail&&(n._beforeTailState=this.state),[e,o]=this.doPrepare(e,n);for(let t=0;t<e.length;++t){const r=this._appendChar(e[t],n,i);if(!r.rawInserted&&!this.doSkipInvalid(e[t],n,i))break;o.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=n&&n.input&&e&&o.aggregate(this._appendEager()),null!=i&&(o.tailShift+=this.appendTail(i).tailShift),o}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new b}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,n=this.value,r=e();return this.rawInputValue=t,this.value&&this.value!==n&&0===n.indexOf(this.value)&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e,t,n){return Boolean(this.skipInvalid)}doPrepare(e,t){return void 0===t&&(t={}),b.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),b.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,n,r,s){void 0===n&&(n=""),void 0===r&&(r=i.NONE),void 0===s&&(s={input:!0});const a=e+t,l=this.extractTail(a),c=!0===this.eager||"remove"===this.eager;let u;c&&(r=o(r),u=this.extractInput(0,a,{raw:!0}));let d=e;const h=new b;if(r!==i.NONE&&(d=this.nearestInputPos(e,t>1&&0!==e&&!c?i.NONE:r),h.tailShift=d-e),h.aggregate(this.remove(d)),c&&r!==i.NONE&&u===this.rawInputValue)if(r===i.FORCE_LEFT){let e;for(;u===this.rawInputValue&&(e=this.displayValue.length);)h.aggregate(new b({tailShift:-1})).aggregate(this.remove(e-1))}else r===i.FORCE_RIGHT&&l.unshift();return h.aggregate(this.append(n,s,l))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!a(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||w.EMPTY_VALUES.includes(e)&&w.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new b}}w.DEFAULTS={skipInvalid:!0},w.EMPTY_VALUES=[void 0,null,""],c.Masked=w;class x{constructor(e,t){void 0===e&&(e=[]),void 0===t&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=t(e)?new _(String(e)):e;const n=this.chunks[this.chunks.length-1],r=n&&(n.stop===e.stop||null==e.stop)&&e.from===n.from+n.toString().length;if(e instanceof _)r?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof x){if(null==e.stop){let t;for(;e.chunks.length&&null==e.chunks[0].stop;)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof c.MaskedPattern))return new _(this.toString()).appendTo(e);const t=new b;for(let n=0;n<this.chunks.length;++n){const r=this.chunks[n],i=e._mapPosToBlock(e.displayValue.length),o=r.stop;let s;if(null!=o&&(!i||i.index<=o)&&((r instanceof x||e._stops.indexOf(o)>=0)&&t.aggregate(e._appendPlaceholder(o)),s=r instanceof x&&e._blocks[o]),s){const n=s.appendTail(r);t.aggregate(n);const i=r.toString().slice(n.rawInserted.length);i&&t.aggregate(e.append(i,{tail:!0}))}else t.aggregate(e.append(r.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map((e=>e.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...n}=e;Object.assign(this,n),this.chunks=t.map((e=>{const t="chunks"in e?new x:new _;return t.state=e,t}))}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";const t=null!=e?e-this.from:e;let n=0;for(;n<this.chunks.length;){const e=this.chunks[n],r=e.unshift(t);if(e.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class S{constructor(e,t){this.masked=e,this._log=[];const{offset:n,index:r}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,i.FORCE_LEFT),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,i.LEFT),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,i.LEFT),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,i.FORCE_RIGHT),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,i.NONE),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,i.NONE),!0}))}}class k{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new b}nearestInputPos(e,t){void 0===t&&(t=i.NONE);const n=this._value.length;switch(t){case i.LEFT:case i.FORCE_LEFT:return 0;default:return n}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),void 0===n&&(n={}),n.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new b;const n=!0===this.eager||"append"===this.eager,r=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!n)&&!t.tail,i=new b({inserted:this.char,rawInserted:r?this.char:""});return this._value=this.char,this._isRawInput=r&&(t.raw||t.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new b;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new _("")}appendTail(e){return t(e)&&(e=new _(String(e))),e.appendTo(this)}append(e,t,n){const r=this._appendChar(e[0],t);return null!=n&&(r.tailShift+=this.appendTail(n).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=Boolean(e._rawInputValue)}pad(e){return this._appendPlaceholder()}}class E{constructor(e){const{parent:t,isOptional:n,placeholderChar:r,displayChar:i,lazy:o,eager:s,...a}=e;this.masked=h(a),Object.assign(this,{parent:t,isOptional:n,placeholderChar:r,displayChar:i,lazy:o,eager:s})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),0===e&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new b}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new b;const n=this.masked.state;let r=this.masked._appendChar(e,this.currentMaskFlags(t));return r.inserted&&!1===this.doValidate(t)&&(r=new b,this.masked.state=n),r.inserted||this.isOptional||this.lazy||t.input||(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=Boolean(r.inserted),r}append(e,t,n){return this.masked.append(e,this.currentMaskFlags(t),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new b:(this.isFilled=!0,new b({inserted:this.placeholderChar}))}_appendEager(){return new b}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.masked.extractInput(e,t,n)}nearestInputPos(e,t){void 0===t&&(t=i.NONE);const n=this.value.length,r=Math.min(Math.max(e,0),n);switch(t){case i.LEFT:case i.FORCE_LEFT:return this.isComplete?r:0;case i.RIGHT:case i.FORCE_RIGHT:return this.isComplete?r:n;default:return r}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new b}}E.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class T extends w{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}c.MaskedRegExp=T;class C extends w{constructor(e){super({...C.DEFAULTS,...e,definitions:Object.assign({},E.DEFAULT_DEFINITIONS,null==e?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let n=!1,r=!1;for(let i=0;i<t.length;++i){if(this.blocks){const e=t.slice(i),n=Object.keys(this.blocks).filter((t=>0===e.indexOf(t)));n.sort(((e,t)=>t.length-e.length));const r=n[0];if(r){const{expose:e,repeat:t,...n}=d(this.blocks[r]),o={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...n,repeat:t,parent:this},s=null!=t?new c.RepeatBlock(o):h(o);s&&(this._blocks.push(s),e&&(this.exposeBlock=s),this._maskedBlocks[r]||(this._maskedBlocks[r]=[]),this._maskedBlocks[r].push(this._blocks.length-1)),i+=r.length-1;continue}}let o=t[i],s=o in e;if(o===C.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===o||"}"===o){n=!n;continue}if("["===o||"]"===o){r=!r;continue}if(o===C.ESCAPE_CHAR){if(++i,o=t[i],!o)break;s=!1}const a=s?new E({isOptional:r,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...d(e[o]),parent:this}):new k({char:o,eager:this.eager,isUnmasking:n});this._blocks.push(a)}}get state(){return{...super.state,_blocks:this._blocks.map((e=>e.state))}}set state(e){if(!e)return void this.reset();const{_blocks:t,...n}=e;this._blocks.forEach(((e,n)=>e.state=t[n])),super.state=n}reset(){super.reset(),this._blocks.forEach((e=>e.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((e=>e.isComplete))}get isFilled(){return this._blocks.every((e=>e.isFilled))}get isFixed(){return this._blocks.every((e=>e.isFixed))}get isOptional(){return this._blocks.every((e=>e.isOptional))}doCommit(){this._blocks.forEach((e=>e.doCommit())),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((e,t)=>e+t.unmaskedValue),"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((e,t)=>e+t.value),"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce(((e,t)=>e+t.displayValue),"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new b;let n=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==n)return t;this._blocks[n].isFilled&&++n;for(let e=n;e<this._blocks.length;++e){const n=this._blocks[e]._appendEager();if(!n.inserted)break;t.aggregate(n)}return t}_appendCharRaw(e,t){void 0===t&&(t={});const n=this._mapPosToBlock(this.displayValue.length),r=new b;if(!n)return r;for(let o,s=n.index;o=this._blocks[s];++s){var i;const n=o._appendChar(e,{...t,_beforeTailState:null==(i=t._beforeTailState)||null==(i=i._blocks)?void 0:i[s]});if(r.aggregate(n),n.consumed)break}return r}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const n=new x;return e===t||this._forEachBlocksInRange(e,t,((e,t,r,i)=>{const o=e.extractTail(r,i);o.stop=this._findStopBefore(t),o.from=this._blockStartPos(t),o instanceof x&&(o.blockIndex=t),n.extend(o)})),n}extractInput(e,t,n){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),void 0===n&&(n={}),e===t)return"";let r="";return this._forEachBlocksInRange(e,t,((e,t,i,o)=>{r+=e.extractInput(i,o,n)})),r}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){const r=this._stops[n];if(!(r<=e))break;t=r}return t}_appendPlaceholder(e){const t=new b;if(this.lazy&&null==e)return t;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return t;const r=n.index,i=null!=e?e:this._blocks.length;return this._blocks.slice(r,i).forEach((n=>{var r;n.lazy&&null==e||t.aggregate(n._appendPlaceholder(null==(r=n._blocks)?void 0:r.length))})),t}_mapPosToBlock(e){let t="";for(let n=0;n<this._blocks.length;++n){const r=this._blocks[n],i=t.length;if(t+=r.displayValue,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce(((e,t)=>e+t.displayValue.length),0)}_forEachBlocksInRange(e,t,n){void 0===t&&(t=this.displayValue.length);const r=this._mapPosToBlock(e);if(r){const e=this._mapPosToBlock(t),i=e&&r.index===e.index,o=r.offset,s=e&&i?e.offset:this._blocks[r.index].displayValue.length;if(n(this._blocks[r.index],r.index,o,s),e&&!i){for(let t=r.index+1;t<e.index;++t)n(this._blocks[t],t,0,this._blocks[t].displayValue.length);n(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const n=super.remove(e,t);return this._forEachBlocksInRange(e,t,((e,t,r,i)=>{n.aggregate(e.remove(r,i))})),n}nearestInputPos(e,t){if(void 0===t&&(t=i.NONE),!this._blocks.length)return 0;const n=new S(this,e);if(t===i.NONE)return n.pushRightBeforeInput()?n.pos:(n.popState(),n.pushLeftBeforeInput()?n.pos:this.displayValue.length);if(t===i.LEFT||t===i.FORCE_LEFT){if(t===i.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===i.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e)return n.pos;if(n.popState(),n.ok&&n.pos<=e)return n.pos;n.popState()}return n.ok?n.pos:t===i.FORCE_LEFT?0:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:0))}return t===i.RIGHT||t===i.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===i.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:this.nearestInputPos(e,i.LEFT)))):e}totalInputPositions(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let n=0;return this._forEachBlocksInRange(e,t,((e,t,r,i)=>{n+=e.totalInputPositions(r,i)})),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map((e=>this._blocks[e])):[]}pad(e){const t=new b;return this._forEachBlocksInRange(0,this.displayValue.length,(n=>t.aggregate(n.pad(e)))),t}}C.DEFAULTS={...w.DEFAULTS,lazy:!0,placeholderChar:"_"},C.STOP_CHAR="`",C.ESCAPE_CHAR="\\",C.InputDefinition=E,C.FixedDefinition=k,c.MaskedPattern=C;class D extends C{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:n=this.from||0,maxLength:r=this.maxLength||0,autofix:i=this.autofix,...o}=e;this.to=t,this.from=n,this.maxLength=Math.max(String(t).length,r),this.autofix=i;const s=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<a.length&&a[l]===s[l];)++l;o.mask=a.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(o)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(e){let t="",n="";const[,r,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t="0".repeat(r.length)+i,n="9".repeat(r.length)+i),t=t.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[t,n]}doPrepareChar(e,t){let n;return void 0===t&&(t={}),[e,n]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const n=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),[i,o]=this.boundaries(this.value+e);return Number(o)<this.from?super._appendCharRaw(n[this.value.length],t):Number(i)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(r[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(-1===t.search(/[^0]/)&&t.length<=this._matchFrom)return!0;const[n,r]=this.boundaries(t);return this.from<=Number(r)&&Number(n)<=this.to&&super.doValidate(e)}pad(e){const t=new b;if(this.value.length===this.maxLength)return t;const n=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let n=0;n<r;++n)t.aggregate(super._appendCharRaw("0",e));n.split("").forEach((e=>this._appendCharRaw(e)))}return t}}c.MaskedRange=D;class M extends C{static extractPatternOptions(e){const{mask:n,pattern:r,...i}=e;return{...i,mask:t(n)?n:r}}constructor(e){super(M.extractPatternOptions({...M.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:r,blocks:i,...o}={...M.DEFAULTS,...e},s=Object.assign({},M.GET_DEFAULT_BLOCKS());e.min&&(s.Y.from=e.min.getFullYear()),e.max&&(s.Y.to=e.max.getFullYear()),e.min&&e.max&&s.Y.from===s.Y.to&&(s.m.from=e.min.getMonth()+1,s.m.to=e.max.getMonth()+1,s.m.from===s.m.to&&(s.d.from=e.min.getDate(),s.d.to=e.max.getDate())),Object.assign(s,this.blocks,i),super._update({...o,mask:t(n)?n:r,blocks:s})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(M.extractPatternOptions(e))}}M.GET_DEFAULT_BLOCKS=()=>({d:{mask:D,from:1,to:31,maxLength:2},m:{mask:D,from:1,to:12,maxLength:2},Y:{mask:D,from:1900,to:9999}}),M.DEFAULTS={...C.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>e?[String(e.getDate()).padStart(2,"0"),String(e.getMonth()+1).padStart(2,"0"),e.getFullYear()].join("."):"",parse:(e,t)=>{const[n,r,i]=e.split(".").map(Number);return new Date(i,r-1,n)}},c.MaskedDate=M;class A extends w{constructor(e){super({...A.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map((e=>{const{expose:t,...n}=d(e),r=h({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return t&&(this.exposeMask=r),r})):[])}_appendCharRaw(e,t){void 0===t&&(t={});const n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(e,t,n){void 0===e&&(e=""),void 0===t&&(t={}),void 0===n&&(n="");const r=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,i=this.rawInputValue,o=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:i,s=i.slice(o.length),a=this.currentMask,l=new b,c=null==a?void 0:a.state;return this.currentMask=this.doDispatch(e,{...t},n),this.currentMask&&(this.currentMask!==a?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),l.tailShift=this.currentMask.value.length-r.length),s&&(l.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),l}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new b;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,n;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(n=e._beforeTailState)?void 0:n.currentMask)||e._beforeTailState}}doDispatch(e,t,n){return void 0===t&&(t={}),void 0===n&&(n=""),this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){void 0===t&&(t={});let[n,r]=super.doPrepare(e,t);if(this.currentMask){let e;[n,e]=super.doPrepare(n,this.currentMaskFlags(t)),r=r.aggregate(e)}return[n,r]}doPrepareChar(e,t){void 0===t&&(t={});let[n,r]=super.doPrepareChar(e,t);if(this.currentMask){let e;[n,e]=super.doPrepareChar(n,this.currentMaskFlags(t)),r=r.aggregate(e)}return[n,r]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach((e=>e.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask)return this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,void this._applyDispatch();let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return Boolean(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){const n=new b;return this.currentMask&&n.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),n}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((e=>e.state)),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:n,currentMask:r,...i}=e;t&&this.compiledMasks.forEach(((e,n)=>e.state=t[n])),null!=n&&(this.currentMask=n,this.currentMask.state=r),super.state=i}extractInput(e,t,n){return this.currentMask?this.currentMask.extractInput(e,t,n):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every(((t,n)=>{if(!e[n])return;const{mask:r,...i}=e[n];return a(t,i)&&t.maskEquals(r)})):super.maskEquals(e)}typedValueEquals(e){var t;return Boolean(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}A.DEFAULTS={...w.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;const o=t.rawInputValue,s=t.compiledMasks.map(((s,a)=>{const l=t.currentMask===s,c=l?s.displayValue.length:s.nearestInputPos(s.displayValue.length,i.FORCE_LEFT);return s.rawInputValue!==o?(s.reset(),s.append(o,{raw:!0})):l||s.remove(c),s.append(e,t.currentMaskFlags(n)),s.appendTail(r),{index:a,weight:s.rawInputValue.length,totalInputPositions:s.totalInputPositions(0,Math.max(c,s.nearestInputPos(s.displayValue.length,i.FORCE_LEFT)))}}));return s.sort(((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions)),t.compiledMasks[s[0].index]}},c.MaskedDynamic=A;class I extends C{constructor(e){super({...I.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...n}=e;if(t){const e=t.map((e=>e.length)),r=Math.min(...e),i=Math.max(...e)-r;n.mask="*".repeat(r),i&&(n.mask+="["+"*".repeat(i)+"]"),this.enum=t}super._update(n)}_appendCharRaw(e,t){void 0===t&&(t={});const n=Math.min(this.nearestInputPos(0,i.FORCE_RIGHT),this.value.length),r=this.enum.filter((t=>this.matchValue(t,this.unmaskedValue+e,n)));if(r.length){1===r.length&&this._forEachBlocksInRange(0,this.value.length,((e,n)=>{const i=r[0][n];n>=this.value.length||i===e.value||(e.reset(),e._appendChar(i,t))}));const e=super._appendCharRaw(r[0][this.value.length],t);return 1===r.length&&r[0].slice(this.unmaskedValue.length).split("").forEach((t=>e.aggregate(super._appendCharRaw(t)))),e}return new b({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new _("",e)}remove(e,t){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new b;const n=Math.min(super.nearestInputPos(0,i.FORCE_RIGHT),this.value.length);let r;for(r=e;r>=0&&!(this.enum.filter((e=>this.matchValue(e,this.value.slice(n,r),n))).length>1);--r);const o=super.remove(r,t);return o.tailShift+=r-e,o}get isComplete(){return this.enum.indexOf(this.value)>=0}}I.DEFAULTS={...C.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n},c.MaskedEnum=I;class L extends w{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}var O;c.MaskedFunction=L;class N extends w{constructor(e){super({...N.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"("+s(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+"\\d*"+t),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(s).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(s(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});const[n,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!n&&(r.skip=!0),!n||this.allowPositive||this.value||"-"===n||r.aggregate(this._appendChar("-")),[n,r]}_separatorsCount(e,t){void 0===t&&(t=!1);let n=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,n))}_appendCharRaw(e,t){void 0===t&&(t={});const n=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const i=this._value;this._value+=e;const o=this.number;let s,a=!isNaN(o),l=!1;if(a){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace(N.UNMASKED_RADIX,this.radix),l||(l=i===this._value&&!t.tail)):a=!1),a&&(a=Boolean(this._value.match(this._numberRegExp)))}a?s=new b({inserted:this._value.slice(i.length),rawInserted:l?"":e,skip:l}):(this._value=i,s=new b),this._value=this._insertThousandsSeparators(this._value);const c=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,u=this._separatorsCountFromSlice(c);return s.tailShift+=(u-r)*this.thousandsSeparator.length,s}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){const n=this._findSeparatorAround(e);n>=0&&(e=n);const r=this._findSeparatorAround(t);return r>=0&&(t=r+this.thousandsSeparator.length),[e,t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const n=this.value.slice(0,e),r=this.value.slice(t),i=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+r));const o=this._separatorsCountFromSlice(n);return new b({tailShift:(o-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case i.NONE:case i.LEFT:case i.FORCE_LEFT:{const n=this._findSeparatorAround(e-1);if(n>=0){const r=n+this.thousandsSeparator.length;if(e<r||this.value.length<=r||t===i.FORCE_LEFT)return n}break}case i.RIGHT:case i.FORCE_RIGHT:{const t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,((e,t,n,r)=>t+r)),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,n){void 0===t&&(t={});const r=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===N.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,n)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,N.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(N.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||N.EMPTY_VALUES.includes(e)&&N.EMPTY_VALUES.includes(this.typedValue))&&!(0===e&&""===this.value)}}O=N,N.UNMASKED_RADIX=".",N.EMPTY_VALUES=[...w.EMPTY_VALUES,0],N.DEFAULTS={...w.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[O.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},c.MaskedNumber=N;const R={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function P(e,t,n){void 0===t&&(t=R.MASKED),void 0===n&&(n=R.MASKED);const r=h(e);return e=>r.runIsolated((r=>(r[t]=e,r[n])))}function F(e,t,n,r){return P(t,n,r)(e)}c.PIPE_TYPE=R,c.createPipe=P,c.pipe=F;class j extends C{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,n,r;const{repeat:i,...o}=d(e);this._blockOpts=Object.assign({},this._blockOpts,o);const s=h(this._blockOpts);this.repeat=null!=(t=null!=(n=null!=i?i:s.repeat)?n:this.repeat)?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(r=this._blocks)?void 0:r.length)||0,this.repeatFrom)),blocks:{m:s},eager:s.eager,overwrite:s.overwrite,skipInvalid:s.skipInvalid,lazy:s.lazy,placeholderChar:s.placeholderChar,displayChar:s.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(h(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});const n=new b;for(let a,l,c=null!=(r=null==(i=this._mapPosToBlock(this.displayValue.length))?void 0:i.index)?r:Math.max(this._blocks.length-1,0);a=null!=(o=this._blocks[c])?o:l=!l&&this._allocateBlock(c);++c){var r,i,o,s;const u=a._appendChar(e,{...t,_beforeTailState:null==(s=t._beforeTailState)||null==(s=s._blocks)?void 0:s[c]});if(u.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(u),u.consumed)break}return n}_trimEmptyTail(e,t){var n,r;void 0===e&&(e=0);const i=Math.max((null==(n=this._mapPosToBlock(e))?void 0:n.index)||0,this.repeatFrom,0);let o;null!=t&&(o=null==(r=this._mapPosToBlock(t))?void 0:r.index),null==o&&(o=this._blocks.length-1);let s=0;for(let e=o;i<=e&&!this._blocks[e].unmaskedValue;--e,++s);s&&(this._blocks.splice(o-s+1,s),this.mask=this.mask.slice(s))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);const n=super.remove(e,t);return this._trimEmptyTail(e,t),n}totalInputPositions(e,t){return void 0===e&&(e=0),null==t&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}c.RepeatBlock=j;try{globalThis.IMask=c}catch{}e.ChangeDetails=b,e.ChunksTailDetails=x,e.DIRECTION=i,e.HTMLContenteditableMaskElement=g,e.HTMLInputMaskElement=m,e.HTMLMaskElement=f,e.InputMask=y,e.MaskElement=p,e.Masked=w,e.MaskedDate=M,e.MaskedDynamic=A,e.MaskedEnum=I,e.MaskedFunction=L,e.MaskedNumber=N,e.MaskedPattern=C,e.MaskedRange=D,e.MaskedRegExp=T,e.PIPE_TYPE=R,e.PatternFixedDefinition=k,e.PatternInputDefinition=E,e.RepeatBlock=j,e.createMask=h,e.createPipe=P,e.default=c,e.forceDirection=o,e.normalizeOpts=d,e.pipe=F,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.wm_common_variables=t():e.wm_common_variables=t()}(window,(()=>(()=>{var e={"./node_modules/@metrichor/jmespath/dist/jmespath.esm.js":
|
|
845
845
|
/*!***************************************************************!*\
|
|
846
846
|
!*** ./node_modules/@metrichor/jmespath/dist/jmespath.esm.js ***!
|
|
@@ -1725,7 +1725,7 @@ i.version="2.30.1",o(Zn),i.fn=co,i.min=er,i.max=tr,i.now=nr,i.utc=m,i.unix=uo,i.
|
|
|
1725
1725
|
/*!**********************************************************!*\
|
|
1726
1726
|
!*** ./src/manager/variable/service-variable.manager.ts ***!
|
|
1727
1727
|
\**********************************************************/
|
|
1728
|
-
(e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableManager:()=>v});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ../../util/file-upload.util */"./src/util/file-upload.util.ts"),s=n(/*! ../../util/variable/service-variable.utils */"./src/util/variable/service-variable.utils.ts"),a=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),l=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),c=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),u=n(/*! ../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),d=n(/*! ../../util/oAuth.utils */"./src/util/oAuth.utils.ts"),h=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),p=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),f=n(/*! lodash */"./node_modules/lodash/lodash.js"),m=n.n(f),g=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fileUploadResponse=[],t.fileUploadCount=0,t.totalFilesCount=0,t.successFileUploadCount=0,t.failedFileUploadCount=0,t}return g(t,e),t.prototype.processErrorResponse=function(e,t,n,r,o,s){var l=this.getMethodInfo(e,{},{}),h=m().get(l,"securityDefinitions.0"),f=this.prepareCallbackOptions(r);o||(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,f,s),m().get(h,"type")===c.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2&&m().includes([c.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.UNAUTHORIZED,c.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.FORBIDDEN],m().get(r,"status"))&&(0,d.removeAccessToken)(h["x-WM-PROVIDER_ID"]),(0,i.triggerFn)(n,t),e.notify(p.VariableEvents.AFTER_INVOKE,[this,t]),c.CONSTANTS.isStudioMode||(e.canUpdate=!0,a.$queue.process(e),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,t,f))},t.prototype.processSuccessResponse=function(e,t,n,r,o,s){var l,d,f,g={},v=(0,i.getValidJSON)(e);e=(0,i.isDefined)(v)?v:e&&(0,i.xmlToJson)(e)||e;var y=(0,i.isPageable)(e);if("DataService"===t.serviceType||"JavaService"===t.serviceType){var b=(0,u.decodeData)(e);m().isString(e)&&(e=b)}y?(l=e.content,g=m().omit(e,"content")):l=e,f=this.prepareCallbackOptions(n.xhrObj,{pagination:g,rawData:l}),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.RESULT,t,e,f),(0,i.triggerFn)(r,e,g),t.transformationColumns&&this.transformData(e,t),l=m().isObject(l)?l:{value:l},d=(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,l,f),(0,i.isDefined)(d)&&(l=d);var _=(0,i.getClonedObject)(n.inputFields||t.dataBinding),w=s||this.getMethodInfo(t,_,n),x=h.PaginationUtils.getPaginationInfo(w,t);if(x){var S=h.PaginationUtils.generatePaginationRes(w,x,e,o,n,t);m().isEmpty(S)||h.PaginationUtils.setVariablePagination(t,S,n)}return n.forceRunMode||n.skipDataSetUpdate||(t._paginationConfig||(t.pagination=g),t.dataSet=l,y&&Object.defineProperty(t.dataSet,"content",{get:function(){return t.dataSet}})),t.notify(p.VariableEvents.AFTER_INVOKE,[this,l]),setTimeout((function(){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,l,f),c.CONSTANTS.isStudioMode||(t.canUpdate=!0,a.$queue.process(t)),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,l,f)})),{data:t.dataSet,pagination:t.pagination}},t.prototype.uploadFileInFormData=function(e,t,n,r,i,s){var a=this,l=(0,o.upload)(i,e,s.data,{fileParamName:"files",url:s.url});return l.then((function(o){return a.fileUploadCount++,a.successFileUploadCount++,a.fileUploadResponse.push(o[0]),o&&o[0]&&!1===o[0].success&&(e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o[0].errorMessage}),a.fileUploadResponse=[],a.processErrorResponse(e,o[0].errorMessage,r,o,t.skipNotification)),a.totalFilesCount===a.fileUploadCount&&!0===o[0].success&&(0===a.failedFileUploadCount?(a.processSuccessResponse(a.fileUploadResponse,e,t,n),a.fileUploadResponse=[],e.onSuccess||u.appManager&&u.appManager.notifyApp(u.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_SUCCESS,"success")):((0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,a.fileUploadResponse),a.fileUploadResponse=[],u.appManager&&u.appManager.notifyApp(u.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_ERROR,"error")),a.fileUploadCount=0,a.successFileUploadCount=0,a.totalFilesCount=0),o}),(function(n){a.fileUploadCount++,a.failedFileUploadCount++,a.fileUploadResponse.push(n);var o=(0,u.getErrMessage)(n,e.httpService.getLocale());return e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o}),a.totalFilesCount===a.fileUploadCount&&(a.processErrorResponse(e,o,r,n,t.skipNotification),a.fileUploadResponse=[],a.fileUploadCount=0,a.failedFileUploadCount=0,a.totalFilesCount=0),n}),(function(t){return e._progressObservable&&e._progressObservable.next({progress:t,status:c.VARIABLE_CONSTANTS.EVENT.PROGRESS,fileName:i.name}),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.PROGRESS,e,t),t})),l},t.prototype.handleAuthError=function(e,t,n,r){var i;return m().get(u.securityService.get(),"authenticated")?i={error:{message:"You're not authorised to access the resource \""+e.service+'".'}}:(i={error:{message:"You're not authenticated to access the resource \""+e.service+'".',skipDefaultNotification:!0}},u.appManager.pushToSessionFailureRequests(e.invoke.bind(e,r,t,n)),u.appManager.handle401()),console.warn(e.name+": "+i.error.message),i},t.prototype.handleRequestMetaError=function(e,t,n,r,i){try{var o=m().get(e,"error.type");switch(o){case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:(0,d.performAuthorization)(void 0,e.securityDefnObj[c.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],this.invoke.bind(this,t,i,n,r),null,this.getProviderInfo(t,e.securityDefnObj["x-WM-PROVIDER_ID"])),this.processErrorResponse(t,e.error.message,r,i.xhrObj,!0,!0);break;case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:e=this.handleAuthError(t,n,r,i),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:if(e.error.message){e.error.message=e.error.message.replace("$variable",t.name);var s=void 0;s=o===c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING?["1. You did not Preview the app after creating a Variable for the imported service.","2. You deleted the imported service this Variable is linked to."]:["1. You haven't chosen an endpoint for "+i.operation+" operation for this Entity."],console.warn(e.error.message+"\n Possible reasons for this:\n "+s.join("\n "))}this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;default:e.error.message&&(console.warn(e.error.message,t.name),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification))}}catch(e){console.error(e)}return e},t.prototype.transformData=function(e,t){e.wmTransformedData=[];var n=t.transformationColumns,r=m().get(e,t.dataField)||[],i=e.wmTransformedData;m().forEach(r,(function(e,t){i[t]={},m().forEach(n,(function(n,r){i[t][n]=e[r]}))}))},t.prototype.getMethodInfo=function(e,t,n){var r;if(m().isEmpty(u.metadataService))r=e.serviceInfo;else{var o=(0,i.getClonedObject)(u.metadataService.getByOperationId(e.operationId,e.getPrefabName()));r=null===o?null:m().get(o,"wmServiceOperationInfo")}if(!r)return r;var s=m().get(r.securityDefinitions,"0"),a=s&&s.type===c.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2;return r.parameters&&r.parameters.forEach((function(r){r.readOnly||(r.sampleValue=t[r.name],-1!==c.VARIABLE_CONSTANTS.PAGINATION_PARAMS.indexOf(r.name)?"size"===r.name?r.sampleValue=n.size||r.sampleValue||parseInt(e.maxResults,10):"page"===r.name?r.sampleValue=n.page||r.sampleValue||1:"sort"===r.name&&(r.sampleValue=(0,u.getEvaluatedOrderBy)(e.orderBy,n.orderBy)||r.sampleValue||""):"access_token"===r.name&&a&&(r.sampleValue=(0,d.getAccessToken)(s[c.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))})),r},t.prototype.getProviderInfo=function(e,t){return(0,i.getClonedObject)(null===u.metadataService||void 0===u.metadataService?void 0:u.metadataService.getByProviderId(t,e.getPrefabName()))},t.prototype.isFileUploadInProgress=function(e){var t=!1;return m().forEach(e,(function(e){m().isArray(e)&&e[0]instanceof File&&m().forEach(e,(function(e){"onProgress"!==e.status||(t=!0)}))})),t},t.prototype.uploadFile=function(e,t,n,r,i,o){var s=this,a=0,l=[],c=[];if(m().forEach(i,(function(e){m().isArray(e)?(e[0]instanceof File&&a++,m().forEach(e,(function(e){(e instanceof File||m().find(m().values(e),(function(e){return e instanceof Blob})))&&(l.push(e),s.totalFilesCount++,a=a||1)}))):e instanceof File&&(a++,s.totalFilesCount++,l.push(e))})),1===a)return i.files.length>1?(m().forEach(l,(function(i){c.push(s.uploadFileInFormData(e,t,n,r,i,o))})),Promise.all(c)):this.uploadFileInFormData(e,t,n,r,l[0],o)},t.prototype._invoke=function(e,t,n,r){var o,l,d=this,h=(0,i.getClonedObject)(t.inputFields||e.dataBinding),p=(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,h,t);if(!1===p)return a.$queue.process(e),void(0,i.triggerFn)(r);m().isObject(p)&&(h=p);var f=this.getMethodInfo(e,h,t),g=s.ServiceVariableUtils.constructRequestParams(e,f,h,t);if(g.error){var v=this.handleRequestMetaError(g,e,n,r,t),y=(m().get(v,"error.message")||"An error occurred while triggering the variable: ")+": "+e.name;return(0,i.triggerFn)(r),a.$queue.process(e),Promise.reject(y)}if(s.ServiceVariableUtils.isFileUploadRequest(e)){var b=this.uploadFile(e,t,n,r,h,g);if(b)return b}return f&&m().isArray(f.produces)&&m().includes(f.produces,c.WS_CONSTANTS.CONTENT_TYPES.OCTET_STREAM)&&e.simulateFileDownload?e.simulateFileDownload(g,e.dataBinding.file||e.name,e.dataBinding.exportType,(function(){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,null,null,null),a.$queue.process(e),(0,i.triggerFn)(n)}),(function(){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,null,null,null),a.$queue.process(e),(0,i.triggerFn)(r)}),e.dataBinding):(this.notifyInflight(e,!t.skipToggleState),o=function(r,i){if(r&&r.type||r&&r.status){var o=r.body||r.data,s=d.processSuccessResponse(o,e,m().extend(t,{xhrObj:r}),n,r.headers);d.notifyInflight(e,!1,s),i(r)}},l=function(n,i){var o=(0,u.getErrMessage)(n,e.httpService.getLocale());d.notifyInflight(e,!1),d.processErrorResponse(e,o,r,n,t.skipNotification),i({error:o,details:n})},new Promise((function(t,n){g.responseType="text",e.httpService.sendCall(g,e).then((function(e){o(e,t)})).catch((function(e){(e=e||{}).error=e.error||"{}";var t=(0,i.getValidJSON)(e.error);e.error=(0,i.isDefined)(t)?t:e.error,l(e,n)}))})))},t.prototype.invoke=function(e,t,n,r){return(t=t||{}).inputFields=t.inputFields||(0,i.getClonedObject)(e.dataBinding),a.$queue.submit(e).then(this._invoke.bind(this,e,t,n,r),r)},t.prototype.setPagination=function(e,t){e._paginationConfig=t},t.prototype.download=function(e,t,n,r){t=t||{};var o,a=(0,i.getClonedObject)(e.dataBinding),l=t.data||{},d=this.getMethodInfo(e,a,t);return d.relativePath+="/export",(o=s.ServiceVariableUtils.constructRequestParams(e,d,a)).data=l,o.data.fields=(0,u.formatExportExpression)(l.fields||[]),o.method=t.httpMethod||"POST",o.url=t.url||o.url,m().hasIn(o,"error.message")?((0,i.triggerFn)(r,o.error.message),Promise.reject(o.error.message)):e.httpService.send(o).then((function(t){t&&(0,i.isValidWebURL)(t.body.result)?(window.location.href=t.body.result,(0,i.triggerFn)(n,t)):((0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,t),(0,i.triggerFn)(r,t))}),(function(t,n){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,n),(0,i.triggerFn)(r,t)}))},t.prototype.getInputParms=function(e){var t;return t=m().isEmpty(u.metadataService)?e.serviceInfo:m().get(u.metadataService.getByOperationId(e.operationId,e.getPrefabName()),"wmServiceOperationInfo"),m().get(t,"parameters")},t.prototype.setInput=function(e,t,n,r){return(0,u.setInput)(e.dataBinding,t,n,r)},t.prototype.cancel=function(e,t){a.$queue.requestsQueue.has(e)&&(s.ServiceVariableUtils.isFileUploadRequest(e)?(e.httpService.cancel(e,t),t.status="abort",this.totalFilesCount--,(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ABORT,e,t),this.isFileUploadInProgress(e.dataBinding)||0!==this.totalFilesCount||(a.$queue.process(e),this.notifyInflight(e,!1))):e.httpService.cancel&&(e.httpService.cancel(e),a.$queue.process(e),this.notifyInflight(e,!1)))},t.prototype.defineFirstLastRecord=function(e){e.isList&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().head(t&&t.content)||m().head(t)||{}}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().last(t&&t.content)||m().last(t)||{}}}))},t.prototype.getQueryParams=function(e,t,n){var r=this.getInputParms(n),i=s.ServiceVariableUtils.excludePaginationParams(r),o={};return m().map(n.dataBinding,(function(e,t){o[t]=e})),m().forEach(e,(function(e){m().includes(i,e)&&(o[e]=t)})),o},t.prototype.searchRecords=function(e,t,n,r){var o=this.getQueryParams(m().split(t.searchKey,","),t.query,e),s={page:t.page,pagesize:t.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",inputFields:o};return t.onBeforeservicecall&&t.onBeforeservicecall(o),this.invoke(e,s,n,r).catch(i.noop)},t}(l.BaseVariableManager)},"./src/model/action/timer-action.ts":
|
|
1728
|
+
(e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableManager:()=>v});var r,i=n(/*! ../../util/utils */"./src/util/utils.ts"),o=n(/*! ../../util/file-upload.util */"./src/util/file-upload.util.ts"),s=n(/*! ../../util/variable/service-variable.utils */"./src/util/variable/service-variable.utils.ts"),a=n(/*! ../../util/inflight-queue */"./src/util/inflight-queue.ts"),l=n(/*! ./base-variable.manager */"./src/manager/variable/base-variable.manager.ts"),c=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),u=n(/*! ../../util/variable/variables.utils */"./src/util/variable/variables.utils.ts"),d=n(/*! ../../util/oAuth.utils */"./src/util/oAuth.utils.ts"),h=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),p=n(/*! ../../model/base-variable */"./src/model/base-variable.ts"),f=n(/*! lodash */"./node_modules/lodash/lodash.js"),m=n.n(f),g=(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),v=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.fileUploadResponse=[],t.fileUploadCount=0,t.totalFilesCount=0,t.successFileUploadCount=0,t.failedFileUploadCount=0,t}return g(t,e),t.prototype.processErrorResponse=function(e,t,n,r,o,s){var l=this.getMethodInfo(e,{},{}),h=m().get(l,"securityDefinitions.0"),f=this.prepareCallbackOptions(r);o||(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,f,s),m().get(h,"type")===c.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2&&m().includes([c.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.UNAUTHORIZED,c.VARIABLE_CONSTANTS.HTTP_STATUS_CODE.FORBIDDEN],m().get(r,"status"))&&(0,d.removeAccessToken)(h["x-WM-PROVIDER_ID"]),(0,i.triggerFn)(n,t),e.notify(p.VariableEvents.AFTER_INVOKE,[this,t]),c.CONSTANTS.isStudioMode||(e.canUpdate=!0,a.$queue.process(e),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,e,t,f))},t.prototype.processSuccessResponse=function(e,t,n,r,o,s){var l,d,f,g={},v=(0,i.getValidJSON)(e);e=(0,i.isDefined)(v)?v:e&&(0,i.xmlToJson)(e)||e;var y=(0,i.isPageable)(e);if("DataService"===t.serviceType||"JavaService"===t.serviceType){var b=(0,u.decodeData)(e);m().isString(e)&&(e=b)}y?(l=e.content,g=m().omit(e,"content")):l=e,f=this.prepareCallbackOptions(n.xhrObj,{pagination:g,rawData:l}),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.RESULT,t,e,f),(0,i.triggerFn)(r,e,g),t.transformationColumns&&this.transformData(e,t),l=m().isObject(l)?l:{value:l},d=(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.PREPARE_SETDATA,t,l,f),(0,i.isDefined)(d)&&(l=d);var _=(0,i.getClonedObject)(n.inputFields||t.dataBinding),w=s||this.getMethodInfo(t,_,n),x=h.PaginationUtils.getPaginationInfo(w,t);if(x){var S=h.PaginationUtils.generatePaginationRes(w,x,e,o,n,t);m().isEmpty(S)||h.PaginationUtils.setVariablePagination(t,S,n)}return n.forceRunMode||n.skipDataSetUpdate||(t._paginationConfig||(t.pagination=g),t.dataSet=l,y&&Object.defineProperty(t.dataSet,"content",{get:function(){return t.dataSet}})),t.notify(p.VariableEvents.AFTER_INVOKE,[this,l]),setTimeout((function(){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.SUCCESS,t,l,f),c.CONSTANTS.isStudioMode||(t.canUpdate=!0,a.$queue.process(t)),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.CAN_UPDATE,t,l,f)})),{data:t.dataSet,pagination:t.pagination}},t.prototype.uploadFileInFormData=function(e,t,n,r,i,s){var a=this,l=(0,o.upload)(i,e,s.data,{fileParamName:"files",url:s.url});return l.then((function(o){return a.fileUploadCount++,a.successFileUploadCount++,a.fileUploadResponse.push(o[0]),i._response=o[0],o&&o[0]&&!1===o[0].success&&(e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o[0].errorMessage}),a.fileUploadResponse=[],a.processErrorResponse(e,o[0].errorMessage,r,o,t.skipNotification)),a.totalFilesCount===a.fileUploadCount&&!0===o[0].success&&(0===a.failedFileUploadCount?(a.processSuccessResponse(a.fileUploadResponse,e,t,n),a.fileUploadResponse=[],e.onSuccess||u.appManager&&u.appManager.notifyApp(u.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_SUCCESS,"success")):((0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,a.fileUploadResponse),a.fileUploadResponse=[],u.appManager&&u.appManager.notifyApp(u.appManager.getAppLocale().MESSAGE_FILE_UPLOAD_ERROR,"error")),a.fileUploadCount=0,a.successFileUploadCount=0,a.totalFilesCount=0),o}),(function(n){a.fileUploadCount++,a.failedFileUploadCount++,a.fileUploadResponse.push(n);var o=(0,u.getErrMessage)(n,e.httpService.getLocale());return e._progressObservable&&e._progressObservable.next({status:"error",fileName:i.name,errMsg:o}),a.totalFilesCount===a.fileUploadCount&&(a.processErrorResponse(e,o,r,n,t.skipNotification),a.fileUploadResponse=[],a.fileUploadCount=0,a.failedFileUploadCount=0,a.totalFilesCount=0),n}),(function(t){return e._progressObservable&&e._progressObservable.next({progress:t,status:c.VARIABLE_CONSTANTS.EVENT.PROGRESS,fileName:i.name}),(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.PROGRESS,e,t),t})),l},t.prototype.handleAuthError=function(e,t,n,r){var i;return m().get(u.securityService.get(),"authenticated")?i={error:{message:"You're not authorised to access the resource \""+e.service+'".'}}:(i={error:{message:"You're not authenticated to access the resource \""+e.service+'".',skipDefaultNotification:!0}},u.appManager.pushToSessionFailureRequests(e.invoke.bind(e,r,t,n)),u.appManager.handle401()),console.warn(e.name+": "+i.error.message),i},t.prototype.handleRequestMetaError=function(e,t,n,r,i){try{var o=m().get(e,"error.type");switch(o){case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN:(0,d.performAuthorization)(void 0,e.securityDefnObj[c.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],this.invoke.bind(this,t,i,n,r),null,this.getProviderInfo(t,e.securityDefnObj["x-WM-PROVIDER_ID"])),this.processErrorResponse(t,e.error.message,r,i.xhrObj,!0,!0);break;case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED:e=this.handleAuthError(t,n,r,i),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING:case c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING:if(e.error.message){e.error.message=e.error.message.replace("$variable",t.name);var s=void 0;s=o===c.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING?["1. You did not Preview the app after creating a Variable for the imported service.","2. You deleted the imported service this Variable is linked to."]:["1. You haven't chosen an endpoint for "+i.operation+" operation for this Entity."],console.warn(e.error.message+"\n Possible reasons for this:\n "+s.join("\n "))}this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification);break;default:e.error.message&&(console.warn(e.error.message,t.name),this.processErrorResponse(t,e.error.message,r,i.xhrObj,i.skipNotification,e.error.skipDefaultNotification))}}catch(e){console.error(e)}return e},t.prototype.transformData=function(e,t){e.wmTransformedData=[];var n=t.transformationColumns,r=m().get(e,t.dataField)||[],i=e.wmTransformedData;m().forEach(r,(function(e,t){i[t]={},m().forEach(n,(function(n,r){i[t][n]=e[r]}))}))},t.prototype.getMethodInfo=function(e,t,n){var r;if(m().isEmpty(u.metadataService))r=e.serviceInfo;else{var o=(0,i.getClonedObject)(u.metadataService.getByOperationId(e.operationId,e.getPrefabName()));r=null===o?null:m().get(o,"wmServiceOperationInfo")}if(!r)return r;var s=m().get(r.securityDefinitions,"0"),a=s&&s.type===c.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2;return r.parameters&&r.parameters.forEach((function(r){r.readOnly||(r.sampleValue=t[r.name],-1!==c.VARIABLE_CONSTANTS.PAGINATION_PARAMS.indexOf(r.name)?"size"===r.name?r.sampleValue=n.size||r.sampleValue||parseInt(e.maxResults,10):"page"===r.name?r.sampleValue=n.page||r.sampleValue||1:"sort"===r.name&&(r.sampleValue=(0,u.getEvaluatedOrderBy)(e.orderBy,n.orderBy)||r.sampleValue||""):"access_token"===r.name&&a&&(r.sampleValue=(0,d.getAccessToken)(s[c.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))})),r},t.prototype.getProviderInfo=function(e,t){return(0,i.getClonedObject)(null===u.metadataService||void 0===u.metadataService?void 0:u.metadataService.getByProviderId(t,e.getPrefabName()))},t.prototype.isFileUploadInProgress=function(e){var t=!1;return m().forEach(e,(function(e){m().isArray(e)&&e[0]instanceof File&&m().forEach(e,(function(e){"onProgress"!==e.status||(t=!0)}))})),t},t.prototype.uploadFile=function(e,t,n,r,i,o){var s=this,a=0,l=[],c=[];if(m().forEach(i,(function(e){m().isArray(e)?(e[0]instanceof File&&a++,m().forEach(e,(function(e){(e instanceof File||m().find(m().values(e),(function(e){return e instanceof Blob})))&&(l.push(e),s.totalFilesCount++,a=a||1)}))):e instanceof File&&(a++,s.totalFilesCount++,l.push(e))})),1===a)return i.files.length>1?(m().forEach(l,(function(i){c.push(s.uploadFileInFormData(e,t,n,r,i,o))})),Promise.all(c)):this.uploadFileInFormData(e,t,n,r,l[0],o)},t.prototype._invoke=function(e,t,n,r){var o,l,d=this,h=(0,i.getClonedObject)(t.inputFields||e.dataBinding),p=(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.BEFORE_UPDATE,e,h,t);if(!1===p)return a.$queue.process(e),void(0,i.triggerFn)(r);m().isObject(p)&&(h=p);var f=this.getMethodInfo(e,h,t),g=s.ServiceVariableUtils.constructRequestParams(e,f,h,t);if(g.error){var v=this.handleRequestMetaError(g,e,n,r,t),y=(m().get(v,"error.message")||"An error occurred while triggering the variable: ")+": "+e.name;return(0,i.triggerFn)(r),a.$queue.process(e),Promise.reject(y)}if(s.ServiceVariableUtils.isFileUploadRequest(e)){var b=this.uploadFile(e,t,n,r,h,g);if(b)return b}return f&&m().isArray(f.produces)&&m().includes(f.produces,c.WS_CONSTANTS.CONTENT_TYPES.OCTET_STREAM)&&e.simulateFileDownload?e.simulateFileDownload(g,e.dataBinding.file||e.name,e.dataBinding.exportType,(function(){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.SUCCESS,e,null,null,null),a.$queue.process(e),(0,i.triggerFn)(n)}),(function(){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,null,null,null),a.$queue.process(e),(0,i.triggerFn)(r)}),e.dataBinding):(this.notifyInflight(e,!t.skipToggleState),o=function(r,i){if(r&&r.type||r&&r.status){var o=r.body||r.data,a=d.processSuccessResponse(o,e,m().extend(t,{xhrObj:r}),n,r.headers);d.notifyInflight(e,!1,a),s.ServiceVariableUtils.isFileDeleteRequest(e)&&e._deleteFileObservable&&(e._deleteFileObservable.next({status:"success",response:o}),u.appManager&&u.appManager.notifyApp(u.appManager.getAppLocale().MESSAGE_FILE_DELETE_SUCCESS||"File delete success","success")),i(r)}},l=function(n,i){var o=(0,u.getErrMessage)(n,e.httpService.getLocale());d.notifyInflight(e,!1),d.processErrorResponse(e,o,r,n,t.skipNotification),s.ServiceVariableUtils.isFileDeleteRequest(e)&&e._deleteFileObservable&&(e._deleteFileObservable.error({status:"error",error:o,details:n}),u.appManager&&u.appManager.notifyApp(u.appManager.getAppLocale().MESSAGE_FILE_DELETE_ERROR||"File delete failed","error")),i({error:o,details:n})},new Promise((function(t,n){g.responseType="text",e.httpService.sendCall(g,e).then((function(e){o(e,t)})).catch((function(e){(e=e||{}).error=e.error||"{}";var t=(0,i.getValidJSON)(e.error);e.error=(0,i.isDefined)(t)?t:e.error,l(e,n)}))})))},t.prototype.invoke=function(e,t,n,r){return(t=t||{}).inputFields=t.inputFields||(0,i.getClonedObject)(e.dataBinding),a.$queue.submit(e).then(this._invoke.bind(this,e,t,n,r),r)},t.prototype.setPagination=function(e,t){e._paginationConfig=t},t.prototype.download=function(e,t,n,r){t=t||{};var o,a=(0,i.getClonedObject)(e.dataBinding),l=t.data||{},d=this.getMethodInfo(e,a,t);return d.relativePath+="/export",(o=s.ServiceVariableUtils.constructRequestParams(e,d,a)).data=l,o.data.fields=(0,u.formatExportExpression)(l.fields||[]),o.method=t.httpMethod||"POST",o.url=t.url||o.url,m().hasIn(o,"error.message")?((0,i.triggerFn)(r,o.error.message),Promise.reject(o.error.message)):e.httpService.send(o).then((function(t){t&&(0,i.isValidWebURL)(t.body.result)?(window.location.href=t.body.result,(0,i.triggerFn)(n,t)):((0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,t),(0,i.triggerFn)(r,t))}),(function(t,n){(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ERROR,e,t,n),(0,i.triggerFn)(r,t)}))},t.prototype.getInputParms=function(e){var t;return t=m().isEmpty(u.metadataService)?e.serviceInfo:m().get(u.metadataService.getByOperationId(e.operationId,e.getPrefabName()),"wmServiceOperationInfo"),m().get(t,"parameters")},t.prototype.setInput=function(e,t,n,r){return(0,u.setInput)(e.dataBinding,t,n,r)},t.prototype.cancel=function(e,t){a.$queue.requestsQueue.has(e)&&(s.ServiceVariableUtils.isFileUploadRequest(e)?(e.httpService.cancel(e,t),t.status="abort",this.totalFilesCount--,(0,u.initiateCallback)(c.VARIABLE_CONSTANTS.EVENT.ABORT,e,t),this.isFileUploadInProgress(e.dataBinding)||0!==this.totalFilesCount||(a.$queue.process(e),this.notifyInflight(e,!1))):e.httpService.cancel&&(e.httpService.cancel(e),a.$queue.process(e),this.notifyInflight(e,!1)))},t.prototype.defineFirstLastRecord=function(e){e.isList&&(Object.defineProperty(e,"firstRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().head(t&&t.content)||m().head(t)||{}}}),Object.defineProperty(e,"lastRecord",{configurable:!0,get:function(){var t=e.dataSet;return m().last(t&&t.content)||m().last(t)||{}}}))},t.prototype.getQueryParams=function(e,t,n){var r=this.getInputParms(n),i=s.ServiceVariableUtils.excludePaginationParams(r),o={};return m().map(n.dataBinding,(function(e,t){o[t]=e})),m().forEach(e,(function(e){m().includes(i,e)&&(o[e]=t)})),o},t.prototype.searchRecords=function(e,t,n,r){var o=this.getQueryParams(m().split(t.searchKey,","),t.query,e),s={page:t.page,pagesize:t.pagesize,skipDataSetUpdate:!0,skipToggleState:!0,inFlightBehavior:"executeAll",inputFields:o};return t.onBeforeservicecall&&t.onBeforeservicecall(o),this.invoke(e,s,n,r).catch(i.noop)},t}(l.BaseVariableManager)},"./src/model/action/timer-action.ts":
|
|
1729
1729
|
/*!******************************************!*\
|
|
1730
1730
|
!*** ./src/model/action/timer-action.ts ***!
|
|
1731
1731
|
\******************************************/
|
|
@@ -1829,7 +1829,7 @@ i.version="2.30.1",o(Zn),i.fn=co,i.min=er,i.max=tr,i.now=nr,i.utc=m,i.unix=uo,i.
|
|
|
1829
1829
|
/*!*****************************************************!*\
|
|
1830
1830
|
!*** ./src/util/variable/service-variable.utils.ts ***!
|
|
1831
1831
|
\*****************************************************/
|
|
1832
|
-
(e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableUtils:()=>h});var r=n(/*! ../../util/utils */"./src/util/utils.ts"),i=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),o=n(/*! ./variables.utils */"./src/util/variable/variables.utils.ts"),s=n(/*! ./../oAuth.utils */"./src/util/oAuth.utils.ts"),a=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),l=n(/*! lodash */"./node_modules/lodash/lodash.js"),c=n.n(l),u=function(e,t,n){var s=c().toLower((0,r.extractType)(c().get(t,"items.type")||t.type)),a=i.CONSTANTS.isStudioMode?t["x-WM-CONTENT_TYPE"]:t.contentType;if((0,o.isFileUploadSupported)())return"file"===s||"string"!==a&&a?c().isArray(n)&&"file"===s?c().forEach(n,(function(n){e.append(t.name,n&&n.content||(0,r.getBlob)(n),n.name)})):e.append(t.name,(0,r.getBlob)(n,a),n&&n.name):(c().isObject(n)&&(n=JSON.stringify(n)),e.append(t.name,n)),e},d=function(e,t,n){var i,s={},a=[];return c().forEach(t,(function(t){i=c().get(e,t.name),c().isUndefined(i)||""===i||null===i||t.readOnly?t.required&&a.push(t.name||t.id):(i=(0,r.isDateTimeType)(t.type)?(0,o.formatDate)(i,t.type,n.dateFormatter):i,c().isArray(i)&&"string"===c().toLower((0,r.extractType)(t.type))&&(i=c().join(i,",")),s[t.name]=i)})),{requestBody:s,missingParams:a}},h=function(){function e(){}return e.constructRequestParams=function(e,t,n,l){if(e=e||{},null===t)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.USER_UNAUTHORISED,field:"_wmServiceOperationInfo"}};if(c().isEmpty(t))return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.METADATA_MISSING,field:"_wmServiceOperationInfo"}};if(t&&t.invalid)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.CRUD_OPERATION_MISSING,field:"_wmServiceOperationInfo"}};var h,p,f,m,g,v,y,b,_,w,x,S,k,E,T,C=t.directPath||"",D=t.basePath?t.basePath+t.relativePath:t.relativePath,M=function(e){return c().includes(["QueryExecution","ProcedureExecution"],e.controller)&&c().includes(["put","post"],e.operationType)}(e),A="",I={},L=[],O=null;function N(){return _||(_=new FormData)}if(k=c().get(t.securityDefinitions,"0"))switch(k.type){case i.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2:if(!(E=(0,s.getAccessToken)(k[i.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.NO_ACCESSTOKEN},securityDefnObj:k};I[i.VARIABLE_CONSTANTS.REST_SERVICE.AUTH_HDR_KEY]=i.VARIABLE_CONSTANTS.REST_SERVICE.PREFIX.AUTH_HDR_VAL.OAUTH+" "+E;break;case i.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.BASIC:if(v=n.wm_auth_username,y=n.wm_auth_password,!v||!y)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_CREDENTIALS,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.NO_CREDENTIALS},securityDefnObj:k};I[i.VARIABLE_CONSTANTS.REST_SERVICE.AUTH_HDR_KEY]=i.VARIABLE_CONSTANTS.REST_SERVICE.PREFIX.AUTH_HDR_VAL.BASIC+" "+btoa(v+":"+y),O={type:i.VARIABLE_CONSTANTS.REST_SERVICE.AUTH_TYPE.BASIC}}if(a.PaginationUtils.checkPaginationAtQuery(t,e,l),t.proxySettings=t.proxySettings||{web:!0,mobile:!1},b=t.httpMethod||t.methodType,w=t.proxySettings.mobile,T=t.proxySettings.withCredentials,f=w?D:C,c().forEach(t.parameters,(function(s){function a(){n?(x=n[s.name]&&c().isObject(n[s.name])?n[s.name]:n,S=c().get(t,["definitions",s.type])):(x=v||{},S=s.children)}var l,m,v=s.sampleValue;if((0,r.isDefined)(v)&&null!==v&&""!==v||M&&"file"!==s.type)switch(e.serviceType===i.VARIABLE_CONSTANTS.SERVICE_TYPE.DATA&&(0,r.isDateTimeType)(s.type)&&(v=(0,o.formatDate)(v,s.type,e.dateFormatter)),c().isArray(v)&&"string"===c().toLower((0,r.extractType)(s.type))&&e.serviceType===i.VARIABLE_CONSTANTS.SERVICE_TYPE.DATA&&(v=c().join(v,",")),s.parameterType.toUpperCase()){case"QUERY":if(c().isNull(v)&&(l=e.controller,m=e.serviceType,l===i.VARIABLE_CONSTANTS.CONTROLLER_TYPE.QUERY&&m===i.VARIABLE_CONSTANTS.SERVICE_TYPE.DATA))break;A?A+="&"+s.name+"="+encodeURIComponent(v):A="?"+s.name+"="+encodeURIComponent(v);break;case"PATH":g=new RegExp("\\s*\\{\\s*"+s.name+"(:\\.\\+)?\\s*\\}\\s*"),f=f.replace(g,v);break;case"HEADER":I[s.name]=v;break;case"BODY":M?(a(),h=d(x,S,e),p=h.requestBody,L=c().concat(L,h.missingParams)):p=v;break;case"FORMDATA":M&&s.name===i.SWAGGER_CONSTANTS.WM_DATA_JSON?(a(),h=d(x,S,e),p=u(N(),s,h.requestBody),L=c().concat(L,h.missingParams)):p=u(N(),s,v)}else s.required&&L.push(s.name||s.id)})),L.length)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.REQUIRED_FIELD_MISSING,field:L.join(","),message:(0,r.replace)(i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.REQUIRED_FIELD_MISSING,[L.join(",")]),skipDefaultNotification:!0}};c().includes(i.WS_CONSTANTS.NON_BODY_HTTP_METHODS,c().toUpper(b))||t.consumes&&t.consumes[0]===i.WS_CONSTANTS.CONTENT_TYPES.MULTIPART_FORMDATA||(I["Content-Type"]=t.consumes&&t.consumes[0]||"application/json"),c().includes(t.consumes,i.WS_CONSTANTS.CONTENT_TYPES.FORM_URL_ENCODED)&&!c().includes(i.WS_CONSTANTS.NON_BODY_HTTP_METHODS,(b||"").toUpperCase())?(A&&(p=(p?p+"&":"")+A.substring(1)),I["Content-Type"]=i.WS_CONSTANTS.CONTENT_TYPES.FORM_URL_ENCODED):f+=A,w&&(I=e.serviceType!==i.VARIABLE_CONSTANTS.SERVICE_TYPE.REST&&e.serviceType!==i.VARIABLE_CONSTANTS.SERVICE_TYPE.OPENAPI||t.skipCloakHeaders?I:function(e){var t={},n=i.VARIABLE_CONSTANTS.REST_SERVICE.UNCLOAKED_HEADERS,r=i.VARIABLE_CONSTANTS.REST_SERVICE.PREFIX.CLOAK_HEADER_KEY;return c().forEach(e,(function(e,i){c().includes(n,i.toUpperCase())?t[i]=e:t[r+i]=e})),t}(I),e.getPrefabName()&&-1!==i.VARIABLE_CONSTANTS.REST_SUPPORTED_SERVICES.indexOf(e.serviceType)?(f="prefabs/"+e.getPrefabName()+f,m="invokePrefabRestService"):e.getPrefabName()||(f="services"+f),f=i.$rootScope.project.deployedUrl+f);var R=a.PaginationUtils.getPaginationInfo(t,e);if(R&&e.pagination){var P=a.PaginationUtils.setPaginationAtReq(R,t,e,I,p,f,l);P&&(P.headers?I=P.headers:P.requestBody?p=P.requestBody:P.url&&(f=P.url))}return{projectID:i.$rootScope.project.id,url:f,target:m,method:b,headers:I,data:p,authDetails:O,isDirectCall:!w,isExtURL:e.serviceType===i.VARIABLE_CONSTANTS.SERVICE_TYPE.REST,withCredentials:T}},e.isFileUploadRequest=function(e){return"FileService"===e.service&&"uploadFile"===e.operation},e.excludePaginationParams=function(e){return c().map(c().reject(e,(function(e){return c().includes(i.VARIABLE_CONSTANTS.PAGINATION_PARAMS,e.name)})),(function(e){return e.name}))},e}()},"./src/util/variable/variables.utils.ts":
|
|
1832
|
+
(e,t,n)=>{"use strict";n.r(t),n.d(t,{ServiceVariableUtils:()=>h});var r=n(/*! ../../util/utils */"./src/util/utils.ts"),i=n(/*! ../../constants/variables.constants */"./src/constants/variables.constants.ts"),o=n(/*! ./variables.utils */"./src/util/variable/variables.utils.ts"),s=n(/*! ./../oAuth.utils */"./src/util/oAuth.utils.ts"),a=n(/*! ../../util/variable/pagination.utils */"./src/util/variable/pagination.utils.ts"),l=n(/*! lodash */"./node_modules/lodash/lodash.js"),c=n.n(l),u=function(e,t,n){var s=c().toLower((0,r.extractType)(c().get(t,"items.type")||t.type)),a=i.CONSTANTS.isStudioMode?t["x-WM-CONTENT_TYPE"]:t.contentType;if((0,o.isFileUploadSupported)())return"file"===s||"string"!==a&&a?c().isArray(n)&&"file"===s?c().forEach(n,(function(n){e.append(t.name,n&&n.content||(0,r.getBlob)(n),n.name)})):e.append(t.name,(0,r.getBlob)(n,a),n&&n.name):(c().isObject(n)&&(n=JSON.stringify(n)),e.append(t.name,n)),e},d=function(e,t,n){var i,s={},a=[];return c().forEach(t,(function(t){i=c().get(e,t.name),c().isUndefined(i)||""===i||null===i||t.readOnly?t.required&&a.push(t.name||t.id):(i=(0,r.isDateTimeType)(t.type)?(0,o.formatDate)(i,t.type,n.dateFormatter):i,c().isArray(i)&&"string"===c().toLower((0,r.extractType)(t.type))&&(i=c().join(i,",")),s[t.name]=i)})),{requestBody:s,missingParams:a}},h=function(){function e(){}return e.constructRequestParams=function(e,t,n,l){if(e=e||{},null===t)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.USER_UNAUTHORISED,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.USER_UNAUTHORISED,field:"_wmServiceOperationInfo"}};if(c().isEmpty(t))return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.METADATA_MISSING,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.METADATA_MISSING,field:"_wmServiceOperationInfo"}};if(t&&t.invalid)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.CRUD_OPERATION_MISSING,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.CRUD_OPERATION_MISSING,field:"_wmServiceOperationInfo"}};var h,p,f,m,g,v,y,b,_,w,x,S,k,E,T,C=t.directPath||"",D=t.basePath?t.basePath+t.relativePath:t.relativePath,M=function(e){return c().includes(["QueryExecution","ProcedureExecution"],e.controller)&&c().includes(["put","post"],e.operationType)}(e),A="",I={},L=[],O=null;function N(){return _||(_=new FormData)}if(k=c().get(t.securityDefinitions,"0"))switch(k.type){case i.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.OAUTH2:if(!(E=(0,s.getAccessToken)(k[i.VARIABLE_CONSTANTS.REST_SERVICE.OAUTH_PROVIDER_KEY],null)))return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_ACCESSTOKEN,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.NO_ACCESSTOKEN},securityDefnObj:k};I[i.VARIABLE_CONSTANTS.REST_SERVICE.AUTH_HDR_KEY]=i.VARIABLE_CONSTANTS.REST_SERVICE.PREFIX.AUTH_HDR_VAL.OAUTH+" "+E;break;case i.VARIABLE_CONSTANTS.REST_SERVICE.SECURITY_DEFN.BASIC:if(v=n.wm_auth_username,y=n.wm_auth_password,!v||!y)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.NO_CREDENTIALS,message:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.NO_CREDENTIALS},securityDefnObj:k};I[i.VARIABLE_CONSTANTS.REST_SERVICE.AUTH_HDR_KEY]=i.VARIABLE_CONSTANTS.REST_SERVICE.PREFIX.AUTH_HDR_VAL.BASIC+" "+btoa(v+":"+y),O={type:i.VARIABLE_CONSTANTS.REST_SERVICE.AUTH_TYPE.BASIC}}if(a.PaginationUtils.checkPaginationAtQuery(t,e,l),t.proxySettings=t.proxySettings||{web:!0,mobile:!1},b=t.httpMethod||t.methodType,w=t.proxySettings.mobile,T=t.proxySettings.withCredentials,f=w?D:C,c().forEach(t.parameters,(function(s){function a(){n?(x=n[s.name]&&c().isObject(n[s.name])?n[s.name]:n,S=c().get(t,["definitions",s.type])):(x=v||{},S=s.children)}var l,m,v=s.sampleValue;if((0,r.isDefined)(v)&&null!==v&&""!==v||M&&"file"!==s.type)switch(e.serviceType===i.VARIABLE_CONSTANTS.SERVICE_TYPE.DATA&&(0,r.isDateTimeType)(s.type)&&(v=(0,o.formatDate)(v,s.type,e.dateFormatter)),c().isArray(v)&&"string"===c().toLower((0,r.extractType)(s.type))&&e.serviceType===i.VARIABLE_CONSTANTS.SERVICE_TYPE.DATA&&(v=c().join(v,",")),s.parameterType.toUpperCase()){case"QUERY":if(c().isNull(v)&&(l=e.controller,m=e.serviceType,l===i.VARIABLE_CONSTANTS.CONTROLLER_TYPE.QUERY&&m===i.VARIABLE_CONSTANTS.SERVICE_TYPE.DATA))break;A?A+="&"+s.name+"="+encodeURIComponent(v):A="?"+s.name+"="+encodeURIComponent(v);break;case"PATH":g=new RegExp("\\s*\\{\\s*"+s.name+"(:\\.\\+)?\\s*\\}\\s*"),f=f.replace(g,v);break;case"HEADER":I[s.name]=v;break;case"BODY":M?(a(),h=d(x,S,e),p=h.requestBody,L=c().concat(L,h.missingParams)):p=v;break;case"FORMDATA":M&&s.name===i.SWAGGER_CONSTANTS.WM_DATA_JSON?(a(),h=d(x,S,e),p=u(N(),s,h.requestBody),L=c().concat(L,h.missingParams)):p=u(N(),s,v)}else s.required&&L.push(s.name||s.id)})),L.length)return{error:{type:i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_TYPE.REQUIRED_FIELD_MISSING,field:L.join(","),message:(0,r.replace)(i.VARIABLE_CONSTANTS.REST_SERVICE.ERR_MSG.REQUIRED_FIELD_MISSING,[L.join(",")]),skipDefaultNotification:!0}};c().includes(i.WS_CONSTANTS.NON_BODY_HTTP_METHODS,c().toUpper(b))||t.consumes&&t.consumes[0]===i.WS_CONSTANTS.CONTENT_TYPES.MULTIPART_FORMDATA||(I["Content-Type"]=t.consumes&&t.consumes[0]||"application/json"),c().includes(t.consumes,i.WS_CONSTANTS.CONTENT_TYPES.FORM_URL_ENCODED)&&!c().includes(i.WS_CONSTANTS.NON_BODY_HTTP_METHODS,(b||"").toUpperCase())?(A&&(p=(p?p+"&":"")+A.substring(1)),I["Content-Type"]=i.WS_CONSTANTS.CONTENT_TYPES.FORM_URL_ENCODED):f+=A,w&&(I=e.serviceType!==i.VARIABLE_CONSTANTS.SERVICE_TYPE.REST&&e.serviceType!==i.VARIABLE_CONSTANTS.SERVICE_TYPE.OPENAPI||t.skipCloakHeaders?I:function(e){var t={},n=i.VARIABLE_CONSTANTS.REST_SERVICE.UNCLOAKED_HEADERS,r=i.VARIABLE_CONSTANTS.REST_SERVICE.PREFIX.CLOAK_HEADER_KEY;return c().forEach(e,(function(e,i){c().includes(n,i.toUpperCase())?t[i]=e:t[r+i]=e})),t}(I),e.getPrefabName()&&-1!==i.VARIABLE_CONSTANTS.REST_SUPPORTED_SERVICES.indexOf(e.serviceType)?(f="prefabs/"+e.getPrefabName()+f,m="invokePrefabRestService"):e.getPrefabName()||(f="services"+f),f=i.$rootScope.project.deployedUrl+f);var R=a.PaginationUtils.getPaginationInfo(t,e);if(R&&e.pagination){var P=a.PaginationUtils.setPaginationAtReq(R,t,e,I,p,f,l);P&&(P.headers?I=P.headers:P.requestBody?p=P.requestBody:P.url&&(f=P.url))}return{projectID:i.$rootScope.project.id,url:f,target:m,method:b,headers:I,data:p,authDetails:O,isDirectCall:!w,isExtURL:e.serviceType===i.VARIABLE_CONSTANTS.SERVICE_TYPE.REST,withCredentials:T}},e.isFileUploadRequest=function(e){return"FileService"===e.service&&"uploadFile"===e.operation},e.isFileDeleteRequest=function(e){return"FileService"===e.service&&"deleteFile"===e.operation},e.excludePaginationParams=function(e){return c().map(c().reject(e,(function(e){return c().includes(i.VARIABLE_CONSTANTS.PAGINATION_PARAMS,e.name)})),(function(e){return e.name}))},e}()},"./src/util/variable/variables.utils.ts":
|
|
1833
1833
|
/*!**********************************************!*\
|
|
1834
1834
|
!*** ./src/util/variable/variables.utils.ts ***!
|
|
1835
1835
|
\**********************************************/
|