openc3-tool-base 5.11.3 → 5.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49d4697d7d758ba09f1ebb45d00165bfab3ae69b991ecb6c14b8273ac41e51cd
4
- data.tar.gz: e785063af3c8b0a2fef589d24dfb043f0971ff83bc50633cdd732a1b71a0e273
3
+ metadata.gz: 8f4df7e4e08300235d2d901b17f52edd490abf7c9d67cd41c9752dca739c3b47
4
+ data.tar.gz: 1beac5cc96ec7f2f60b6c5f63f65e6a996a249923bf913072bf5aa04bc09cd02
5
5
  SHA512:
6
- metadata.gz: a14f7e39ae2c7b7699222611ce734de993eb782991b77ffa98e4e4934b22586078a64c83cc01fef834dd19ae651e3c20ed942e9c642ed2de823935c1282debc0
7
- data.tar.gz: 3e3abe154e2b027261b4fe0f4cfdc51d1367bb35f59dab761807a166449911076c0eb850256e80dc7a1768fb583431f6b8907000c0eb6418c924c5c1a6e3a169
6
+ metadata.gz: 74c7df7ff945db93cdba49a0f30cbb8e73b3bd7cb1c0017498c7026974e5a9d9b5f6ce596bfd722dfbc4b7ba489fa8249475a5520d48833cbc3c4d23fcb90da1
7
+ data.tar.gz: 51f7e557e3a4631e5300612fa7998e2a80bc8378de04770fda61e9930642ae2364166c408edc69760ff4ebd0a7c3ad378addee47dddd0f0f35f752a4e523cdb9
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunktool_base=self.webpackChunktool_base||[]).push([[543],{1543:function(t,s,e){e.r(s),e.d(s,{default:function(){return d}});var r=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("v-card",[e("v-card-title",[t._v(" Login ")]),t._v(" "),e("v-card-subtitle",[t._v("\n "+t._s(t.isSet?"Enter the":"Create a")+"\n password to begin using OpenC3\n ")]),t._v(" "),e("v-card-text",[e("v-form",[t.isSet&&t.reset?e("v-text-field",{attrs:{type:"password",label:"Old Password"},model:{value:t.oldPassword,callback:function(s){t.oldPassword=s},expression:"oldPassword"}}):t._e(),t._v(" "),e("v-text-field",{attrs:{type:"password",label:(!t.isSet||t.reset?"New ":"")+"Password","data-test":"new-password"},model:{value:t.password,callback:function(s){t.password=s},expression:"password"}}),t._v(" "),t.reset?e("v-text-field",{attrs:{rules:[t.rules.matchPassword],type:"password",label:"Confirm Password","data-test":"confirm-password"},model:{value:t.confirmPassword,callback:function(s){t.confirmPassword=s},expression:"confirmPassword"}}):t._e(),t._v(" "),t.reset?e("v-btn",{attrs:{type:"submit",large:"",color:t.isSet?"warn":"success",disabled:!t.formValid,"data-test":"set-password"},on:{click:function(s){return s.preventDefault(),t.setPassword.apply(null,arguments)}}},[t._v("\n Set\n ")]):e("v-container",[e("v-row",[e("v-btn",{attrs:{type:"submit",large:"",color:"success",disabled:!t.formValid},on:{click:function(s){return s.preventDefault(),t.verifyPassword.apply(null,arguments)}}},[t._v("\n Login\n ")]),t._v(" "),e("v-spacer"),t._v(" "),e("v-btn",{attrs:{text:"",small:""},on:{click:t.showReset}},[t._v(" Change Password ")])],1)],1)],1)],1),t._v(" "),e("v-alert",{attrs:{type:t.alertType,dismissible:""},model:{value:t.showAlert,callback:function(s){t.showAlert=s},expression:"showAlert"}},[t._v("\n "+t._s(t.alert)+"\n ")])],1)};r._withStripped=!0;var o=e(4649),n=e(9554);function a(t,s){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);s&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable}))),e.push.apply(e,r)}return e}function i(t){for(var s=1;s<arguments.length;s++){var e=null!=arguments[s]?arguments[s]:{};s%2?a(Object(e),!0).forEach((function(s){(0,o.Z)(t,s,e[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):a(Object(e)).forEach((function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(e,s))}))}return t}var c={data:function(){return{isSet:!0,password:"",confirmPassword:"",oldPassword:"",reset:!1,alert:"",alertType:"success",showAlert:!1}},computed:{options:function(){return{noAuth:!0,noScope:!0}},rules:function(){var t=this;return{matchPassword:function(){return t.password===t.confirmPassword||"Passwords must match"}}},formValid:function(){return this.reset?this.isSet?!!this.oldPassword&&!!this.password&&this.password===this.confirmPassword:!!this.password&&this.password===this.confirmPassword:!!this.password}},created:function(){var t=this;n.Z.get("/openc3-api/auth/token-exists",this.options).then((function(s){t.isSet=!!s.data.result,t.isSet||(t.reset=!0)}))},methods:{showReset:function(){this.reset=!0},login:function(){localStorage.openc3Token=this.password;var t=new URLSearchParams(window.location.search).get("redirect");window.location=decodeURI(t||"/")},verifyPassword:function(){var t=this;this.showAlert=!1,n.Z.post("/openc3-api/auth/verify",i({data:{token:this.password}},this.options)).then((function(s){t.login()})).catch((function(s){t.alert="Incorrect password",t.alertType="warning",t.showAlert=!0}))},setPassword:function(){this.showAlert=!1,n.Z.post("/openc3-api/auth/set",i({data:{old_token:this.oldPassword,token:this.password}},this.options)).then(this.login)}}},l=(0,e(1900).Z)(c,r,[],!1,null,null,null);l.options.__file="packages/openc3-tool-common/src/tools/base/components/Login.vue";var d=l.exports}}]);
1
+ "use strict";(self.webpackChunktool_base=self.webpackChunktool_base||[]).push([[543],{543:function(s,t,e){e.r(t),e.d(t,{default:function(){return i}});var o=function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("v-card",[e("v-card-title",[s._v(" Login ")]),s._v(" "),e("v-card-subtitle",[s._v("\n "+s._s(s.isSet?"Enter the":"Create a")+"\n password to begin using OpenC3\n ")]),s._v(" "),e("v-card-text",[e("v-form",[s.isSet&&s.reset?e("v-text-field",{attrs:{type:"password",label:"Old Password"},model:{value:s.oldPassword,callback:function(t){s.oldPassword=t},expression:"oldPassword"}}):s._e(),s._v(" "),e("v-text-field",{attrs:{type:"password",label:(!s.isSet||s.reset?"New ":"")+"Password","data-test":"new-password"},model:{value:s.password,callback:function(t){s.password=t},expression:"password"}}),s._v(" "),s.reset?e("v-text-field",{attrs:{rules:[s.rules.matchPassword],type:"password",label:"Confirm Password","data-test":"confirm-password"},model:{value:s.confirmPassword,callback:function(t){s.confirmPassword=t},expression:"confirmPassword"}}):s._e(),s._v(" "),s.reset?e("v-btn",{attrs:{type:"submit",large:"",color:s.isSet?"warn":"success",disabled:!s.formValid,"data-test":"set-password"},on:{click:function(t){return t.preventDefault(),s.setPassword.apply(null,arguments)}}},[s._v("\n Set\n ")]):e("v-container",[e("v-row",[e("v-btn",{attrs:{type:"submit",large:"",color:"success",disabled:!s.formValid},on:{click:function(t){return t.preventDefault(),s.verifyPassword.apply(null,arguments)}}},[s._v("\n Login\n ")]),s._v(" "),e("v-spacer"),s._v(" "),e("v-btn",{attrs:{text:"",small:""},on:{click:s.showReset}},[s._v(" Change Password ")])],1)],1)],1)],1),s._v(" "),e("v-alert",{attrs:{type:s.alertType,dismissible:""},model:{value:s.showAlert,callback:function(t){s.showAlert=t},expression:"showAlert"}},[s._v("\n "+s._s(s.alert)+"\n ")])],1)};o._withStripped=!0;var r=e(554),a={data(){return{isSet:!0,password:"",confirmPassword:"",oldPassword:"",reset:!1,alert:"",alertType:"success",showAlert:!1}},computed:{options:function(){return{noAuth:!0,noScope:!0}},rules:function(){return{matchPassword:()=>this.password===this.confirmPassword||"Passwords must match"}},formValid:function(){return this.reset?this.isSet?!!this.oldPassword&&!!this.password&&this.password===this.confirmPassword:!!this.password&&this.password===this.confirmPassword:!!this.password}},created:function(){r.Z.get("/openc3-api/auth/token-exists",this.options).then((s=>{this.isSet=!!s.data.result,this.isSet||(this.reset=!0)}))},methods:{showReset:function(){this.reset=!0},login:function(){localStorage.openc3Token=this.password;const s=new URLSearchParams(window.location.search).get("redirect");window.location=decodeURI(s||"/")},verifyPassword:function(){this.showAlert=!1,r.Z.post("/openc3-api/auth/verify",{data:{token:this.password},...this.options}).then((s=>{this.login()})).catch((s=>{this.alert="Incorrect password",this.alertType="warning",this.showAlert=!0}))},setPassword:function(){this.showAlert=!1,r.Z.post("/openc3-api/auth/set",{data:{old_token:this.oldPassword,token:this.password},...this.options}).then(this.login)}}},n=(0,e(900).Z)(a,o,[],!1,null,null,null);n.options.__file="packages/openc3-tool-common/src/tools/base/components/Login.vue";var i=n.exports}}]);
2
2
  //# sourceMappingURL=543.openc3-tool-base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"543.openc3-tool-base.js","mappings":"wJAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,EAAIK,MAAMD,IAAMF,EACzB,OAAOE,EACL,SACA,CACEA,EAAG,eAAgB,CAACJ,EAAIM,GAAG,aAC3BN,EAAIM,GAAG,KACPF,EAAG,kBAAmB,CACpBJ,EAAIM,GACF,SACEN,EAAIO,GAAGP,EAAIQ,MAAQ,YAAc,YACjC,8CAGNR,EAAIM,GAAG,KACPF,EACE,cACA,CACEA,EACE,SACA,CACEJ,EAAIQ,OAASR,EAAIS,MACbL,EAAG,eAAgB,CACjBM,MAAO,CAAEC,KAAM,WAAYC,MAAO,gBAClCC,MAAO,CACLC,MAAOd,EAAIe,YACXC,SAAU,SAAUC,GAClBjB,EAAIe,YAAcE,CACpB,EACAC,WAAY,iBAGhBlB,EAAImB,KACRnB,EAAIM,GAAG,KACPF,EAAG,eAAgB,CACjBM,MAAO,CACLC,KAAM,WACNC,QAASZ,EAAIQ,OAASR,EAAIS,MAAQ,OAAS,IAAM,WACjD,YAAa,gBAEfI,MAAO,CACLC,MAAOd,EAAIoB,SACXJ,SAAU,SAAUC,GAClBjB,EAAIoB,SAAWH,CACjB,EACAC,WAAY,cAGhBlB,EAAIM,GAAG,KACPN,EAAIS,MACAL,EAAG,eAAgB,CACjBM,MAAO,CACLW,MAAO,CAACrB,EAAIqB,MAAMC,eAClBX,KAAM,WACNC,MAAO,mBACP,YAAa,oBAEfC,MAAO,CACLC,MAAOd,EAAIuB,gBACXP,SAAU,SAAUC,GAClBjB,EAAIuB,gBAAkBN,CACxB,EACAC,WAAY,qBAGhBlB,EAAImB,K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B,MAAA,eAAA4B,EAAA,KACA,OACA3B,cAAA,kBACA2B,EAAA7B,WAAA6B,EAAA1B,iBAAA,wBAEA,EACAI,UAAA,WACA,YAAAlB,MACA,KAAAD,QAIA,KAAAO,eACA,KAAAK,UACA,KAAAA,WAAA,KAAAG,kBALA,KAAAH,UAAA,KAAAA,WAAA,KAAAG,kBASA,KAAAH,QAEA,GAEA8B,QAAA,eAAAC,EAAA,KACAC,EAAAA,EAAAC,IAAA,qCAAAP,SAAAQ,MAAA,SAAAC,GACAJ,EAAA3C,QAAA+C,EAAAX,KAAAY,OACAL,EAAA3C,QACA2C,EAAA1C,OAAA,EAEA,GACA,EACAgD,QAAA,CACAnB,UAAA,WACA,KAAA7B,OAAA,CACA,EACAiD,MAAA,WACAC,aAAAC,YAAA,KAAAxC,SACA,IAAAyC,EAAA,IAAAC,gBAAAC,OAAAC,SAAAC,QAAAZ,IACA,YAEAU,OAAAC,SAAAE,UAAAL,GAAA,IACA,EACA1B,eAAA,eAAAgC,EAAA,KACA,KAAA1B,WAAA,EACAW,EAAAA,EAAAgB,KAAA,0BAAAC,EAAA,CACAzB,KAAA,CACA0B,MAAA,KAAAlD,WAEA,KAAA0B,UAEAQ,MAAA,SAAAC,GACAY,EAAAT,OACA,IACAa,OAAA,SAAAC,GACAL,EAAAzB,MAAA,qBACAyB,EAAA5B,UAAA,UACA4B,EAAA1B,WAAA,CACA,GACA,EACAT,YAAA,WACA,KAAAS,WAAA,EACAW,EAAAA,EAAAgB,KAAA,uBAAAC,EAAA,CACAzB,KAAA,CACA6B,UAAA,KAAA1D,YACAuD,MAAA,KAAAlD,WAEA,KAAA0B,UACAQ,KAAA,KAAAI,MACA,IExKIgB,GAAY,E,QAAA,GACd,EACA3E,EHqJoB,IGnJpB,EACA,KACA,KACA,MAuBF2E,EAAU5B,QAAQ6B,OAAS,kEAC3B,MAAeD,EAAiB,O","sources":["webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?085f","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?ebfd","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?dc66"],"sourcesContent":["var render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"v-card\",\n [\n _c(\"v-card-title\", [_vm._v(\" Login \")]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.isSet ? \"Enter the\" : \"Create a\") +\n \"\\n password to begin using OpenC3\\n \"\n ),\n ]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\n \"v-form\",\n [\n _vm.isSet && _vm.reset\n ? _c(\"v-text-field\", {\n attrs: { type: \"password\", label: \"Old Password\" },\n model: {\n value: _vm.oldPassword,\n callback: function ($$v) {\n _vm.oldPassword = $$v\n },\n expression: \"oldPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"v-text-field\", {\n attrs: {\n type: \"password\",\n label: (!_vm.isSet || _vm.reset ? \"New \" : \"\") + \"Password\",\n \"data-test\": \"new-password\",\n },\n model: {\n value: _vm.password,\n callback: function ($$v) {\n _vm.password = $$v\n },\n expression: \"password\",\n },\n }),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\"v-text-field\", {\n attrs: {\n rules: [_vm.rules.matchPassword],\n type: \"password\",\n label: \"Confirm Password\",\n \"data-test\": \"confirm-password\",\n },\n model: {\n value: _vm.confirmPassword,\n callback: function ($$v) {\n _vm.confirmPassword = $$v\n },\n expression: \"confirmPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: _vm.isSet ? \"warn\" : \"success\",\n disabled: !_vm.formValid,\n \"data-test\": \"set-password\",\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.setPassword.apply(null, arguments)\n },\n },\n },\n [_vm._v(\"\\n Set\\n \")]\n )\n : _c(\n \"v-container\",\n [\n _c(\n \"v-row\",\n [\n _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: \"success\",\n disabled: !_vm.formValid,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.verifyPassword.apply(\n null,\n arguments\n )\n },\n },\n },\n [_vm._v(\"\\n Login\\n \")]\n ),\n _vm._v(\" \"),\n _c(\"v-spacer\"),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: { text: \"\", small: \"\" },\n on: { click: _vm.showReset },\n },\n [_vm._v(\" Change Password \")]\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"v-alert\",\n {\n attrs: { type: _vm.alertType, dismissible: \"\" },\n model: {\n value: _vm.showAlert,\n callback: function ($$v) {\n _vm.showAlert = $$v\n },\n expression: \"showAlert\",\n },\n },\n [_vm._v(\"\\n \" + _vm._s(_vm.alert) + \"\\n \")]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license \n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <v-card>\n <v-card-title> Login </v-card-title>\n <v-card-subtitle>\n {{ isSet ? 'Enter the' : 'Create a' }}\n password to begin using OpenC3\n </v-card-subtitle>\n <v-card-text>\n <v-form>\n <v-text-field\n v-if=\"isSet && reset\"\n v-model=\"oldPassword\"\n type=\"password\"\n label=\"Old Password\"\n />\n <v-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"`${!isSet || reset ? 'New ' : ''}Password`\"\n data-test=\"new-password\"\n />\n <v-text-field\n v-if=\"reset\"\n v-model=\"confirmPassword\"\n :rules=\"[rules.matchPassword]\"\n type=\"password\"\n label=\"Confirm Password\"\n data-test=\"confirm-password\"\n />\n <v-btn\n v-if=\"reset\"\n type=\"submit\"\n @click.prevent=\"setPassword\"\n large\n :color=\"isSet ? 'warn' : 'success'\"\n :disabled=\"!formValid\"\n data-test=\"set-password\"\n >\n Set\n </v-btn>\n <v-container v-else>\n <v-row>\n <v-btn\n type=\"submit\"\n @click.prevent=\"verifyPassword\"\n large\n color=\"success\"\n :disabled=\"!formValid\"\n >\n Login\n </v-btn>\n <v-spacer />\n <v-btn text small @click=\"showReset\"> Change Password </v-btn>\n </v-row>\n </v-container>\n </v-form>\n </v-card-text>\n <v-alert :type=\"alertType\" v-model=\"showAlert\" dismissible>\n {{ alert }}\n </v-alert>\n </v-card>\n</template>\n\n<script>\nimport Api from '../../../services/api'\n\nexport default {\n data() {\n return {\n isSet: true,\n password: '',\n confirmPassword: '',\n oldPassword: '',\n reset: false, // setting a password for the first time, or changing to a new password\n alert: '',\n alertType: 'success',\n showAlert: false,\n }\n },\n computed: {\n options: function () {\n return {\n noAuth: true,\n noScope: true, // lol\n }\n },\n rules: function () {\n return {\n matchPassword: () =>\n this.password === this.confirmPassword || 'Passwords must match',\n }\n },\n formValid: function () {\n if (this.reset) {\n if (!this.isSet) {\n return !!this.password && this.password === this.confirmPassword\n } else {\n return (\n !!this.oldPassword &&\n !!this.password &&\n this.password === this.confirmPassword\n )\n }\n } else {\n return !!this.password\n }\n },\n },\n created: function () {\n Api.get('/openc3-api/auth/token-exists', this.options).then((response) => {\n this.isSet = !!response.data.result\n if (!this.isSet) {\n this.reset = true\n }\n })\n },\n methods: {\n showReset: function () {\n this.reset = true\n },\n login: function () {\n localStorage.openc3Token = this.password\n const redirect = new URLSearchParams(window.location.search).get(\n 'redirect'\n )\n window.location = decodeURI(redirect || '/')\n },\n verifyPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/verify', {\n data: {\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login()\n })\n .catch((error) => {\n this.alert = 'Incorrect password'\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n setPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/set', {\n data: {\n old_token: this.oldPassword,\n token: this.password,\n },\n ...this.options,\n }).then(this.login)\n },\n },\n}\n</script>\n","import mod from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=c187c65e&\"\nimport script from \"./Login.vue?vue&type=script&lang=js&\"\nexport * from \"./Login.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"/openc3/plugins/openc3-tool-base/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c187c65e')) {\n api.createRecord('c187c65e', component.options)\n } else {\n api.reload('c187c65e', component.options)\n }\n module.hot.accept(\"./Login.vue?vue&type=template&id=c187c65e&\", function () {\n api.rerender('c187c65e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"packages/openc3-tool-common/src/tools/base/components/Login.vue\"\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","_s","isSet","reset","attrs","type","label","model","value","oldPassword","callback","$$v","expression","_e","password","rules","matchPassword","confirmPassword","large","color","disabled","formValid","on","click","$event","preventDefault","setPassword","apply","arguments","verifyPassword","text","small","showReset","alertType","dismissible","showAlert","alert","_withStripped","data","computed","options","noAuth","noScope","_this","created","_this2","Api","get","then","response","result","methods","login","localStorage","openc3Token","redirect","URLSearchParams","window","location","search","decodeURI","_this3","post","_objectSpread","token","catch","error","old_token","component","__file"],"sourceRoot":""}
1
+ {"version":3,"file":"543.openc3-tool-base.js","mappings":"uJAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,EAAIK,MAAMD,IAAMF,EACzB,OAAOE,EACL,SACA,CACEA,EAAG,eAAgB,CAACJ,EAAIM,GAAG,aAC3BN,EAAIM,GAAG,KACPF,EAAG,kBAAmB,CACpBJ,EAAIM,GACF,SACEN,EAAIO,GAAGP,EAAIQ,MAAQ,YAAc,YACjC,8CAGNR,EAAIM,GAAG,KACPF,EACE,cACA,CACEA,EACE,SACA,CACEJ,EAAIQ,OAASR,EAAIS,MACbL,EAAG,eAAgB,CACjBM,MAAO,CAAEC,KAAM,WAAYC,MAAO,gBAClCC,MAAO,CACLC,MAAOd,EAAIe,YACXC,SAAU,SAAUC,GAClBjB,EAAIe,YAAcE,CACpB,EACAC,WAAY,iBAGhBlB,EAAImB,KACRnB,EAAIM,GAAG,KACPF,EAAG,eAAgB,CACjBM,MAAO,CACLC,KAAM,WACNC,QAASZ,EAAIQ,OAASR,EAAIS,MAAQ,OAAS,IAAM,WACjD,YAAa,gBAEfI,MAAO,CACLC,MAAOd,EAAIoB,SACXJ,SAAU,SAAUC,GAClBjB,EAAIoB,SAA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B,EACA,KACA,KACA,MAuBFuE,EAAUxB,QAAQyB,OAAS,kEAC3B,MAAeD,EAAiB,O","sources":["webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?085f","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?ebfd","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?dc66"],"sourcesContent":["var render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"v-card\",\n [\n _c(\"v-card-title\", [_vm._v(\" Login \")]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.isSet ? \"Enter the\" : \"Create a\") +\n \"\\n password to begin using OpenC3\\n \"\n ),\n ]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\n \"v-form\",\n [\n _vm.isSet && _vm.reset\n ? _c(\"v-text-field\", {\n attrs: { type: \"password\", label: \"Old Password\" },\n model: {\n value: _vm.oldPassword,\n callback: function ($$v) {\n _vm.oldPassword = $$v\n },\n expression: \"oldPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"v-text-field\", {\n attrs: {\n type: \"password\",\n label: (!_vm.isSet || _vm.reset ? \"New \" : \"\") + \"Password\",\n \"data-test\": \"new-password\",\n },\n model: {\n value: _vm.password,\n callback: function ($$v) {\n _vm.password = $$v\n },\n expression: \"password\",\n },\n }),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\"v-text-field\", {\n attrs: {\n rules: [_vm.rules.matchPassword],\n type: \"password\",\n label: \"Confirm Password\",\n \"data-test\": \"confirm-password\",\n },\n model: {\n value: _vm.confirmPassword,\n callback: function ($$v) {\n _vm.confirmPassword = $$v\n },\n expression: \"confirmPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: _vm.isSet ? \"warn\" : \"success\",\n disabled: !_vm.formValid,\n \"data-test\": \"set-password\",\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.setPassword.apply(null, arguments)\n },\n },\n },\n [_vm._v(\"\\n Set\\n \")]\n )\n : _c(\n \"v-container\",\n [\n _c(\n \"v-row\",\n [\n _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: \"success\",\n disabled: !_vm.formValid,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.verifyPassword.apply(\n null,\n arguments\n )\n },\n },\n },\n [_vm._v(\"\\n Login\\n \")]\n ),\n _vm._v(\" \"),\n _c(\"v-spacer\"),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: { text: \"\", small: \"\" },\n on: { click: _vm.showReset },\n },\n [_vm._v(\" Change Password \")]\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"v-alert\",\n {\n attrs: { type: _vm.alertType, dismissible: \"\" },\n model: {\n value: _vm.showAlert,\n callback: function ($$v) {\n _vm.showAlert = $$v\n },\n expression: \"showAlert\",\n },\n },\n [_vm._v(\"\\n \" + _vm._s(_vm.alert) + \"\\n \")]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"","<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license \n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <v-card>\n <v-card-title> Login </v-card-title>\n <v-card-subtitle>\n {{ isSet ? 'Enter the' : 'Create a' }}\n password to begin using OpenC3\n </v-card-subtitle>\n <v-card-text>\n <v-form>\n <v-text-field\n v-if=\"isSet && reset\"\n v-model=\"oldPassword\"\n type=\"password\"\n label=\"Old Password\"\n />\n <v-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"`${!isSet || reset ? 'New ' : ''}Password`\"\n data-test=\"new-password\"\n />\n <v-text-field\n v-if=\"reset\"\n v-model=\"confirmPassword\"\n :rules=\"[rules.matchPassword]\"\n type=\"password\"\n label=\"Confirm Password\"\n data-test=\"confirm-password\"\n />\n <v-btn\n v-if=\"reset\"\n type=\"submit\"\n @click.prevent=\"setPassword\"\n large\n :color=\"isSet ? 'warn' : 'success'\"\n :disabled=\"!formValid\"\n data-test=\"set-password\"\n >\n Set\n </v-btn>\n <v-container v-else>\n <v-row>\n <v-btn\n type=\"submit\"\n @click.prevent=\"verifyPassword\"\n large\n color=\"success\"\n :disabled=\"!formValid\"\n >\n Login\n </v-btn>\n <v-spacer />\n <v-btn text small @click=\"showReset\"> Change Password </v-btn>\n </v-row>\n </v-container>\n </v-form>\n </v-card-text>\n <v-alert :type=\"alertType\" v-model=\"showAlert\" dismissible>\n {{ alert }}\n </v-alert>\n </v-card>\n</template>\n\n<script>\nimport Api from '../../../services/api'\n\nexport default {\n data() {\n return {\n isSet: true,\n password: '',\n confirmPassword: '',\n oldPassword: '',\n reset: false, // setting a password for the first time, or changing to a new password\n alert: '',\n alertType: 'success',\n showAlert: false,\n }\n },\n computed: {\n options: function () {\n return {\n noAuth: true,\n noScope: true, // lol\n }\n },\n rules: function () {\n return {\n matchPassword: () =>\n this.password === this.confirmPassword || 'Passwords must match',\n }\n },\n formValid: function () {\n if (this.reset) {\n if (!this.isSet) {\n return !!this.password && this.password === this.confirmPassword\n } else {\n return (\n !!this.oldPassword &&\n !!this.password &&\n this.password === this.confirmPassword\n )\n }\n } else {\n return !!this.password\n }\n },\n },\n created: function () {\n Api.get('/openc3-api/auth/token-exists', this.options).then((response) => {\n this.isSet = !!response.data.result\n if (!this.isSet) {\n this.reset = true\n }\n })\n },\n methods: {\n showReset: function () {\n this.reset = true\n },\n login: function () {\n localStorage.openc3Token = this.password\n const redirect = new URLSearchParams(window.location.search).get(\n 'redirect'\n )\n window.location = decodeURI(redirect || '/')\n },\n verifyPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/verify', {\n data: {\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login()\n })\n .catch((error) => {\n this.alert = 'Incorrect password'\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n setPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/set', {\n data: {\n old_token: this.oldPassword,\n token: this.password,\n },\n ...this.options,\n }).then(this.login)\n },\n },\n}\n</script>\n","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=c187c65e&\"\nimport script from \"./Login.vue?vue&type=script&lang=js&\"\nexport * from \"./Login.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (module.hot) {\n var api = require(\"/openc3/plugins/openc3-tool-base/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c187c65e')) {\n api.createRecord('c187c65e', component.options)\n } else {\n api.reload('c187c65e', component.options)\n }\n module.hot.accept(\"./Login.vue?vue&type=template&id=c187c65e&\", function () {\n api.rerender('c187c65e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"packages/openc3-tool-common/src/tools/base/components/Login.vue\"\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","_s","isSet","reset","attrs","type","label","model","value","oldPassword","callback","$$v","expression","_e","password","rules","matchPassword","confirmPassword","large","color","disabled","formValid","on","click","$event","preventDefault","setPassword","apply","arguments","verifyPassword","text","small","showReset","alertType","dismissible","showAlert","alert","_withStripped","data","computed","options","noAuth","noScope","created","Api","get","then","response","result","methods","login","localStorage","openc3Token","redirect","URLSearchParams","window","location","search","decodeURI","post","token","catch","error","old_token","component","__file"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 576.openc3-tool-base.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunktool_base=self.webpackChunktool_base||[]).push([[576],{576:function(e,t,s){s.r(t),s.d(t,{scopeCss:function(){return T}});const r="-shadowcsshost",c="-shadowcssslotted",o="-shadowcsscontext",n=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",l=new RegExp("("+r+n,"gim"),i=new RegExp("("+o+n,"gim"),a=new RegExp("("+c+n,"gim"),p=r+"-no-combinator",h=/-shadowcsshost-no-combinator([^\s]*)/,u=[/::shadow/g,/::content/g],g=/-shadowcsshost/gim,d=/:host/gim,m=/::slotted/gim,f=/:host-context/gim,$=/\/\*\s*[\s\S]*?\*\//g,x=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g,_=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,w=/([{}])/g,b=/(^.*?[^\\])??((:+)(.*)|$)/,S="%BLOCK%",W=(e,t)=>{const s=k(e);let r=0;return s.escapedString.replace(_,((...e)=>{const c=e[2];let o="",n=e[4],l="";n&&n.startsWith("{"+S)&&(o=s.blocks[r++],n=n.substring(S.length+1),l="{");const i=t({selector:c,content:o});return`${e[1]}${i.selector}${e[3]}${l}${i.content}${n}`}))},k=e=>{const t=e.split(w),s=[],r=[];let c=0,o=[];for(let e=0;e<t.length;e++){const n=t[e];"}"===n&&c--,c>0?o.push(n):(o.length>0&&(r.push(o.join("")),s.push(S),o=[]),s.push(n)),"{"===n&&c++}return o.length>0&&(r.push(o.join("")),s.push(S)),{escapedString:s.join(""),blocks:r}},O=(e,t,s)=>e.replace(t,((...e)=>{if(e[2]){const t=e[2].split(","),r=[];for(let c=0;c<t.length;c++){const o=t[c].trim();if(!o)break;r.push(s(p,o,e[3]))}return r.join(",")}return p+e[3]})),j=(e,t,s)=>e+t.replace(r,"")+s,E=(e,t,s)=>t.indexOf(r)>-1?j(e,t,s):e+t+s+", "+t+" "+e+s,R=(e,t)=>e.replace(b,((e,s="",r,c="",o="")=>s+t+c+o)),C=(e,t,s,r,c)=>W(e,(e=>{let c=e.selector,o=e.content;return"@"!==e.selector[0]?c=((e,t,s,r)=>e.split(",").map((e=>r&&e.indexOf("."+r)>-1?e.trim():((e,t)=>!(e=>(e=e.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+e+")([>\\s~+[.,{:][\\s\\S]*)?$","m")))(t).test(e))(e,t)?((e,t,s)=>{const r="."+(t=t.replace(/\[is=([^\]]*)\]/g,((e,...t)=>t[0]))),c=e=>{let c=e.trim();if(!c)return"";if(e.indexOf(p)>-1)c=((e,t,s)=>{if(g.lastIndex=0,g.test(e)){const t=`.${s}`;return e.replace(h,((e,s)=>R(s,t))).replace(g,t+" ")}return t+" "+e})(e,t,s);else{const t=e.replace(g,"");t.length>0&&(c=R(t,r))}return c},o=(e=>{const t=[];let s=0;return{content:(e=e.replace(/(\[[^\]]*\])/g,((e,r)=>{const c=`__ph-${s}__`;return t.push(r),s++,c}))).replace(/(:nth-[-\w]+)(\([^)]+\))/g,((e,r,c)=>{const o=`__ph-${s}__`;return t.push(c),s++,r+o})),placeholders:t}})(e);let n,l="",i=0;const a=/( |>|\+|~(?!=))\s*/g;let u=!((e=o.content).indexOf(p)>-1);for(;null!==(n=a.exec(e));){const t=n[1],s=e.slice(i,n.index).trim();u=u||s.indexOf(p)>-1,l+=`${u?c(s):s} ${t} `,i=a.lastIndex}const d=e.substring(i);return u=u||d.indexOf(p)>-1,l+=u?c(d):d,m=o.placeholders,l.replace(/__ph-(\d+)__/g,((e,t)=>m[+t]));var m})(e,t,s).trim():e.trim())).join(", "))(e.selector,t,s,r):(e.selector.startsWith("@media")||e.selector.startsWith("@supports")||e.selector.startsWith("@page")||e.selector.startsWith("@document"))&&(o=C(e.content,t,s,r)),{selector:c.replace(/\s{2,}/g," ").trim(),content:o}})),T=(e,t,s)=>{const n=t+"-h",h=t+"-s",g=e.match(x)||[];e=e.replace($,"");const _=[];if(s){const t=e=>{const t=`/*!@___${_.length}___*/`,s=`/*!@${e.selector}*/`;return _.push({placeholder:t,comment:s}),e.selector=t+e.selector,e};e=W(e,(e=>"@"!==e.selector[0]?t(e):e.selector.startsWith("@media")||e.selector.startsWith("@supports")||e.selector.startsWith("@page")||e.selector.startsWith("@document")?(e.content=W(e.content,t),e):e))}const w=((e,t,s,n,h)=>{const g=((e,t)=>{const s="."+t+" > ",r=[];return e=e.replace(a,((...e)=>{if(e[2]){const t=e[2].trim(),c=e[3],o=s+t+c;let n="";for(let t=e[4]-1;t>=0;t--){const s=e[5][t];if("}"===s||","===s)break;n=s+n}const l=n+o,i=`${n.trimRight()}${o.trim()}`;if(l.trim()!==i.trim()){const e=`${i}, ${l}`;r.push({orgSelector:l,updatedSelector:e})}return o}return p+e[3]})),{selectors:r,cssText:e}})(e=(e=>O(e,i,E))(e=(e=>O(e,l,j))(e=e.replace(f,o).replace(d,r).replace(m,c))),n);return e=(e=>u.reduce(((e,t)=>e.replace(t," ")),e))(e=g.cssText),t&&(e=C(e,t,s,n)),{cssText:(e=(e=e.replace(/-shadowcsshost-no-combinator/g,`.${s}`)).replace(/>\s*\*\s+([^{, ]+)/gm," $1 ")).trim(),slottedSelectors:g.selectors}})(e,t,n,h);return e=[w.cssText,...g].join("\n"),s&&_.forEach((({placeholder:t,comment:s})=>{e=e.replace(t,s)})),w.slottedSelectors.forEach((t=>{e=e.replace(t.orgSelector,t.updatedSelector)})),e}}}]);
3
+ //# sourceMappingURL=576.openc3-tool-base.js.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ *
8
+ * This file is a port of shadowCSS from webcomponents.js to TypeScript.
9
+ * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
10
+ * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
11
+ */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"576.openc3-tool-base.js","mappings":";wJAcA,MA4BMA,EAAgB,iBAChBC,EAAmB,oBAEnBC,EAAuB,oBACvBC,EAAe,kDACfC,EAAkB,IAAIC,OAAO,IAAML,EAAgBG,EAAc,OACjEG,EAAyB,IAAID,OAAO,IAAMH,EAAuBC,EAAc,OAC/EI,EAAqB,IAAIF,OAAO,IAAMJ,EAAmBE,EAAc,OACvEK,EAA4BR,EAAgB,iBAC5CS,EAA8B,uCAC9BC,EAAwB,CAAC,YAAa,cAEtCC,EAAkB,oBAClBC,EAAe,WACfC,EAAkB,eAClBC,EAAsB,mBACtBC,EAAa,uBAIbC,EAAqB,+CAIrBC,EAAU,wDACVC,EAAW,UACXC,EAAmB,4BAGnBC,EAAoB,UACpBC,EAAe,CAACC,EAAOC,KACzB,MAAMC,EAAyBC,EAAaH,GAC5C,IAAII,EAAiB,EACrB,OAAOF,EAAuBG,cAAcC,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AQ,gCAAiC,IAAI6E,MAC7C7E,QAAQ,uBAAwB,SAE7B6B,OACjB2E,iBAAkBlB,EAAQE,UAC7B,EA8BciB,CAAanF,EAASsD,EAASC,EAAaC,GAU3D,OATAxD,EAAU,CAAC+D,EAAO/D,WAAYyD,GAAkB3D,KAAK,MACjDyB,GACAoC,EAAayB,SAAQ,EAAGvB,cAAaC,cACjC9D,EAAUA,EAAQtB,QAAQmF,EAAaC,EAAQ,IAGvDC,EAAOmB,iBAAiBE,SAAShB,IAC7BpE,EAAUA,EAAQtB,QAAQ0F,EAAgBG,YAAaH,EAAgBM,gBAAgB,IAEpF1E,CAAO","sources":["webpack://tool-base/./node_modules/@stencil/core/internal/client/shadow-css.js"],"sourcesContent":["/*\n Stencil Client Platform v3.4.2 | MIT Licensed | https://stenciljs.com\n */\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n *\n * This file is a port of shadowCSS from webcomponents.js to TypeScript.\n * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js\n * https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts\n */\nconst safeSelector = (selector) => {\n const placeholders = [];\n let index = 0;\n // Replaces attribute selectors with placeholders.\n // The WS in [attr=\"va lue\"] would otherwise be interpreted as a selector separator.\n selector = selector.replace(/(\\[[^\\]]*\\])/g, (_, keep) => {\n const replaceBy = `__ph-${index}__`;\n placeholders.push(keep);\n index++;\n return replaceBy;\n });\n // Replaces the expression in `:nth-child(2n + 1)` with a placeholder.\n // WS and \"+\" would otherwise be interpreted as selector separators.\n const content = selector.replace(/(:nth-[-\\w]+)(\\([^)]+\\))/g, (_, pseudo, exp) => {\n const replaceBy = `__ph-${index}__`;\n placeholders.push(exp);\n index++;\n return pseudo + replaceBy;\n });\n const ss = {\n content,\n placeholders,\n };\n return ss;\n};\nconst restoreSafeSelector = (placeholders, content) => {\n return content.replace(/__ph-(\\d+)__/g, (_, index) => placeholders[+index]);\n};\nconst _polyfillHost = '-shadowcsshost';\nconst _polyfillSlotted = '-shadowcssslotted';\n// note: :host-context pre-processed to -shadowcsshostcontext.\nconst _polyfillHostContext = '-shadowcsscontext';\nconst _parenSuffix = ')(?:\\\\((' + '(?:\\\\([^)(]*\\\\)|[^)(]*)+?' + ')\\\\))?([^,{]*)';\nconst _cssColonHostRe = new RegExp('(' + _polyfillHost + _parenSuffix, 'gim');\nconst _cssColonHostContextRe = new RegExp('(' + _polyfillHostContext + _parenSuffix, 'gim');\nconst _cssColonSlottedRe = new RegExp('(' + _polyfillSlotted + _parenSuffix, 'gim');\nconst _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';\nconst _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\\s]*)/;\nconst _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];\nconst _selectorReSuffix = '([>\\\\s~+[.,{:][\\\\s\\\\S]*)?$';\nconst _polyfillHostRe = /-shadowcsshost/gim;\nconst _colonHostRe = /:host/gim;\nconst _colonSlottedRe = /::slotted/gim;\nconst _colonHostContextRe = /:host-context/gim;\nconst _commentRe = /\\/\\*\\s*[\\s\\S]*?\\*\\//g;\nconst stripComments = (input) => {\n return input.replace(_commentRe, '');\n};\nconst _commentWithHashRe = /\\/\\*\\s*#\\s*source(Mapping)?URL=[\\s\\S]+?\\*\\//g;\nconst extractCommentsWithHash = (input) => {\n return input.match(_commentWithHashRe) || [];\n};\nconst _ruleRe = /(\\s*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))/g;\nconst _curlyRe = /([{}])/g;\nconst _selectorPartsRe = /(^.*?[^\\\\])??((:+)(.*)|$)/;\nconst OPEN_CURLY = '{';\nconst CLOSE_CURLY = '}';\nconst BLOCK_PLACEHOLDER = '%BLOCK%';\nconst processRules = (input, ruleCallback) => {\n const inputWithEscapedBlocks = escapeBlocks(input);\n let nextBlockIndex = 0;\n return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {\n const selector = m[2];\n let content = '';\n let suffix = m[4];\n let contentPrefix = '';\n if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) {\n content = inputWithEscapedBlocks.blocks[nextBlockIndex++];\n suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);\n contentPrefix = '{';\n }\n const cssRule = {\n selector,\n content,\n };\n const rule = ruleCallback(cssRule);\n return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;\n });\n};\nconst escapeBlocks = (input) => {\n const inputParts = input.split(_curlyRe);\n const resultParts = [];\n const escapedBlocks = [];\n let bracketCount = 0;\n let currentBlockParts = [];\n for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {\n const part = inputParts[partIndex];\n if (part === CLOSE_CURLY) {\n bracketCount--;\n }\n if (bracketCount > 0) {\n currentBlockParts.push(part);\n }\n else {\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(''));\n resultParts.push(BLOCK_PLACEHOLDER);\n currentBlockParts = [];\n }\n resultParts.push(part);\n }\n if (part === OPEN_CURLY) {\n bracketCount++;\n }\n }\n if (currentBlockParts.length > 0) {\n escapedBlocks.push(currentBlockParts.join(''));\n resultParts.push(BLOCK_PLACEHOLDER);\n }\n const strEscapedBlocks = {\n escapedString: resultParts.join(''),\n blocks: escapedBlocks,\n };\n return strEscapedBlocks;\n};\nconst insertPolyfillHostInCssText = (selector) => {\n selector = selector\n .replace(_colonHostContextRe, _polyfillHostContext)\n .replace(_colonHostRe, _polyfillHost)\n .replace(_colonSlottedRe, _polyfillSlotted);\n return selector;\n};\nconst convertColonRule = (cssText, regExp, partReplacer) => {\n // m[1] = :host(-context), m[2] = contents of (), m[3] rest of rule\n return cssText.replace(regExp, (...m) => {\n if (m[2]) {\n const parts = m[2].split(',');\n const r = [];\n for (let i = 0; i < parts.length; i++) {\n const p = parts[i].trim();\n if (!p)\n break;\n r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));\n }\n return r.join(',');\n }\n else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n};\nconst colonHostPartReplacer = (host, part, suffix) => {\n return host + part.replace(_polyfillHost, '') + suffix;\n};\nconst convertColonHost = (cssText) => {\n return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);\n};\nconst colonHostContextPartReplacer = (host, part, suffix) => {\n if (part.indexOf(_polyfillHost) > -1) {\n return colonHostPartReplacer(host, part, suffix);\n }\n else {\n return host + part + suffix + ', ' + part + ' ' + host + suffix;\n }\n};\nconst convertColonSlotted = (cssText, slotScopeId) => {\n const slotClass = '.' + slotScopeId + ' > ';\n const selectors = [];\n cssText = cssText.replace(_cssColonSlottedRe, (...m) => {\n if (m[2]) {\n const compound = m[2].trim();\n const suffix = m[3];\n const slottedSelector = slotClass + compound + suffix;\n let prefixSelector = '';\n for (let i = m[4] - 1; i >= 0; i--) {\n const char = m[5][i];\n if (char === '}' || char === ',') {\n break;\n }\n prefixSelector = char + prefixSelector;\n }\n const orgSelector = prefixSelector + slottedSelector;\n const addedSelector = `${prefixSelector.trimRight()}${slottedSelector.trim()}`;\n if (orgSelector.trim() !== addedSelector.trim()) {\n const updatedSelector = `${addedSelector}, ${orgSelector}`;\n selectors.push({\n orgSelector,\n updatedSelector,\n });\n }\n return slottedSelector;\n }\n else {\n return _polyfillHostNoCombinator + m[3];\n }\n });\n return {\n selectors,\n cssText,\n };\n};\nconst convertColonHostContext = (cssText) => {\n return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);\n};\nconst convertShadowDOMSelectors = (cssText) => {\n return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText);\n};\nconst makeScopeMatcher = (scopeSelector) => {\n const lre = /\\[/g;\n const rre = /\\]/g;\n scopeSelector = scopeSelector.replace(lre, '\\\\[').replace(rre, '\\\\]');\n return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');\n};\nconst selectorNeedsScoping = (selector, scopeSelector) => {\n const re = makeScopeMatcher(scopeSelector);\n return !re.test(selector);\n};\nconst injectScopingSelector = (selector, scopingSelector) => {\n return selector.replace(_selectorPartsRe, (_, before = '', _colonGroup, colon = '', after = '') => {\n return before + scopingSelector + colon + after;\n });\n};\nconst applySimpleSelectorScope = (selector, scopeSelector, hostSelector) => {\n // In Android browser, the lastIndex is not reset when the regex is used in String.replace()\n _polyfillHostRe.lastIndex = 0;\n if (_polyfillHostRe.test(selector)) {\n const replaceBy = `.${hostSelector}`;\n return selector\n .replace(_polyfillHostNoCombinatorRe, (_, selector) => injectScopingSelector(selector, replaceBy))\n .replace(_polyfillHostRe, replaceBy + ' ');\n }\n return scopeSelector + ' ' + selector;\n};\nconst applyStrictSelectorScope = (selector, scopeSelector, hostSelector) => {\n const isRe = /\\[is=([^\\]]*)\\]/g;\n scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);\n const className = '.' + scopeSelector;\n const _scopeSelectorPart = (p) => {\n let scopedP = p.trim();\n if (!scopedP) {\n return '';\n }\n if (p.indexOf(_polyfillHostNoCombinator) > -1) {\n scopedP = applySimpleSelectorScope(p, scopeSelector, hostSelector);\n }\n else {\n // remove :host since it should be unnecessary\n const t = p.replace(_polyfillHostRe, '');\n if (t.length > 0) {\n scopedP = injectScopingSelector(t, className);\n }\n }\n return scopedP;\n };\n const safeContent = safeSelector(selector);\n selector = safeContent.content;\n let scopedSelector = '';\n let startIndex = 0;\n let res;\n const sep = /( |>|\\+|~(?!=))\\s*/g;\n // If a selector appears before :host it should not be shimmed as it\n // matches on ancestor elements and not on elements in the host's shadow\n // `:host-context(div)` is transformed to\n // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator`\n // the `div` is not part of the component in the 2nd selectors and should not be scoped.\n // Historically `component-tag:host` was matching the component so we also want to preserve\n // this behavior to avoid breaking legacy apps (it should not match).\n // The behavior should be:\n // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)\n // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a\n // `:host-context(tag)`)\n const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;\n // Only scope parts after the first `-shadowcsshost-no-combinator` when it is present\n let shouldScope = !hasHost;\n while ((res = sep.exec(selector)) !== null) {\n const separator = res[1];\n const part = selector.slice(startIndex, res.index).trim();\n shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;\n const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;\n scopedSelector += `${scopedPart} ${separator} `;\n startIndex = sep.lastIndex;\n }\n const part = selector.substring(startIndex);\n shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;\n scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;\n // replace the placeholders with their original values\n return restoreSafeSelector(safeContent.placeholders, scopedSelector);\n};\nconst scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {\n return selector\n .split(',')\n .map((shallowPart) => {\n if (slotSelector && shallowPart.indexOf('.' + slotSelector) > -1) {\n return shallowPart.trim();\n }\n if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {\n return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();\n }\n else {\n return shallowPart.trim();\n }\n })\n .join(', ');\n};\nconst scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {\n return processRules(cssText, (rule) => {\n let selector = rule.selector;\n let content = rule.content;\n if (rule.selector[0] !== '@') {\n selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);\n }\n else if (rule.selector.startsWith('@media') ||\n rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') ||\n rule.selector.startsWith('@document')) {\n content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector);\n }\n const cssRule = {\n selector: selector.replace(/\\s{2,}/g, ' ').trim(),\n content,\n };\n return cssRule;\n });\n};\nconst scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {\n cssText = insertPolyfillHostInCssText(cssText);\n cssText = convertColonHost(cssText);\n cssText = convertColonHostContext(cssText);\n const slotted = convertColonSlotted(cssText, slotScopeId);\n cssText = slotted.cssText;\n cssText = convertShadowDOMSelectors(cssText);\n if (scopeId) {\n cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId);\n }\n cssText = cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);\n cssText = cssText.replace(/>\\s*\\*\\s+([^{, ]+)/gm, ' $1 ');\n return {\n cssText: cssText.trim(),\n slottedSelectors: slotted.selectors,\n };\n};\nconst scopeCss = (cssText, scopeId, commentOriginalSelector) => {\n const hostScopeId = scopeId + '-h';\n const slotScopeId = scopeId + '-s';\n const commentsWithHash = extractCommentsWithHash(cssText);\n cssText = stripComments(cssText);\n const orgSelectors = [];\n if (commentOriginalSelector) {\n const processCommentedSelector = (rule) => {\n const placeholder = `/*!@___${orgSelectors.length}___*/`;\n const comment = `/*!@${rule.selector}*/`;\n orgSelectors.push({ placeholder, comment });\n rule.selector = placeholder + rule.selector;\n return rule;\n };\n cssText = processRules(cssText, (rule) => {\n if (rule.selector[0] !== '@') {\n return processCommentedSelector(rule);\n }\n else if (rule.selector.startsWith('@media') ||\n rule.selector.startsWith('@supports') ||\n rule.selector.startsWith('@page') ||\n rule.selector.startsWith('@document')) {\n rule.content = processRules(rule.content, processCommentedSelector);\n return rule;\n }\n return rule;\n });\n }\n const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId);\n cssText = [scoped.cssText, ...commentsWithHash].join('\\n');\n if (commentOriginalSelector) {\n orgSelectors.forEach(({ placeholder, comment }) => {\n cssText = cssText.replace(placeholder, comment);\n });\n }\n scoped.slottedSelectors.forEach((slottedSelector) => {\n cssText = cssText.replace(slottedSelector.orgSelector, slottedSelector.updatedSelector);\n });\n return cssText;\n};\n\nexport { scopeCss };\n"],"names":["_polyfillHost","_polyfillSlotted","_polyfillHostContext","_parenSuffix","_cssColonHostRe","RegExp","_cssColonHostContextRe","_cssColonSlottedRe","_polyfillHostNoCombinator","_polyfillHostNoCombinatorRe","_shadowDOMSelectorsRe","_polyfillHostRe","_colonHostRe","_colonSlottedRe","_colonHostContextRe","_commentRe","_commentWithHashRe","_ruleRe","_curlyRe","_selectorPartsRe","BLOCK_PLACEHOLDER","processRules","input","ruleCallback","inputWithEscapedBlocks","escapeBlocks","nextBlockIndex","escapedString","replace","m","selector","content","suffix","contentPrefix","startsWith","blocks","substring","length","rule","inputParts","split","resultParts","escapedBlocks","bracketCount","currentBlockParts","partIndex","part","push","join","convertColonRule","cssText","regExp","partReplacer","parts","r","i","p","trim","colonHostPartReplacer","host","colonHostContextPartReplacer","indexOf","injectScopingSelector","scopingSelector","_","before","_colonGroup","colon","after","scopeSelectors","scopeSelectorText","hostSelector","slotSelector","commentOriginalSelector","map","shallowPart","scopeSelector","makeScopeMatcher","test","selectorNeedsScoping","className","_scopeSelectorPart","scopedP","lastIndex","replaceBy","applySimpleSelectorScope","t","safeContent","placeholders","index","keep","pseudo","exp","safeSelector","res","scopedSelector","startIndex","sep","shouldScope","exec","separator","slice","applyStrictSelectorScope","scopeCss","scopeId","hostScopeId","slotScopeId","commentsWithHash","match","orgSelectors","processCommentedSelector","placeholder","comment","scoped","slotted","slotClass","selectors","compound","slottedSelector","prefixSelector","char","orgSelector","addedSelector","trimRight","updatedSelector","convertColonSlotted","convertColonHostContext","convertColonHost","reduce","result","pattern","convertShadowDOMSelectors","slottedSelectors","scopeCssText","forEach"],"sourceRoot":""}