@mxtommy/kip 3.8.2 → 3.9.0-beta.11
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/.github/copilot-instructions.md +1 -1
- package/CHANGELOG.md +3 -2
- package/package.json +1 -3
- package/public/3rdpartylicenses.txt +0 -26
- package/public/{chunk-SIMUFQFG.js → chunk-4JJLPUET.js} +1 -1
- package/public/{chunk-7BMBGIZI.js → chunk-53YH6WHF.js} +1 -1
- package/public/chunk-65LQUQJE.js +2 -0
- package/public/{chunk-KPQDHC2Z.js → chunk-7O6MKSQ3.js} +1 -1
- package/public/{chunk-4WFDZ6FH.js → chunk-AS4F4I3P.js} +1 -1
- package/public/{chunk-WD5WD3GY.js → chunk-CQXWGD3T.js} +1 -1
- package/public/{chunk-GQ3O7IYU.js → chunk-JNFARXLF.js} +11 -11
- package/public/chunk-KKHPIFEB.js +1 -0
- package/public/{chunk-OPPBJYH7.js → chunk-Q2Y75POI.js} +1 -1
- package/public/{chunk-ZWNGAG3P.js → chunk-RRTCHHRC.js} +1 -1
- package/public/chunk-TXPLRBW5.js +2 -0
- package/public/chunk-VHFBF47T.js +1 -0
- package/public/index.html +2 -2
- package/public/main-5BGEDP4B.js +53 -0
- package/public/{styles-RECKN66R.css → styles-GMXUNVLC.css} +1 -1
- package/public/assets/hammer.min.js +0 -7
- package/public/chunk-7VNHJHIE.js +0 -1
- package/public/chunk-FYMQ3PE4.js +0 -1
- package/public/chunk-SMXTNO74.js +0 -2
- package/public/chunk-TE3Z6IE7.js +0 -2
- package/public/main-ZQQ2KBG6.js +0 -237
|
@@ -57,7 +57,7 @@ Use this quick-start map to be productive in this repo. Prefer these concrete pa
|
|
|
57
57
|
|
|
58
58
|
## Project specifics & gotchas
|
|
59
59
|
- Always respect serve path /@mxtommy/kip/ (dev/prod). Assets and routing assume this base.
|
|
60
|
-
- CommonJS deps are explicitly allowed (howler,
|
|
60
|
+
- CommonJS deps are explicitly allowed (howler, js-quantities). Avoid introducing new CJS without adding to allowedCommonJsDependencies.
|
|
61
61
|
- Use standalone components, signals, @if/@for; follow .github/instructions/angular.instructions.md for style.
|
|
62
62
|
- Widget config UIs live under src/app/widget-config; path controls use custom validators (no Validators.required). Respect isPathConfigurable and pathRequired.
|
|
63
63
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# v 3.8.2
|
|
2
|
-
|
|
2
|
+
# Improvements
|
|
3
3
|
* Faster app loading with local font and font swap support
|
|
4
4
|
* Linux/RPi UI cleanup with removal of unnecessary scroll bars in multiple pages
|
|
5
5
|
* Increased mobile Wake Lock support
|
|
6
|
+
* Help component active page marker
|
|
6
7
|
## Fixes
|
|
7
|
-
*
|
|
8
|
+
* Dashboard card Drag & Drop and Long Press event collision preventing dashboard reordering in Chromium.
|
|
8
9
|
# v 3.8.1
|
|
9
10
|
## Improvements
|
|
10
11
|
* Expose option to invert pitch and roll axes in Horizon gauge widget
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxtommy/kip",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0-beta.11",
|
|
4
4
|
"description": "An advanced and versatile marine instrumentation package to display Signal K data.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"@godind/ng-canvas-gauges": "^6.2.1",
|
|
64
64
|
"@robloche/chartjs-plugin-streaming": "^3.1.0",
|
|
65
65
|
"@types/canvas-gauges": "^2.1.8",
|
|
66
|
-
"@types/hammerjs": "^2.0.45",
|
|
67
66
|
"@types/howler": "^2.2.10",
|
|
68
67
|
"@types/jasmine": "~3.6.0",
|
|
69
68
|
"@types/jasminewd2": "^2.0.9",
|
|
@@ -80,7 +79,6 @@
|
|
|
80
79
|
"date-fns": "^2.30.0",
|
|
81
80
|
"eslint": "^9.29.0",
|
|
82
81
|
"gridstack": "^11.4.0",
|
|
83
|
-
"hammerjs": "^2.0.8",
|
|
84
82
|
"howler": "^2.2.4",
|
|
85
83
|
"jasmine-core": "~4.0.1",
|
|
86
84
|
"jasmine-spec-reporter": "~5.0.0",
|
|
@@ -49,32 +49,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
49
49
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
50
50
|
SOFTWARE.
|
|
51
51
|
|
|
52
|
-
--------------------------------------------------------------------------------
|
|
53
|
-
Package: hammerjs
|
|
54
|
-
License: "MIT"
|
|
55
|
-
|
|
56
|
-
The MIT License (MIT)
|
|
57
|
-
|
|
58
|
-
Copyright (C) 2011-2014 by Jorik Tangelder (Eight Media)
|
|
59
|
-
|
|
60
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
61
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
62
|
-
in the Software without restriction, including without limitation the rights
|
|
63
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
64
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
65
|
-
furnished to do so, subject to the following conditions:
|
|
66
|
-
|
|
67
|
-
The above copyright notice and this permission notice shall be included in
|
|
68
|
-
all copies or substantial portions of the Software.
|
|
69
|
-
|
|
70
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
71
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
72
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
73
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
74
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
75
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
76
|
-
THE SOFTWARE.
|
|
77
|
-
|
|
78
52
|
--------------------------------------------------------------------------------
|
|
79
53
|
Package: gridstack
|
|
80
54
|
License: "MIT"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{d as $t}from"./chunk-TXPLRBW5.js";import{$b as Pe,$d as Ae,$e as Gt,A as st,Aa as q,Ab as xt,Ac as Dt,Ba as dt,Be as Ut,Ce as Xt,Da as A,Db as yt,Ea as Te,Ee as Yt,Fb as C,Gb as Ce,Hb as wt,I as ot,Id as E,K as O,Kd as At,Ke as ze,L as at,Mc as Oe,Me as Vt,Na as mt,Qa as L,Qb as vt,Qd as Lt,R as lt,Ra as ft,Rb as Y,Rd as zt,S as ct,Sb as Mt,Sd as Nt,Tb as Tt,V as ut,Va as gt,Xc as Ot,Xe as Zt,Yb as Rt,Zb as Ie,_b as Ee,_e as Ne,a as m,ac as V,b as S,bc as ue,be as Bt,cf as Qt,da as ht,ed as K,ef as Wt,f as rt,fa as oe,g as se,ga as j,gb as bt,gc as St,ha as ae,hc as Ct,hf as Kt,ic as De,id as J,jc as he,kc as z,lb as U,lc as Z,le as Ft,m as v,mc as N,me as jt,nb as Re,nc as pe,oa as pt,oc as It,oe as Ht,pa as Me,pb as _t,pc as G,qb as le,qc as Q,ra as y,rb as kt,sa as M,sb as X,se as qt,t as F,ta as f,te as Le,wb as $,wc as W,we as $e,xb as Se,yb as ce,yc as Et,za as H,zc as Pt}from"./chunk-35L7BBBD.js";function He(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var D=He();function sn(r){D=r}var ne={exec:()=>null};function g(r,i=""){let t=typeof r=="string"?r:r.source,e={replace:(n,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(x.caret,"$1"),t=t.replace(n,o),e},getRegex:()=>new RegExp(t,i)};return e}var x={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Mn=/^(?:[ \t]*(?:\n|$))+/,Tn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Rn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ie=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Sn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qe=/(?:[*+-]|\d{1,9}[.)])/,on=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,an=g(on).replace(/bull/g,qe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Cn=g(on).replace(/bull/g,qe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ue=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,In=/^[^\n]+/,Xe=/(?!\s*\])(?:\\.|[^\[\]\\])+/,En=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xe).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pn=g(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qe).getRegex(),be="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ye=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dn=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ye).replace("tag",be).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ln=g(Ue).replace("hr",ie).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",be).getRegex(),On=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ln).getRegex(),Ve={blockquote:On,code:Tn,def:En,fences:Rn,heading:Sn,hr:ie,html:Dn,lheading:an,list:Pn,newline:Mn,paragraph:ln,table:ne,text:In},Jt=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ie).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",be).getRegex(),An=S(m({},Ve),{lheading:Cn,table:Jt,paragraph:g(Ue).replace("hr",ie).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",be).getRegex()}),Ln=S(m({},Ve),{html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ye).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(Ue).replace("hr",ie).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",an).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),$n=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,zn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,cn=/^( {2,}|\\)\n(?!\s*$)/,Nn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_e=/[\p{P}\p{S}]/u,Ze=/[\s\p{P}\p{S}]/u,un=/[^\s\p{P}\p{S}]/u,Bn=g(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ze).getRegex(),hn=/(?!~)[\p{P}\p{S}]/u,Fn=/(?!~)[\s\p{P}\p{S}]/u,jn=/(?:[^\s\p{P}\p{S}]|~)/u,Hn=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,pn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,qn=g(pn,"u").replace(/punct/g,_e).getRegex(),Un=g(pn,"u").replace(/punct/g,hn).getRegex(),dn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xn=g(dn,"gu").replace(/notPunctSpace/g,un).replace(/punctSpace/g,Ze).replace(/punct/g,_e).getRegex(),Yn=g(dn,"gu").replace(/notPunctSpace/g,jn).replace(/punctSpace/g,Fn).replace(/punct/g,hn).getRegex(),Vn=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,un).replace(/punctSpace/g,Ze).replace(/punct/g,_e).getRegex(),Zn=g(/\\(punct)/,"gu").replace(/punct/g,_e).getRegex(),Gn=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Qn=g(Ye).replace("(?:-->|$)","-->").getRegex(),Wn=g("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Qn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),fe=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Kn=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",fe).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mn=g(/^!?\[(label)\]\[(ref)\]/).replace("label",fe).replace("ref",Xe).getRegex(),fn=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xe).getRegex(),Jn=g("reflink|nolink(?!\\()","g").replace("reflink",mn).replace("nolink",fn).getRegex(),Ge={_backpedal:ne,anyPunctuation:Zn,autolink:Gn,blockSkip:Hn,br:cn,code:zn,del:ne,emStrongLDelim:qn,emStrongRDelimAst:Xn,emStrongRDelimUnd:Vn,escape:$n,link:Kn,nolink:fn,punctuation:Bn,reflink:mn,reflinkSearch:Jn,tag:Wn,text:Nn,url:ne},ei=S(m({},Ge),{link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",fe).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe).getRegex()}),Be=S(m({},Ge),{emStrongRDelimAst:Yn,emStrongLDelim:Un,url:g(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),ti=S(m({},Be),{br:g(cn).replace("{2,}","*").getRegex(),text:g(Be.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),de={normal:Ve,gfm:An,pedantic:Ln},ee={normal:Ge,gfm:Be,breaks:ti,pedantic:ei},ni={"&":"&","<":"<",">":">",'"':""","'":"'"},en=r=>ni[r];function w(r,i){if(i){if(x.escapeTest.test(r))return r.replace(x.escapeReplace,en)}else if(x.escapeTestNoEncode.test(r))return r.replace(x.escapeReplaceNoEncode,en);return r}function tn(r){try{r=encodeURI(r).replace(x.percentDecode,"%")}catch{return null}return r}function nn(r,i){let t=r.replace(x.findPipe,(s,o,a)=>{let c=!1,l=o;for(;--l>=0&&a[l]==="\\";)c=!c;return c?"|":" |"}),e=t.split(x.splitPipe),n=0;if(e[0].trim()||e.shift(),e.length>0&&!e.at(-1)?.trim()&&e.pop(),i)if(e.length>i)e.splice(i);else for(;e.length<i;)e.push("");for(;n<e.length;n++)e[n]=e[n].trim().replace(x.slashPipe,"|");return e}function te(r,i,t){let e=r.length;if(e===0)return"";let n=0;for(;n<e;){let s=r.charAt(e-n-1);if(s===i&&!t)n++;else if(s!==i&&t)n++;else break}return r.slice(0,e-n)}function ii(r,i){if(r.indexOf(i[1])===-1)return-1;let t=0;for(let e=0;e<r.length;e++)if(r[e]==="\\")e++;else if(r[e]===i[0])t++;else if(r[e]===i[1]&&(t--,t<0))return e;return t>0?-2:-1}function rn(r,i,t,e,n){let s=i.href,o=i.title||null,a=r[1].replace(n.other.outputLinkReplace,"$1");e.state.inLink=!0;let c={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:o,text:a,tokens:e.inlineTokens(a)};return e.state.inLink=!1,c}function ri(r,i,t){let e=r.match(t.other.indentCodeCompensation);if(e===null)return i;let n=e[1];return i.split(`
|
|
3
3
|
`).map(s=>{let o=s.match(t.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=n.length?s.slice(n.length):s}).join(`
|
|
4
4
|
`)}var ge=class{options;rules;lexer;constructor(r){this.options=r||D}space(r){let i=this.rules.block.newline.exec(r);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(r){let i=this.rules.block.code.exec(r);if(i){let t=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?t:te(t,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-FYMQ3PE4.js";import{f as oe,n as ae}from"./chunk-ZBCOJLI4.js";import{k as I}from"./chunk-SMXTNO74.js";import{a as R}from"./chunk-7VNHJHIE.js";import{a as ie}from"./chunk-2YVW3TBK.js";import{A as B,D as G,E as K,H,K as z,N as Y,P as $,Q,R as X,T as Z,_ as ee,ca as te,da as ne,g as N,h as V,i as A,r as W,t as q,w as J,x as U}from"./chunk-TA4GACKT.js";import{$b as _,Aa as g,Cc as E,Ec as w,Fc as T,Fe as j,Gc as y,Nc as F,Sb as v,Tb as h,Ub as L,Vb as P,Wb as M,Xb as k,Yb as f,Zb as n,_b as i,f as O,gc as b,ic as m,kc as u,lb as c,ta as C,uc as x,wb as D,za as d,zc as o}from"./chunk-35L7BBBD.js";var le=()=>({standalone:!1});function se(r,p){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function ce(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",31)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",32),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigScope,t)||(a.saveConfigScope=t),g(t)}),n(5,"mat-option",33),o(6," Global "),i(),n(7,"mat-option",34),o(8," User "),i()()(),n(9,"mat-form-field",35)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",36),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigName,t)||(a.saveConfigName=t),g(t)}),i()(),v(13,se,2,0,"div"),i()}if(r&2){let e=u();c(4),w("ngModel",e.saveConfigScope),c(8),w("ngModel",e.saveConfigName),f("ngModelOptions",F(4,le)),c(),h(e.hasToken?-1:13)}}function de(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ge(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function pe(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",38),y("ngModelChange",function(t){d(e);let a=u();return T(a.deleteConfigItem,t)||(a.deleteConfigItem=t),g(t)}),M(5,ge,2,3,"mat-option",39,P),i()()()}if(r&2){let e=u();c(4),w("ngModel",e.deleteConfigItem),c(),k(e.serverConfigList)}}function me(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function fe(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function ue(r,p){if(r&1&&(n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",40),M(5,fe,2,3,"mat-option",39,L),i()()()),r&2){let e=u();c(5),k(e.serverConfigList)}}function Ce(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Ne=(()=>{class r{appSettingsService=C(A);storageSvc=C(V);appService=C(R);auth=C(N);fb=C($);pageTitle="Configurations";hasToken=!1;isTokenTypeDevice=!1;tokenSub;supportApplicationData=!1;serverConfigList=[];serverUpgradableConfigList=[];copyConfigForm;storageLocation=null;locations=["Local Storage","Server Storage"];saveConfigName=null;saveConfigScope=null;deleteConfigItem;jsonData=null;ngOnInit(){this.tokenSub=this.auth.authToken$.subscribe(e=>{e&&e.token?(this.hasToken=!0,this.isTokenTypeDevice=e.isDeviceAccessToken,e.isDeviceAccessToken?this.saveConfigScope="global":this.saveConfigScope="user"):this.hasToken=!1}),this.copyConfigForm=this.fb.group({sourceTarget:[{value:"",disabled:!1},q.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.hasToken&&this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return O(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(S){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",S)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=D({type:r,selectors:[["settings-config"]],decls:82,vars:8,consts:[["saveConfigForm","ngForm"],["deleteConfigForm","ngForm"],["fileInput",""],[3,"pageTitle"],[1,"page-content"],["routerLink","/help"],[1,"flex-container"],[1,"flex-item-rounded-card","rounded-card-color"],["name","saveConfigForm",3,"ngSubmit"],[2,"margin-bottom","16px"],[1,"no-token-notice"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit","color","accent",3,"disabled"],["name","deleteConfigForm",3,"ngSubmit"],[3,"ngSubmit","formGroup"],[1,"flex-item-reset","rounded-card-color"],[1,"config-operation-container",2,"margin-top","20px"],[1,"download-txt"],[1,"download-btn","btn-div"],["mat-flat-button","","type","button",1,"adv-btn",3,"click"],[1,"upload-txt"],[1,"upload-btn","btn-div"],["type","file","accept",".json","hidden","",3,"change"],["mat-flat-button","",1,"adv-btn",3,"click"],[1,"demo-txt"],[1,"demo-btn","btn-div"],[1,"reset-txt"],[1,"reset-btn","btn-div"],[1,"config-txt"],[1,"config-btn","btn-div"],[2,"width","25%"],["name","serverConfiScope","required","",3,"ngModelChange","ngModel"],["value","global"],["value","user"],[2,"width","70%","padding-left","3%"],["matInput","","name","serverConfigName","placeholder","Enter a name for the configuration","required","",3,"ngModelChange","ngModel","ngModelOptions"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();_(0,"page-header",3),n(1,"div",4)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",5),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",6)(8,"div",7)(9,"form",8,0),m("ngSubmit",function(){return d(a),g(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",9),o(14," Create a backup of the current active configuration on the server. "),i(),v(15,ce,14,5,"div")(16,de,3,0,"div",10),n(17,"div",11),_(18,"mat-divider",12),n(19,"button",13),o(20," Create "),i()()()(),n(21,"div",7)(22,"form",14,1),m("ngSubmit",function(){return d(a),g(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(24,"h2"),o(25,"Delete"),i(),n(26,"p",9),o(27," Select a backup configuration to permanently delete from the server. "),i(),v(28,pe,7,1,"div")(29,me,3,0,"div",10),n(30,"div",11),_(31,"mat-divider",12),n(32,"button",13),o(33," Delete "),i()()()(),n(34,"div",7)(35,"form",15),m("ngSubmit",function(){return d(a),g(t.copyConfig())}),n(36,"h2"),o(37,"Restore"),i(),n(38,"p",9),o(39," Replace the current configuration with a backup from the server. "),i(),v(40,ue,7,0,"div")(41,Ce,3,0,"div",10),n(42,"div",11),_(43,"mat-divider",12),n(44,"button",13),o(45," Restore "),i()()()(),n(46,"div",16)(47,"h2"),o(48,"Advanced"),i(),n(49,"div",17)(50,"div",18)(51,"p"),o(52,"Download the active configuration to a file."),i()(),n(53,"div",19)(54,"button",20),m("click",function(){return d(a),g(t.downloadJsonConfig())}),o(55," Download "),i()(),n(56,"div",21)(57,"p"),o(58," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(59,"div",22)(60,"input",23,2),m("change",function(S){return d(a),g(t.uploadJsonConfig(S))}),i(),n(62,"button",24),m("click",function(){d(a);let S=x(61);return g(S.click())}),o(63," Upload "),i()(),n(64,"div",25)(65,"p"),o(66," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(67,"div",26)(68,"button",20),m("click",function(){return d(a),g(t.loadDemoConfig())}),o(69," Demo "),i()(),n(70,"div",27)(71,"p"),o(72," Reset all your settings to default. The default configuration has a single Getting Started instruction widget. Your Signal K server connection settings will remain. "),i()(),n(73,"div",28)(74,"button",20),m("click",function(){return d(a),g(t.resetConfigToDefault())}),o(75," Default "),i()(),n(76,"div",29)(77,"p"),o(78," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(79,"div",30)(80,"button",20),m("click",function(){return d(a),g(t.resetConnectionToDefault())}),o(81," Connection "),i()()()()()()}if(l&2){let a=x(10),s=x(23);f("pageTitle",t.pageTitle),c(15),h(t.hasToken?15:16),c(4),f("disabled",!t.hasToken||!a.valid),c(9),h(t.hasToken?28:29),c(4),f("disabled",!t.hasToken||!s.valid),c(3),f("formGroup",t.copyConfigForm),c(5),h(t.hasToken?40:41),c(4),f("disabled",!t.copyConfigForm.valid)}},dependencies:[I,Q,K,W,J,U,Y,G,B,ie,j,ee,Z,ae,oe,te,X,H,z,re,ne],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:auto;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Ne as SettingsConfigComponent};
|
|
1
|
+
import{a as re}from"./chunk-VHFBF47T.js";import{f as oe,n as ae}from"./chunk-ZBCOJLI4.js";import{h as I}from"./chunk-TXPLRBW5.js";import{a as R}from"./chunk-KKHPIFEB.js";import{a as ie}from"./chunk-2YVW3TBK.js";import{A as B,D as G,E as K,H,K as z,N as Y,P as $,Q,R as X,T as Z,_ as ee,ca as te,da as ne,g as N,h as V,i as A,r as W,t as q,w as J,x as U}from"./chunk-TA4GACKT.js";import{$b as _,Aa as g,Cc as E,Ec as w,Fc as T,Fe as j,Gc as y,Nc as F,Sb as v,Tb as h,Ub as L,Vb as P,Wb as M,Xb as k,Yb as f,Zb as n,_b as i,f as O,gc as b,ic as m,kc as u,lb as c,ta as C,uc as x,wb as D,za as d,zc as o}from"./chunk-35L7BBBD.js";var le=()=>({standalone:!1});function se(r,p){r&1&&(n(0,"div"),o(1,' Writing to the server requires "Login to Server" authentication or a Device token '),i())}function ce(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",31)(2,"mat-label"),o(3,"Scope"),i(),n(4,"mat-select",32),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigScope,t)||(a.saveConfigScope=t),g(t)}),n(5,"mat-option",33),o(6," Global "),i(),n(7,"mat-option",34),o(8," User "),i()()(),n(9,"mat-form-field",35)(10,"mat-label"),o(11,"Configuration Name"),i(),n(12,"input",36),y("ngModelChange",function(t){d(e);let a=u();return T(a.saveConfigName,t)||(a.saveConfigName=t),g(t)}),i()(),v(13,se,2,0,"div"),i()}if(r&2){let e=u();c(4),w("ngModel",e.saveConfigScope),c(8),w("ngModel",e.saveConfigName),f("ngModelOptions",F(4,le)),c(),h(e.hasToken?-1:13)}}function de(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Server authentication or Device Token required"),i()())}function ge(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function pe(r,p){if(r&1){let e=b();n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",38),y("ngModelChange",function(t){d(e);let a=u();return T(a.deleteConfigItem,t)||(a.deleteConfigItem=t),g(t)}),M(5,ge,2,3,"mat-option",39,P),i()()()}if(r&2){let e=u();c(4),w("ngModel",e.deleteConfigItem),c(),k(e.serverConfigList)}}function me(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}function fe(r,p){if(r&1&&(n(0,"mat-option",39),o(1),i()),r&2){let e=p.$implicit;f("value",e),c(),E(" ",e.scope," / ",e.name," ")}}function ue(r,p){if(r&1&&(n(0,"div")(1,"mat-form-field",37)(2,"mat-label"),o(3,"Configuration"),i(),n(4,"mat-select",40),M(5,fe,2,3,"mat-option",39,L),i()()()),r&2){let e=u();c(5),k(e.serverConfigList)}}function Ce(r,p){r&1&&(n(0,"div",10)(1,"p"),o(2,"Authentication or Device Token required"),i()())}var Ne=(()=>{class r{appSettingsService=C(A);storageSvc=C(V);appService=C(R);auth=C(N);fb=C($);pageTitle="Configurations";hasToken=!1;isTokenTypeDevice=!1;tokenSub;supportApplicationData=!1;serverConfigList=[];serverUpgradableConfigList=[];copyConfigForm;storageLocation=null;locations=["Local Storage","Server Storage"];saveConfigName=null;saveConfigScope=null;deleteConfigItem;jsonData=null;ngOnInit(){this.tokenSub=this.auth.authToken$.subscribe(e=>{e&&e.token?(this.hasToken=!0,this.isTokenTypeDevice=e.isDeviceAccessToken,e.isDeviceAccessToken?this.saveConfigScope="global":this.saveConfigScope="user"):this.hasToken=!1}),this.copyConfigForm=this.fb.group({sourceTarget:[{value:"",disabled:!1},q.required]}),this.supportApplicationData=this.storageSvc.isAppDataSupported,this.hasToken&&this.getServerConfigList()}getServerConfigList(e){this.supportApplicationData&&this.storageSvc.listConfigs(e).then(l=>{let t=l.filter(a=>!(a.scope==="user"&&a.name==="default"));e?this.serverUpgradableConfigList=t:this.serverConfigList=t}).catch(l=>{switch(l.status){case 401:this.appService.sendSnackbarNotification("Application Storage Error: "+l.statusText+". Signal K configuration must meet the following requirements; 1) Security enabled. 2) Application Data Storage Interface: On. 3) Either Allow Readonly Access enabled, or connecting with a user.",0,!1);break;default:this.appService.sendSnackbarNotification("Error listing server configurations: "+l,3e3,!1);break}})}saveConfig(e,l,t,a,s){if(this.supportApplicationData){if(l==="user"&&t==="default"&&!s){this.appService.sendSnackbarNotification("Saving configuration with scope 'user' and name 'default' is not allowed.",5e3,!1);return}this.storageSvc.setConfig(l,t,e)?(this.appService.sendSnackbarNotification(`Configuration [${t}] saved to [${l}] storage scope`,5e3,!1),a||this.getServerConfigList()):this.appService.sendSnackbarNotification("Error saving configuration to server",0,!1)}}saveToLocalstorage(e){this.appSettingsService.replaceConfig("appConfig",e.app,!1),this.appSettingsService.replaceConfig("dashboardsConfig",e.dashboards,!1),this.appSettingsService.replaceConfig("themeConfig",e.theme,!1)}copyConfig(){return O(this,null,function*(){let e=null;try{yield this.storageSvc.getConfig(this.copyConfigForm.value.sourceTarget.scope,this.copyConfigForm.value.sourceTarget.name).then(l=>{e=l})}catch(l){this.appService.sendSnackbarNotification("Error retrieving configuration from server: "+l.statusText,3e3,!1);return}this.saveConfig(e,"user","default",!1,!0),this.appSettingsService.reloadApp()})}deleteConfig(e,l,t,a){this.storageSvc.removeItem(e,l,t),this.appService.sendSnackbarNotification(`Configuration [${l}] deleted from [${e}] storage scope`,5e3,!1),a||this.getServerConfigList()}resetConfigToDefault(){this.appSettingsService.resetSettings()}resetConnectionToDefault(){this.appSettingsService.resetConnection()}loadDemoConfig(){this.appSettingsService.loadDemoConfig()}getActiveConfig(){let e;return this.appSettingsService.useSharedConfig?e=this.getLocalConfigFromMemory():e=this.getLocalConfigFromLocalStorage(),e}getLocalConfigFromMemory(){return{app:this.appSettingsService.getAppConfig(),dashboards:this.appSettingsService.getDashboardConfig(),theme:this.appSettingsService.getThemeConfig()}}getLocalConfigFromLocalStorage(){return{app:this.appSettingsService.loadConfigFromLocalStorage("appConfig"),dashboards:this.appSettingsService.loadConfigFromLocalStorage("dashboardsConfig"),theme:this.appSettingsService.loadConfigFromLocalStorage("themeConfig")}}downloadJsonConfig(){let e=this.getActiveConfig(),l=JSON.stringify(e,null,2),t=new Blob([l],{type:"application/json"}),a=window.URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="KipConfig.json",document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(a)}uploadJsonConfig(e){let t=e.target.files?.[0];if(t&&t.type==="application/json"){let a=new FileReader;a.onload=s=>{try{this.jsonData=JSON.parse(s.target?.result),this.hasToken?this.saveConfig(this.jsonData,"user","default",!1,!0):this.saveToLocalstorage(this.jsonData),this.appSettingsService.reloadApp()}catch(S){this.appService.sendSnackbarNotification("Invalid JSON file",3e3,!1),console.error("Invalid JSON file:",S)}},a.readAsText(t)}else this.appService.sendSnackbarNotification("Please select a valid JSON file",0,!1)}ngOnDestroy(){this.tokenSub.unsubscribe()}static \u0275fac=function(l){return new(l||r)};static \u0275cmp=D({type:r,selectors:[["settings-config"]],decls:82,vars:8,consts:[["saveConfigForm","ngForm"],["deleteConfigForm","ngForm"],["fileInput",""],[3,"pageTitle"],[1,"page-content"],["routerLink","/help"],[1,"flex-container"],[1,"flex-item-rounded-card","rounded-card-color"],["name","saveConfigForm",3,"ngSubmit"],[2,"margin-bottom","16px"],[1,"no-token-notice"],[1,"formActionFooter"],[1,"formActionDivider"],["mat-flat-button","","type","submit","color","accent",3,"disabled"],["name","deleteConfigForm",3,"ngSubmit"],[3,"ngSubmit","formGroup"],[1,"flex-item-reset","rounded-card-color"],[1,"config-operation-container",2,"margin-top","20px"],[1,"download-txt"],[1,"download-btn","btn-div"],["mat-flat-button","","type","button",1,"adv-btn",3,"click"],[1,"upload-txt"],[1,"upload-btn","btn-div"],["type","file","accept",".json","hidden","",3,"change"],["mat-flat-button","",1,"adv-btn",3,"click"],[1,"demo-txt"],[1,"demo-btn","btn-div"],[1,"reset-txt"],[1,"reset-btn","btn-div"],[1,"config-txt"],[1,"config-btn","btn-div"],[2,"width","25%"],["name","serverConfiScope","required","",3,"ngModelChange","ngModel"],["value","global"],["value","user"],[2,"width","70%","padding-left","3%"],["matInput","","name","serverConfigName","placeholder","Enter a name for the configuration","required","",3,"ngModelChange","ngModel","ngModelOptions"],[2,"width","100%"],["name","selectedDeleteItem","required","",3,"ngModelChange","ngModel"],[3,"value"],["formControlName","sourceTarget"]],template:function(l,t){if(l&1){let a=b();_(0,"page-header",3),n(1,"div",4)(2,"p"),o(3," Recommended Reading: To understand configuration management and storage options, consult the "),n(4,"a",5),o(5,"Configuration Management Help"),i(),o(6," section. "),i(),n(7,"div",6)(8,"div",7)(9,"form",8,0),m("ngSubmit",function(){return d(a),g(t.saveConfig(t.getActiveConfig(),t.saveConfigScope,t.saveConfigName))}),n(11,"h2"),o(12,"Backup"),i(),n(13,"p",9),o(14," Create a backup of the current active configuration on the server. "),i(),v(15,ce,14,5,"div")(16,de,3,0,"div",10),n(17,"div",11),_(18,"mat-divider",12),n(19,"button",13),o(20," Create "),i()()()(),n(21,"div",7)(22,"form",14,1),m("ngSubmit",function(){return d(a),g(t.deleteConfig(t.deleteConfigItem.scope,t.deleteConfigItem.name))}),n(24,"h2"),o(25,"Delete"),i(),n(26,"p",9),o(27," Select a backup configuration to permanently delete from the server. "),i(),v(28,pe,7,1,"div")(29,me,3,0,"div",10),n(30,"div",11),_(31,"mat-divider",12),n(32,"button",13),o(33," Delete "),i()()()(),n(34,"div",7)(35,"form",15),m("ngSubmit",function(){return d(a),g(t.copyConfig())}),n(36,"h2"),o(37,"Restore"),i(),n(38,"p",9),o(39," Replace the current configuration with a backup from the server. "),i(),v(40,ue,7,0,"div")(41,Ce,3,0,"div",10),n(42,"div",11),_(43,"mat-divider",12),n(44,"button",13),o(45," Restore "),i()()()(),n(46,"div",16)(47,"h2"),o(48,"Advanced"),i(),n(49,"div",17)(50,"div",18)(51,"p"),o(52,"Download the active configuration to a file."),i()(),n(53,"div",19)(54,"button",20),m("click",function(){return d(a),g(t.downloadJsonConfig())}),o(55," Download "),i()(),n(56,"div",21)(57,"p"),o(58," Select a configuration file to upload. The file must be a valid KIP configuration file of JSON format. "),i()(),n(59,"div",22)(60,"input",23,2),m("change",function(S){return d(a),g(t.uploadJsonConfig(S))}),i(),n(62,"button",24),m("click",function(){d(a);let S=x(61);return g(S.click())}),o(63," Upload "),i()(),n(64,"div",25)(65,"p"),o(66," Load the demonstration configuration and connection to Signal K demo server. WARNING: This will completely reset all your settings. "),i()(),n(67,"div",26)(68,"button",20),m("click",function(){return d(a),g(t.loadDemoConfig())}),o(69," Demo "),i()(),n(70,"div",27)(71,"p"),o(72," Reset all your settings to default. The default configuration has a single Getting Started instruction widget. Your Signal K server connection settings will remain. "),i()(),n(73,"div",28)(74,"button",20),m("click",function(){return d(a),g(t.resetConfigToDefault())}),o(75," Default "),i()(),n(76,"div",29)(77,"p"),o(78," Clear the current connection configuration. This only affects Connectivity tab settings. "),i()(),n(79,"div",30)(80,"button",20),m("click",function(){return d(a),g(t.resetConnectionToDefault())}),o(81," Connection "),i()()()()()()}if(l&2){let a=x(10),s=x(23);f("pageTitle",t.pageTitle),c(15),h(t.hasToken?15:16),c(4),f("disabled",!t.hasToken||!a.valid),c(9),h(t.hasToken?28:29),c(4),f("disabled",!t.hasToken||!s.valid),c(3),f("formGroup",t.copyConfigForm),c(5),h(t.hasToken?40:41),c(4),f("disabled",!t.copyConfigForm.valid)}},dependencies:[I,Q,K,W,J,U,Y,G,B,ie,j,ee,Z,ae,oe,te,X,H,z,re,ne],styles:['[_nghost-%COMP%]{display:block;height:100%;width:100%}.page-content[_ngcontent-%COMP%]{width:100%;height:calc(100% - 63px);overflow-y:auto;scroll-behavior:smooth;padding:0 24px 10px}.flex-item-copy[_ngcontent-%COMP%]{flex:2 1 41%;padding:10px 20px;border-radius:15px}.flex-item-reset[_ngcontent-%COMP%]{flex:1 1 100%;padding:10px 20px;border-radius:15px}a[_ngcontent-%COMP%]{font-size:14px}a[_ngcontent-%COMP%]:hover{text-decoration:underline;cursor:pointer}a[_ngcontent-%COMP%]:link, a[_ngcontent-%COMP%]:visited{color:#8ab4f8;text-decoration:none}.warningText[_ngcontent-%COMP%]{padding-left:15px}.no-token-notice[_ngcontent-%COMP%]{height:58px;contain:content;text-align:center;font-style:italic}.mat-mdc-radio-button[_ngcontent-%COMP%] ~ .mat-radio-button[_ngcontent-%COMP%]{margin-right:16px;margin-left:16px}.config-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-basis:100%;flex:1;margin:0 10px}.sources-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.sources-radio-button[_ngcontent-%COMP%]{margin:5px;margin-left:0!important}.select-config[_ngcontent-%COMP%]{margin-left:0}.config-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.btn-div[_ngcontent-%COMP%]{align-self:center}.adv-btn[_ngcontent-%COMP%]{width:100%}.config-operation-container[_ngcontent-%COMP%]{display:grid;grid-template-columns:[col-start] auto [col1-end] min-content [col2-end];grid-template-rows:[row-start] max-content [row1-end] max-content [row2-end];grid-template-areas:"download-txt download-btn" "upload-txt upload-btn" "demo-txt demo-btn" "reset-txt reset-btn" "config-txt config-btn";row-gap:20px;column-gap:10px}.upload-txt[_ngcontent-%COMP%]{grid-area:upload-txt}.upload-btn[_ngcontent-%COMP%]{grid-area:upload-btn}.download-txt[_ngcontent-%COMP%]{grid-area:download-txt}.download-btn[_ngcontent-%COMP%]{grid-area:download-btn}.demo-txt[_ngcontent-%COMP%]{grid-area:demo-txt}.demo-btn[_ngcontent-%COMP%]{grid-area:demo-btn}.reset-txt[_ngcontent-%COMP%]{grid-area:reset-txt}.reset-btn[_ngcontent-%COMP%]{grid-area:reset-btn}.config-txt[_ngcontent-%COMP%]{grid-area:config-txt}.config-btn[_ngcontent-%COMP%]{grid-area:config-btn}']})}return r})();export{Ne as SettingsConfigComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as $t,b as Ut,e as te,f as ee,g as ie,h as se,i as ne,j as re,l as oe,m as ae,o as le,p as de}from"./chunk-JNFARXLF.js";import"./chunk-PKNLASTF.js";import"./chunk-VYUMZVH2.js";import"./chunk-CBUY7NMR.js";import"./chunk-JY3WVS7C.js";import{a as ce}from"./chunk-VHFBF47T.js";import"./chunk-ZBCOJLI4.js";import{m as $,n as U}from"./chunk-TXPLRBW5.js";import"./chunk-3LEMFOCV.js";import"./chunk-KKHPIFEB.js";import"./chunk-2YVW3TBK.js";import"./chunk-TA4GACKT.js";import{$b as zt,A as Et,Aa as y,Ac as ot,Da as kt,Ea as tt,Fb as b,Gb as V,Ge as Yt,Hb as Lt,Ie as Xt,J as Rt,Ja as et,K as B,Mc as at,Na as Ot,Qa as it,R as Ct,Rb as Nt,Rd as Wt,Sb as At,Sd as Zt,Tb as Ft,Td as G,Ue as Jt,Vd as L,Wb as Ht,We as Qt,Xb as Bt,Yb as Vt,Yd as dt,Zb as _,_b as m,_d as S,be as jt,de as qt,ed as lt,fa as J,g as R,ga as It,gc as z,ha as M,ia as Tt,ic as x,id as k,j as X,jd as Gt,kc as E,lb as I,le as Kt,m as p,o as yt,oa as Q,ob as st,q as xt,ra as C,sb as Mt,se as ct,ta as c,wb as T,wc as rt,yb as nt,za as P,zc as v}from"./chunk-35L7BBBD.js";function _t(r){let e=r.cloneNode(!0),t=e.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();e.removeAttribute("id");for(let s=0;s<t.length;s++)t[s].removeAttribute("id");return i==="canvas"?_e(r,e):(i==="input"||i==="select"||i==="textarea")&&pe(r,e),he("canvas",r,e,_e),he("input, textarea, select",r,e,pe),e}function he(r,e,t,i){let s=e.querySelectorAll(r);if(s.length){let n=t.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var Ge=0;function pe(r,e){e.type!=="file"&&(e.value=r.value),e.type==="radio"&&e.name&&(e.name=`mat-clone-${e.name}-${Ge++}`)}function _e(r,e){let t=e.getContext("2d");if(t)try{t.drawImage(r,0,0)}catch{}}function Dt(r){let e=r.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height,x:e.x,y:e.y}}function gt(r,e,t){let{top:i,bottom:s,left:n,right:o}=r;return t>=i&&t<=s&&e>=n&&e<=o}function $e(r,e){let t=e.left<r.left,i=e.left+e.width>r.right,s=e.top<r.top,n=e.top+e.height>r.bottom;return t||i||s||n}function F(r,e,t){r.top+=e,r.bottom=r.top+r.height,r.left+=t,r.right=r.left+r.width}function ge(r,e,t,i){let{top:s,right:n,bottom:o,left:a,width:l,height:d}=r,h=l*e,u=d*e;return i>s-u&&i<o+u&&t>a-h&&t<n+h}var W=class{_document;positions=new Map;constructor(e){this._document=e}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),e.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:Dt(t)})})}handleScroll(e){let t=L(e),i=this.positions.get(t);if(!i)return null;let s=i.scrollPosition,n,o;if(t===this._document){let d=this.getViewportScrollPosition();n=d.top,o=d.left}else n=t.scrollTop,o=t.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((d,h)=>{d.clientRect&&t!==h&&t.contains(h)&&F(d.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Ce(r,e){let t=r.rootNodes;if(t.length===1&&t[0].nodeType===e.ELEMENT_NODE)return t[0];let i=e.createElement("div");return t.forEach(s=>i.appendChild(s)),i}function bt(r,e,t){for(let i in e)if(e.hasOwnProperty(i)){let s=e[i];s?r.setProperty(i,s,t?.has(i)?"important":""):r.removeProperty(i)}return r}function O(r,e){let t=e?"":"none";bt(r.style,{"touch-action":e?"":"none","-webkit-user-drag":e?"":"none","-webkit-tap-highlight-color":e?"":"transparent","user-select":t,"-ms-user-select":t,"-webkit-user-select":t,"-moz-user-select":t})}function ue(r,e,t){bt(r.style,{position:e?"":"fixed",top:e?"":"0",opacity:e?"":"0",left:e?"":"-999em"},t)}function Z(r,e){return e&&e!="none"?r+" "+e:r}function me(r,e){r.style.width=`${e.width}px`,r.style.height=`${e.height}px`,r.style.transform=H(e.left,e.top)}function H(r,e){return`translate3d(${Math.round(r)}px, ${Math.round(e)}px, 0)`}function fe(r){let e=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*e}function Ue(r){let e=getComputedStyle(r),t=ht(e,"transition-property"),i=t.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=t.indexOf(i),n=ht(e,"transition-duration"),o=ht(e,"transition-delay");return fe(n[s])+fe(o[s])}function ht(r,e){return r.getPropertyValue(e).split(",").map(i=>i.trim())}var We=new Set(["position"]),ut=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(e,t,i,s,n,o,a,l,d,h){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),ve(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(e){this._preview.style.transform=e}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e)}getTransitionDuration(){return Ue(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){let e=this._previewTemplate,t=this._previewClass,i=e?e.template:null,s;if(i&&e){let n=e.matchSize?this._initialDomRect:null,o=e.viewContainer.createEmbeddedView(i,e.context);o.detectChanges(),s=Ce(o,this._document),this._previewEmbeddedView=o,e.matchSize?me(s,n):s.style.transform=H(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=_t(this._rootElement),me(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return bt(s.style,{"pointer-events":"none",margin:ve(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},We),O(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(n=>s.classList.add(n)):s.classList.add(t)),s}};function ve(r){return"showPopover"in r}var Ze={passive:!0},De={passive:!1},je={passive:!1,capture:!0},qe=800,be="cdk-drag-placeholder",we=new Set(["position"]),mt=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=et(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new p;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=R.EMPTY;_pointerUpSubscription=R.EMPTY;_scrollSubscription=R.EMPTY;_resizeSubscription=R.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>O(t,e)))}_disabled=!1;beforeStarted=new p;started=new p;released=new p;ended=new p;entered=new p;exited=new p;dropped=new p;moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,s,n,o,a){this._config=t,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new W(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(i=>S(i)),this._handles.forEach(i=>O(i,this.disabled)),this._toggleNativeDragInteractions();let t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){let t=S(e);if(t!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,De),i.listen(t,"touchstart",this._pointerDown,Ze),i.listen(t,"dragstart",this._nativeDragStart,De)]),this._initialTransform=void 0,this._rootElement=t}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?S(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&$e(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect(),i=0,s=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?s=e.top-t.top:t.bottom>e.bottom&&(s=e.bottom-t.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=H(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),O(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),O(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){let e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){let e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)};_pointerMove=e=>{let t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){let s=Math.abs(t.x-this._pickupPositionOnPage.x),n=Math.abs(t.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!a){this._endDragSequence(e);return}(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(e)))}return}e.cancelable&&e.preventDefault();let i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=e=>{this._endDragSequence(e)};_endDragSequence(e){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(e){N(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",Ke,je)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new ut(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,t)),ue(s,!1,we),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();let i=this.isDragging(),s=N(t),n=!s&&t.button!==0,o=this._rootElement,a=L(t),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+qe>Date.now(),d=s?Zt(t):Wt(t);if(a&&a.draggable&&t.type==="mousedown"&&t.preventDefault(),i||n||l||d)return;if(this._handles.length){let w=o.style;this._rootElementTapHighlight=w.webkitTapHighlightColor||"",w.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(w=>this._updateOnScroll(w)),this._boundaryElement&&(this._boundaryRect=Dt(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);let u=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:u.x,y:u.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){ue(this._rootElement,!0,we),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let t=this._dropContainer,i=t.getItemIndex(this),s=this._getPointerPositionOnPage(e),n=this._getDragDistance(s),o=t._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,e),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,e,t,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);let t=this._preview.getTransitionDuration();return t===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&L(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,t*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let e=this._placeholderTemplate,t=e?e.template:null,i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=Ce(this._placeholderRef,this._document)):i=_t(this._rootElement),i.style.pointerEvents="none",i.classList.add(be),i}_getPointerPositionInElement(e,t,i){let s=t===this._rootElement?null:t,n=s?s.getBoundingClientRect():e,o=N(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,d=o.pageY-n.top-a.top;return{x:n.left-e.left+l,y:n.top-e.top+d}}_getPointerPositionOnPage(e){let t=this._getViewportScrollPosition(),i=N(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,s=i.pageX-t.left,n=i.pageY-t.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(e){let t=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if(this.lockAxis==="x"||t==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||t==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+o,u=a.bottom-(d-o),w=a.left+n,K=a.right-(l-n);i=Se(i,w,K),s=Se(s,h,u)}return{x:i,y:s}}_updatePointerDirectionDelta(e){let{x:t,y:i}=e,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(t-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=t>n.x?1:-1,n.x=t),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,O(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){let i=1/this.scale,s=H(e*i,t*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=Z(s,this._initialTransform)}_applyPreviewTransform(e,t){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=H(e,t);this._preview.setTransform(Z(s,i))}_getDragDistance(e){let t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(e===0&&t===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(e+=n),o>0&&(e-=o)):e=0,s.height>i.height?(a>0&&(t+=a),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){let t=this.dragStartDelay;return typeof t=="number"?t:N(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){let t=this._parentPositions.handleScroll(e);if(t){let i=L(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&F(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=G(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){let i=this._previewContainer||"global";if(i==="parent")return e;if(i==="global"){let s=this._document;return t||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return S(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){let t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault()}else this.disabled||e.preventDefault()};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){let s=this._anchor??=_t(this._placeholder);s.classList.remove(be),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):S(t.element).appendChild(s)}}};function Se(r,e,t){return Math.max(e,Math.min(t,r))}function N(r){return r.type[0]==="t"}function Ke(r){r.preventDefault()}function q(r,e,t){let i=Pe(e,r.length-1),s=Pe(t,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function Pe(r,e){return Math.max(0,Math.min(e,r))}var j=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(e){this._dragDropRegistry=e}_previousSwap={drag:null,delta:0,overlaps:!1};start(e){this.withItems(e)}sort(e,t,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(e,t,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(f=>f.drag===e),d=n[o],h=n[l].clientRect,u=d.clientRect,w=l>o?1:-1,K=this._getItemOffsetPx(h,u,w),Be=this._getSiblingOffsetPx(l,n,w),Ve=n.slice();return q(n,l,o),n.forEach((f,ze)=>{if(Ve[ze]===f)return;let wt=f.drag===e,Y=wt?K:Be,St=wt?e.getPlaceholderElement():f.drag.getRootElement();f.offset+=Y;let Pt=Math.round(f.offset*(1/f.drag.scale));a?(St.style.transform=Z(`translate3d(${Pt}px, 0, 0)`,f.initialTransform),F(f.clientRect,0,Y)):(St.style.transform=Z(`translate3d(0, ${Pt}px, 0)`,f.initialTransform),F(f.clientRect,Y,0))}),this._previousSwap.overlaps=gt(u,t,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(e,t,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(e,t,i):s,o=this._activeDraggables,a=o.indexOf(e),l=e.getPlaceholderElement(),d=o[n];if(d===e&&(d=o[n+1]),!d&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(d=o[0]),a>-1&&o.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),o.splice(n,0,e)}else this._element.appendChild(l),o.push(e);l.style.transform="",this._cacheItemPositions()}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions()}withSortPredicate(e){this._sortPredicate=e}reset(){this._activeDraggables?.forEach(e=>{let t=e.getRootElement();if(t){let i=this._itemPositions.find(s=>s.drag===e)?.initialTransform;t.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e)}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{F(i,e,t)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(e){this._element=e}_cacheItemPositions(){let e=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(t=>{let i=t.getVisibleElement();return{drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:Dt(i)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(e,t,i){let s=this.orientation==="horizontal",n=s?t.left-e.left:t.top-e.top;return i===-1&&(n+=s?t.width-e.width:t.height-e.height),n}_getSiblingOffsetPx(e,t,i){let s=this.orientation==="horizontal",n=t[e].clientRect,o=t[e+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",d=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[d]:a+=n[l]-o.clientRect[d]}return a}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?e>=o.right:t>=o.bottom}else{let o=i[0].clientRect;return s?e<=o.left:t<=o.top}}_getItemIndexFromPointerPosition(e,t,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===e)return!1;if(s){let d=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return n?t>=Math.floor(l.left)&&t<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,e)?-1:o}},ft=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t}start(e){let t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){let s=t[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(e)}sort(e,t,i,s){let n=this._getItemIndexFromPointerPosition(e,t,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===e)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(e),d=e.getPlaceholderElement(),h=a.getRootElement();n>l?h.after(d):h.before(d),q(this._activeItems,l,n);let u=this._getRootNode().elementFromPoint(t,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=h===u||h.contains(u),{previousIndex:l,currentIndex:n}}enter(e,t,i,s){let n=this._activeItems.indexOf(e);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(e,t,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(e,t,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,e),a.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()))}withItems(e){this._activeItems=e.slice()}withSortPredicate(e){this._sortPredicate=e}reset(){let e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===e&&s.nextSibling!==n&&(n===null?e.appendChild(s):n.parentNode===e&&e.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}getItemAtIndex(e){return this._activeItems[e]||null}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()})}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0)}_getItemIndexFromPointerPosition(e,t,i){let s=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,e)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=G(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==e){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(t-l,i-d);h<s&&(s=h,n=o)}}return n}},ye=.05,Ie=.05,D=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(D||{}),g=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(g||{}),vt=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new p;entered=new p;exited=new p;dropped=new p;sorted=new p;receivingStarted=new p;receivingStopped=new p;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=R.EMPTY;_verticalScrollDirection=D.NONE;_horizontalScrollDirection=g.NONE;_scrollNode;_stopScrollTimers=new p;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,s,n){this._dragDropRegistry=t,this._ngZone=s,this._viewportRuler=n;let o=this.element=S(e);this._document=i,this.withOrientation("vertical").withElementContainer(o),t.registerDropContainer(this),this._parentPositions=new W(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(e,t,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(e){let t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(s=>s.isDragging()).every(s=>e.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof j&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if(e==="mixed")this._sortStrategy=new ft(this._document,this._dragDropRegistry);else{let t=new j(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this}withScrollableParents(e){let t=this._container;return this._scrollableElements=e.indexOf(t)===-1?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;let t=S(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,s){if(this.sortingDisabled||!this._domRect||!ge(this._domRect,ye,t,i))return;let n=this._sortStrategy.sort(e,t,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:e})}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,s=D.NONE,n=g.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||ge(o.clientRect,ye,e,t)&&([s,n]=Ye(a,o.clientRect,this._direction,e,t),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Te(l,t),n=ke(l,e),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let e=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Rt(0,xt).pipe(M(this._stopScrollTimers)).subscribe(()=>{let e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===D.UP?e.scrollBy(0,-t):this._verticalScrollDirection===D.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===g.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===g.RIGHT&&e.scrollBy(t,0)})};_isOverContainer(e,t){return this._domRect!=null&>(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(s=>s._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._domRect||!gt(this._domRect,t,i)||!this.enterPredicate(e,this))return!1;let s=this._getShadowRoot().elementFromPoint(t,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(e,t){let i=this._activeSiblings;!i.has(e)&&t.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}))}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){let t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let e=G(this._container);this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}};function Te(r,e){let{top:t,bottom:i,height:s}=r,n=s*Ie;return e>=t-n&&e<=t+n?D.UP:e>=i-n&&e<=i+n?D.DOWN:D.NONE}function ke(r,e){let{left:t,right:i,width:s}=r,n=s*Ie;return e>=t-n&&e<=t+n?g.LEFT:e>=i-n&&e<=i+n?g.RIGHT:g.NONE}function Ye(r,e,t,i,s){let n=Te(e,s),o=ke(e,i),a=D.NONE,l=g.NONE;if(n){let d=r.scrollTop;n===D.UP?d>0&&(a=D.UP):r.scrollHeight-d>r.clientHeight&&(a=D.DOWN)}if(o){let d=r.scrollLeft;t==="rtl"?o===g.RIGHT?d<0&&(l=g.RIGHT):r.scrollWidth+d>r.clientWidth&&(l=g.LEFT):o===g.LEFT?d>0&&(l=g.LEFT):r.scrollWidth-d>r.clientWidth&&(l=g.RIGHT)}return[a,l]}var A={capture:!0},pt={passive:!1,capture:!0},Xe=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=T({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return r})(),Oe=(()=>{class r{_ngZone=c(V);_document=c(tt);_styleLoader=c(jt);_renderer=c(st).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new p;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=et([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new p;pointerUp=new p;constructor(){}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,pt)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(t,i){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(Xe),this._activeDragInstances.update(s=>[...s,t]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),A],["selectstart",this._preventDefaultWhileDragging,pt]];s?o.push(["touchend",n,A],["touchcancel",n,A]):o.push(["mouseup",n,A]),s||o.push(["mousemove",a=>this.pointerMove.next(a),pt]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d))})}}stopDragging(t){this._activeDragInstances.update(i=>{let s=i.indexOf(t);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){let i=[this._scroll];return t&&t!==this._document&&i.push(new X(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(t,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},A);return()=>{n()}}))),B(...i)}registerDirectiveNode(t,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,i)}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t)}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault()};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||r)};static \u0275prov=Q({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),Je={dragStartThreshold:5,pointerDirectionChangeThreshold:5},Me=(()=>{class r{_document=c(tt);_ngZone=c(V);_viewportRuler=c(Qt);_dragDropRegistry=c(Oe);_renderer=c(st).createRenderer(null,null);constructor(){}createDrag(t,i=Je){return new mt(t,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(t){return new vt(t,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=Q({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),xe=new C("CDK_DRAG_PARENT");var Qe=new C("CdkDragHandle");var Le=new C("CDK_DRAG_CONFIG"),Ne=new C("CdkDropList"),Ae=(()=>{class r{element=c(it);dropContainer=c(Ne,{optional:!0,skipSelf:!0});_ngZone=c(V);_viewContainerRef=c(Mt);_dir=c(ct,{optional:!0});_changeDetectorRef=c(lt);_selfHandle=c(Qe,{optional:!0,self:!0});_parentDrag=c(xe,{optional:!0,skipSelf:!0});_dragDropRegistry=c(Oe);_destroyed=new p;_handles=new yt([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new b;released=new b;ended=new b;entered=new b;exited=new b;dropped=new b;moved=new X(t=>{let i=this._dragRef.moved.pipe(Et(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(t);return()=>{i.unsubscribe()}});_injector=c(kt);constructor(){let t=this.dropContainer,i=c(Le,{optional:!0}),s=c(Me);this._dragRef=s.createDrag(this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),t&&(t.addItem(this),t._dropListRef.beforeStarted.pipe(M(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){Lt(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(t){let i=t.rootElementSelector,s=t.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(t){let i=this._handles.getValue();i.push(t),this._handles.next(i)}_removeHandle(t){let i=this._handles.getValue(),s=i.indexOf(t);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(t){this._previewTemplate=t}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(t){this._placeholderTemplate=t}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let t=this.element.nativeElement,i=t;this.rootElementSelector&&(i=t.closest!==void 0?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||t)}_getBoundaryElement(){let t=this.boundaryElement;return t?typeof t=="string"?this.element.nativeElement.closest(t):S(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay=typeof s=="object"&&s?s:dt(s),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&t.withDirection(i.value)}}),t.beforeStarted.pipe(Ct(1)).subscribe(()=>{if(this._parentDrag){t.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){t.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(t){t.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),t.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(t){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:h}=t;this.disabled=l??!1,this.dragStartDelay=s||0,i&&(this.lockAxis=i),n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Tt(t=>{let i=t.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),It(t=>B(...t.map(i=>i._stateChanges.pipe(J(i))))),M(this._destroyed)).subscribe(t=>{let i=this._dragRef,s=t.element.nativeElement;t.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=nt({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&rt("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",k],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Gt]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[at([{provide:xe,useExisting:r}]),Ot]})}return r})(),Ee=new C("CdkDropListGroup");var Fe=(()=>{class r{element=c(it);_changeDetectorRef=c(lt);_scrollDispatcher=c(Jt);_dir=c(ct,{optional:!0});_group=c(Ee,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new p;_scrollableParentsResolved;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation;id=c(Kt).getId("cdk-drop-list-");lockAxis;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t}_disabled;sortingDisabled;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled;autoScrollStep;elementContainerSelector;hasAnchor;dropped=new b;entered=new b;exited=new b;sorted=new b;_unsortedItems=new Set;constructor(){let t=c(Me),i=c(Le,{optional:!0});this._dropListRef=t.createDropList(this.element),this._dropListRef.data=this,i&&this._assignDefaults(i),this._dropListRef.enterPredicate=(s,n)=>this.enterPredicate(s.data,n.data),this._dropListRef.sortPredicate=(s,n,o)=>this.sortPredicate(s,n.data,o.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),r._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(t){this._unsortedItems.add(t),t._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(t._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,i)=>t._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let t=r._dropLists.indexOf(this);t>-1&&r._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(t){this._dir&&this._dir.change.pipe(J(this._dir.value),M(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{let i=qt(this.connectedTo).map(s=>{if(typeof s=="string"){let n=r._dropLists.find(o=>o.id===s);return n}return s});if(this._group&&this._group._items.forEach(s=>{i.indexOf(s)===-1&&i.push(s)}),!this._scrollableParentsResolved){let s=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(n=>n.getElementRef().nativeElement);this._dropListRef.withScrollableParents(s),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let s=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(s)}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=dt(this.autoScrollStep,2),t.hasAnchor=this.hasAnchor,t.connectedTo(i.filter(s=>s&&s!==this).map(s=>s._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),t.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),B(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(t){let{lockAxis:i,draggingDisabled:s,sortingDisabled:n,listAutoScrollDisabled:o,listOrientation:a}=t;this.disabled=s??!1,this.sortingDisabled=n??!1,this.autoScrollDisabled=o??!1,this.orientation=a||"vertical",i&&(this.lockAxis=i)}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t)}static \u0275fac=function(i){return new(i||r)};static \u0275dir=nt({type:r,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,s){i&2&&(Nt("id",s.id),rt("cdk-drop-list-disabled",s.disabled)("cdk-drop-list-dragging",s._dropListRef.isDragging())("cdk-drop-list-receiving",s._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",k],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",k],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",k],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",k]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[at([{provide:Ee,useValue:void 0},{provide:Ne,useExisting:r}])]})}return r})();function ei(r,e){if(r&1){let t=z();_(0,"button",0),x("click",function(){P(t);let s=E();return y(s.clickAction("cancel"))}),_(1,"mat-icon",1),v(2,"close"),m(),_(3,"span"),v(4,"Close"),m()()}}var He=(()=>{class r{_bottomSheetRef=c(se);data=c(ie);showCancel=!!(this.data&&this.data.showCancel);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=T({type:r,selectors:[["dashboards-manage-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(i,s){i&1&&(_(0,"mat-action-list")(1,"button",0),x("click",function(){return s.clickAction("duplicate")}),_(2,"mat-icon",1),v(3,"content_copy"),m(),_(4,"span"),v(5,"Duplicate"),m()(),_(6,"button",0),x("click",function(){return s.clickAction("delete")}),_(7,"mat-icon",1),v(8,"delete_forever"),m(),_(9,"span"),v(10,"Delete"),m()(),At(11,ei,5,0,"button",2),m()),i&2&&(I(11),Ft(s.showCancel?11:-1))},dependencies:[de,ae,le,oe,U,$],encapsulation:2})}return r})();var ii=(r,e)=>e.id;function si(r,e){if(r&1){let t=z();_(0,"div",6),x("cdkDragStarted",function(){P(t);let s=E();return y(s.dragStart())})("cdkDragMoved",function(s){P(t);let n=E();return y(n.onDragMoved(s))})("cdkDragEnded",function(){P(t);let s=E();return y(s.dragEnd())})("press",function(s){let n=P(t).$index,o=E();return y(o.onPress(n,s))})("doubletap",function(){let s=P(t).$index,n=E();return y(n.editDashboard(s))}),_(1,"span",7)(2,"div",8),v(3),m()(),_(4,"p",9),v(5),m()()}if(r&2){let t=e.$implicit,i=e.$index;I(3),ot(i+1),I(2),ot(t.name)}}var qi=(()=>{class r{pageTitle="Dashboards";_bottomSheet=c(ne);_dashboard=c(Ut);_uiEvent=c(ee);_dialog=c(te);_dragActive=!1;_dragMoved=!1;_dragSuppressThresholdPx=4;addDashboard(){this._dialog.openNameDialog({title:"New Dashboard",name:`Dashboard ${this._dashboard.dashboards().length+1}`,confirmBtnText:"Create",cancelBtnText:"Cancel"}).afterClosed().subscribe(t=>{t&&this._dashboard.add(t.name,[])})}openBottomSheet(t){let i=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(He,i?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(n=>{switch(n){case"delete":this.deleteDashboard(t);break;case"duplicate":this.duplicateDashboard(t,`${this._dashboard.dashboards()[t].name}`);break;default:break}})}editDashboard(t){this._dialog.openNameDialog({title:"Rename Dashboard",name:this._dashboard.dashboards()[t].name,confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(i=>{i&&this._dashboard.update(t,i.name)})}deleteDashboard(t){this._dashboard.delete(t)}duplicateDashboard(t,i){this._dialog.openNameDialog({title:"Duplicate Dashboard",name:`${i} copy`,confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(s=>{s&&this._dashboard.duplicate(t,s.name)})}drop(t){this._dashboard.dashboards.update(i=>{let s=[...i];return q(s,t.previousIndex,t.currentIndex),s})}dragStart(){this._uiEvent.isDragging.set(!0),this._dragActive=!0,this._dragMoved=!1}dragEnd(){this._uiEvent.isDragging.set(!1),this._dragActive=!1,setTimeout(()=>{this._dragMoved=!1},60)}onDragMoved(t){if(!this._dragActive||this._dragMoved)return;Math.hypot(t.distance.x,t.distance.y)>this._dragSuppressThresholdPx&&(this._dragMoved=!0)}onPress(t,i){i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault(),i.stopPropagation(),!this._dragMoved&&setTimeout(()=>{this.openBottomSheet(t)},0)}static \u0275fac=function(i){return new(i||r)};static \u0275cmp=T({type:r,selectors:[["dashboards-editor"]],decls:11,vars:1,consts:[[3,"pageTitle"],["cdkDropList","","cdkDropListOrientation","mixed",1,"dashboard-manage",3,"cdkDropListDropped"],["kipGestures","","cdkDrag","","cdkDragBoundary",".dashboard-manage",1,"dashboard-card","dashboard-item"],[1,"dashboard-card","dashboard-item-add","dashboard-add-btn"],["mat-fab","",3,"click"],[2,"margin-top","10px"],["kipGestures","","cdkDrag","","cdkDragBoundary",".dashboard-manage",1,"dashboard-card","dashboard-item",3,"cdkDragStarted","cdkDragMoved","cdkDragEnded","press","doubletap"],[2,"display","block","width","100%"],[1,"item-index"],[1,"mat-title-large",2,"margin-top","25px"]],template:function(i,s){i&1&&(zt(0,"page-header",0),_(1,"div",1),x("cdkDropListDropped",function(o){return s.drop(o)}),Ht(2,si,6,2,"div",2,ii),_(4,"div",3)(5,"button",4),x("click",function(){return s.addDashboard()}),_(6,"mat-icon"),v(7,"add_box"),m()(),_(8,"p",5)(9,"i"),v(10,"Add Dashboard"),m()()()()),i&2&&(Vt("pageTitle",s.pageTitle),I(2),Bt(s._dashboard.dashboards()))},dependencies:[re,Xt,Yt,ce,U,$,Fe,Ae,$t],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%}.dashboard-manage[_ngcontent-%COMP%]{box-sizing:border-box;padding:0 60px;width:100%;height:calc(100% - 63px);display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-around;overflow-y:auto;scroll-behavior:smooth}.dashboard-card[_ngcontent-%COMP%]{position:relative;height:200px;width:300px;margin:10px;border-radius:15px;padding:10px;align-content:center;text-align:center}.dashboard-item[_ngcontent-%COMP%]{background-color:var(--kip-widget-card-background-color);border:1px solid var(--mat-sys-surface-container-highest)}.dashboard-item-add[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);border:1px solid var(--mat-sys-surface-container-highest)}.dashboard-add-btn[_ngcontent-%COMP%]{align-content:center;text-align:center;border:dashed 1px var(--mat-sys-outline)}.item-index[_ngcontent-%COMP%]{display:inline-flex;flex-wrap:wrap;height:42px;width:42px;background-color:var(--mat-sys-tertiary-fixed);color:var(--mat-sys-surface-bright);border-radius:50%;align-content:center;align-items:center;justify-content:center;font-weight:700}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px var(--mat-sys-on-primary-container),0 8px 10px 1px var(--mat-sys-on-primary-container),0 3px 14px 2px var(--mat-sys-on-primary-container)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}"]})}return r})();export{qi as DashboardsEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-NMEZOCU2.js";import{g as l}from"./chunk-3LEMFOCV.js";import{a as g}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-NMEZOCU2.js";import{g as l}from"./chunk-3LEMFOCV.js";import{a as g}from"./chunk-KKHPIFEB.js";import"./chunk-2YVW3TBK.js";import{g as a,i as r}from"./chunk-TA4GACKT.js";import{ta as t,wb as s}from"./chunk-35L7BBBD.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(()=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};
|