pacem 0.40.1 → 0.40.3
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.
- package/dist/css/pacem-dark-content.min.css +2 -2
- package/dist/css/pacem-dark-shell.min.css +2 -2
- package/dist/css/pacem-dark.min.css +2 -2
- package/dist/css/pacem-light-content.min.css +2 -2
- package/dist/css/pacem-light-shell.min.css +2 -2
- package/dist/css/pacem-light.min.css +2 -2
- package/dist/css/pacem-phousys-content.min.css +2 -2
- package/dist/css/pacem-phousys-shell.min.css +2 -2
- package/dist/css/pacem-phousys.min.css +2 -2
- package/dist/js/azure-maps.d.ts +2 -2
- package/dist/js/pacem-2d.d.ts +2 -2
- package/dist/js/pacem-2d.js +2 -2
- package/dist/js/pacem-2d.min.js +2 -2
- package/dist/js/pacem-3d.d.ts +2 -2
- package/dist/js/pacem-3d.js +2 -2
- package/dist/js/pacem-3d.min.js +2 -2
- package/dist/js/pacem-charts.d.ts +2 -2
- package/dist/js/pacem-charts.js +2 -2
- package/dist/js/pacem-charts.min.js +2 -2
- package/dist/js/pacem-cms.d.ts +2 -2
- package/dist/js/pacem-cms.js +2 -2
- package/dist/js/pacem-cms.min.js +2 -2
- package/dist/js/pacem-core.d.ts +2 -2
- package/dist/js/pacem-core.js +2 -2
- package/dist/js/pacem-core.min.js +2 -2
- package/dist/js/pacem-foundation.d.ts +2 -2
- package/dist/js/pacem-foundation.js +2 -2
- package/dist/js/pacem-foundation.min.js +2 -2
- package/dist/js/pacem-fx.d.ts +2 -2
- package/dist/js/pacem-fx.js +2 -2
- package/dist/js/pacem-fx.min.js +2 -2
- package/dist/js/pacem-logging.d.ts +2 -2
- package/dist/js/pacem-logging.js +2 -2
- package/dist/js/pacem-logging.min.js +2 -2
- package/dist/js/pacem-maps.d.ts +2 -2
- package/dist/js/pacem-maps.js +2 -2
- package/dist/js/pacem-maps.min.js +2 -2
- package/dist/js/pacem-media.d.ts +2 -2
- package/dist/js/pacem-media.js +2 -2
- package/dist/js/pacem-media.min.js +2 -2
- package/dist/js/pacem-networking.js +2 -2
- package/dist/js/pacem-networking.min.js +2 -2
- package/dist/js/pacem-numerical.d.ts +2 -2
- package/dist/js/pacem-numerical.js +2 -2
- package/dist/js/pacem-numerical.min.js +2 -2
- package/dist/js/pacem-plus.d.ts +2 -2
- package/dist/js/pacem-plus.js +2 -2
- package/dist/js/pacem-plus.min.js +2 -2
- package/dist/js/pacem-scaffolding.d.ts +2 -2
- package/dist/js/pacem-scaffolding.js +2 -2
- package/dist/js/pacem-scaffolding.min.js +2 -2
- package/dist/js/pacem-ui.d.ts +2 -2
- package/dist/js/pacem-ui.js +2 -2
- package/dist/js/pacem-ui.min.js +2 -2
- package/dist/js/swagger-types.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
7
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,r,n,s){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(e,r):s?s.value=r:t.set(e,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};!function(e){e.Arrays=class Arrays{static range(e,t,r=2){let n=e;const s=(t-e)/(r-1),a=[];if(s>0)for(;a.length<r;)a.push(n.roundoff()),n+=s;return a}static chunkify(t,r){if(e.NullChecker.isNullOrEmpty(t))return[];if(r<=0||r%1!=0)throw new Error("Provide a positive integer number.");const n=Math.ceil(t.length/r);return Array.from({length:n},((e,n)=>{const s=n*r,a=s+r;return t.slice(s,a)}))}}}(Pacem||(Pacem={})),function(e){const t=/^hsl\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)%\s*\)$/,r=/^hsla\s*\(\s*([\d\.]+)\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)%\s*,\s*([\d\.]+)\)$/,n=/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,s=/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\)$/,a=/^#[a-f0-9]{6}$/,i=/^#[a-f0-9]{3}$/;function o(t){return!e.NullChecker.isNullOrEmpty(t)&&"object"==typeof t&&"r"in t&&"g"in t&&"b"in t&&"number"==typeof t.r&&"number"==typeof t.b&&"number"==typeof t.g&&(t.a??=1,t.r>=0&&t.r<=1&&t.g>=0&&t.g<=1&&t.b>=0&&t.b<=1&&t.a>=0&&t.a<=1)}function c(t){return!e.NullChecker.isNullOrEmpty(t)&&"object"==typeof t&&"h"in t&&"s"in t&&"l"in t&&"number"==typeof t.h&&"number"==typeof t.s&&"number"==typeof t.l&&(t.a??=1,t.h>=0&&t.h<=360&&t.s>=0&&t.s<=1&&t.l>=0&&t.l<=1&&t.a>=0&&t.a<=1)}const l={adjustRgbChannel:e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),adjustRgbChannelInv:e=>e<=.00304?12.92*e:1.055*(Math.pow(e,1/2.4)-.055),adjustRgb:e=>({r:l.adjustRgbChannel(e.r),g:l.adjustRgbChannel(e.g),b:l.adjustRgbChannel(e.b),a:e.a}),adjustRgbInv:e=>({r:l.adjustRgbChannelInv(e.r),g:l.adjustRgbChannelInv(e.g),b:l.adjustRgbChannelInv(e.b),a:e.a}),X:e=>.4125*e.r+.3576*e.g+.1804*e.b,Y:e=>.2126*e.r+.7152*e.g+.0722*e.b,Z:e=>.0193*e.r+.1191*e.g+.9503*e.b,relativeLuminance:e=>{const t=l.adjustRgb(e);return l.Y(t)},rgbToCieXYZ:e=>{const t=l.adjustRgb(e);return{x:l.X(t),y:l.Y(t),z:l.Z(t),a:e.a}},cieXYZToRgb:e=>{const t=3.241*e.x-1.5374*e.y-.4986*e.z,r=-.9692*e.x+1.876*e.y+.0416*e.z,n=.0556*e.x-.204*e.y+1.057*e.z;return l.adjustRgbInv({r:t,g:r,b:n,a:e.a})},contrastRatio:(e,t)=>{const r=l.relativeLuminance(e)+.05,n=l.relativeLuminance(t)+.05;return r>n?r/n:n/r}};function u(t){return e.Strings.leftPad(t.toString(16),2,"0")}e.Colors=class Colors{static _clampRGB(e){const t=e=>Math.min(1,Math.max(0,e));return null==e[3]&&(e[3]=1),{r:t(e[0]),g:t(e[1]),b:t(e[2]),a:Math.min(1,Math.max(0,e[3]))}}static _normalize(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}static parse(e){if(e=(e||"").toLowerCase(),n.test(e)){let t=n.exec(e);return this._clampRGB(this._normalize([parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),1]))}if(s.test(e)){let t=s.exec(e);return this._clampRGB(this._normalize([parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]))}if(a.test(e)){let t=a.exec(e)[0];return this._clampRGB(this._normalize([parseInt("0x"+t.substr(1,2)),parseInt("0x"+t.substr(3,2)),parseInt("0x"+t.substr(5,2)),1]))}if(i.test(e)){let t=i.exec(e)[0],r=t.substr(1,1),n=t.substr(2,1),s=t.substr(3,1);return this._clampRGB(this._normalize([parseInt("0x"+r+r),parseInt("0x"+n+n),parseInt("0x"+s+s),1]))}if(t.test(e)){let r=t.exec(e);const n={h:parseFloat(r[1]),s:.01*parseFloat(r[2]),l:.01*parseFloat(r[3])};return this.rgb(n)}if(r.test(e)){let t=r.exec(e);const n={h:parseFloat(t[1]),s:.01*parseFloat(t[2]),l:.01*parseFloat(t[3]),a:parseFloat(t[4])};return this.rgb(n)}}static hsl(e){const t=function(e){const t=e.r,r=e.g,n=e.b;return.5*(Math.max(t,r,n)+Math.min(t,r,n))}(e),r=function(e,t){const r=e.r,n=e.g,s=e.b,a=Math.max(r,n,s),i=Math.min(r,n,s);return 0===t||1===t?0:(a-i)/(1-Math.abs(2*t-1))}(e,t),n=function(e){const t=e.r,r=e.g,n=e.b;return t>=r&&r>n?60*(r-n)/(t-n):r>t&&t>=n?60*(2-(t-n)/(r-n)):r>=n&&n>t?60*(2+(n-t)/(r-t)):n>r&&r>t?60*(4-(r-t)/(n-t)):n>t&&t>=r?60*(4+(t-r)/(n-r)):t>=n&&n>r?60*(6-(n-r)/(t-r)):void 0}(e);return{h:n,s:r,l:t,a:e.a}}static cieXYZ(e){return c(e)&&(e=this.rgb(e)),l.rgbToCieXYZ(e)}static rgb(e){if(!c(e))return l.cieXYZToRgb(e);{const t=e.h,r=e.s,n=e.l,s=t/60,a=(1-Math.abs(2*n-1))*r,i=a*(1-Math.abs(s%2-1)),o=n-a/2,c=(t,r,n)=>this._clampRGB([t+o,r+o,n+o,e.a]);if(s<=1)return c(a,i,0);if(s<=2)return c(i,a,0);if(s<=3)return c(0,a,i);if(s<=4)return c(0,i,a);if(s<=5)return c(i,0,a);if(s<=6)return c(a,0,i)}}static stringify(e,t=1){if(c(e)){t??=1,e.a??=1;const r="number"==typeof t?t:1;return`hsla(${e.h.roundoff(r)},${(100*e.s).roundoff(r)}%,${(100*e.l).roundoff(r)}%,${e.a.roundoff()})`}if(o(e)){t??=!0,e.a??=1;const r="boolean"==typeof t?t:!!t,n=Math.round(255*e.r),s=Math.round(255*e.g),a=Math.round(255*e.b),i=e.a.roundoff();return 1===i?r?("#"+u(n)+u(s)+u(a)).toUpperCase():`rgb(${n},${s},${a})`:`rgba(${n},${s},${a},${i})`}}static contrastRatio(e,t){return c(e)&&(e=this.rgb(e)),c(t)&&(t=this.rgb(t)),l.contrastRatio(e,t)}static lighten(e,t=.1){if(t||=0,c(e)){const r=Math.min(1,Math.max(0,e.l+t));return Object.assign({},e,{l:r})}if(o(e)){const r=this.lighten(this.hsl(e),t);return this.rgb(r)}return e}static darken(e,t=.1){return this.lighten(e,-t)}static saturate(e,t=.1){if(t||=0,c(e)){const r=Math.min(1,Math.max(0,e.s+t));return Object.assign({},e,{s:r})}if(o(e)){const r=this.saturate(this.hsl(e),t);return this.rgb(r)}return e}static desaturate(e,t=.1){return this.saturate(e,-t)}}}(Pacem||(Pacem={})),function(e){const t=/^\/Date\([\d]+\)\/$/i;class Dates{static parse(e){let r;return"string"==typeof e?(r=t.test(e)?parseInt(e.substring(6)):Date.parse(e),new Date(r)):"number"==typeof e?new Date(e):e}static isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}static daysInMonth(e,t){return[31,Dates.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]}static isDate(e){return e instanceof Date&&!isNaN(e.valueOf())}static dateOnly(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}static addMonths(e,t){let r=e.getDate(),n=new Date(e),s=n.getMonth()+t,a=0;for(;s<0;)s+=12,a--;return n.setDate(1),n.setMonth(s%12),n.setFullYear(n.getFullYear()+a+Math.floor(s/12)),n.setDate(Math.min(r,Dates.daysInMonth(n.getFullYear(),n.getMonth()))),n}static addDays(e,t){return new Date(e.valueOf()+864e5*t)}static daysBetween(e,t){return(t.valueOf()-e.valueOf())/864e5}}e.Dates=Dates}(Pacem||(Pacem={})),function(e){const t=/[-+]?[\d]+(\.[\d]+(e-[\d]+)?)?/g;function r(e){const r=[];let n=e.match(t);return n&&n.length>0&&n.forEach((e=>r.push(parseFloat(e)))),r}e.parseAsNumericalArray=r;class Size{static parse(e){let t=r(e);if(t&&4===t.length)return{width:t[0],height:t[1]};throw new Error(`Cannot parse "${e}" as a valid Size.`)}static isSize(e){return"object"==typeof e&&"width"in e&&"number"==typeof e.width&&"height"in e&&"number"==typeof e.height}}e.Size=Size;class Point{static parse(e){let t=r(e);if(t&&2===t.length)return{x:t[0],y:t[1]};throw new Error(`Cannot parse "${e}" as a valid Point.`)}static isPoint(e){return"object"==typeof e&&"x"in e&&"number"==typeof e.x&&"y"in e&&"number"==typeof e.y}static distance(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}static subtract(e,t){return{x:t.x-e.x,y:t.y-e.y}}static add(...e){var t={x:0,y:0};for(var r of e)t.x+=r.x,t.y+=r.y;return t}}e.Point=Point;class Rect{static parse(e){let t=r(e);if(t&&4===t.length)return{x:t[0],y:t[1],width:t[2],height:t[3]};throw new Error(`Cannot parse "${e}" as a valid Rect.`)}static isRect(e){return Point.isPoint(e)&&Size.isSize(e)}static _stretch(e,t){return{a:t.width/e.width,b:0,c:0,d:t.height/e.height,e:t.x-e.x,f:t.y-e.y}}static _contain(t,r,n,s){let a=1;a=t.width/t.height>=r.width/r.height?r.width/t.width:r.height/t.height;const i=t.width*a,o=t.height*a,c=this._align({x:t.x,y:t.y,width:i,height:o},r,n,s);return e.Matrix2D.translate({a:a,b:0,c:0,d:a,e:0,f:0},c)}static _cover(t,r,n,s){let a=1;a=t.width/t.height<r.width/r.height?r.width/t.width:r.height/t.height;const i=t.width*a,o=t.height*a,c=this._align({x:t.x,y:t.y,width:i,height:o},r,n,s);return e.Matrix2D.translate({a:a,b:0,c:0,d:a,e:0,f:0},c)}static _align(e,t,r,n){let s=0,a=0;switch(r){case"left":s=t.x-e.x;break;case"right":s=t.x+t.width-e.width-e.x;break;default:s=t.x+.5*t.width-.5*e.width-e.x}switch(n){case"top":a=t.y-e.y;break;case"bottom":a=t.y+t.height-e.height-e.y;break;default:a=t.y+.5*t.height-.5*e.height-e.y}return{x:s,y:a}}static findTransform(e,t,r="stretch",n="center",s="middle"){switch(r){case"contain":return this._contain(e,t,n,s);case"cover":return this._cover(e,t,n,s);default:return this._stretch(e,t)}}static intersect(...e){const t={x:0,y:0,height:0,width:0},r=Array.from(e||[]);if(r.length<=0)return t;for(var n=r[0],s=1;s<r.length;s++){const e=r[s],a=Math.max(e.x,n.x),i=Math.max(e.y,n.y),o=Math.min(e.x+e.width,n.x+n.width)-a,c=Math.min(e.y+e.height,n.y+n.height)-i;if(o<0||c<=0)return t;n={x:a,y:i,width:o,height:c}}return n}static expand(e,...t){const r=Array.from(t||[]);let n=e.x,s=e.y,a=n,i=s;Rect.isRect(e)&&(a+=e.width,i+=e.height);for(let e of r)n=Math.min(e.x,n),s=Math.min(e.y,s),a=Math.max(e.x,a),i=Math.max(e.y,i);return{x:n,y:s,width:a-n,height:i-s}}}e.Rect=Rect}(Pacem||(Pacem={})),function(e){var t,r,n,s;t=new WeakMap,r=new WeakMap,n=new WeakMap,s=new WeakMap,e.HistoryService=class HistoryService{constructor(e,a){t.set(this,[]),r.set(this,[]),n.set(this,void 0),s.set(this,void 0),__classPrivateFieldSet(this,s,e,"f"),__classPrivateFieldSet(this,n,a,"f")}get current(){return __classPrivateFieldGet(this,s,"f")}get canUndo(){return __classPrivateFieldGet(this,t,"f").length>0}get canRedo(){return __classPrivateFieldGet(this,r,"f").length>0}undo(){if(this.canUndo){const e=__classPrivateFieldGet(this,t,"f"),n=__classPrivateFieldGet(this,r,"f"),a=__classPrivateFieldGet(this,s,"f");n.unshift(a),__classPrivateFieldSet(this,s,e.pop(),"f")}}redo(){if(this.canRedo){const e=__classPrivateFieldGet(this,t,"f"),n=__classPrivateFieldGet(this,r,"f"),a=__classPrivateFieldGet(this,s,"f");e.push(a),__classPrivateFieldSet(this,s,n.shift(),"f")}}push(e){__classPrivateFieldGet(this,r,"f").splice(0),__classPrivateFieldGet(this,t,"f").push(__classPrivateFieldGet(this,s,"f")),__classPrivateFieldSet(this,s,e,"f");const a=__classPrivateFieldGet(this,n,"f"),i=__classPrivateFieldGet(this,t,"f");a>0&&i.length>a&&i.splice(0,i.length-a)}reset(){__classPrivateFieldGet(this,r,"f").splice(0),__classPrivateFieldGet(this,t,"f").splice(0)}}}(Pacem||(Pacem={})),function(e){class Matrix2D{static isIdentity(e){return 1===e.a&&1===e.d&&0===e.b&&0===e.f&&0===e.c&&0===e.e}static get identity(){return{a:1,b:0,c:0,d:1,e:0,f:0}}static copy(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}}static scale(e,t,r=t){return{a:e.a*t,b:e.b,c:e.c,d:e.d*r,e:e.e,f:e.f}}static translate(e,t){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e+t.x,f:e.f+t.y}}static rotate(e,t){const r=Math.cos(t),n=Math.sin(t);return Matrix2D.multiply(e,{a:r,b:n,c:-n,d:r,e:0,f:0})}static multiply(e,t){return"x"in e&&"y"in e?"number"==typeof t?{x:e.x*t,y:e.y*t}:{x:e.x*t.a+e.y*t.c+t.e,y:e.x*t.b+e.y*t.d+t.f}:"number"==typeof t?{a:e.a*t,b:e.b*t,c:e.c*t,d:e.d*t,e:e.e*t,f:e.f*t}:{a:e.a*t.a+e.b*t.c,b:e.a*t.b+e.b*t.d,c:e.c*t.a+e.d*t.c,d:e.c*t.b+e.d*t.d,e:e.e*t.a+e.f*t.c+t.e,f:e.e*t.b+e.f*t.d+t.f}}static det(e){return e.a*e.d-e.c*e.b}static invert(e){const t=this.det(e);if(0===t)return null;const r=1/t;return this.multiply({a:e.d,b:-e.c,c:-e.b,d:e.a,e:-e.e*e.d+e.c*e.f,f:e.e*e.b-e.a*e.f},r)}}e.Matrix2D=Matrix2D}(Pacem||(Pacem={})),function(e){class NullChecker{static isNull(e){return null==e}static isEmpty(t){try{return Array.isArray(t)&&0===t.length||"string"==typeof t&&""===t||"object"==typeof t&&0===Object.keys(t).length&&!e.Dates.isDate(t)&&!(t instanceof RegExp)}catch(e){return!1}}static isNullOrEmpty(e){return NullChecker.isNull(e)||NullChecker.isEmpty(e)}}e.NullChecker=NullChecker}(Pacem||(Pacem={})),Number.prototype.isCloseTo=function(e,t=14){return this.toFixed(t)===e.toFixed(t)},Number.prototype.roundoff=function(e=14){return parseFloat(this.toFixed(e))},function(e){e.Numbers=class Numbers{static round(e,t=1){return Math.round(e/t)*t}static log(e,t){return Math.log10(e)/Math.log10(t)}static rebase(e,t,r){const n=e.toString(),s=parseInt(n,t);return n.endsWith(s.toString(t))?parseInt(e.toString(),t).toString(r):Number.NaN.toString()}}}(Pacem||(Pacem={})),function(e){e.Strings=class Strings{static leftPad(e,t,r){let n=e.toString();for(;n.length<t;)n=r+n;return n}static format(t,...r){const n=Array.from(r);let s=t;for(let e=0;e<n.length;e++){const t=new RegExp("(^|[^\\{])\\{"+e+"\\}($|[^\\}])","g");s=s.replaceAll(t,((t,...r)=>t.replace("{"+e+"}",n[e])))}const a=/(^|[^\{}])\{(\d+)\}($|[^\}])/.exec(s);if(!e.NullChecker.isNullOrEmpty(a))throw new Error(`Missing argument at index ${a[2]}.`);return s}}}(Pacem||(Pacem={})),function(e){!function(e){class LexerClass{tokenize(e,t){const r=[];for(;e;){const n=e.length;for(let n of t){const t=n.exec(e,this),s=t?.length;if(s>0){Array.prototype.push.apply(r,t);const n=t[s-1];e=e.substr((n.index||0)+n.raw.length);break}}if(e.length>=n)throw new Error(`Cannot parse\n"${e}"\n using the provided grammar.`)}return r}}e.Parser=class Parser{constructor(e=new LexerClass){this._lexer=e}parse(e,t,r){const n=this._lexer.tokenize(e,t);return r.render(n)}}}(e.Compile||(e.Compile={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){function r(e){return(e??"").replace(/</g,"<")}function n(e){return e?.index||void 0}function s(e){return e?.replace(/[^\w]+/g," ").trim().replace(/ +/g,"-").toLowerCase()}function a(e,t,r){const n=t.exec(e);return n&&n.length?r(n):null}const i=/(<!--)([\s\S]*?)(-->|$)/,o=/^ {0,3}(={3,}|_{3,}|-{3,})(\r?\n|$)/,c=/^ {0,3}(#{1,6})\s+([^\n]+)(\r?\n|$)+/,l=/^ {0,3}([^\n]+)(\r?\n=+(\r?\n|$))+/,u=/^ {0,3}([^\n]+)(\r?\n-+(\r?\n|$))+/,h=/^ {4,}.+(\r?\n {4,}.+)*(\r?\n|$)+/,d=/^ {0,3}``` *([^\n]*)\r?\n(([\s\S](?!\r?\n {0,3}```))*.(\r?\n)+) {0,3}```(\r?\n|$)+/,p=/^ {0,3}> *([^\n]+)(\r?\n {0,3}> *([^\n]*))*(\r?\n|$)+/,f=/^( {0,3}([-+]).*\r?\n|$)((?!(?: {0,3}(?:\d+[.\)]|\r?\n\S))).*(\r?\n|$))*/,g=/^( {0,3}(\d+[.\)]).*\r?\n|$)((?!(?: {0,3}(?:[+-]|\r?\n\S))).*(\r?\n|$))*/,m=/^(?:[-+*]|\d+[.\)])/m,y=/^(?! {4,})(.+(\n(?! {0,3}```)(?! {0,3}([-+]|\d+[.\)]))(?! {4,})(?! {0,3}>).+)*)/,x=/^ {0,3}(!?)\[([^\]]+)\]: +(\S+)(?: +['"\(](.+)['"\)])?(\r?\n|$)+/,b=/!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?(\[[^\[\]]*\]|\([^\(\)]*\))?/,k=/(\*\*?|__?)(\[[^\]]*]\([^\)]+\))\1/,w=/(?:(?<!\\)`)(.+?)(?:(?<!\\)`)/,_=/(\*\*?|__?)((?!\1\s?)(?:(?!\1)[\S\s])*[^\s])\1/,$=/(~~?|__?)(?!\1\s?)([^\s][\s\S]*?(?!\1)[^\s])\1/,C=/(:")(?!":\s?)([^\s][\s\S]*?(?!":)[^\s])":/,P=/^\s+/,v=/ {2,}\r?\n/,M=/^[^\r\n]+/;let R,L;function S(t=[]){const S={[L.Comment]:{exec:(e,t)=>a(e,i,(r=>{const s=n(r),a=[{type:R.Html,index:s,raw:r[0],text:r[2]}];if(s>0){const r=e.substr(0,s),n=t.tokenize(r,A);Array.prototype.unshift.apply(a,n)}return a}))},[L.Reference]:{exec:e=>a(e,x,(e=>{const t=n(e),r=e[0],s=r,a="!"===e[1],i=e[2],o=e[3],c=e[4];return[{type:R.Reference,index:t,raw:r,text:s,id:i,image:a,url:o,title:c}]}))}},N=[],z=[],I={};for(let e of t){let t,r="inline";switch("type"in e?(r=e.type,t=e.rule):t=e,r){case"block":N.push(t);break;case"code":if("lang"in e){const r=e.lang.toLowerCase();(I[r]=I[r]||[]).push(t)}break;default:const r={exec:(e,r)=>{const n=t.exec(e,r);return O(e,n,r),n}};z.push(r)}}const F={[L.Text]:{exec:e=>a(e,M,(e=>{const t=e[0],r=t;return[{index:n(e),raw:t,text:r,type:R.Text}]}))},[L.Space]:{exec:e=>a(e,P,(e=>{const t=e[0];return[{type:R.Space,raw:t,text:t}]}))}},E={[L.ImageOrLink]:{exec:(t,r)=>B(t,b,r,(t=>{const a=n(t),i=t[0],o="!"===i.charAt(0),c=t[1],l=function(t){if(!(e.NullChecker.isNullOrEmpty(t)||/^\[/.test(t)&&/\]$/.test(t)))return/^\(/.test(t)&&/\)$/.test(t)&&(t=t.substr(1,t.length-2)),t}(t[2]),u=s(function(t){if(!(e.NullChecker.isNullOrEmpty(t)||/^\(/.test(t)&&/\)$/.test(t)))return/^\[/.test(t)&&/\]$/.test(t)&&(t=t.substr(1,t.length-2)),t}(t[2])??c);return o?[{index:a,type:l?R.Image:R.ImageLike,raw:i,text:c,src:l,ref:u,tokens:r.tokenize(c,H)}]:[{index:a,type:l?R.Link:R.LinkLike,raw:i,text:c,href:l,ref:u,tokens:r.tokenize(c,H)}]}))},[L.Code]:{exec:(e,t)=>B(e,w,t,(e=>{const t=r(e[1]);return[{type:R.Code,raw:e[0],text:t,index:n(e)}]}))},[L.EmphasizedLink]:{exec:(t,r)=>B(t,k,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=t[1].length>1?R.Bold:R.Italic,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[L.Emphasize]:{exec:(t,r)=>B(t,_,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=t[1].length>1?R.Bold:R.Italic,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[L.StrikeThrough]:{exec:(t,r)=>B(t,$,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=R.StrikeThrough,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[L.Quote]:{exec:(t,r)=>B(t,C,r,(t=>{if(t.length<3||e.NullChecker.isNullOrEmpty(t[2]))return null;const s=R.Quote,a=t[2];return[{index:n(t),type:s,raw:t[0],text:a,tokens:r.tokenize(a,H)}]}))},[L.LineBreak]:{exec:(e,t)=>B(e,v,t,(e=>{const t=e[0],r=t;return[{index:n(e),raw:t,text:r,type:R.LineBreak}]}))}},O=(e,t,r)=>{const n=t?.length>0&&t[0].index;if(n>0){const s=e.substr(0,n),a=r.tokenize(s,H)||[];Array.prototype.unshift.apply(t,a)}},B=(e,t,r,n)=>{const s=a(e,t,(r=>{if(t!=w){const t=w.exec(e);if(t&&t.length&&t.index<r.index)return null}return n(r)}));return O(e,s,r),s},H=Object.values(E);Array.prototype.push.apply(H,z),H.push(F[L.Text],F[L.Space]);const j=e=>{const t=[F[L.Text],F[L.Space]],r=e?.toLowerCase()||"";return r&&r in I&&Array.prototype.unshift.apply(t,I[r]),t},D={[L.Paragraph]:{exec:(e,t)=>a(e,y,(e=>{const r=e[0],n=r;return[{type:R.Paragraph,raw:r,text:n,tokens:t.tokenize(n,H)}]}))},[L.Space]:F[L.Space]},T=(e,t)=>{const r=/^ {0,3}(`{3,}|$|>|[+-]\s|\d+[.\)])/m.test(e)?A:H;return t.tokenize(e,r)},G={[L.HorizontalRule]:{exec:(e,t)=>a(e,o,(e=>{const t=e[0],r=t;return[{type:R.HorizontalRule,raw:t,text:r}]}))},[L.Heading]:{exec:(e,t)=>a(e,c,(e=>{const r=e[2];return[{type:R.Heading,raw:e[0],text:r,level:e[1].length,ref:s(r),tokens:t.tokenize(r,H)}]}))},[L.Heading1]:{exec:(e,t)=>a(e,l,(e=>{const r=e[1];return[{type:R.Heading,raw:e[0],text:r,level:1,ref:s(r),tokens:t.tokenize(r,H)}]}))},[L.Heading2]:{exec:(e,t)=>a(e,u,(e=>{const r=e[1];return[{type:R.Heading,raw:e[0],text:r,level:2,ref:s(r),tokens:t.tokenize(r,H)}]}))},[L.CodeBlock]:{exec:(e,t)=>a(e,h,(e=>{const n=e[0],s=r(n);return[{type:R.CodeBlock,raw:n,text:s,tokens:t.tokenize(s,[])}]}))},[L.Fences]:{exec:(e,t)=>a(e,d,(e=>{const n=r(e[2]),s=e[1]?.toLowerCase();return[{type:R.CodeBlock,raw:e[0],text:n,lang:s,tokens:t.tokenize(n,j(s))}]}))},[L.BlockQuote]:{exec:(e,t)=>a(e,p,(e=>{const r=e[0],n=r.replace(/^ {0,3}> */gm,"");return[{type:R.BlockQuote,raw:r,text:n,tokens:t.tokenize(n,[D[L.Paragraph],D[L.Space]])}]}))},[L.OrderedList]:{exec:(t,r)=>a(t,g,(t=>{const n=t[0],s=n.replace(/^ {0,3}/gm,"").split(m).filter((t=>!e.NullChecker.isNullOrEmpty(t))).map((e=>e.trim()));return[{type:R.OrderedList,start:parseInt(/\d/.exec(t[0])[0]),raw:n,text:n,tokens:s.map((e=>({type:R.ListItem,raw:e,text:e,tokens:T(e,r)})))}]}))},[L.UnorderedList]:{exec:(t,r)=>a(t,f,(t=>{const n=t[0],s=n.replace(/^ {0,3}/gm,"").split(m).filter((t=>!e.NullChecker.isNullOrEmpty(t))).map((e=>e.trim()));return[{type:R.UnorderedList,raw:n,text:n,tokens:s.map((e=>({type:R.ListItem,raw:e,text:e,tokens:T(e,r)})))}]}))}},A=Object.values(G);return Array.prototype.push.apply(A,N),A.push(D[L.Paragraph],D[L.Space]),[S[L.Comment],S[L.Reference]].concat(A)}!function(e){e.Html="html",e.Text="text",e.Paragraph="paragraph",e.BlockQuote="blockquote",e.Space="space",e.Heading="heading",e.Bold="bold",e.Italic="italic",e.CodeBlock="codeblock",e.Code="code",e.Image="img",e.ImageLike="imglike",e.Link="link",e.LinkLike="linklike",e.LineBreak="br",e.StrikeThrough="strike",e.Quote="quote",e.HorizontalRule="hr",e.OrderedList="ol",e.UnorderedList="ul",e.ListItem="listitem",e.Reference="ref"}(R||(R={})),function(e){e[e.Comment=0]="Comment",e[e.Reference=1]="Reference",e[e.HorizontalRule=2]="HorizontalRule",e[e.Heading=3]="Heading",e[e.Heading1=4]="Heading1",e[e.Heading2=5]="Heading2",e[e.CodeBlock=6]="CodeBlock",e[e.Fences=7]="Fences",e[e.BlockQuote=8]="BlockQuote",e[e.OrderedList=9]="OrderedList",e[e.UnorderedList=10]="UnorderedList",e[e.Paragraph=11]="Paragraph",e[e.EmphasizedLink=12]="EmphasizedLink",e[e.ImageOrLink=13]="ImageOrLink",e[e.Emphasize=14]="Emphasize",e[e.StrikeThrough=15]="StrikeThrough",e[e.Quote=16]="Quote",e[e.Code=17]="Code",e[e.LineBreak=18]="LineBreak",e[e.Text=254]="Text",e[e.Space=255]="Space"}(L||(L={}));const N=/[ \r\n]*\0+[ \r\n]*/g;class HtmlRenderer{constructor(t=((e,t)=>e?.text||"")){this._extraItemRender=t,this._renderContent=t=>{const r=t.tokens;return e.NullChecker.isNullOrEmpty(r)?t.text:this._render(r)}}_rendeItem(e,t){const r=this._renderContent,n="\0";switch(e?.type){case R.Reference:return"";case R.Html:return e.raw;case R.BlockQuote:return`<blockquote>\n${r(e)}</blockquote>${n}`;case R.Bold:return`<b>${r(e)}</b>`;case R.CodeBlock:const s=e.lang;return`<pre>${n}<code${s?' class="'+s+'"':""}>${r(e)}</code>${n}</pre>${n}`;case R.Code:return`<code>${r(e)}</code>`;case R.HorizontalRule:return`<hr />${n}`;case R.Heading:const a=e.level;return`<h${a} id="${e.ref}">${r(e)}</h${a}>${n}`;case R.Image:case R.ImageLike:const i=e;let o=i.src,c="";const l=i.text,u=i.ref;if(!o&&u){const e=t.find((e=>e.type===R.Reference&&!0===e.image&&e.id?.toLowerCase()===u.toLowerCase()));e&&(o=e.url,c=e.title??"")}return o?`<img src="${o}" alt="${l}"${c?' title="'+c+'"':""} />`:`![${r(e)}]`;case R.Italic:return`<i>${r(e)}</i>`;case R.StrikeThrough:return`<s>${r(e)}</s>`;case R.Quote:return`<q>${r(e)}</q>`;case R.LineBreak:return"<br />\0";case R.OrderedList:return`<ol start="${e.start}">\n${r(e)}</ol>${n}`;case R.UnorderedList:return`<ul>\n${r(e)}</ul>${n}`;case R.ListItem:return`\t<li>${r(e)}</li>${n}`;case R.Link:case R.LinkLike:const h=e;let d=h.href,p="";const f=h.ref;if(!d&&f){const e=t.find((e=>e.type===R.Reference&&!0!==e.image&&e.id?.toLowerCase()===f.toLowerCase()));e&&(d=e.url,p=e.title??"")}return d?`<a href="${d}"${p?' title="'+p+'"':""}>${r(e)}</a>`:`[${r(e)}]`;case R.Paragraph:return`<p>${r(e)}</p>${n}`;case R.Text:case R.Space:return e.text}return this._extraItemRender(e,t)}_render(e){let t="";for(let r of e||[])t+=this._rendeItem(r,e);return t}render(e){return t=this._render(e),t?.replace(N,"\n").trim();var t}}class TokenRenderer{_render(t){return e.NullChecker.isNullOrEmpty(t)?"":JSON.stringify(t)}render(t){return"["+t.filter((t=>!e.NullChecker.isNullOrEmpty(t))).map(this._render).join(",")+"]"}}class Parser extends e.Compile.Parser{toHtml(t,r,n){const s=new HtmlRenderer(n);return e.NullChecker.isNullOrEmpty(r)?this.parse(t,s):this.parse(t,S(r),s)}tokenize(e,t){const r=this.parse(e,S(t),new TokenRenderer);return JSON.parse(r)}parse(e,t=S(),r=new HtmlRenderer){return(n=t)&&"object"==typeof n&&"function"==typeof n.render?super.parse(e,S(),t):super.parse(e,t,r);var n}}t.Parser=Parser}(t.Markdown||(t.Markdown={}))}(e.Compile||(e.Compile={}))}(Pacem||(Pacem={}));
|
package/dist/js/pacem-fx.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
/// <reference path="pacem-core.d.ts" />
|
|
7
7
|
/// <reference path="pacem-ui.d.ts" />
|
package/dist/js/pacem-fx.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
package/dist/js/pacem-fx.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__decorate=this&&this.__decorate||function(t,e,s,i){var r,a=arguments.length,n=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(n=(a<3?r(n):a>3?r(e,s,n):r(e,s))||n);return a>3&&n&&Object.defineProperty(e,s,n),n},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,s,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,s):r?r.value=s:e.set(t,s),s},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)};!function(t){!function(e){!function(s){class PacemFxElement extends e.PacemEventTarget{}__decorate([t.Watch({converter:t.PropertyConverters.Element})],PacemFxElement.prototype,"target",void 0),s.PacemFxElement=PacemFxElement}(e.Fx||(e.Fx={}))}(t.Components||(t.Components={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const s=t.PCSS+"-fancy",i=t.PCSS+"-fancify";let r=class PacemFxFancyElement extends e.PacemFxElement{constructor(){super(...arguments),this._progress=0,this._started=!1}get progress(){return this._progress}get started(){return this._started}propertyChangedCallback(e,s,i,r){super.propertyChangedCallback(e,s,i,r),"fancify"!==e&&"target"!==e||t.Utils.isNull(this.target)||(this.fancify?this.start():this._reset())}viewActivatedCallback(){super.viewActivatedCallback(),this.fancify&&!t.Utils.isNull(this.target)&&this.start()}disconnectedCallback(){cancelAnimationFrame(this._handle),clearTimeout(this._handle1),t.Utils.isNull(this.target)||this._reset(),super.disconnectedCallback()}_reset(){t.Utils.removeClass(this.target,s),this._started&&this.dispatchEvent(new t.PropertyChangeEvent({propertyName:"started",oldValue:this._started,currentValue:this._started=!1})),this.dispatchEvent(new t.PropertyChangeEvent({propertyName:"progress",oldValue:this._progress,currentValue:this._progress=0})),t.Utils.isNull(this._originalContent)?this._originalContent=this.target.innerHTML:this.target.innerHTML=this._originalContent}_parse(){let t,e=[],s=document.createTreeWalker(this.target,NodeFilter.SHOW_TEXT);for(;t=s.nextNode();)t.textContent&&e.push(t);this._textNodes=e}start(){this.disabled||(this._reset(),this._parse(),this._startShow(),this._handle1=setTimeout((()=>{this.dispatchEvent(new t.PropertyChangeEvent({propertyName:"started",oldValue:this._started,currentValue:this._started=!0}))}),this.delay||0))}_startShow(e=0){t.Utils.addClass(this.target,s);const i=this._textNodes,r=i.length;this._fancify(i[e]);const a=this._progress;e++;const n=this._progress=e/r;this.dispatchEvent(new t.PropertyChangeEvent({propertyName:"progress",oldValue:a,currentValue:n})),e<r&&(this._handle=requestAnimationFrame((()=>{this._startShow(e)})))}_fancify(e){const s=e.textContent;if(t.Utils.isNullOrEmpty(s)||!/[^\s]/.test(s))return;const r=/^\s/.test(s),a=/\s$/.test(s);e.textContent="";const n=s.trim().split(" "),o=this.gap||20,l=this.delay||0;let h=0;for(let t of n){var c=document.createElement("span");c.className=i,c.style.animationDelay=`${l+h*o}ms`,(r||h>0)&&e.parentElement.insertBefore(document.createTextNode(" "),e),c.textContent=t,e.parentElement.insertBefore(c,e),h++}a&&e.parentElement.insertBefore(document.createTextNode(" "),e)}};__decorate([t.Watch({converter:t.PropertyConverters.Boolean})],r.prototype,"fancify",void 0),__decorate([t.Watch({converter:t.PropertyConverters.Number})],r.prototype,"delay",void 0),__decorate([t.Watch({converter:t.PropertyConverters.Number})],r.prototype,"gap",void 0),r=__decorate([t.CustomElement({tagName:t.P+"-fx-fancy"})],r),e.PacemFxFancyElement=r}(e.Fx||(e.Fx={}))}(t.Components||(t.Components={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const s=t.PCSS+"-hero",i={convert:e=>e.trim().startsWith("#")?t.PropertyConverters.Element.convert(e):t.PropertyConverters.Json.convert(e)};let r=class PacemFxHeroElement extends e.PacemFxElement{propertyChangedCallback(e,s,i,r){super.propertyChangedCallback(e,s,i,r),"target"!==e||t.Utils.isNull(s)||this._resetTarget(s),"from"===e&&this.hero&&!t.Utils.isNull(i)&&(this._originalState=this._computeFromState()),"hero"!==e&&"target"!==e&&"goal"!==e||t.Utils.isNull(this.target)||(this.hero?this.start():this.reset())}viewActivatedCallback(){super.viewActivatedCallback(),this.hero&&!t.Utils.isNull(this.target)&&this.start()}disconnectedCallback(){t.Utils.isNull(this.target)||this.reset(),super.disconnectedCallback()}_computeFromState(){const e=this.target,s=t.Utils.offset(e);if(this.from instanceof Element){let e=t.Utils.offset(this.from);return{x:e.left,y:e.top,width:e.width,height:e.height}}return{x:s.left,y:s.top,width:s.width,height:s.height}}_resetTarget(e=this.target){const i=e.style;i.top=i.left=i.height=i.width="";for(let t=0;t<i.length;t++){let e=i.item(t);i[e]=""}for(let t in this._originalStyle)i[t]=this._originalStyle[t];t.Utils.removeClass(e,s)}reset(){if(!t.Utils.isNull(this._originalState)&&!t.Utils.isNull(this._targetState))return this.dispatchEvent(new Event("exiting")),this._animate(this._targetState,this._originalState).then((()=>{this._resetTarget(),this.dispatchEvent(new Event("exited"))}))}start(){if(!this.disabled&&!t.Utils.isNull(this.target)){let e;if(this.to instanceof Element){let s=t.Utils.offset(this.to);e={x:s.left,y:s.top,width:s.width,height:s.height}}else e=this.to;const i=this.target,r=t.Utils.windowSize,a=e||{x:0,y:0,width:r.width,height:r.height},n=i.style;this._targetState=a;let o=this._originalState=this._computeFromState();this._originalStyle={};for(let t=0;t<n.length;t++){let e=n.item(t);this._originalStyle[e]=n[e]}return t.Utils.addClass(i,s),this.dispatchEvent(new Event("entering")),this._animate(o,a).then((()=>{this.dispatchEvent(new Event("entered"))}))}return Promise.resolve()}_animate(e,s){const i=this.target,r=i.style,a=e.width/s.width,n=e.height/s.height,o=e.x-s.x+"px",l=e.y-s.y+"px";return r.transformOrigin="0 0",r.transition="none",r.transform=`translate(${o}, ${l}) scale(${a}, ${n})`,r.width=s.width+"px",r.height=s.height+"px",r.top=s.y+"px",r.left=s.x+"px",requestAnimationFrame((()=>{let t=this.duration||200;r.transition=`transform cubic-bezier(0.445, 0.05, 0.55, 0.95) ${t}ms, opacity ${t}ms`,r.transform="translate(0, 0) scale(1)"})),t.Utils.waitForAnimationEnd(i,210)}};__decorate([t.Watch({converter:t.PropertyConverters.Boolean})],r.prototype,"hero",void 0),__decorate([t.Watch({converter:i,emit:!1})],r.prototype,"to",void 0),__decorate([t.Watch({converter:i,emit:!1})],r.prototype,"from",void 0),__decorate([t.Watch({converter:t.PropertyConverters.Number,emit:!1})],r.prototype,"duration",void 0),r=__decorate([t.CustomElement({tagName:t.P+"-fx-hero"})],r),e.PacemFxHeroElement=r}(e.Fx||(e.Fx={}))}(t.Components||(t.Components={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const s=t.PCSS+"-fx-list";let i=class PacemFxListElement extends e.PacemFxElement{constructor(){super(...arguments),this._observed=t=>{const e=Array.from(this.target.children);for(let s of t)s.removedNodes.forEach((t=>{t instanceof Element&&this.dispatchEvent(new CustomEvent("itemremoved",{detail:t}))})),s.addedNodes.forEach(((t,s)=>{t instanceof Element&&this.dispatchEvent(new CustomEvent("itemadded",{detail:{item:t,index:e.indexOf(t)}}))}))}}viewActivatedCallback(){super.viewActivatedCallback(),t.Utils.isNull(this.target)||this._setup()}disconnectedCallback(){t.Utils.isNull(this._observer)||this._observer.disconnect(),super.disconnectedCallback()}propertyChangedCallback(t,e,s,i){super.propertyChangedCallback(t,e,s,i),"target"===t&&(e?this._reset(e):this._setup())}_reset(e){t.Utils.removeClass(e,s),this._observer.disconnect()}_setup(){const e=this.target;t.Utils.addClass(e,s);(this._observer=new MutationObserver(this._observed)).observe(e,{childList:!0})}};i=__decorate([t.CustomElement({tagName:t.P+"-fx-list"})],i),e.PacemFxListElement=i}(e.Fx||(e.Fx={}))}(t.Components||(t.Components={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(s){var i;function r(e){return`${t.PCSS}-fx-pulse-${e}`}let a=class PacemFxPulseElement extends s.PacemFxElement{constructor(){super(),i.set(this,void 0),this._resizeHandler=t=>{this._pulse(t.detail)},__classPrivateFieldSet(this,i,t.Utils.uniqueCode(),"f")}viewActivatedCallback(){super.viewActivatedCallback(),this._pulse()}disconnectedCallback(){t.Utils.isNull(this._sheet)||(this._sheet.remove(),this._sheet=null),super.disconnectedCallback()}propertyChangedCallback(t,e,s,i){super.propertyChangedCallback(t,e,s,i),"disabled"!==t||i||this._pulse()}_pulse(e=this._resize.currentSize){const s=t.Utils.isNull(this.target)||t.Utils.isNull(e)||!(e.height>0)||!(e.width>0);if(this._resize.disabled=this.disabled,this.disabled||s)return void t.Utils.addClass(this,"pulse-off");t.Utils.removeClass(this,"pulse-off");const a=e,n=getComputedStyle(this.target),o=this.style,l=Math.max(a.width,a.height);o.width=l+"px",o.height=l+"px",o.top=a.top+.5*(a.height-l)+"px",o.left=a.left+.5*(a.width-l)+"px";const h=this._rect1,c=this._rect2,d=h.style,p=c.style;this._sheet=function(e,s,i="0",a=i){const n="style#"+e,o=document.querySelector(n);if(t.Utils.isNull(o)){const t=document.createElement("style");t.id=e,document.head.appendChild(t)}const l=document.querySelector(n),h=s.width,c=s.height,d=Math.max(h,c),p=.5*(d-h),m=.5*(d-c);l.sheet.insertRule(`@keyframes ${r(e)} {\n 0%{\n opacity: .25; stroke-thickness: 0; rx: ${i}; ry: ${a}; x: ${p}px; y: ${m}px; width: ${s.width}px; height: ${s.height}px;\n }\n 50%{\n width: ${s.width}px; height: ${s.height}px; transform: scale(1); stroke-width: 10px; rx: ${i}; ry: ${a}; opacity: .333; x: ${p}px; y: ${m}px; width: ${h}px; height: ${c}px;\n }\n 80%{\n stroke-width: 10px;\n }\n 100%{\n opacity: 0; rx: 50%; ry: 50%; transform: scale(2); stroke-width: 0; width: ${d}px; height: ${d}px; x: 0; y: 0\n }\n}`,0);for(let t=l.sheet.rules.length-1;t>0;t--)l.sheet.deleteRule(t);return l}(__classPrivateFieldGet(this,i,"f"),e,n.borderTopLeftRadius);const m=r(__classPrivateFieldGet(this,i,"f"));d.animation=p.animation=`${m} both cubic-bezier(0.37, 0, 0.63, 1) 1.25s infinite`,p.animationDelay=".175s"}};i=new WeakMap,__decorate([t.ViewChild(t.P+"-resize")],a.prototype,"_resize",void 0),__decorate([t.ViewChild("svg")],a.prototype,"_svg",void 0),__decorate([t.ViewChild("svg > rect[rect1]")],a.prototype,"_rect1",void 0),__decorate([t.ViewChild("svg > rect[rect2]")],a.prototype,"_rect2",void 0),a=__decorate([t.CustomElement({tagName:t.P+"-fx-pulse",shadow:t.Defaults.USE_SHADOW_ROOT,template:`<${t.P}-resize target="{{ :host.target }}" watch-position="true" on-${e.ResizeEventName}=":host._resizeHandler($event)"></${t.P}-resize>\n<svg class="pulse" xmlns="http://www.w3.org/2000/svg">\n <rect rect1 /><rect rect2 />\n</svg>`})],a),s.PacemFxPulseElement=a}(e.Fx||(e.Fx={}))}(t.Components||(t.Components={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(s){const i="ripple";let r=class PacemFxRippleElement extends s.PacemFxElement{constructor(){super(...arguments),this._lock=!1,this._remove=!1,this._rippleHandler=s=>{if(this.disabled||this.target instanceof e.PacemEventTarget&&this.target.disabled)return;if(s instanceof MouseEvent&&0!==s.button)return;const i=t.Utils.offset(this.target),r=getComputedStyle(this.target),a=this.style;a.top=i.top+"px",a.left=i.left+"px",a.width=i.width+"px",a.height=i.height+"px",a.borderRadius=r.borderRadius;const n="touchstart"===s.type?s.touches[0]:s,o={x:n.pageX,y:n.pageY},l={x:i.left,y:i.top},h={x:i.left+i.width,y:i.top},c={x:i.left,y:i.top+i.height},d={x:h.x,y:c.y},p=Math.max(t.Point.distance(o,l),t.Point.distance(o,h),t.Point.distance(o,d),t.Point.distance(o,c)),m=this._wave;m.style.left=o.x-i.left-p+"px",m.style.top=o.y-i.top-p+"px",m.style.width=m.style.height=2*p+"px",t.Utils.addAnimationEndCallback(m,(()=>{this._lock=!1,this._tryRemove()})),this._lock=!0,t.Utils.addClass(m,"ripple-go")},this._unrippleHandler=t=>{this._remove=!0,this._tryRemove()}}propertyChangedCallback(e,s,i,r){super.propertyChangedCallback(e,s,i,r),"target"===e&&(t.Utils.isNull(s)||this._reset(s),t.Utils.isNull(i)||this._set(i))}viewActivatedCallback(){super.viewActivatedCallback(),t.Utils.isNull(this.target)||this._set()}disconnectedCallback(){t.Utils.isNull(this.target)||this._reset(),super.disconnectedCallback()}_tryRemove(){!this._lock&&this._remove&&(this._remove=!1,t.Utils.removeClass(this._wave,"ripple-go"))}_set(t=this.target){t.addEventListener("mousedown",this._rippleHandler,!1),t.addEventListener("touchstart",this._rippleHandler,!1),t.addEventListener("touchend",this._unrippleHandler,!1),t.addEventListener("mouseup",this._unrippleHandler,!1),t.addEventListener("mousemove",this._unrippleHandler,!1)}_reset(t=this.target){t.removeEventListener("mousedown",this._rippleHandler,!1),t.removeEventListener("touchstart",this._rippleHandler,!1),t.removeEventListener("touchend",this._unrippleHandler,!1),t.removeEventListener("mouseup",this._unrippleHandler,!1),t.removeEventListener("mousemove",this._unrippleHandler,!1)}};__decorate([t.ViewChild("."+i)],r.prototype,"_wave",void 0),r=__decorate([t.CustomElement({tagName:t.P+"-fx-ripple",shadow:t.Defaults.USE_SHADOW_ROOT,template:`<div class="${i}"></div>`})],r),s.PacemFxRippleElement=r}(e.Fx||(e.Fx={}))}(t.Components||(t.Components={}))}(Pacem||(Pacem={}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
/// <reference path="pacem-core.d.ts" />
|
|
7
7
|
declare namespace Pacem.Components.Logging {
|
package/dist/js/pacem-logging.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__decorate=this&&this.__decorate||function(e,t,o,n){var r,a=arguments.length,c=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(c=(a<3?r(c):a>3?r(t,o,c):r(t,o))||c);return a>3&&c&&Object.defineProperty(t,o,c),c};!function(e){!function(t){!function(o){const n={error:!0,info:!0,warn:!0};let r=class PacemConsoleElement extends t.PacemEventTarget{constructor(){super(...arguments),this._config=n}propertyChangedCallback(t,o,r,a){super.propertyChangedCallback(t,o,r,a),"configuration"===t&&(this._config=e.Utils.extend({},r||{},n))}log(e,t,o){try{this._log(e,t,o)}catch(e){}}_log(t,o,n){if(!this.disabled&&!0===this._config[t]){n!==this._category&&(e.Utils.isNullOrEmpty(this._category)||console.groupEnd(),e.Utils.isNullOrEmpty(n)||console.group(n),this._category=n);var r=e=>{};switch(t){case e.Logging.LogLevel.Debug:r=console.debug;break;case e.Logging.LogLevel.Error:r=console.error;break;case e.Logging.LogLevel.Info:r=console.info;break;case e.Logging.LogLevel.Trace:r=console.trace;break;case e.Logging.LogLevel.Warn:r=console.warn;break;case e.Logging.LogLevel.Log:r=console.log}r((new Date).toISOString()+": "+o)}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],r.prototype,"configuration",void 0),r=__decorate([e.CustomElement({tagName:e.P+"-console"})],r),o.PacemConsoleElement=r}(t.Logging||(t.Logging={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(o){const n={current:0,count:0,average:0,max:Number.MIN_VALUE,min:Number.MAX_VALUE};class PacemTrackerElement extends t.PacemEventTarget{constructor(){super(),this.data=n}propertyChangedCallback(e,t,o,n){super.propertyChangedCallback(e,t,o,n),"entry"===e&&this._update(o).then((e=>this.data=e))}_update(t){return e.Utils.fromResultAsync((()=>{const e=this.data,o=Math.min(t,e.min),n=Math.max(t,e.max),r=e.count+1;return{count:r,min:o,max:n,average:(e.count*e.average+t)/r,current:t}}))}reset(){this.data=n}}__decorate([e.Watch({converter:e.PropertyConverters.Json})],PacemTrackerElement.prototype,"data",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],PacemTrackerElement.prototype,"entry",void 0),__decorate([e.Concurrent()],PacemTrackerElement.prototype,"_update",null),o.PacemTrackerElement=PacemTrackerElement}(t.Logging||(t.Logging={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){let o=class PacemFpsElement extends t.PacemTrackerElement{constructor(){super()}_start(e=Date.now()){this._handle=requestAnimationFrame((()=>{const t=Date.now(),o=t-e;this.entry=Math.min(60,1e3/o),this._start(t)}))}viewActivatedCallback(){super.viewActivatedCallback(),this._start()}disconnectedCallback(){cancelAnimationFrame(this._handle),super.disconnectedCallback()}};o=__decorate([e.CustomElement({tagName:e.P+"-fps"})],o),t.PacemFpsElement=o}(t.Logging||(t.Logging={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={}));
|
package/dist/js/pacem-maps.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
/// <reference path="pacem-core.d.ts" />
|
|
7
7
|
/// <reference path="azure-maps.d.ts" />
|
package/dist/js/pacem-maps.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__decorate=this&&this.__decorate||function(e,t,o,a){var n,s=arguments.length,i=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,o,a);else for(var r=e.length-1;r>=0;r--)(n=e[r])&&(i=(s<3?n(i):s>3?n(t,o,i):n(t,o))||i);return s>3&&i&&Object.defineProperty(t,o,i),i},__awaiter=this&&this.__awaiter||function(e,t,o,a){return new(o||(o=Promise))((function(n,s){function i(e){try{l(a.next(e))}catch(e){s(e)}}function r(e){try{l(a.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,r)}l((a=a.apply(e,t||[])).next())}))},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,o,a){if("a"===o&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?a:"a"===o?a.call(e):a?a.value:t.get(e)};!function(e){!function(t){!function(o){o.MapConsts={MAP_SELECTOR:e.P+"-map",LINK_SELECTOR:e.P+"-map-link",MARKER_SELECTOR:e.P+"-map-marker",POLYLINE_SELECTOR:e.P+"-map-polyline",CIRCLE_SELECTOR:e.P+"-map-circle",LAYER_SELECTOR:e.P+"-map-layer",DEFAULT_COORDS:{lat:44.71418802507798,lng:10.296516444873811}};const a="defaultMapTarget",n={convert:e=>{const t=/^\s*([+\-\d\.]+)\s*,?\s*([+\-\d\.]+)\s*$/.exec(e);return t&&t.length>2?{lat:parseFloat(t[1]),lng:parseFloat(t[2])}:JSON.parse(e)},convertBack:e=>JSON.stringify(e)};o.MapUtils=class MapUtils{static parseCoords(t){if(t&&!isNaN(t.lat)&&!isNaN(t.lng))return[t.lat,t.lng];if(e.Utils.isArray(t)&&t.length>1)return[t[0],t[1]];if(/^\s*(\+|-)?[\d]+(.[\d]+)?\s*,\s*(\+|-)?[\d]+(.[\d]+)?\s*$/.test(t)){var a=t.split(",");return[parseFloat(a[0]),parseFloat(a[1])]}return[o.MapConsts.DEFAULT_COORDS.lat,o.MapConsts.DEFAULT_COORDS.lng]}static expandBounds(e,t){t&&(Array.isArray(t)||(t=[t.lat,t.lng]),e.push(t))}static isContentEmpty(e){return 0==e.children.length}};class MapRelevantElement extends t.PacemEventTarget{get map(){return this._map=this._map||e.CustomElementUtils.findAncestorOfType(this,r)}viewActivatedCallback(){super.viewActivatedCallback(),this.map&&this.map.register(this)}disconnectedCallback(){this.map&&this.map.unregister(this),super.disconnectedCallback()}}__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],MapRelevantElement.prototype,"hide",void 0),o.MapRelevantElement=MapRelevantElement;class PacemMapAdapterElement extends t.PacemEventTarget{updateMapElement(e,t,o){var a,n;const s=t.lat,i=t.lng;e.zoom=o,s==(null===(a=e.center)||void 0===a?void 0:a.lat)&&i==(null===(n=e.center)||void 0===n?void 0:n.lng)||(e.center={lat:s,lng:i})}}o.PacemMapAdapterElement=PacemMapAdapterElement;class MapEvent extends e.CustomTypedEvent{constructor(e,t){super(e,t)}}o.MapEvent=MapEvent;let s=class PacemMapMarkerElement extends MapRelevantElement{onDragEnd(e){this.position=e,this.dispatchEvent(new MapEvent("dragend",{position:e}))}onInfoOpen(){this.dispatchEvent(new MapEvent("openinfo"))}onInfoClose(){this.dispatchEvent(new MapEvent("closeinfo"))}};__decorate([e.Watch({converter:n})],s.prototype,"position",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Json})],s.prototype,"icon",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],s.prototype,"caption",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],s.prototype,"draggable",void 0),s=__decorate([e.CustomElement({tagName:o.MapConsts.MARKER_SELECTOR})],s),o.PacemMapMarkerElement=s;let i=class PacemMapLayerElement extends MapRelevantElement{};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],i.prototype,"url",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Json})],i.prototype,"include",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],i.prototype,"mode",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"minZoom",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],i.prototype,"maxZoom",void 0),i=__decorate([e.CustomElement({tagName:o.MapConsts.LAYER_SELECTOR})],i),o.PacemMapLayerElement=i;let r=class PacemMapElement extends t.PacemEventTarget{constructor(){super(...arguments),this.zoom=12,this.center=o.MapConsts.DEFAULT_COORDS,this.scale=!0,this.mousewheel=!0,this.draggable=!0,this.doubleClickZoom=!0,this.keyboardShortcuts=!0,this.autofit=!0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this._drawHandler=e=>{this._draw(e.target)},this._initialized=!1,this._afterInit=(t,o)=>{for(var a of(this._initialized=!0,e.CustomElementUtils.findDescendants(this,(e=>e instanceof MapRelevantElement))))this._erase(a,o),this._draw(a);null==o||o.destroy(this)},this._resizeHandler=e=>{this.onResize(e)}}get container(){return this._container}register(t){t.addEventListener(e.PropertyChangeEventName,this._drawHandler,!1),this._draw(t)}unregister(t){this._erase(t),t.removeEventListener(e.PropertyChangeEventName,this._drawHandler,!1)}_draw(e,t=this.adapter){this._initialized&&t&&t.drawItem(e)}_erase(e,t=this.adapter){this._initialized&&t&&t.removeItem(e)}propertyChangedCallback(t,o,a,n){if(super.propertyChangedCallback(t,o,a,n),"adapter"===t)e.Utils.isNull(this._container)||(this._initialized=!1,this.adapter.initialize(this).then((e=>this._afterInit(e,o))));else{switch(t){case"zoom":case"center":this.adapter&&this.adapter.setView(a);break;case"autofit":a&&this.adapter&&this.adapter.fitBounds();break;case"target":o&&this._dismissContainer(o),a?(this._setupContainer(a),this._setupResizer()):this._dismissResizer()}this.adapter&&this.adapter.invalidateSize()}}_dismissContainer(t=this._container){"true"===t.dataset[a]?t.remove():e.Utils.removeClass(t,e.PCSS+"-map"),t===this._container&&(this._container=null)}_dismissResizer(){const e=this._resizer;e.removeEventListener("resize",this._resizeHandler,!1),e.remove(),this._resizer=null}_setupContainer(t=this.target){e.Utils.isNull(t)&&((t=document.createElement("div")).dataset[a]="true",this.insertAdjacentElement("afterend",t));const o=this._container=t;return e.Utils.addClass(o,e.PCSS+"-map"),o}_setupResizer(){const t=this._container;if(e.Utils.isNull(t))throw new Error("You must set up the map container before its resizing listener.");if(e.Utils.isNull(this._resizer)){const o=this._resizer=document.createElement(e.P+"-resize");o.addEventListener("resize",this._resizeHandler,!1),t.insertAdjacentElement("afterend",o)}return this._resizer.target=t,this._resizer}viewActivatedCallback(){super.viewActivatedCallback(),this._setupContainer(),this.adapter&&this.adapter.initialize(this).then(this._afterInit)}disconnectedCallback(){e.Utils.isNull(this._container)||this._dismissContainer(),e.Utils.isNull(this._resizer)||this._dismissResizer(),super.disconnectedCallback()}onResize(e){this.adapter&&this.adapter.invalidateSize()}};__decorate([e.Watch({emit:!0,converter:e.PropertyConverters.Number})],r.prototype,"zoom",void 0),__decorate([e.Watch({emit:!0,converter:n})],r.prototype,"center",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],r.prototype,"scale",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],r.prototype,"mousewheel",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],r.prototype,"zoomControl",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],r.prototype,"draggable",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],r.prototype,"doubleClickZoom",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],r.prototype,"keyboardShortcuts",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],r.prototype,"autofit",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],r.prototype,"paddingTop",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],r.prototype,"paddingLeft",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],r.prototype,"paddingRight",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],r.prototype,"paddingBottom",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],r.prototype,"adapter",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],r.prototype,"target",void 0),r=__decorate([e.CustomElement({tagName:o.MapConsts.MAP_SELECTOR})],r),o.PacemMapElement=r}(t.Maps||(t.Maps={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){const o="//webapi.amap.com/maps",a="//webapi.amap.com/ui/1.1/main.js?v=1.1.1",n={getLocation:e=>(Array.isArray(e)&&(e={lat:e[0],lng:e[1]}),[e.lng,e.lat]),getLngLat(e){const t=n.getLocation(e);return new AMap.LngLat(t[0],t[1])},getPosition(e){switch(e.toLowerCase()){case"topleft":return"lt";case"bottomleft":return"lb";case"bottomright":return"rb";default:return"rt"}},getLang(e){switch(e){case"zh-cn":return"zh_cn";case"zh-en":return"zh_en";default:return"en"}},expandBounds(t,o){var a=t.getSouthWest(),n=t.getNorthEast();const s=e.Utils.isArray(o)?new AMap.LngLat(o[0],o[1]):o,i=s.getLat(),r=s.getLng();return a.lat>i&&(a=new AMap.LngLat(a.lng,i)),a.lng>r&&(a=new AMap.LngLat(r,a.lat)),n.lat<i&&(n=new AMap.LngLat(n.lng,i)),n.lng<r&&(n=new AMap.LngLat(r,n.lat)),new AMap.Bounds(a,n)}};class PacemAMapMarkerAdapter{constructor(e){this.map=e,this.markers=new Map,this.infoWindows=new Map}_onDragEnd(e,t){const o=this.markers.get(e).getPosition(),a={lat:o.lat,lng:o.lng};e.onDragEnd(a)}_onInfo(e){e.onInfoOpen()}_onClose(e){e.onInfoClose()}drawMarker(t){var o=this;if(!e.Utils.isNull(o.map.map))if(e.Utils.isNull(t&&t.position))o.map.removeItem(t);else{var a;if(o.markers.has(t)?a=o.markers.get(t):((a=new AMap.Marker({position:[0,0],map:o.map.map})).on("click",(e=>o.openInfoWindow(t,e))),a.on("drag",(()=>o.map.fitBounds(!0))),a.on("dragend",(e=>o._onDragEnd(t,e))),o.markers.set(t,a)),a.setPosition(n.getLocation(t.position)),"string"==typeof t.icon)a.setIcon(t.icon);else if(!e.Utils.isNull(t.icon)){const o={image:t.icon.url};e.Utils.isNullOrEmpty(t.icon.size)||(o.size=o.imageSize=new AMap.Size(t.icon.size.width,t.icon.size.height),a.setAnchor("bottom-center")),a.setIcon(new AMap.Icon(o)),e.Utils.isNullOrEmpty(t.icon.anchor)||(a.setAnchor("top-left"),a.setOffset(new AMap.Pixel(-t.icon.anchor.x,-t.icon.anchor.y)))}a.setLabel({content:t.caption,offset:[0,0],direction:"ltr"}),a.setDraggable(t.draggable)}}closeInfoWindow(e,t){const o=this;if(o.infoWindows.has(e)){const t=o.infoWindows.get(e);t.getIsOpen()&&t.close()}}openInfoWindow(o,a){var n=this,s=n.markers.get(o),i=o.caption;if(t.MapUtils.isContentEmpty(o)||(i=o.innerHTML),!e.Utils.isNullOrEmpty(i)){var r;if(n.infoWindows.has(o))r=n.infoWindows.get(o);else{let e=s.getSize()[1];(r=new AMap.InfoWindow({anchor:"bottom-center",offset:[0,-e]})).on("close",(function(){n._onClose(o)})),n.infoWindows.set(o,r)}r.setContent(i);const e=s.getPosition(),t=[e.getLng(),e.getLat()];r.open(n.map.map,t,0),n._onInfo(o)}}}const s=["zoomend","moveend","dragend"];let i=class PacemAMapAdapterElement extends t.PacemMapAdapterElement{popupInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.openInfoWindow(e)}popoutInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.closeInfoWindow(e)}snapshot(e,t="image/png",o){throw new Error("Method not implemented.")}constructor(){super(),this._mapUpdateHandler=t=>{const o=this._map,a=this._container;e.Utils.isNull(o)||e.Utils.isNull(a)||this.updateMapElement(a,o.getCenter(),o.getZoom())},this._shapes=new Map,this._markersAdapter=new PacemAMapMarkerAdapter(this)}invalidateSize(){const e=this._map;e&&e.emit("resize")}destroy(e){s.forEach((e=>{this._map.on(e,this._mapUpdateHandler)})),this._map.destroy()}initialize(i){return __awaiter(this,void 0,void 0,(function*(){const r=this.apiVersion||"2.0",l=this.apiKey||"";yield e.CustomElementUtils.importjs(o+"?v="+r+"&key="+l),yield e.CustomElementUtils.importjs(a);const p=this._container=i;if(e.Utils.isNull(AMap))return;var d=p.scale,c=p.draggable,m=p.doubleClickZoom,h=p.keyboardShortcuts;const g=t.MapUtils.parseCoords(p.center),u={center:n.getLocation(g),scrollWheel:p.mousewheel,animateEnable:!0,dragEnable:c,keyboardEnable:h,doubleClickZoom:m,zoomEnable:d,viewMode:"2D",zoom:p.zoom,langForeign:n.getLang(e.Utils.lang(i)),layers:[AMap.createDefaultLayer()]};var _=p.container,f=document.createElement("div");f.style.width="100%",f.style.height="100%",_.innerHTML="",_.appendChild(f);const v=this._map=new AMap.Map(f,u);return window.AMapUI.loadUI(["control/BasicControl"],(e=>{p.zoomControl&&v.addControl(new e.Zoom({position:n.getPosition(p.zoomControl)}))})),v.on("complete",(()=>{i.dispatchEvent(new t.MapEvent("maploaded"))}),v,!0),s.forEach((e=>{v.on(e,this._mapUpdateHandler)})),f}))}drawItem(e){if(e instanceof t.PacemMapMarkerElement){var o=this._markersAdapter,a=o.drawMarker(e);o.markers.has(e)||o.markers.set(e,a)}this.fitBounds(!0)}removeItem(o){if(o instanceof t.PacemMapMarkerElement){var a=this._markersAdapter,n=a.markers.get(o);e.Utils.isNull(n)||(n.setMap(null),a.markers.delete(o))}this.fitBounds(!0)}get map(){return this._map}setView(t,o){const a=this._map;if(!e.Utils.isNull(a))if("number"==typeof t)a.setZoom(t);else{const e=n.getLngLat(t);a.setCenter(e),o&&a.setZoom(o)}}fitBounds(t){if(!this.map)return;const o=this._container;if(!o.autofit&&!0===t)return;const a=this._markersAdapter.markers,s=this._shapes,i=this._map;if(a.size||s.size){var r=null,l=0;for(var p of a.keys()){let t=a.get(p);if(e.Utils.isNull(t))continue;const o=t.getPosition();o&&(r=e.Utils.isNull(r)?new AMap.Bounds(o,o):n.expandBounds(r,o),l++)}for(var d of s.keys()){var c=s.get(d).getBounds();const e=c.getSouthWest(),t=c.getNorthEast();r=n.expandBounds(r,e),r=n.expandBounds(r,t),l+=2}if(l>=2){const e=this._padBounds(r);i.setBounds(e)}else 1==l&&(i.setCenter(r.getCenter()),i.setZoom(o.zoom))}else i.setCenter(n.getLocation(o.center)),i.setZoom(o.zoom)}_padBounds(e){const t=this._container,o=t.paddingTop||0,a=t.paddingLeft||0,s=t.paddingRight||0,i=t.paddingBottom||0,r=this._map;if(a||o||s||i){const t=e.getNorthWest(),d=e.getSouthEast(),c=r.lngLatToPixel(d),m=r.lngLatToPixel(t);var l=r.pixelToLngLat(new AMap.Pixel(m.x-a,m.y-o)),p=r.pixelToLngLat(new AMap.Pixel(c.x+s,c.y+i));e=n.expandBounds(e,l),e=n.expandBounds(e,p)}return e}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],i.prototype,"apiKey",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],i.prototype,"apiVersion",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-map-adapter-amap"})],i),t.PacemAMapAdapterElement=i}(t.Maps||(t.Maps={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){var o;const a=1e3,n="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.js",s="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.css";class AtlasMapUtils{static getPosition(e){return Array.isArray(e)&&(e={lat:e[0],lng:e[1]}),atlas.data.Position.fromLatLng(e)}static getBounds(e){return atlas.data.BoundingBox.fromPositions(e.map((e=>[e[1],e[0]])))}static getLatLng(e){return{lat:e[1],lng:e[0]}}}class PacemAzureMarkerAdapter{constructor(e){this.map=e,this.markers=new Map}_onDragEnd(e,t){var o=t.target.getOptions().position;e.onDragEnd(AtlasMapUtils.getLatLng(o))}_onInfo(e){e.onInfoOpen()}_onClose(e){e.onInfoClose()}drawMarker(t){var o,a=this;if(e.Utils.isNull(a.map.map))return;if(e.Utils.isNull(t&&t.position))return void a.map.removeItem(t);var n=AtlasMapUtils.getPosition(t.position);if(a.markers.has(t))o=a.markers.get(t);else{o=new atlas.HtmlMarker;const e=a.map.map;e.markers.add(o,n),e.events.add("click",o,(e=>a.openInfoWindow(t,e))),e.events.add("drag",o,(()=>a.map.fitBounds(!0))),e.events.add("dragend",o,(e=>a._onDragEnd(t,e))),a.markers.set(t,o)}let s={position:n,pixelOffset:[0,-36]},i={position:n,draggable:t.draggable,popup:new atlas.Popup},r=(e,t,o)=>`<img width="${t||"auto"}" height="${o||"auto"}" style="pointer-events: none" src="${e}" />`;if("string"==typeof t.icon)i.htmlContent=r(t.icon);else if(!e.Utils.isNull(t.icon)){const e=t.icon.size,o=t.icon.anchor;i.htmlContent=r(t.icon.url,e&&e.width,e&&e.height),o?(i.anchor="top-left",i.pixelOffset=[-o.x,-o.y],s.pixelOffset=[0,-o.y]):e&&e.height&&(s.pixelOffset=[0,-e.height/2])}i.popup.setOptions(s),i.text=t.caption,o.setOptions(i)}closeInfoWindow(e,t){var o=((null==t?void 0:t.target)||this.markers.get(e)).getOptions().popup;o&&o.isOpen()&&o.close()}openInfoWindow(o,a){var n=this,s=(null==a?void 0:a.target)||n.markers.get(o),i=o.caption,r=s.getOptions().popup;r&&(t.MapUtils.isContentEmpty(o)||(i=o.innerHTML),e.Utils.isNullOrEmpty(i)||(r.setOptions({content:`<div style="padding: 24px;">${i}</div>`}),s.togglePopup(),n._onInfo(o),n.map.map.events.addOnce("close",r,(e=>{r.setOptions({content:""}),n._onClose(o)}))))}}const i=["moveend","dragend","zoomend","rotateend"];let r=class PacemAzureMapAdapterElement extends t.PacemMapAdapterElement{popupInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.openInfoWindow(e)}popoutInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.closeInfoWindow(e)}constructor(){super(),o.set(this,new WeakMap),this._mapUpdateHandler=e=>{this._updateMap()},this._shapes=new Map,this._markersAdapter=new PacemAzureMarkerAdapter(this)}snapshot(t,a="image/png",n){return new Promise(((s,i)=>{e.Utils.blobToDataURL(__classPrivateFieldGet(this,o,"f").get(t)).then((t=>{const o=this._map.getCanvasContainer();o.style.backgroundImage=`url(${t})`,o.style.backgroundSize="contain",e.Utils.snapshotElement(o,null,a,n).then(s)}))}))}setView(t,o){const a=this._map;if(!e.Utils.isNull(a)){const e=a.getCamera();"number"==typeof t?a.setCamera({zoom:t,center:e.center}):a.setCamera({position:AtlasMapUtils.getPosition(t),zoom:o||e.zoom})}}get map(){return this._map}destroy(e){const t=this._map;i.forEach((e=>{t.events.remove(e,this._mapUpdateHandler)})),t.dispose()}initialize(a){return __awaiter(this,void 0,void 0,(function*(){yield Promise.all([e.CustomElementUtils.importjs(n),e.CustomElementUtils.importcss(s,void 0,!0)]);const r=this._container=a;var l=r.scale,p=r.draggable,d=r.doubleClickZoom,c=r.keyboardShortcuts,m={center:AtlasMapUtils.getPosition(r.center),zoom:r.zoom,subscriptionKey:this.subscriptionKey,dragPanInteraction:p,scrollZoomInteraction:r.mousewheel,dblClickZoomInteraction:!d,keyboardInteraction:c,language:e.Utils.lang(a)},h=r.container,g=document.createElement("div");g.id=`azure-maps-${e.Utils.uniqueCode()}`,g.style.width="100%",g.style.height="100%",h.innerHTML="",h.appendChild(g);var u=this._map=new atlas.Map(g.id,m);return l&&r.zoomControl&&u.events.addOnce("ready",(e=>{let t=atlas.ControlPosition.NonFixed;switch(r.zoomControl){case"topleft":t=atlas.ControlPosition.TopLeft;break;case"topright":t=atlas.ControlPosition.TopRight;break;case"bottomright":t=atlas.ControlPosition.BottomRight;break;case"bottomleft":t=atlas.ControlPosition.BottomLeft}u.controls.add(new atlas.control.ZoomControl,{position:t})})),i.forEach((e=>{u.events.add(e,this._mapUpdateHandler)})),u.events.add("idle",(e=>{u.getCanvas().toBlob((e=>{__classPrivateFieldGet(this,o,"f").set(a,e)}))})),u.events.addOnce("ready",(()=>{a.dispatchEvent(new t.MapEvent("maploaded"))})),g}))}invalidateSize(){this.map&&this.map.resize()}removeItem(o){if(o instanceof t.PacemMapMarkerElement){var a=this._markersAdapter,n=a.markers.get(o);e.Utils.isNull(n)||(this.map.markers.remove(n),a.markers.delete(o))}this.fitBounds(!0)}drawItem(e){if(e instanceof t.PacemMapMarkerElement){var o=this._markersAdapter,a=o.drawMarker(e);o.markers.has(e)||o.markers.set(e,a)}this.fitBounds(!0)}_updateMap(){const t=this._map,o=this._container;if(!e.Utils.isNull(t)&&!e.Utils.isNull(o)){const e=t.getCamera(),a=e.center,n=e.zoom;1===e.zoom?console.warn("Azure Maps control lacks in reflecting the actual map zoom onto the camera property. Cannot reflect info back to PacemMapElement."):this.updateMapElement(o,AtlasMapUtils.getLatLng(a),n)}}fitBounds(o){if(this.map){var a=this._container;if(a.autofit||!0!==o){var n=this._markersAdapter.markers,s=this._shapes;if(n.size||s.size){var i=[];for(var r of n.keys()){let o=n.get(r);e.Utils.isNull(o)||t.MapUtils.expandBounds(i,AtlasMapUtils.getLatLng(o.getOptions().position))}for(var l of s.keys()){var p=s.get(l).getBounds();t.MapUtils.expandBounds(i,AtlasMapUtils.getLatLng(atlas.data.BoundingBox.getSouthWest(p))),t.MapUtils.expandBounds(i,AtlasMapUtils.getLatLng(atlas.data.BoundingBox.getNorthEast(p)))}var d=a.paddingTop||0,c=a.paddingLeft||0,m=a.paddingRight||0,h=a.paddingBottom||0;i.length>=2?this._map.setCamera({bounds:AtlasMapUtils.getBounds(i),padding:{top:d,bottom:h,left:c,right:m}}):1===i.length&&this._map.setCamera({center:AtlasMapUtils.getPosition(i[0]),zoom:a.zoom})}else this._map.setCamera({center:AtlasMapUtils.getPosition(a.center),zoom:a.zoom})}}}};o=new WeakMap,__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],r.prototype,"subscriptionKey",void 0),__decorate([e.Debounce(500)],r.prototype,"_updateMap",null),__decorate([e.Debounce(a)],r.prototype,"fitBounds",null),r=__decorate([e.CustomElement({tagName:e.P+"-map-adapter-azure"})],r),t.PacemAzureMapAdapterElement=r}(t.Maps||(t.Maps={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){const o=1e3,a="https://maps.googleapis.com/maps/api/js";class GMapsUtils{static getPosition(e){return Array.isArray(e)&&(e={lat:e[0],lng:e[1]}),e}}class PacemGoogleMarkerAdapter{constructor(e){this.map=e,this.markers=new Map,this.infoWindows=new Map}_onDragEnd(e,t){const o=this.markers.get(e).getPosition(),a={lat:o.lat(),lng:o.lng()};e.onDragEnd(a)}_onInfo(e){e.onInfoOpen()}_onClose(e){e.onInfoClose()}drawMarker(t){var o=this;if(!e.Utils.isNull(o.map.map))if(e.Utils.isNull(t&&t.position))o.map.removeItem(t);else{var a;if(o.markers.has(t)?a=o.markers.get(t):((a=new google.maps.Marker({position:{lat:0,lng:0},map:o.map.map})).addListener("click",(e=>o.openInfoWindow(t,e))),a.addListener("drag",(()=>o.map.fitBounds(!0))),a.addListener("dragend",(e=>o._onDragEnd(t,e))),o.markers.set(t,a)),a.setPosition(GMapsUtils.getPosition(t.position)),"string"==typeof t.icon)a.setIcon(t.icon);else if(!e.Utils.isNull(t.icon)){let o={url:t.icon.url};e.Utils.isNullOrEmpty(t.icon.size)||(o.size=new google.maps.Size(t.icon.size.width,t.icon.size.height),o.anchor=new google.maps.Point(t.icon.size.width/2,t.icon.size.height)),e.Utils.isNullOrEmpty(t.icon.anchor)||(o.anchor=new google.maps.Point(t.icon.anchor.x,t.icon.anchor.y)),a.setIcon(o)}a.setLabel(t.caption),a.setDraggable(t.draggable)}}closeInfoWindow(e,t){const o=this;if(o.infoWindows.has(e)){o.infoWindows.get(e).close()}}openInfoWindow(o,a){var n,s,i,r,l=this,p=l.markers.get(o),d=o.caption;if(t.MapUtils.isContentEmpty(o)||(d=o.innerHTML),!e.Utils.isNullOrEmpty(d)){var c;if(l.infoWindows.has(o))c=l.infoWindows.get(o);else{let t=0;"string"==typeof o.icon||e.Utils.isNull(o.icon)||(t=null!==(r=(null!==(s=null===(n=o.icon.size)||void 0===n?void 0:n.width)&&void 0!==s?s:0)/2-(null===(i=o.icon.anchor)||void 0===i?void 0:i.x))&&void 0!==r?r:0),(c=new google.maps.InfoWindow({pixelOffset:new google.maps.Size(-t,0)})).addListener("closeclick",(function(){l._onClose(o)})),l.infoWindows.set(o,c)}c.setContent(d),c.open(l.map.map,p),l._onInfo(o)}}}const n=["dragend","zoom_changed"];let s=class PacemGoogleMapAdapterElement extends t.PacemMapAdapterElement{popupInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.openInfoWindow(e)}popoutInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.closeInfoWindow(e)}constructor(){super(),this._listeners=[],this._mapUpdateHandler=()=>{const t=this._map,o=this._container;if(!e.Utils.isNull(t)&&!e.Utils.isNull(o)){const e=t.getCenter();this.updateMapElement(o,{lat:e.lat(),lng:e.lng()},t.getZoom())}},this._shapes=new Map,this._markersAdapter=new PacemGoogleMarkerAdapter(this)}snapshot(t,o="image/png",a){return e.Utils.snapshotElement(this._map.getDiv(),null,o,a)}setView(t,o){const a=this._map;e.Utils.isNull(a)||("number"==typeof t?a.setZoom(t):(a.setCenter(t),o&&a.setZoom(o)))}get map(){return this._map}propertyChangedCallback(e,t,o,a){super.propertyChangedCallback(e,t,o,a),this.invalidateSize()}destroy(e){const t=this._listeners;for(;t.length;)google.maps.event.removeListener(t.pop())}initialize(o){return __awaiter(this,void 0,void 0,(function*(){yield e.CustomElementUtils.importjs(a+"?key="+this.apiKey);const s=this._container=o;if(e.Utils.isNull(google&&google.maps))return;var i=s.scale,r=s.draggable,l=s.doubleClickZoom,p=s.keyboardShortcuts;const d=t.MapUtils.parseCoords(s.center);var c=new google.maps.LatLng(d[0],d[1]),m={zoomControl:i&&!e.Utils.isNullOrEmpty(s.zoomControl),zoomControlOptions:{position:function(e){switch(e){case"topright":return google.maps.ControlPosition.RIGHT_TOP;case"bottomleft":return google.maps.ControlPosition.LEFT_BOTTOM;case"bottomright":return google.maps.ControlPosition.RIGHT_BOTTOM;default:return google.maps.ControlPosition.LEFT_TOP}}(s.zoomControl)},scrollwheel:s.mousewheel,disableDoubleClickZoom:l,keyboardShortcuts:p,draggable:r},h=s.container,g=document.createElement("div");g.style.width="100%",g.style.height="100%",h.innerHTML="",h.appendChild(g);var u=this._map=new google.maps.Map(g,m);if(i&&s.zoomControl){var _=google.maps.ControlPosition.TOP_LEFT;switch(s.zoomControl){case"topright":_=google.maps.ControlPosition.TOP_RIGHT;break;case"bottomleft":_=google.maps.ControlPosition.BOTTOM_LEFT;break;case"bottomright":_=google.maps.ControlPosition.BOTTOM_RIGHT}var f={position:_};u.setOptions({zoomControlOptions:f})}const v=this._listeners;n.forEach((e=>{v.push(u.addListener(e,this._mapUpdateHandler))})),u.setCenter(c),u.setZoom(s.zoom);var y=u.addListener("idle",(function(e){y.remove(),o.dispatchEvent(new t.MapEvent("maploaded"))}));const C=t.MapUtils.parseCoords(s.center),M=new google.maps.LatLng(C[0],C[1]);return u.setCenter(M),u.setZoom(s.zoom),g}))}invalidateSize(){this.map&&google.maps.event.trigger(this.map,"resize")}removeItem(o){if(o instanceof t.PacemMapMarkerElement){var a=this._markersAdapter,n=a.markers.get(o);e.Utils.isNull(n)||(n.setMap(null),a.markers.delete(o))}this.fitBounds(!0)}drawItem(e){if(e instanceof t.PacemMapMarkerElement){var o=this._markersAdapter,a=o.drawMarker(e);o.markers.has(e)||o.markers.set(e,a)}this.fitBounds(!0)}fitBounds(t){if(!this.map)return;const o=this._container;if(!o.autofit&&!0===t)return;const a=this._markersAdapter.markers,n=this._shapes,s=this._map;if(!a.size&&!n.size)return s.setCenter(o.center),void s.setZoom(o.zoom);var i=new google.maps.LatLngBounds,r=0;for(var l of a.keys()){let t=a.get(l);if(e.Utils.isNull(t))continue;const o=t.getPosition();o&&(i.extend({lat:o.lat(),lng:o.lng()}),r++)}for(var p of n.keys()){var d=n.get(p).getBounds();const e=d.getSouthWest(),t=d.getNorthEast();i.extend({lat:e.lat(),lng:e.lng()}),i.extend({lat:t.lat(),lng:t.lng()}),r+=2}r>=2?s.fitBounds(i):1==r&&(s.setCenter(i.getCenter()),s.setZoom(o.zoom)),this._padBounds()}_padBounds(){const e=this._container,t=e.paddingTop||0,o=e.paddingLeft||0,a=e.paddingRight||0,n=e.paddingBottom||0;if(o||t||a||n){const e=this._map;var s=e.getBounds();const l=e.getDiv().clientWidth,p=e.getDiv().clientHeight;var i=e.getProjection().fromPointToLatLng(new google.maps.Point(-o,-t)),r=e.getProjection().fromPointToLatLng(new google.maps.Point(l+a,p+n));s.extend(i),s.extend(r)}}_redrawMap(){}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],s.prototype,"apiKey",void 0),__decorate([e.Debounce(o)],s.prototype,"fitBounds",null),s=__decorate([e.CustomElement({tagName:e.P+"-map-adapter-google"})],s),t.PacemGoogleMapAdapterElement=s}(t.Maps||(t.Maps={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(t){const o=1e3,a="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js",n="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==",s="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css",i="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==";t.LayerLoadEventName="layerload";class LayerLoadEvent extends e.CustomTypedEvent{constructor(e){super(t.LayerLoadEventName,e,{bubbles:!0})}}class PacemLeafletMarkerAdapter{constructor(e){this._map=e,this._markers=new Map}get markers(){return this._markers}_onDragEnd(e,t){var o=t.target.getLatLng();e.onDragEnd(o)}_onInfo(e){e.onInfoOpen()}_onClose(e){e.onInfoClose()}drawMarker(t){var o=this;if(!e.Utils.isNull(o._map.map))if(e.Utils.isNullOrEmpty(t&&t.position)||t&&t.hide)e.Utils.isNull(t)||(o._map.removeItem(t),this._markers.delete(t));else{var a;if(o._markers.has(t)?a=o._markers.get(t):((a=L.marker(t.position).addTo(o._map.map)).on("click",(e=>o.openInfoWindow(t,e))),a.on("drag",(()=>o._map.fitBounds(!0))),a.on("dragend",(e=>o._onDragEnd(t,e))),o._markers.set(t,a)),a.setLatLng(t.position),"string"==typeof t.icon)o._setIcon(a,t.icon);else if(!e.Utils.isNull(t.icon)){let n={iconUrl:t.icon.url};e.Utils.isNullOrEmpty(t.icon.size)||e.Utils.extend(n,{iconSize:[t.icon.size.width,t.icon.size.height],iconAnchor:[t.icon.size.width/2,t.icon.size.height],popupAnchor:[0,-t.icon.size.height]}),e.Utils.isNullOrEmpty(t.icon.anchor)||e.Utils.extend(n,{iconAnchor:[t.icon.anchor.x,t.icon.anchor.y]}),o._setIcon(a,new L.Icon(n))}o._setCaption(a,t.caption),o._setDraggable(a,t.draggable)}}closeInfoWindow(e,t){((null==t?void 0:t.target)||this._markers.get(e)).closePopup()}openInfoWindow(o,a){var n=this,s=(null==a?void 0:a.target)||n._markers.get(o),i=o.caption;t.MapUtils.isContentEmpty(o)||(i=o.innerHTML),e.Utils.isNullOrEmpty(i)||(s.bindPopup(i).openPopup(),n._onInfo(o),s.on("popupclose",(function(){s.unbindPopup(),n._onClose(o)})))}_setDraggable(e,t){!0===t?e.dragging.enable():e.dragging.disable()}_setIcon(e,t){if("string"==typeof t){var o,a,n,s={iconUrl:t};if((o=this.size)&&/[\d]+,[\d]+/.test(o)){var i=-1,r=[parseInt(o.substring(0,i=o.indexOf(","))),parseInt(o.substring(i+1))];Object.assign(s,{iconSize:r})}if((a=this.anchor)&&/[\d]+,[\d]+/.test(a)){i=-1;var l=[parseInt(a.substring(0,i=a.indexOf(","))),parseInt(a.substring(i+1))];Object.assign(s,{iconAnchor:l,popupAnchor:[0,-l[1]]})}if((n=this.popupAnchor)&&/[\d]+,[\d]+/.test(n)){i=-1,l=[parseInt(a.substring(0,i=a.indexOf(","))),parseInt(a.substring(i+1))];Object.assign(s,{popupAnchor:l})}e.setIcon(L.icon(s))}else t&&e.setIcon(t)}_setCaption(e,t){e.getPopup()&&e.getPopup().getContent()!=t&&e.setPopupContent(t)}removeMarker(e){const t=this._markers;t.has(e)&&(t.get(e).remove(),t.delete(e))}}class PacemLeafletLayerAdapter{constructor(e){this._map=e,this._layers=new Map,this._tileLayerLoadHandler=e=>{this._map.dispatchLayerLoadEvent(e.sourceTarget)}}drawLayer(e){const t=this._layers;if(t.has(e)){let o=t.get(e);o&&(o.off("load",this._tileLayerLoadHandler),o.remove())}if(e.hide)return void t.delete(e);const o=(e.mode||"").toLowerCase(),a=this._map.map;if("wms"===o){let o=L.tileLayer.wms(e.url,{layers:(e.include||[]).join(","),minZoom:e.minZoom,maxZoom:e.maxZoom,transparent:!0,format:"image/png"}).addTo(a);t.set(e,o),o.on("load",this._tileLayerLoadHandler)}else{let n=L.tileLayer(e.url,{tms:"tms"===o,minZoom:e.minZoom,maxZoom:e.maxZoom}).addTo(a);t.set(e,n),n.on("load",this._tileLayerLoadHandler)}}removeLayer(e){const t=this._layers;t.has(e)&&(t.get(e).remove(),t.delete(e))}}let r=class PacemLeafletMapAdapterElement extends t.PacemMapAdapterElement{constructor(){super(),this.tiles="//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",this.attribution='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',this._tileLayerLoadHandler=e=>{this.dispatchLayerLoadEvent(e.sourceTarget)},this._mapUpdateHandler=()=>{const t=this._map,o=this._container;e.Utils.isNull(t)||e.Utils.isNull(o)||this.updateMapElement(o,t.getCenter(),t.getZoom())},this._tileLayer=null,this._shapes=new Map,this._markersAdapter=new PacemLeafletMarkerAdapter(this),this._layersAdapter=new PacemLeafletLayerAdapter(this)}snapshot(t,o="image/png",a){return e.Utils.snapshotElement(t.container.firstElementChild,null,o,a)}popupInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.openInfoWindow(e)}popoutInfoWindow(e){e instanceof t.PacemMapMarkerElement&&this._markersAdapter.closeInfoWindow(e)}setView(t,o){const a=this._map;e.Utils.isNull(a)||("number"==typeof t?a.setZoom(t):a.setView(t,o||a.getZoom()))}get map(){return this._map}propertyChangedCallback(e,t,o,a){if(super.propertyChangedCallback(e,t,o,a),"tiles"===e)this._redrawMap();this.invalidateSize()}destroy(e){const t=this._tileLayer;t&&t.off("load",this._tileLayerLoadHandler),this._map.clearAllEventListeners()}initialize(o){return __awaiter(this,void 0,void 0,(function*(){yield Promise.all([e.CustomElementUtils.importjs(a,n,!0),e.CustomElementUtils.importcss(s,i,!0)]);const r=this._container=o;var l=r.scale,p=r.draggable,d=r.doubleClickZoom,c=r.keyboardShortcuts,m=L.latLng(t.MapUtils.parseCoords(r.center)),h={zoomControl:l&&!e.Utils.isNullOrEmpty(r.zoomControl),scrollWheelZoom:r.mousewheel,dragging:p,doubleClickZoom:!d,keyboard:c},g=r.container,u=document.createElement("div");u.style.width="100%",u.style.height="100%",g.innerHTML="",g.appendChild(u);var _=this._map=L.map(u,h);["zoomend","moveend"].forEach((e=>{_.on(e,(e=>{this._idleFiller(),this._mapUpdateHandler()}))})),_.on("load",(()=>{l&&r.zoomControl&&_.zoomControl.setPosition(r.zoomControl),this._idleFiller()}));(this._tileLayer=L.tileLayer(this.tiles,{attribution:this.attribution}).addTo(_)).on("load",this._tileLayerLoadHandler),_.setView(m,r.zoom),_.once("idle",(function(){_.fire("resize"),o.dispatchEvent(new t.MapEvent("maploaded"))}));const f=t.MapUtils.parseCoords(r.center),v=[f[0],f[1]];return _.setView(v,r.zoom),u}))}dispatchLayerLoadEvent(e){this.dispatchEvent(new LayerLoadEvent(e))}invalidateSize(){this.map&&this.map.invalidateSize()}removeItem(e){e instanceof t.PacemMapMarkerElement?this._markersAdapter.removeMarker(e):e instanceof t.PacemMapLayerElement&&this._layersAdapter.removeLayer(e),this.fitBounds(!0)}drawItem(e){e instanceof t.PacemMapMarkerElement?this._markersAdapter.drawMarker(e):e instanceof t.PacemMapLayerElement&&this._layersAdapter.drawLayer(e),this.fitBounds(!0)}_idleFiller(){this.map&&this.map.fire("idle")}fitBounds(o){if(this.map){var a=this._container;if(a.autofit||!0!==o){var n=this._markersAdapter.markers,s=this._shapes;if(n.size||s.size){var i=[];for(var r of n.keys()){let o=n.get(r);e.Utils.isNull(o)||t.MapUtils.expandBounds(i,o.getLatLng())}for(var l of s.keys()){var p=s.get(l).getBounds();t.MapUtils.expandBounds(i,p.getSouthWest()),t.MapUtils.expandBounds(i,p.getNorthEast())}var d=a.paddingTop,c=a.paddingLeft,m=a.paddingRight,h=a.paddingBottom,g={paddingTopLeft:new L.Point(c,d),paddingBottomRight:new L.Point(m,h)};if(i.length>=2||1==i.length&&(d||c||h||m)){const e=L.latLngBounds(i),t=e.getNorthEast(),o=e.getSouthWest();try{this.map.fitBounds([[t.lat,t.lng],[o.lat,o.lng]],g)}catch(e){throw e}}else 1==i.length&&this.map.setView(i[0],a.zoom)}else this._map.setView(t.MapUtils.parseCoords(a.center),a.zoom)}}}_redrawMap(){var t=this;e.Utils.isNull(t.tiles&&t._tileLayer)||t._tileLayer.setUrl(t.tiles)}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],r.prototype,"tiles",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],r.prototype,"attribution",void 0),__decorate([e.Debounce(500)],r.prototype,"_idleFiller",null),__decorate([e.Debounce(o)],r.prototype,"fitBounds",null),r=__decorate([e.CustomElement({tagName:e.P+"-map-adapter-leaflet"})],r),t.PacemLeafletMapAdapterElement=r}(t.Maps||(t.Maps={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={}));
|
package/dist/js/pacem-media.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
/// <reference path="pacem-core.d.ts" />
|
|
7
7
|
declare namespace Pacem.Components.Media {
|
package/dist/js/pacem-media.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__decorate=this&&this.__decorate||function(e,t,a,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,a):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,a,r);else for(var c=e.length-1;c>=0;c--)(i=e[c])&&(o=(s<3?i(o):s>3?i(t,a,o):i(t,a))||o);return s>3&&o&&Object.defineProperty(t,a,o),o},__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,a,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,a):i?i.value=a:t.set(e,a),a},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(e):r?r.value:t.get(e)};!function(e){!function(t){!function(a){var r,i,s;let o=class PacemAudioElement extends t.PacemEventTarget{constructor(){super(...arguments),r.set(this,void 0),i.set(this,void 0),s.set(this,void 0),this._endedHandler=e=>{this.dispatchEvent(new Event("end"))},this._canPlayHandler=e=>{__classPrivateFieldSet(this,i,!0,"f"),this._autoplay()},this._canPlayThroughHandler=e=>{__classPrivateFieldSet(this,s,!0,"f"),this._autoplay()}}connectedCallback(){super.connectedCallback();const e=__classPrivateFieldSet(this,r,new Audio,"f");e.addEventListener("canplay",this._canPlayHandler,!1),e.addEventListener("ended",this._endedHandler,!1),e.addEventListener("canplaythrough",this._canPlayThroughHandler,!1)}propertyChangedCallback(e,t,a,r){if(super.propertyChangedCallback(e,t,a,r),!r&&"src"===e)this._init()}viewActivatedCallback(){super.viewActivatedCallback(),this._init()}disconnectedCallback(){const e=__classPrivateFieldGet(this,r,"f");e.removeEventListener("ended",this._endedHandler,!1),e.removeEventListener("canplaythrough",this._canPlayThroughHandler,!1),e.removeEventListener("canplay",this._canPlayHandler,!1),super.disconnectedCallback()}play(){return this.disabled?Promise.reject("disabled"):__classPrivateFieldGet(this,r,"f").play().then((e=>{this.dispatchEvent(new Event("start"))}),(e=>{this.dispatchEvent(new CustomEvent("error",{detail:e}))}))}pause(){__classPrivateFieldGet(this,r,"f").pause()}reset(){__classPrivateFieldGet(this,r,"f").load()}get _canPlay(){return this.stream&&__classPrivateFieldGet(this,i,"f")||__classPrivateFieldGet(this,s,"f")}_autoplay(){this.autoplay&&this._canPlay&&this.play()}_init(e=this.src){const t=__classPrivateFieldGet(this,r,"f");__classPrivateFieldSet(this,i,__classPrivateFieldSet(this,s,!1,"f"),"f"),t.src=e}};r=new WeakMap,i=new WeakMap,s=new WeakMap,__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"src",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"stream",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Boolean})],o.prototype,"autoplay",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-audio"})],o),a.PacemAudioElement=o}(t.Media||(t.Media={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={})),function(e){!function(t){!function(a){var r,i;const s="video/mp4",o=["start","stop","dataavailable","pause","resume","error","warning"];let c=class PacemMediaRecorderElement extends t.PacemEventTarget{constructor(){super(...arguments),this._recorderLifecycleHandler=e=>{switch(this.state=__classPrivateFieldGet(this,r,"f").state,e.type){case"start":this.output=null;break;case"stop":this.flush();break;case"dataavailable":var t=e;__classPrivateFieldGet(this,i,"f").push(t.data)}},r.set(this,null),i.set(this,[])}viewActivatedCallback(){super.viewActivatedCallback(),this._setupMediaRecorder()}propertyChangedCallback(e,t,a,r){if(super.propertyChangedCallback(e,t,a,r),!r)switch(e){case"source":case"fps":case"mimeType":case"audioBitsPerSecond":case"videoBitsPerSecond":this._setupMediaRecorder()}}disconnectedCallback(){this._closeMediaRecorder(),super.disconnectedCallback()}_setupMediaRecorder(t,a){var i,c,n;if(void 0===t&&(t=this.source),void 0===a&&(a={mimeType:this.mimeType||s,audioBitsPerSecond:null!==(i=this.audioBitsPerSecond)&&void 0!==i?i:128e3,videoBitsPerSecond:null!==(c=this.videoBitsPerSecond)&&void 0!==c?c:25e5}),this._closeMediaRecorder(),!e.Utils.isNull(t)){if((n=t)instanceof HTMLCanvasElement||"captureStream"in n&&"function"==typeof n.captureStream){const e=this.fps||25;t=t.captureStream(e)}try{__classPrivateFieldSet(this,r,new MediaRecorder(t,a),"f")}catch(e){console.error(e)}const e=__classPrivateFieldGet(this,r,"f");o.forEach((t=>{e.addEventListener(t,this._recorderLifecycleHandler,!1)}))}}_closeMediaRecorder(){const t=__classPrivateFieldGet(this,r,"f");e.Utils.isNull(t)||("inactive"!==t.state&&t.stop(),o.forEach((e=>{t.removeEventListener(e,this._recorderLifecycleHandler,!1)})),__classPrivateFieldSet(this,r,null,"f"))}flush(){const e=new Blob(__classPrivateFieldGet(this,i,"f"),{type:this.mimeType||s});__classPrivateFieldSet(this,i,[],"f"),this.output=e}start(){const t=__classPrivateFieldGet(this,r,"f");e.Utils.isNull(t)||"inactive"!==t.state||t.start()}stop(){const t=__classPrivateFieldGet(this,r,"f");e.Utils.isNull(t)||"inactive"===t.state||t.stop()}resume(){const t=__classPrivateFieldGet(this,r,"f");e.Utils.isNull(t)||"paused"!==t.state||t.start()}pause(){const t=__classPrivateFieldGet(this,r,"f");e.Utils.isNull(t)||"paused"===t.state||t.pause()}};r=new WeakMap,i=new WeakMap,__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Element})],c.prototype,"source",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],c.prototype,"fps",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],c.prototype,"mimeType",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],c.prototype,"audioBitsPerSecond",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.Number})],c.prototype,"videoBitsPerSecond",void 0),__decorate([e.Watch({converter:e.PropertyConverters.String})],c.prototype,"state",void 0),__decorate([e.Watch()],c.prototype,"output",void 0),c=__decorate([e.CustomElement({tagName:e.P+"-media-recorder"})],c),a.PacemMediaRecorderElement=c}(t.Media||(t.Media={}))}(e.Components||(e.Components={}))}(Pacem||(Pacem={}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__decorate=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var c=e.length-1;c>=0;c--)(i=e[c])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},__awaiter=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{a(o.next(e))}catch(e){r(e)}}function c(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))};!function(e){!function(t){const n="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/5.0.7/signalr.min.js";let o=class PacemHubListener extends t.PacemItemElement{constructor(){super(...arguments),this.onreceive=(...e)=>{this.dispatchEvent(new CustomEvent("receive",{detail:Array.from(e)}))}}propertyChangedCallback(t,n,o,r){if(super.propertyChangedCallback(t,n,o,r),this.container instanceof i&&!e.Utils.isNull(this.container.connection)){const i=this.container.connection;switch(t){case"method":e.Utils.isNullOrEmpty(n)||i.off(n,this.onreceive),e.Utils.isNullOrEmpty(o)||i.on(o,this.onreceive);break;case"disabled":if(!e.Utils.isNullOrEmpty(this.method)){(o?i.off:i.on)(this.method,this.onreceive)}}}}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],o.prototype,"method",void 0),o=__decorate([e.CustomElement({tagName:e.P+"-hub-listener"})],o),t.PacemHubListener=o;let i=class PacemHubProxy extends t.PacemItemsContainerElement{validate(e){return e instanceof o}get connection(){return this._hub}invoke(e,...t){if(this.connected)return this._hub.invoke.apply(this._hub,arguments);throw"Hub is not connected. Cannot call `invoke` method."}send(e,...t){if(this.connected)return this._hub.send.apply(this._hub,arguments);throw"Hub is not connected. Cannot call `send` method."}start(){this._resetProxy()}propertyChangedCallback(e,t,n,o){super.propertyChangedCallback(e,t,n,o),"url"!==e&&"disabled"!==e&&"accesstoken"!==e||this._resetProxy()}disconnectedCallback(){this.connected&&this._hub.stop(),super.disconnectedCallback()}_resetProxy(){return __awaiter(this,void 0,void 0,(function*(){e.Utils.isNull(this._hub)||(yield this._hub.stop(),this.connected=!1),this._setupProxy()}))}_initialize(){return e.CustomElementUtils.importjs(n)}_setupProxy(){return __awaiter(this,void 0,void 0,(function*(){if(!this.disabled&&!e.Utils.isNullOrEmpty(this.url)){yield this._initialize();const n=new signalR.HubConnectionBuilder;n.withUrl(this.url,{accessTokenFactory:()=>this.accesstoken});const o=this._hub=n.build();for(var t of(o.onclose((()=>{this.connected=!1,this._hub=null})),yield o.start(),this.connected=!0,this.items))t.disabled||e.Utils.isNullOrEmpty(t.method)||o.on(t.method,t.onreceive)}}))}};__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],i.prototype,"url",void 0),__decorate([e.Watch({emit:!1,converter:e.PropertyConverters.String})],i.prototype,"accesstoken",void 0),__decorate([e.Watch({converter:e.PropertyConverters.Boolean})],i.prototype,"connected",void 0),i=__decorate([e.CustomElement({tagName:e.P+"-hub-proxy"})],i),t.PacemHubProxy=i}(e.Components||(e.Components={}))}(Pacem||(Pacem={}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
/// <reference path="pacem-foundation.d.ts" />
|
|
7
7
|
declare namespace Pacem.Geometry.LinearAlgebra {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
7
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var Pacem,__classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(t,e,r,n,m){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!m)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!m:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?m.call(t,r):m?m.value=r:e.set(t,r),r},__classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};!function(t){!function(e){!function(e){class Vector{static unit(t){const e={x:t.x,y:t.y};return this.normalize(e),e}static magSqr(t){return t.x*t.x+t.y*t.y}static mag(t){return Math.sqrt(Vector.magSqr(t))}static normalize(t){const e=Vector.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r}static from(e,r){return t.Point.subtract(e,r)}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}}e.Vector=Vector}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){const r=180/Math.PI,n=2*Math.PI,m=e.LinearAlgebra.Vector;function a(t){return null!=t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y}e.Utils=class Utils{static slopeRad(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}static slopeRad2(t,e){return(n+this.slopeRad(t,e))%n}static slopeDeg(t,e){return this.slopeRad(t,e)*r}static slopeDeg2(t,e){return(360+this.slopeDeg(t,e))%360}static intersect(t,e,...r){return Array.isArray(t)&&Array.isArray(e)?this._intersectSegments(t,e,!0):this._intersectRects.apply(this,arguments)}static intersectLines(t,e,r,n){let m,a;if(Array.isArray(t)&&Array.isArray(e)&&2===t.length&&2===e.length&&"number"==typeof t[0]&&"number"==typeof e[0]&&"number"==typeof t[1]&&"number"==typeof e[1]&&(r=e[0],n=e[1],e=t[1],t=t[0]),"number"==typeof t&&"number"==typeof e){m=[{x:0,y:e},{x:1,y:t+e}],a=[{x:0,y:n},{x:1,y:r+n}]}else m=t,a=e;return this._intersectSegments(m,a,!1)}static cramer(t,e){Array.isArray(t)&&(t={a:t[0],b:t[1],c:t[2]}),Array.isArray(e)&&(e={a:e[0],b:e[1],c:e[2]});let r=(t.b*e.c-t.c*e.b)/(t.b*e.a-t.a*e.b),n=(t.c*e.a-t.a*e.c)/(t.b*e.a-t.a*e.b);return{x:-r.roundoff(),y:-n.roundoff()}}static mq(t,e){let r;if(a(t)?r=t:(r=t[0],e=t[1]),r.x===e.x)return[Number.NaN,Number.NaN];const n=(e.y-r.y)/(e.x-r.x);return[n,r.y-n*r.x]}static _intersectSegments(t,e,r){const n=t[0],m=t[1],a=e[0],s=e[1],i=Math.min(n.x,m.x),o=Math.min(n.y,m.y),c=Math.max(n.x,m.x),f=c-i,u=Math.max(n.y,m.y),l=u-o,h=Math.min(a.x,s.x),y=Math.min(a.y,s.y),x=Math.max(a.x,s.x),p=x-h,g=Math.max(a.y,s.y),d=g-y;if(0===f&&0===p)return null;if(0===l&&0===d)return null;const M=t=>t.x<h||t.x>x||t.x<i||t.x>c,b=t=>t.y<y||t.y>g||t.y<o||t.y>u;var w=null;if(0===f){if(r&&(h>i||x<c))return null;const t=this.mq(a,s);w=this.cramer([1,0,-i],[t[0],-1,t[1]]),r&&b(w)&&(w=null)}else if(0===p){if(r&&(i>h||c<x))return null;const t=this.mq(n,m);w=this.cramer([t[0],-1,t[1]],[1,0,-h]),r&&b(w)&&(w=null)}else if(0===l){if(r&&(y>o||g<u))return null;const t=this.mq(a,s);w=this.cramer([0,1,-o],[t[0],-1,t[1]]),r&&M(w)&&(w=null)}else if(0===d){if(r&&(o>y||u<g))return null;const t=this.mq(n,m);w=this.cramer([t[0],-1,t[1]],[0,1,-y]),r&&M(w)&&(w=null)}else{let t;if(!r||(t=this._intersectRects({x:i,y:o,width:f,height:l},{x:h,y:y,width:p,height:d}))&&t.width>0&&t.height>0){const e=this.mq(n,m),i=this.mq(a,s),o=e[0],c=i[0],f=e[1],u=i[1];if(o!==c){let e=(w=this.cramer([o,-1,f],[c,-1,u])).x,n=w.y;r&&(e<t.x||e>t.x+t.width||n<t.y||n>t.y+t.height)&&(w=null)}}}return null===w?null:{x:w.x,y:w.y}}static _intersectRects(...e){return t.Rect.intersect.apply(this,e)}static dot(t,e){return m.dot(t,e)}static cross(t,e){return m.cross(t,e)}static distance(e,r){if(null!=(n=e)&&Array.isArray(n)&&2===n.length&&a(n[0])&&a(n[1]))return t.Point.distance(e[0],e[1]);if(a(r))return t.Point.distance(e,r);{const t=r[0],n=r[1];return Math.abs(t*e.x-e.y+n)/Math.sqrt(Math.pow(t,2)+1)}var n}static inLine(t,e){const r=m.from(e[0],t),n=m.from(t,e[1]);return this.cross(r,n).isCloseTo(0)}static inSegment(t,e){const r=Math.min(e[0].x,e[1].x),n=Math.max(e[0].x,e[1].x),m=Math.min(e[0].y,e[1].y),a=Math.max(e[0].y,e[1].y);return t.x>=r&&t.x<=n&&t.y>=m&&t.y<=a&&this.inLine(t,e)}static inTriangle(e,r){let n;for(let m=0;m<3;m++){const a=r[m],s=r[(m+1)%3],i=t.Point.subtract(s,e),o=t.Point.subtract(a,e),c=this.cross(i,o);if(m>0&&c*n<=0)return!1;n=c}return!0}static inPolygon(t,e){if(!((null==e?void 0:e.length)>=3))throw"Not enough vertices";const r=e.length;if(3===r)return this.inTriangle(t,[e[0],e[1],e[2]]);let n=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,a=0,s=0;for(let t=0;t<r;t++){const r=e[t];n=Math.min(n,r.x),m=Math.min(m,r.y),a=Math.max(a,r.x),s=Math.max(s,r.y)}if(t.x<n||t.x>a||t.y<m||t.y>s)return!1;const i=[{x:n-1,y:t.y},t];let o=0;for(let n=0;n<r;n++){const m=e[n],a=e[(n+1)%r],s=[m,a];if(m.y===t.y){const s=e[(n-1+r)%r];t.x>m.x&&(s.y-t.y)*(a.y-t.y)<0&&o++}else{if(a.y===t.y)continue;null!=this.intersect(s,i)&&o++}}return o%2==1}}}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r=180/Math.PI,n=1/r;class Vector3D{static from(...t){if(3!==t.length)throw new RangeError("Must provide exactly 3 numbers");return{x:t[0],y:t[1],z:t[2]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&3===r.length)return Vector3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Vector3D.`)}static i(){return{x:1,y:0,z:0}}static j(){return{x:0,y:1,z:0}}static k(){return{x:0,y:0,z:1}}static subtract(t,e){return{x:e.x-t.x,y:e.y-t.y,z:e.z-t.z}}static add(...t){var e={x:0,y:0,z:0};for(var r of t)e.x+=r.x,e.y+=r.y,e.z+=r.z;return e}static dot(t,e){return t.x*e.x+t.y*e.y+t.z*e.z}static cross(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}}static magSqr(t){return t.x*t.x+t.y*t.y+t.z*t.z}static mag(t){return Math.sqrt(Vector3D.magSqr(t))}static unit(t){const e={x:t.x,y:t.y,z:t.z};return this.normalize(e),e}static normalize(t){const e=Vector3D.mag(t);if(e<=0)throw"Cannot normalize a vector of length 0.";const r=1/e;t.x*=r,t.y*=r,t.z*=r}static angleBetween(t,e){let n;const m=Vector3D.unit(t),a=Vector3D.unit(e);if(Vector3D.dot(m,a)<0){const t={x:-m.x-a.x,y:-m.y-a.y,z:-m.z-a.z},e=Vector3D.mag(t);n=Math.PI-2*Math.asin(e/2)}else{const t={x:m.x-a.x,y:m.y-a.y,z:m.z-a.z},e=Vector3D.mag(t);n=2*Math.asin(e/2)}return r*n}}e.Vector3D=Vector3D;class Matrix3D{static identity(){return{m11:1,m12:0,m13:0,m14:0,m21:0,m22:1,m23:0,m24:0,m31:0,m32:0,m33:1,m34:0,offsetX:0,offsetY:0,offsetZ:0,m44:1}}static from(...t){if(16!==t.length)throw new RangeError("Must provide exactly 16 numbers");return{m11:t[0],m12:t[1],m13:t[2],m14:t[3],m21:t[4],m22:t[5],m23:t[6],m24:t[7],m31:t[8],m32:t[9],m33:t[10],m34:t[11],offsetX:t[12],offsetY:t[13],offsetZ:t[14],m44:t[15]}}static toArray(t){return[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.offsetX,t.offsetY,t.offsetZ,t.m44]}static clone(t){return Matrix3D.from.apply(null,Matrix3D.toArray(t))}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&16===r.length)return Matrix3D.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Matrix3D.`)}static isIdentity(t){return 1==t.m11&&0==t.m12&&0==t.m13&&0==t.m14&&0==t.m21&&1==t.m22&&0==t.m23&&0==t.m24&&0==t.m31&&0==t.m32&&1==t.m33&&0==t.m34&&0==t.offsetX&&0==t.offsetY&&0==t.offsetZ&&1==t.m44}static isAffine(t){return 0==t.m14&&0==t.m24&&0==t.m34&&1==t.m44}static determinant(t){if(Matrix3D.isIdentity(t))return 1;if(Matrix3D.isAffine(t))return t.m11*(t.m22*t.m33-t.m32*t.m23)-t.m12*(t.m21*t.m33-t.m31*t.m23)+t.m13*(t.m21*t.m32-t.m31*t.m22);{const e=t.m13*t.m24-t.m23*t.m14,r=t.m13*t.m34-t.m33*t.m14,n=t.m13*t.m44-t.offsetZ*t.m14,m=t.m23*t.m34-t.m33*t.m24,a=t.m23*t.m44-t.offsetZ*t.m24,s=t.m33*t.m44-t.offsetZ*t.m34,i=t.m22*r-t.m32*e-t.m12*m,o=t.m12*a-t.m22*n+t.offsetY*e,c=t.m32*n-t.offsetY*r-t.m12*s,f=t.m22*s-t.m32*a+t.offsetY*m;return t.offsetX*i+t.m31*o+t.m21*c+t.m11*f}}static multiply(t,e){return Matrix3D.isIdentity(t)?e:Matrix3D.isIdentity(e)?t:Matrix3D.from(t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.offsetX,t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.offsetY,t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.offsetZ,t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.offsetX,t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.offsetY,t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.offsetZ,t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.offsetX,t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.offsetY,t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.offsetZ,t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,t.offsetX*e.m11+t.offsetY*e.m21+t.offsetZ*e.m31+t.m44*e.offsetX,t.offsetX*e.m12+t.offsetY*e.m22+t.offsetZ*e.m32+t.m44*e.offsetY,t.offsetX*e.m13+t.offsetY*e.m23+t.offsetZ*e.m33+t.m44*e.offsetZ,t.offsetX*e.m14+t.offsetY*e.m24+t.offsetZ*e.m34+t.m44*e.m44)}static invert(t){if(Matrix3D.isAffine(t)){const e=t.m12*t.m23-t.m22*t.m13,r=t.m32*t.m13-t.m12*t.m33,n=t.m22*t.m33-t.m32*t.m23,m=Matrix3D.determinant(t);if(0==m)return null;const a=t.m21*t.m13-t.m11*t.m23,s=t.m11*t.m33-t.m31*t.m13,i=t.m31*t.m23-t.m21*t.m33,o=t.m11*t.m22-t.m21*t.m12,c=t.m11*t.m32-t.m31*t.m12,f=t.m11*t.offsetY-t.offsetX*t.m12,u=t.m21*t.m32-t.m31*t.m22,l=t.m21*t.offsetY-t.offsetX*t.m22,h=t.m31*t.offsetY-t.offsetX*t.m32,y=t.m23*f-t.offsetZ*o-t.m13*l,x=t.m13*h-t.m33*f+t.offsetZ*c,p=t.m33*l-t.offsetZ*u-t.m23*h,g=o,d=-c,M=u,b=1/m;return Matrix3D.from(n*b,r*b,e*b,0,i*b,s*b,a*b,0,M*b,d*b,g*b,0,p*b,x*b,y*b,1)}{const e=Matrix3D.determinant(t);if(0==e)return null;const r=t.m33*t.m44-t.m34*t.offsetZ,n=t.m32*t.m44-t.m34*t.offsetY,m=t.m31*t.m44-t.m34*t.offsetX,a=t.m32*t.offsetZ-t.m33*t.offsetY,s=t.m31*t.offsetZ-t.m33*t.offsetX,i=t.m31*t.offsetY-t.m32*t.offsetX,o=t.m33*t.m44-t.m34*t.offsetZ,c=t.m32*t.m44-t.m34*t.offsetY,f=t.m31*t.m44-t.m34*t.offsetX,u=t.m32*t.offsetZ-t.m33*t.offsetY,l=t.m31*t.offsetZ-t.m33*t.offsetX,h=t.m31*t.offsetY-t.m32*t.offsetX,y=t.m23*t.m44-t.m24*t.offsetZ,x=t.m22*t.m44-t.m24*t.offsetY,p=t.m21*t.m44-t.m24*t.offsetX,g=t.m22*t.offsetZ-t.m23*t.offsetY,d=t.m21*t.offsetZ-t.m23*t.offsetX,M=t.m21*t.offsetY-t.m22*t.offsetX,b=t.m23*t.m34-t.m24*t.m33,w=t.m22*t.m34-t.m24*t.m32,v=t.m21*t.m34-t.m24*t.m31,z=t.m22*t.m33-t.m23*t.m32,N=t.m21*t.m33-t.m23*t.m31,P=t.m21*t.m32-t.m22*t.m31,A=t.m22*r-t.m23*n+t.m24*a,D=-(t.m21*r-t.m23*m+t.m24*s),_=t.m21*n-t.m22*m+t.m24*i,C=-(t.m21*a-t.m22*s+t.m23*i),q=-(t.m12*o-t.m13*c+t.m14*u),Y=t.m11*o-t.m13*f+t.m14*l,I=-(t.m11*c-t.m12*f+t.m14*h),Z=t.m11*u-t.m12*l+t.m13*h,X=t.m12*y-t.m13*x+t.m14*g,S=-(t.m11*y-t.m13*p+t.m14*d),F=t.m11*x-t.m12*p+t.m14*M,V=-(t.m11*g-t.m12*d+t.m13*M),T=-(t.m12*b-t.m13*w+t.m14*z),E=t.m11*b-t.m13*v+t.m14*N,Q=-(t.m11*w-t.m12*v+t.m14*P),j=t.m11*z-t.m12*N+t.m13*P,G=1/e;return Matrix3D.from(A*G,q*G,X*G,T*G,D*G,Y*G,S*G,E*G,_*G,I*G,F*G,Q*G,C*G,Z*G,V*G,j*G)}}static transform(t,e){var r={x:t.x,y:t.y,z:t.z};if(!Matrix3D.isIdentity(e)){var n=r.x,m=r.y,a=r.z;if(r.x=n*e.m11+m*e.m21+a*e.m31+e.offsetX,r.y=n*e.m12+m*e.m22+a*e.m32+e.offsetY,r.z=n*e.m13+m*e.m23+a*e.m33+e.offsetZ,!Matrix3D.isAffine(e)){var s=n*e.m14+m*e.m24+a*e.m34+e.m44;0!=s&&(r.x/=s,r.y/=s,r.z/=s)}}return r}}e.Matrix3D=Matrix3D;class Quaternion{static from(...t){if(4!==t.length)throw new RangeError("Must provide exactly 4 numbers");return{x:t[0],y:t[1],z:t[2],w:t[3]}}static parse(e){const r=t.parseAsNumericalArray(e);if(r&&4===r.length)return Quaternion.from.apply(null,r);throw new Error(`Cannot parse "${e}" as a valid Quaternion.`)}static fromAxisAngle(t,e){var r=n*(e%=360),m=Vector3D.mag(t);if(0==m)throw new RangeError("Invalid argument");var a=Math.sin(.5*r)/m,s=t.x*a,i=t.y*a,o=t.z*a;return Quaternion.from(s,i,o,Math.cos(.5*r))}static fromRotationMatrix(t){const e=t.m11+t.m22+t.m33+t.m44;if(e>0){const r=.5/Math.sqrt(e),n=.25/r,m=(t.m23-t.m32)*r,a=(t.m31-t.m13)*r,s=(t.m12-t.m21)*r;return Quaternion.from(m,a,s,n)}if(t.m11>t.m22&&t.m11>t.m22){const e=.5/Math.sqrt(t.m44+t.m11-t.m22-t.m33),r=(t.m23-t.m32)*e,n=.25/e,m=(t.m12+t.m21)*e,a=(t.m31+t.m13)*e;return Quaternion.from(n,m,a,r)}if(t.m22>t.m33){const e=.5/Math.sqrt(t.m44+t.m22-t.m11-t.m33),r=(t.m23+t.m32)*e,n=.25/e,m=(t.m12+t.m21)*e,a=(t.m31-t.m13)*e;return Quaternion.from(m,n,r,a)}{const e=.5/Math.sqrt(t.m44+t.m33-t.m11-t.m22),r=(t.m23+t.m32)*e,n=.25/e,m=(t.m12-t.m21)*e,a=(t.m31-t.m13)*e;return Quaternion.from(a,r,n,m)}}static conjugate(t){return Quaternion.from(-t.x,-t.y,-t.z,t.w)}static norm(t){return t.x*t.x+t.y*t.y+t.z*t.z}static axis(t){return 0==t.x&&0==t.y&&0==t.z?Vector3D.j():Vector3D.unit(t)}static angle(t){let e=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),r=t.w;if(e>Number.MAX_VALUE){const n=Math.max(Math.abs(t.x),Math.max(Math.abs(t.y),Math.abs(t.z))),m=t.x/n,a=t.y/n,s=t.z/n;e=Math.sqrt(m*m+a*a+s*s),r/=n}return 114.59155902616465*Math.atan2(e,r)}static toRotationMatrix(t){var e=Matrix3D.identity(),r=t.x,n=t.y,m=t.z,a=t.w;return e.m11=1-2*n*n-2*m*m,e.m12=2*r*n+2*a*m,e.m13=2*r*m-2*a*n,e.m21=2*r*n-2*a*m,e.m22=1-2*r*r-2*m*m,e.m23=2*n*m+2*a*r,e.m31=2*a*n+2*r*m,e.m32=2*n*m-2*a*r,e.m33=1-2*r*r-2*n*n,e}static invert(t){const e=1/Quaternion.norm(t),r=Quaternion.conjugate(t);return r.x*=e,r.y*=e,r.z*=e,r.w*=e,r}static multiply(t,e){return Quaternion.from(t.w*e.x+t.x+e.w+t.y*e.z-t.z*e.y,t.w*e.y-t.x*e.z+t.y*e.w+t.z*e.x,t.w*e.z+t.x*e.y-t.y*e.x+t.z*e.w,t.w*e.w-t.x*e.x-t.y*e.y-t.z*e.z)}static dot(t,e){return Quaternion.multiply(t,Quaternion.conjugate(e)).w}}e.Quaternion=Quaternion}(e.LinearAlgebra||(e.LinearAlgebra={}))}(t.Geometry||(t.Geometry={}))}(Pacem||(Pacem={})),function(t){!function(t){function e(t){return"number"==typeof t&&(t={real:t,img:0}),t}var r;function n(t,e){const r={};return Object.defineProperty(r,"real",{value:t,writable:!1}),Object.defineProperty(r,"img",{value:e,writable:!1}),r}function m(){return r||(r=n(Number.NaN,Number.NaN))}t.Complex=class Complex{static build(t,e){return this.isComplex(t)?t:(null!=e||(e=0),"number"!=typeof t||"number"!=typeof e?m():n(t,e||0))}static add(t,r){const m=e(t),a=e(r);return n(m.real+a.real,m.img+a.img)}static subtract(t,r){const m=e(t),a=e(r);return n(m.real-a.real,m.img-a.img)}static multiply(t,r){const m=e(t),a=e(r);return n(m.real*a.real-m.img*a.img,m.real*a.img+m.img*a.real)}static divide(t,r){const a=e(t),s=e(r),i=this.absSquare(s).roundoff();if(0===i)return m();const o=1/i;return n(o*(a.real*s.real+a.img*s.img),o*(a.img*s.real-a.real*s.img))}static absSquare(t){const r=e(t);return Math.pow(r.real,2)+Math.pow(r.img,2)}static modulus(t){return Math.sqrt(this.absSquare(t))}static isComplex(t){return null!=t&&"object"==typeof t&&"real"in t&&"img"in t&&"number"==typeof t.real&&"number"==typeof t.img}static conjugate(t){return n((t=e(t)).real,0==Math.abs(t.img)?0:-t.img)}static equals(t,e){const r=this.build(t),n=this.build(e);return!(!this.isComplex(t)||!this.isComplex(e))&&(r.real===n.real&&r.img===n.img)}static get NaC(){return m()}}}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(e){const r={};function n(e,n){const m=r[n]=r[n]||{};return m[e]=m[e]||function(e,r){const n=2*Math.PI*e/r;return t.Complex.build(Math.cos(n),Math.sin(n))}(e,n)}function m(e){const r=[],a=e.length;if(1===a)return[t.Complex.build(e[0])];const s=m(e.filter(((t,e)=>e%2==0))),i=m(e.filter(((t,e)=>e%2==1)));for(var o=0;o<a/2;o++){const e=s[o],m=t.Complex.multiply(n(o,a),i[o]);r[o]=t.Complex.add(e,m),r[o+a/2]=t.Complex.subtract(e,m)}return r}e.Fourier=class Fourier{static transform(t,e=!0){return(r=(t=t||[]).length)>0&&0==(r&r-1)?this.fft(t,e):this.dft(t,e);var r}static invert(t,e=!0){return this.idft(t||[],e)}static dft(e,r=!0){var m;const a=null===(m=e||[])||void 0===m?void 0:m.length,s=r?1/Math.sqrt(a):1,i=[];for(let r=0;r<a;r++){i.push({real:0,img:0});for(let m=0;m<a;m++){const o=n(r*m,a),c=t.Complex.multiply(e[m],o),f=t.Complex.multiply(c,s);i[r]=t.Complex.add(i[r],f)}}return i}static idft(e,r=!0){const n=e.map((e=>t.Complex.build(e.img,e.real)));return this.transform(n,r).map((e=>t.Complex.build(e.img,e.real)))}static fft(e,r=!0){const n=m(e);if(!r)return n;const a=1/Math.sqrt(e.length);return n.map((e=>t.Complex.multiply(e,a)))}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){const e=Math.sqrt(Math.PI);function r(t){let e,r,n;return r=Math.abs(t),e=1/(1+.5*r),n=e*Math.exp(-r*r-1.26551223+e*(1.00002368+e*(.37409196+e*(.09678418+e*(e*(.27886807+e*(e*(1.48851587+e*(.17087277*e-.82215223))-1.13520398))-.18628806))))),t>=0?n:2-n}class Gaussian{constructor(t,e){this.mean=t,this.stdev=Math.abs(e),this.variance=Math.pow(e,2)}static get normal(){return n}probabilityDensity(t){const r=this.stdev*Math.SQRT2*e;return Math.exp(-.5*Math.pow(this._z(t),2))/r}_z(t){return(t-this.mean)/this.stdev}probability(t){return.5*r(-this._z(t)/Math.SQRT2)}}t.Gaussian=Gaussian;const n=new Gaussian(0,1)}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){var e,r;class Lagrangian{constructor(...t){e.set(this,void 0),r.set(this,void 0),__classPrivateFieldSet(this,e,Array.from(t)||[],"f")}_unsafeCreate(){const t=__classPrivateFieldGet(this,e,"f")||[];let n,m="var ljs = [];\n";for(let e=0;e<t.length;e++){const r=t[e],a=r.x;if(null!=n&&n>=a)throw new Error("Invalid function provided.");n=a,m+=`ljs.push( ${r.y}`;for(let r=0;r<t.length;r++)if(r!==e){const e=t[r];m+=` * ((x - ${e.x})/${a-e.x})`}m+=");\n"}m+="return ljs.reduce((prev, next) => prev + next, 0);",__classPrivateFieldSet(this,r,new Function("x",m),"f")}_compute(t){const r=__classPrivateFieldGet(this,e,"f")||[];let n;const m=[];for(let e=0;e<r.length;e++){const a=r[e].x;if(null!=n&&n>=a)throw new Error("Invalid function provided.");n=a;let s=r[e].y;for(let n=0;n<r.length;n++)if(n!==e){const e=r[n];s*=(t-e.x)/(a-e.x)}m.push(s)}return m.reduce(((t,e)=>t+e),0)}interpolate(t){return"function"==typeof __classPrivateFieldGet(this,r,"f")?__classPrivateFieldGet(this,r,"f").apply(null,[t]):this._compute(t)}static create(...t){const e=(arguments.length>0&&Array.isArray(arguments[0])?arguments[0]:Array.from(t)).map(((t,e)=>"number"==typeof t?{x:e,y:t}:t)),r=new(Function.prototype.bind.apply(Lagrangian,[null].concat(e)));try{r._unsafeCreate()}catch(t){}return r}}e=new WeakMap,r=new WeakMap,t.Lagrangian=Lagrangian}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(e){!function(e){const r="0123456789abcdefghijklmnopqrstuvwxyz",n="Radix out of range: possible values go between positive 1 exclusive and 36 inclusive";class Utils{static lcd(...e){if(t.NullChecker.isNullOrEmpty(e)||e.length<=1)throw"Insufficient set of numbers.";function r(t,e){return e?r(e,t%e):0===e?t:NaN}function n(t,e){return t*e/r(t,e)}let m=Math.round(e[0]);for(let t=1;t<e.length;t++)m=n(m,Math.round(e[t]));return m}static gcd(t,e){return t=Math.round(t),e=Math.round(e),0===t?e:Utils.gcd(e%t,t)}static rebaseInt(e,r,n){return t.Numbers.rebase(e,r,n)}static rebaseFloat(t,e,r,n=12){const m=Utils.rebaseFloat10ToN,a=Utils.rebaseFloatNTo10;if(10===e){const e=parseFloat(t.toString());return r%1==0?Utils.rebaseFloat10ToNIntBase(e,r,n):m(e,r,n)}if(10===r)return a(t.toString(),e,n);return m(a(t.toString(),e,n+1),r,n)}static rebaseFloatNTo10(t,e,m=12){const a=r;if(e<=1||e>a.length)throw new Error(n);const s=(null!=t?t:"0").toString().toLowerCase(),i=Number.NaN;if("0"===s)return 0;const o=/^([-+]?) *([\da-z]+)?(.[\da-z]+)?$/.exec(s);if(o.length<2)return i;const c="-"===o[1]?-1:1,f=o[2]||"0",u=o[3]||".0";let l=0,h=0;for(let t of f+u.substr(1)){const r=a.indexOf(t);if(-1===r||r>=e)return i;l+=r*Math.pow(e,f.length-h-1),h++}return c*l}static rebaseFloat10ToNIntBase(t,e,m=12){const a=r;if(e<=1||e>36)throw new Error(n);const s=e;let i=Math.abs(null!=t?t:0);if(0===i||Number.isNaN(i))return t.toString();let o=(i%1).roundoff(),c="";for(;;){let t=i/s,e=Math.floor(t),r=(i-e*s).roundoff(),n=Math.floor(r);if(c=n>=36?`[${n}]`+c:a[n]+c,e<=0)break;i=e}if(c=c.replace(/^0+/,""),c||(c="0"),0===o)return c;let f="";do{i=(o*s).roundoff();const t=Math.floor(i),e=(i-t).roundoff();t>=36?f=`[${t}]`:f+=a[t],o=e}while(!o.isCloseTo(0)&&f.length<m);return/^0*$/.test(f)?c:(Math.sign(t)<0?"-":"")+c+"."+f.replace(/0+$/,"")}static rebaseFloat10ToN(e,m,a=12){const s=r;if(m<=1||m>s.length)throw new Error(n);const i=m;let o=Math.abs(null!=e?e:0);if(0===o||Number.isNaN(o))return e.toString();let c=Math.sign(e)<0?"-":"",f=[],u=[];for(let t=0;t<20;t++)f.push("0"),u.push("0");const l=i%1==0?i:Math.ceil(i);function h(t,e,r){const n=t?f:u,m=n[e]=n[e]||"0",a=s.indexOf(m)+r,i=a%l,o=Math.floor(a/l);return n[e]=s[i],o>0&&(t?h(t,e+1,o):0===e?h(!0,0,o):h(!1,e-1,o)),o}let y=0;for(;;){const e=Math.floor(t.Numbers.log(o,i)),r=e>=0;if(h(r,r?e:Math.abs(1+e),1),o=(o-Math.pow(i,e).roundoff()).roundoff(),r||y++,0===o||y>=100){const t=c+(f.reverse().map((t=>t||"0")).join("").replace(/^0+/,"")||"0"),e=u.map((t=>t||"0")).join("").substr(0,a).replace(/0+$/,"");return/^0*$/.test(e)?t:t+"."+e}}}}e.Utils=Utils}(e.NumberTheory||(e.NumberTheory={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={})),function(t){!function(t){!function(t){function e(t,e=!1){const r=this._varNum(t);return Math.sqrt(r/(t.length+(e?1:0)))}t.Utils=class Utils{static sum(t){return t.reduce(((t,e)=>t+e),0)}static mean(t){return this.sum(t)/t.length}static var(t){return function(t){const e=this.mean(t);return t.reduce(((t,r)=>Math.pow(r-e,2)+t),0)}(t)/t.length}static pstdev(t){return e(t,!1)}static sstdev(t){return e(t,!0)}static gaussian(e,r){return new t.Gaussian(e,r)}}}(t.DataAnalysis||(t.DataAnalysis={}))}(t.Mathematics||(t.Mathematics={}))}(Pacem||(Pacem={}));
|
package/dist/js/pacem-plus.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
/// <reference path="pacem-core.d.ts" />
|
|
7
7
|
/// <reference path="pacem-ui.d.ts" />
|
package/dist/js/pacem-plus.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.40.
|
|
2
|
+
* pacem v0.40.3 (https://js.pacem.it)
|
|
3
3
|
* Copyright 2023 Pacem (https://pacem.it)
|
|
4
|
-
* Licensed under
|
|
4
|
+
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
7
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|